2025-05-14 21:45:16 +02:00

84 lines
3.6 KiB
TypeScript

/*
███████╗███╗ ██╗██╗ ██╗███╗ ███╗
██╔════╝████╗ ██║██║ ██║████╗ ████║
█████╗ ██╔██╗ ██║██║ ██║██╔████╔██║
██╔══╝ ██║╚██╗██║██║ ██║██║╚██╔╝██║
███████╗██║ ╚████║╚██████╔╝██║ ╚═╝ ██║
╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝
*/
import { IsRefExist } from '@lib/seed/engine/decorators/db.guard';
import ImageComponent from '@lib/seed/interfaces/components';
import { CommentModelEnum } from '@src/__components/components';
import { IsNotEmpty } from 'class-validator';
import { InputType, ObjectType, Field, Int, UseMiddleware, ArgsType } from 'type-graphql';
/*
██████╗ ██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗███████╗███╗ ██╗████████╗███████╗
██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║██╔════╝████╗ ██║╚══██╔══╝██╔════╝
██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║█████╗ ██╔██╗ ██║ ██║ ███████╗
██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║
╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║███████╗██║ ╚████║ ██║ ███████║
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝
*/
@InputType()
@ObjectType()
export class ReportedInfo {
@Field()
accountId: string;
@Field()
addedAt: Date;
}
@InputType()
@ObjectType()
export class CommentReviewInputSchema {
@Field(() => CommentModelEnum)
@IsNotEmpty()
ressourceModel: CommentModelEnum;
@Field()
@IsNotEmpty()
@IsRefExist()
ressourceId: string;
@Field(() => ImageComponent, { nullable: true })
file?: ImageComponent;
}
@InputType()
@ObjectType()
export class CommentReviewDBBaseSchema {
@Field(() => Int, { nullable: true })
note?: number;
@Field({ nullable: true })
comment?: string;
@Field(() => ImageComponent, { nullable: true })
file?: ImageComponent;
@Field(() => [ReportedInfo], { nullable: true })
reported?: ReportedInfo[];
@Field()
@IsNotEmpty()
sentBy: string;
@Field({ nullable: true })
edited?: boolean;
@Field({ nullable: true })
deleted?: boolean;
@Field({ nullable: true })
parentId?: string;
@Field(() => Int, { nullable: true })
numberReplies?: number;
}