update:add ci cd files ==> do not edit those file

This commit is contained in:
mahyargdz
2024-10-10 16:58:55 +03:30
parent dc6c7c63ea
commit ed5e2023f4
179 changed files with 15757 additions and 2277 deletions
+81
View File
@@ -0,0 +1,81 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsMongoId, IsNotEmpty, IsOptional } from 'class-validator';
import { FaqDto, faqObj } from './faq.dto';
import { ItemStatus } from '../common/eNums/itemStatus.enum';
// OBJ *******************
export function faqCategoryObj(faqCategory) {
let Faqs = [];
if (faqCategory.Faqs && faqCategory.Faqs.length !== 0) {
Faqs = faqCategory.Faqs.map((faq) => faqObj(faq));
}
return {
id: faqCategory.id,
title: faqCategory.title,
status: faqCategory.status,
description: faqCategory.description,
Faqs,
};
}
// CLASS *******************
export class FaqCategoryDto {
@IsNotEmpty()
@ApiProperty({ type: String })
@IsMongoId({ message: 'آیدی نامعتبر است.' })
id: string;
@IsNotEmpty()
@ApiProperty({ type: String })
status: string;
@IsNotEmpty()
@ApiProperty({ type: String })
title: string;
@ApiProperty({ type: String })
description: string;
@ApiProperty({ isArray: true, type: FaqDto })
Faqs: FaqDto[];
}
export class CreateFaqCategoryDto {
@IsNotEmpty()
@ApiProperty({ type: String })
title: string;
@ApiProperty({ type: String })
description: string;
}
export class UpdateFaqCategoryDto {
@IsNotEmpty()
@ApiProperty({ type: String })
@IsMongoId({ message: 'آیدی نامعتبر است.' })
id: string;
@IsOptional()
@IsEnum(ItemStatus)
@ApiProperty({ type: String, required: false })
status: string;
@IsNotEmpty()
@ApiProperty({ type: String })
title: string;
@ApiProperty({ type: String })
description: string;
}
export class FilterFaqCategoryDto {
@IsOptional()
@ApiProperty({ type: String, required: false })
@IsMongoId({ message: 'آیدی نامعتبر است.' })
id: string;
@IsOptional()
@IsEnum(ItemStatus)
@ApiProperty({ type: String, required: false })
status: string;
}