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

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

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

    @Field()
    @Prop({ required: true })
    type: string;

    @Field()
    @Prop({ required: true })
    token: string;

    @Field()
    @Prop({ required: true })
    typeToken: string;

    @Field({ nullable: true })
    @Prop({ required: false, default: '' })
    description: string;

}

export type BuildTypesDocument = BuildTypes & Document;
export const BuildTypesSchema = SchemaFactory.createForClass(BuildTypes);
