apps/recallassess/recallassess-api/src/api/admin/testimonial/config/testimonial-config.service.ts
ModuleConfigBase
Methods |
| getConfiguration |
getConfiguration()
|
|
Returns :
ModuleConfig
|
import { ColumnConfig, ColumnType } from "@bish-nest/core/app-config/column-config.class";
import { ModuleConfig } from "@bish-nest/core/app-config/module-config.class";
import { ModuleConfigBase } from "@bish-nest/core/app-config/module-config-base.class";
import { Injectable } from "@nestjs/common";
import { TestimonialAddDto } from "../dto/testimonial-add.dto";
import { TestimonialDetailDto } from "../dto/testimonial-detail.dto";
import { TestimonialListDto } from "../dto/testimonial-list.dto";
import { TestimonialSaveDto } from "../dto/testimonial-save.dto";
@Injectable()
export class TestimonialConfig extends ModuleConfigBase {
getConfiguration(): ModuleConfig {
const columns: ColumnConfig[] = [
new ColumnConfig({ name: "id", type: ColumnType.Integer }),
new ColumnConfig({ name: "participant_name" }),
new ColumnConfig({ name: "role_title" }),
new ColumnConfig({ name: "organization" }),
new ColumnConfig({ name: "course_id", type: ColumnType.Integer }),
new ColumnConfig({ name: "quote" }),
new ColumnConfig({ name: "rating", type: ColumnType.Integer }),
new ColumnConfig({ name: "theme_color" }),
new ColumnConfig({ name: "sort_order", type: ColumnType.Integer }),
new ColumnConfig({ name: "is_featured", type: ColumnType.Boolean }),
new ColumnConfig({ name: "is_published", type: ColumnType.Boolean }),
new ColumnConfig({ name: "created_at", type: ColumnType.DateTime }),
new ColumnConfig({ name: "updated_at", type: ColumnType.DateTime }),
];
const keywordSearchCols: string[] = [
"id",
"participant_name",
"role_title",
"organization",
"quote",
"course.title",
"course.course_code",
];
return new ModuleConfig({
name: "testimonial",
columns,
// Allow searching by numeric id in the list keyword box (e.g. "5")
keywordSearchCols,
relationObjToIncludeForList: {
course: true,
},
relationObjToIncludeForDetail: {
course: true,
userCreatedBy: true,
userUpdatedBy: true,
},
listDto: TestimonialListDto,
detailDto: TestimonialDetailDto,
addDto: TestimonialAddDto,
saveDto: TestimonialSaveDto,
});
}
}