Backend modules from tastefully 8bd93d15: core-libs, core-session, api-gateway, mobile-api, services-auth, services-system, services-counter, services-member, services-log, services-email. solvway-admin-portal from babyboo f64d096ea, solvway-customer-portal from tastefully 8bd93d15. Copied as tracked files only. Literal secrets replaced with environment placeholders: - services-email: SMTP_PASSWORD, MAILGUN_API_KEY, SENDGRID_API_KEY, MAILJET_API_KEY, MAILJET_SECRET_KEY (optional, empty default) - services-system: JUMIO_TOKEN, JUMIO_SECRET (optional) - services-auth: USER_AUTH_API_SECRET (required); commented JWT secret removed - core-libs: JWT_TOKEN default removed (required), XXL_JOB_TOKEN default removed, ipgeolocation key read from IPGEOLOCATION_API_KEY - services-system EkycAppConfig: commented Jumio credentials removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import type { Translate } from "@/app/lib/i18n/t";
|
|
|
|
export const TYPE_OPTIONS = [
|
|
{ value: "W", label: "Warehouse" },
|
|
{ value: "M", label: "WhTypeMaster" },
|
|
{ value: "S", label: "WhTypeStore" },
|
|
{ value: "ONLINE", label: "WhTypeOnline" },
|
|
];
|
|
|
|
export const STATUS_OPTIONS = [
|
|
{ value: "P", label: "CatPending" },
|
|
{ value: "Y", label: "CatActive" },
|
|
{ value: "N", label: "CatInactive" },
|
|
];
|
|
|
|
export const STATUS_TONE: Record<string, "positive" | "warning" | "neutral"> = {
|
|
P: "warning",
|
|
Y: "positive",
|
|
N: "neutral",
|
|
};
|
|
|
|
// EVENT is not offered in the form (event warehouses are created by Event Setup) but appears in the tree.
|
|
const EXTRA_TYPE_LABEL: Record<string, string> = { EVENT: "WhTypeEvent" };
|
|
|
|
export const warehouseTypeLabel = (code: string, t: Translate) => {
|
|
const found = TYPE_OPTIONS.find(o => o.value === code);
|
|
if (found) return t(found.label);
|
|
const extra = EXTRA_TYPE_LABEL[code];
|
|
return extra ? t(extra) : code;
|
|
};
|
|
|
|
export const FULFILMENT_MODE_OPTIONS = [
|
|
{ value: "QIANYI", label: "WhModeQianyi" },
|
|
{ value: "MANUAL", label: "WhModeManual" },
|
|
];
|
|
|
|
export const warehouseStatusLabel = (code: string | undefined, t: Translate) => {
|
|
if (!code) return "—";
|
|
const found = STATUS_OPTIONS.find(o => o.value === code);
|
|
return found ? t(found.label) : code;
|
|
};
|