updated graphql
This commit is contained in:
@@ -1,49 +1,76 @@
|
||||
import { Prop } from '@nestjs/mongoose';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { Field } from '@nestjs/graphql';
|
||||
import { ObjectType } from '@nestjs/graphql';
|
||||
|
||||
@ObjectType({ isAbstract: true })
|
||||
export class Base {
|
||||
|
||||
@Field()
|
||||
@Prop({ default: randomUUID, unique: true })
|
||||
uuid: string;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: () => new Date(Date.now()) })
|
||||
createdAt: Date;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: () => new Date(Date.now()) })
|
||||
updatedAt: Date;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: () => new Date(Date.now()) })
|
||||
expiryStarts: Date;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: () => new Date('2099-12-31') })
|
||||
expiryEnds: Date;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: false })
|
||||
isConfirmed: boolean;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: false })
|
||||
deleted: boolean;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: true })
|
||||
active: boolean;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: randomUUID })
|
||||
crypUuId: string;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: randomUUID })
|
||||
createdCredentialsToken: string;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: randomUUID })
|
||||
updatedCredentialsToken: string;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: randomUUID })
|
||||
confirmedCredentialsToken: string;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: false })
|
||||
isNotificationSend: boolean;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: false })
|
||||
isEmailSend: boolean;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: 0 })
|
||||
refInt: number;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: randomUUID })
|
||||
refId: string;
|
||||
|
||||
@Field()
|
||||
@Prop({ default: 0 })
|
||||
replicationId: number;
|
||||
}
|
||||
|
||||
@@ -72,9 +72,6 @@ export class User extends Base {
|
||||
@Prop({ type: Types.ObjectId, ref: Person.name, required: true })
|
||||
person: Types.ObjectId;
|
||||
|
||||
@Field(() => ID, { nullable: true })
|
||||
@Prop({ type: Types.ObjectId, ref: UserType.name })
|
||||
type?: Types.ObjectId;
|
||||
}
|
||||
|
||||
export type UserDocument = User & Document;
|
||||
|
||||
Reference in New Issue
Block a user