forked from Yara724/api
third party update , optional body is done
This commit is contained in:
@@ -46,6 +46,35 @@ export function fanavaranClaimsBaseUrl(
|
||||
return `${FANAVARAN_CLAIMS_HOST}/${fanavaranClaimsResourcePath(product)}`;
|
||||
}
|
||||
|
||||
export type FanavaranClaimStage = "damage-case" | "attachments" | "expertise";
|
||||
|
||||
/** Hull (بدنه) has no GEN.12 dmg-cases resource. Proven 2026-09-15: Feature:url(.../vehicle-hull-claims/{id}/dmg-cases) not found. Files and expertise do exist. */
|
||||
export const FANAVARAN_HULL_NO_DAMAGE_CASE_REASON =
|
||||
"Fanavaran vehicle-hull-claims has no dmg-cases resource. Hull is first-party (one damaged vehicle on the base claim). Continue with files and expertise.";
|
||||
|
||||
export function fanavaranHasDamageCaseStage(
|
||||
product: FanavaranClaimProduct,
|
||||
): boolean {
|
||||
return product === "third-party";
|
||||
}
|
||||
|
||||
export function fanavaranClaimStageUrl(
|
||||
product: FanavaranClaimProduct,
|
||||
stage: FanavaranClaimStage,
|
||||
claimId: number | string,
|
||||
): string | null {
|
||||
if (stage === "damage-case" && !fanavaranHasDamageCaseStage(product)) {
|
||||
return null;
|
||||
}
|
||||
const suffix =
|
||||
stage === "damage-case"
|
||||
? "dmg-cases"
|
||||
: stage === "attachments"
|
||||
? "files"
|
||||
: "expertise";
|
||||
return `${fanavaranClaimsBaseUrl(product)}/${claimId}/${suffix}`;
|
||||
}
|
||||
|
||||
export function fanavaranInsuranceLineIdForProduct(
|
||||
product: FanavaranClaimProduct,
|
||||
): number {
|
||||
|
||||
Reference in New Issue
Block a user