import { ObjectType, Field, ID } from '@nestjs/graphql';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, Types } from 'mongoose';
import { Base } from '@/models/base.model';

@ObjectType()
@Schema({ timestamps: true })
export class Company extends Base {

    @Field(() => ID)
    readonly _id: string;

    @Field(() => ID)
    @Prop({ required: true })
    name: string;

}

export type CompanyDocument = Company & Document;
export const CompanySchema = SchemaFactory.createForClass(Company);
