forked from Yara724/api
update some important issues
This commit is contained in:
41
src/Types&Enums/blame-request-management/resend-item-ui.ts
Normal file
41
src/Types&Enums/blame-request-management/resend-item-ui.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { ResendItemType } from "./resendItemType.enum";
|
||||
|
||||
/** How the mobile/web client should collect each resend item (no workflow-step manager). */
|
||||
export type ResendItemInputKind = "document_camera" | "voice" | "video" | "text";
|
||||
|
||||
export function getResendItemInputKind(item: string): ResendItemInputKind {
|
||||
if (item === ResendItemType.VOICE) return "voice";
|
||||
if (item === ResendItemType.VIDEO) return "video";
|
||||
if (item === ResendItemType.DESCRIPTION) return "text";
|
||||
return "document_camera";
|
||||
}
|
||||
|
||||
export function buildResendItemsWithUi(requestedItems: string[]) {
|
||||
return requestedItems.map((item) => ({
|
||||
item,
|
||||
inputKind: getResendItemInputKind(item),
|
||||
}));
|
||||
}
|
||||
|
||||
/** Whether a single requested item is satisfied on a party's resend row (after merges). */
|
||||
export function isResendPartyItemSatisfied(
|
||||
item: string,
|
||||
row: {
|
||||
uploadedDocuments?: Record<string, unknown>;
|
||||
resendVoiceId?: unknown;
|
||||
resendVideoId?: unknown;
|
||||
userTextDescription?: string;
|
||||
},
|
||||
): boolean {
|
||||
const uploaded = row.uploadedDocuments || {};
|
||||
if (item === ResendItemType.DESCRIPTION) {
|
||||
return !!(row.userTextDescription && String(row.userTextDescription).trim());
|
||||
}
|
||||
if (item === ResendItemType.VOICE) {
|
||||
return !!row.resendVoiceId;
|
||||
}
|
||||
if (item === ResendItemType.VIDEO) {
|
||||
return !!row.resendVideoId;
|
||||
}
|
||||
return !!uploaded[item];
|
||||
}
|
||||
@@ -9,4 +9,7 @@ export enum ResendItemType {
|
||||
// Media evidence
|
||||
VOICE = "voice",
|
||||
VIDEO = "video",
|
||||
|
||||
/** Written / text party description (maps to FIRST_DESCRIPTION / SECOND_DESCRIPTION workflow steps) */
|
||||
DESCRIPTION = "description",
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ export enum ClaimWorkflowStep {
|
||||
|
||||
// Expert: Damage assessment
|
||||
EXPERT_DAMAGE_ASSESSMENT = "EXPERT_DAMAGE_ASSESSMENT",
|
||||
/** After user objection: damage expert’s last priced reply (stored in evaluation.damageExpertReplyFinal) */
|
||||
EXPERT_FINAL_REPLY = "EXPERT_FINAL_REPLY",
|
||||
EXPERT_COST_EVALUATION = "EXPERT_COST_EVALUATION",
|
||||
|
||||
// Insurer approval
|
||||
|
||||
Reference in New Issue
Block a user