78 lines
1.6 KiB
TypeScript

import { Field, ID, ObjectType } from '@nestjs/graphql';
import { FollowModel } from '@/src/module/follow';
import { NotificationModel, NotificationSettingsModel } from '@/src/module/notification';
import { StreamModel } from '@/src/module/stream/models/stream.model';
import { User } from '@prisma/generated';
import { SocialLinkModel } from '../../profile/models/social-link.model';
@ObjectType()
export class UserModel implements User {
@Field(() => ID)
id: string;
@Field(() => String)
email: string;
@Field(() => String)
password: string;
@Field(() => String)
name: string;
@Field(() => String)
displayName: string;
@Field(() => String, { nullable: true })
avatar: string;
@Field(() => String, { nullable: true })
bio: string;
@Field(() => Boolean)
isEmailVerified: boolean;
@Field(() => Boolean)
isVerified: boolean;
@Field(() => Boolean)
isTotpEnabled: boolean;
@Field(() => Boolean)
isDeactivated: boolean;
@Field(() => Date, { nullable: true })
deactivatedAt: Date;
@Field(() => String, { nullable: true })
totpSecret: string;
@Field(() => [SocialLinkModel])
socialLink: SocialLinkModel[];
@Field(() => StreamModel)
stream: StreamModel;
@Field(() => [FollowModel])
followers: FollowModel[];
@Field(() => [FollowModel])
followings: FollowModel[];
@Field(() => String, { nullable: true })
telegramId: string;
@Field(() => [NotificationModel])
notification: NotificationModel[];
@Field(() => NotificationSettingsModel, { nullable: true })
notificationSettings: NotificationSettingsModel;
@Field(() => Date)
createdAt: Date;
@Field(() => Date)
updatedAt: Date;
}