Initial commit: Meshkee CMS API

NestJS backend with Prisma, Docker Compose for Postgres/Redis, and deploy docs for the production VM.
This commit is contained in:
Ali Reza
2026-07-21 17:52:36 +03:30
commit bb59d5e9ba
254 changed files with 37031 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
import { MediaEntityType } from '@prisma/client';
import { Transform, Type } from 'class-transformer';
import {
IsBoolean,
IsEmail,
IsEnum,
IsInt,
IsOptional,
IsString,
Min,
MinLength,
} from 'class-validator';
export class CreatePublicCommentDto {
@IsEnum(MediaEntityType)
entityType!: MediaEntityType;
@IsString()
@MinLength(1)
entityId!: string;
@IsString()
@MinLength(2)
authorName!: string;
@IsOptional()
@IsEmail()
authorEmail?: string;
@IsString()
@MinLength(1)
text!: string;
}
export class ListPublicCommentsDto {
@IsEnum(MediaEntityType)
entityType!: MediaEntityType;
@IsString()
@MinLength(1)
entityId!: string;
}
export class ListCommentsDto {
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
page?: number;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
pageSize?: number;
@IsOptional()
@IsEnum(MediaEntityType)
entityType?: MediaEntityType;
@IsOptional()
@IsString()
entityId?: string;
/** Filter by approval: true = approved, false = pending, omit = all */
@IsOptional()
@Transform(({ value }) => {
if (value === 'true' || value === true) return true;
if (value === 'false' || value === false) return false;
return value;
})
@IsBoolean()
isApproved?: boolean;
}
export class UpdateCommentApprovalDto {
@IsBoolean()
isApproved!: boolean;
}