import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { Document } from "mongoose";

export type VendorDocument = Vendor & Document;

@Schema({ collection: "vendors", timestamps: false })
export class Vendor {
  @Prop({ required: true })
  declare name: string;

  @Prop({ default: true })
  declare active: boolean;

  @Prop({ type: String, default: null })
  declare countryOfOrigin: string | null;
}

export const VendorSchema = SchemaFactory.createForClass(Vendor);
