location default changed

This commit is contained in:
2026-11-11 14:39:55 +03:30
parent 658a8a74cc
commit 5d84b9697f
3 changed files with 1224 additions and 1220 deletions
+37 -37
View File
@@ -1,9 +1,9 @@
export type FanavaranClientKey = "parsian" | "tejaratno" | "moallem";
export type FanavaranClientKey = 'parsian' | 'tejaratno' | 'moallem';
const FANAVARAN_API_ROOTS: Record<FanavaranClientKey, string> = {
parsian: "https://apimanager.iraneit.com/BimeApiManager/api",
tejaratno: "https://apimanager.iraneit.com/BimeApiManager/api",
moallem: "https://apimanager.iraneit.com/BimeApiManager/api",
parsian: 'https://apimanager.iraneit.com/BimeApiManager/api',
tejaratno: 'https://apimanager.iraneit.com/BimeApiManager/api',
moallem: 'https://apimanager.iraneit.com/BimeApiManager/api',
};
export function getFanavaranApiRoot(clientKey: FanavaranClientKey): string {
@@ -17,9 +17,9 @@ export function getFanavaranLookupBaseUrl(
}
export const FANAVARAN_CLIENT_KEYS: readonly FanavaranClientKey[] = [
"parsian",
"tejaratno",
"moallem",
'parsian',
'tejaratno',
'moallem',
] as const;
/** Swagger `@ApiParam({ enum })` value — keep in sync with {@link FANAVARAN_CLIENT_KEYS}. */
@@ -40,7 +40,7 @@ export function normalizeFanavaranClientKey(value: string): FanavaranClientKey {
return normalized;
}
throw new Error(
`Invalid Fanavaran client "${value}". Expected one of: ${FANAVARAN_CLIENT_KEYS.join(", ")}`,
`Invalid Fanavaran client "${value}". Expected one of: ${FANAVARAN_CLIENT_KEYS.join(', ')}`,
);
}
@@ -126,15 +126,15 @@ export const SEED_FANAVARAN_CLIENT_PROFILES: Record<
FanavaranClientProfile
> = {
tejaratno: {
key: "tejaratno",
key: 'tejaratno',
auth: {
appName: "fanhab",
secret: "5Fa@N#A2B",
username: "fanhabUser",
password: "Fan#@2U$3er",
corpId: "3539",
contractId: "263",
location: "100",
appName: 'fanhab',
secret: '5Fa@N#A2B',
username: 'fanhabUser',
password: 'Fan#@2U$3er',
corpId: '3539',
contractId: '263',
location: '100',
},
defaults: {
...SHARED_FANAVARAN_DEFAULTS,
@@ -146,15 +146,15 @@ export const SEED_FANAVARAN_CLIENT_PROFILES: Record<
},
},
parsian: {
key: "parsian",
key: 'parsian',
auth: {
appName: "ParsianService",
secret: "P@r30@n$erv!ce",
username: "ParsianServiceUser",
password: "P@r30@n123",
corpId: "543",
contractId: "28",
location: "210050",
appName: 'ParsianService',
secret: 'P@r30@n$erv!ce',
username: 'ParsianServiceUser',
password: 'P@r30@n123',
corpId: '543',
contractId: '28',
location: '110011',
},
defaults: {
...SHARED_FANAVARAN_DEFAULTS,
@@ -168,15 +168,15 @@ export const SEED_FANAVARAN_CLIENT_PROFILES: Record<
},
},
moallem: {
key: "moallem",
key: 'moallem',
auth: {
appName: "ItTalie",
secret: "itT@l!3@api",
username: "itTalieUser",
password: "itT@l!3@user",
corpId: "5650",
contractId: "304",
location: "1",
appName: 'ItTalie',
secret: 'itT@l!3@api',
username: 'itTalieUser',
password: 'itT@l!3@user',
corpId: '5650',
contractId: '304',
location: '1',
},
defaults: {
...SHARED_FANAVARAN_DEFAULTS,
@@ -217,11 +217,11 @@ export function resolveFanavaranClientKey(): FanavaranClientKey {
}
// Optional deployment hint when FANAVARAN_CLIENT is not set.
if (String(process.env.CLIENT_ID ?? "") === "8") {
return "parsian";
if (String(process.env.CLIENT_ID ?? '') === '8') {
return 'parsian';
}
return "tejaratno";
return 'tejaratno';
}
export function resolveFanavaranClientProfile(): FanavaranClientProfile {
@@ -239,10 +239,10 @@ export function getFanavaranClientProfile(
/** ثالث uses `contractId`. بدنه uses `hullContractId` when configured. */
export function resolveFanavaranProductContractId(
clientKey: FanavaranClientKey,
product: "third-party" | "car-body",
product: 'third-party' | 'car-body',
): string {
const profile = getFanavaranClientProfile(clientKey);
if (product === "car-body") {
if (product === 'car-body') {
const hull = profile.auth.hullContractId?.trim();
if (hull) return hull;
}