car body policy and sales extended

This commit is contained in:
2026-09-05 18:37:42 +03:30
parent eb072ef080
commit eb636bdbdd
10 changed files with 1097 additions and 14 deletions

View File

@@ -35,6 +35,11 @@ export interface FanavaranAuthConfig {
password: string;
corpId: string;
contractId: string;
/**
* Vehicle-hull (بدنه) ContractId. Must not be the ثالث contract.
* When unset, body lookups fall back to `contractId`.
*/
hullContractId?: string;
location: string;
}
@@ -209,6 +214,19 @@ export function getFanavaranClientProfile(
);
}
/** ثالث uses `contractId`. بدنه uses `hullContractId` when configured. */
export function resolveFanavaranProductContractId(
clientKey: FanavaranClientKey,
product: "third-party" | "car-body",
): string {
const profile = getFanavaranClientProfile(clientKey);
if (product === "car-body") {
const hull = profile.auth.hullContractId?.trim();
if (hull) return hull;
}
return profile.auth.contractId;
}
export function listFanavaranClientProfiles(): FanavaranClientProfile[] {
return FANAVARAN_CLIENT_KEYS.map((key) => getFanavaranClientProfile(key));
}