import {
  IsString,
  IsNotEmpty,
  IsArray,
  IsMongoId,
} from 'class-validator';
import { Type } from 'class-transformer';
import { Types } from 'mongoose';

export class CreateQuotationDto {

  @IsString()
  @IsNotEmpty()
  id: string;

  @IsString()
  @IsNotEmpty()
  name?: string;

//   @IsString()
//   @IsNotEmpty()
//   commodity?: string;

//   @IsString()
//   @IsNotEmpty()
//   equipment?: string;

//   @IsString()
//   @IsNotEmpty()
//   from?: string;

//   @IsString()
//   @IsNotEmpty()
//   to?: string;

//   @IsDateString()
//   @IsNotEmpty()
//   dateOfInquery?: Date;

// //   @IsNumber()
//   @IsNotEmpty()
//   selling?: number;

// //   @IsNumber()
//   @IsNotEmpty()
//   cost?: number;

// @IsEnum(QuotationStatus, {
//     message: 'status must be one of: lost, idle, confirm',
//   })
//   status?: QuotationStatus;
}

class DescriptionItemDto {
  @IsString()
  description: string;

  @IsString()
  price: string;

  @IsString()
  remark?: string;
}

export class CreateEstimateDto {
  
  @IsArray()
  description: DescriptionItemDto[];

  @IsArray()
  notes: string[];

  @IsMongoId()
  @Type(() => Types.ObjectId) 
  quotation_id: Types.ObjectId;
}
