Files
yara724api/src/reports/dto/reports.dto.ts
2026-04-29 20:22:43 +03:30

100 lines
2.8 KiB
TypeScript

/**
* V2-style status buckets (`IN_PROGRESS` + native statuses) for insurer tenant scope.
* `unifiedByPublicId.total` matches merging blame + claim by `publicId` (see insurer `files` API).
*/
export class InsurerRequestsSummaryDtoRs {
claim: Record<string, number>;
blame: Record<string, number>;
unifiedByPublicId: { total: number };
constructor(
claim: Record<string, number>,
blame: Record<string, number>,
unifiedTotal: number,
) {
this.claim = claim;
this.blame = blame;
this.unifiedByPublicId = { total: unifiedTotal };
}
}
export class InsurerPerMonthReportRowDtoRs {
stDate: Date;
enDate: Date;
faLabel: string;
data: InsurerRequestsSummaryDtoRs;
constructor(
stDate: Date,
enDate: Date,
faLabel: string,
data: InsurerRequestsSummaryDtoRs,
) {
this.stDate = stDate;
this.enDate = enDate;
this.faLabel = faLabel;
this.data = data;
}
}
/** Per-expert file-activity stats (ExpertFileActivity: checked / unchecked / handled). */
export class InsurerExpertWorkLogEntryDtoRs {
expertId: string;
fullName: string;
/**
* `expert` = blame-panel expert (`expert` collection — same as insurer expert list, not `field-expert`).
* `damage_expert` = claim damage expert (`damage-expert` collection).
* Field experts (`RoleEnum.FIELD_EXPERT`, `field-expert` collection) are out of scope here.
*/
expertKind: "expert" | "damage_expert";
/** Distinct files in handled state after replaying activity up to the cutoff (or “now”). */
totalHandled: number;
/** Distinct files currently marked checked and not yet handled (same rules as expert-insurer stats). */
currentlyChecking: number;
/** Distinct files that had at least one CHECKED event in the reporting window (all-time = ever; monthly = that month only). */
distinctFilesCheckedInPeriod: number;
constructor(
expertId: string,
fullName: string,
expertKind: "expert" | "damage_expert",
totalHandled: number,
currentlyChecking: number,
distinctFilesCheckedInPeriod: number,
) {
this.expertId = expertId;
this.fullName = fullName;
this.expertKind = expertKind;
this.totalHandled = totalHandled;
this.currentlyChecking = currentlyChecking;
this.distinctFilesCheckedInPeriod = distinctFilesCheckedInPeriod;
}
}
export class InsurerExpertWorkLogResponseDtoRs {
experts: InsurerExpertWorkLogEntryDtoRs[];
constructor(experts: InsurerExpertWorkLogEntryDtoRs[]) {
this.experts = experts;
}
}
export class InsurerExpertWorkLogPerMonthRowDtoRs {
stDate: Date;
enDate: Date;
faLabel: string;
experts: InsurerExpertWorkLogEntryDtoRs[];
constructor(
stDate: Date,
enDate: Date,
faLabel: string,
experts: InsurerExpertWorkLogEntryDtoRs[],
) {
this.stDate = stDate;
this.enDate = enDate;
this.faLabel = faLabel;
this.experts = experts;
}
}