File

apps/recallassess/recallassess-api/src/api/admin/report-log/config/report-log-config.service.ts

Extends

ModuleConfigBase

Index

Methods

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 { ReportLogAddDto } from "../dto/report-log-add.dto";
import { ReportLogDetailDto } from "../dto/report-log-detail.dto";
import { ReportLogListDto } from "../dto/report-log-list.dto";
import { ReportLogSaveDto } from "../dto/report-log-save.dto";

@Injectable()
export class ReportLogConfig extends ModuleConfigBase {
  getConfiguration(): ModuleConfig {
    const columns: ColumnConfig[] = [
      new ColumnConfig({ name: "id", type: ColumnType.Integer }),
      new ColumnConfig({ name: "participant_id", type: ColumnType.Integer }),
      new ColumnConfig({ name: "course_id", type: ColumnType.Integer }),
      new ColumnConfig({ name: "assessment_id", type: ColumnType.Integer }),
      new ColumnConfig({ name: "course_group_id", type: ColumnType.Integer }),
      new ColumnConfig({ name: "email_log_id", type: ColumnType.Integer }),
      new ColumnConfig({ name: "title" }),
      new ColumnConfig({ name: "sent_status", type: ColumnType.Boolean }),
      new ColumnConfig({ name: "sent_date", type: ColumnType.DateTime }),
      new ColumnConfig({ name: "created_at", type: ColumnType.DateTime }),
      new ColumnConfig({ name: "updated_at", type: ColumnType.DateTime }),
    ];

    return new ModuleConfig({
      name: "report-log",
      columns,
      // Keyword box: id, report title, and linked participant name (DB paths; matches list `participant_name`).
      keywordSearchCols: ["id", "title", "participant.first_name", "participant.last_name"],
      relationObjToIncludeForList: {
        participant: true,
        course: true,
        assessment: true,
        courseGroup: true,
        emailLog: true,
      },
      relationObjToIncludeForDetail: {
        participant: true,
        course: true,
        assessment: true,
        courseGroup: true,
        emailLog: true,
        userCreatedBy: true,
        userUpdatedBy: true,
      },
      listDto: ReportLogListDto,
      detailDto: ReportLogDetailDto,
      addDto: ReportLogAddDto,
      saveDto: ReportLogSaveDto,
    });
  }
}

results matching ""

    No results matching ""