forked from Yara724/api
Add TejaratNo notifier review and submission validation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user