import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import mongoose from 'mongoose';
@Schema({ timestamps: true })
export class Quotation {
  @Prop({ unique: true })
  id: string;

  @Prop({ default: '' })
  name: string;

  @Prop({ default: '' })
  commodity: string;

  @Prop({ default: '' })
  equipment: string;

  @Prop({ default: '' })
  from: string;

  @Prop({ default: '' })
  to: string;

  @Prop({ default: '' })
  dateOfInquery: Date;

  @Prop({ default: '' })
  dateOfSelling: Date;

  @Prop({ default: '' })
  selling: string;

  @Prop({ default: '' })
  cost: string;

  @Prop({ default: '' })
  country: string;

  // @Prop({
  // type: String,
  // enum: Object.values(QuotationStatus),
  // default: QuotationStatus.IDEL,
  // })
  @Prop({ default: 'idle' })
  status: string;

  @Prop({ type: mongoose.Schema.Types.ObjectId, ref: 'inquirey' })
  inquiry_id: mongoose.Types.ObjectId;
}

export const QuotationSchema = SchemaFactory.createForClass(Quotation);
export type QuotationDocument = Quotation & Document;
