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

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

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

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

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

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

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

    @Field({ nullable: false })
    @Prop({ required: true })
    isProperty: boolean;

}

export type UserTypeDocument = UserType & Document;
export const UserTypeSchema = SchemaFactory.createForClass(UserType);
