Add TejaratNo notifier review and submission validation

This commit is contained in:
SepehrYahyaee
2026-10-10 12:51:11 +03:30
parent a410655faa
commit 8f568f379c
14 changed files with 588 additions and 34 deletions
@@ -1,3 +1,6 @@
import type { FanavaranClientKey } from "src/core/config/fanavaran-client.config";
import { TEJARAT_NOTIFIER_FIELDS } from "src/fanavaran/tejarat-notifier";
/** GEN.03 VHUD input fields. Do not send ثالث-only keys (DamagedCount, HasOtherCulprit, plaques, …). */
export const FANAVARAN_HULL_BASE_CLAIM_KEYS = [
"ArchiveNo",
@@ -120,6 +123,7 @@ export function customerIdFromHullPolicyRecord(
export function toFanavaranHullBaseClaimPayload(
built: Record<string, unknown>,
clientKey?: FanavaranClientKey,
): Record<string, unknown> {
const next: Record<string, unknown> = {};
for (const key of FANAVARAN_HULL_BASE_CLAIM_KEYS) {
@@ -167,6 +171,11 @@ export function toFanavaranHullBaseClaimPayload(
? built[key]
: null;
}
if (clientKey === "tejaratno") {
for (const key of Object.keys(TEJARAT_NOTIFIER_FIELDS)) {
if (Object.prototype.hasOwnProperty.call(built, key)) next[key] = built[key];
}
}
return next;
}