Add dark-mode business logo, payment order steps, and Arvan DNS diagnostics.

Store logo_dark_media_id on businesses, expose logoDarkUrl on tenant/website APIs, prepend awaiting-payment steps to order workflows, and surface clearer Arvan API network errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-26 00:21:46 +03:30
co-authored by Cursor
parent e942348b1d
commit 6ce6f959ac
17 changed files with 237 additions and 29 deletions
@@ -320,6 +320,19 @@ export function listPublicPaymentGateways(settings: EPaymentSettings) {
};
}
const PAYMENT_PROCESS_STEP_IDS = ['awaiting-payment', 'payment-successful'] as const;
/** Prepend default payment steps when an older store settings JSON omits them. */
function ensurePaymentProcessSteps(steps: OrderProcessStep[]): OrderProcessStep[] {
const missing = DEFAULT_ORDER_PROCESS_STEPS.filter(
(defaults) =>
PAYMENT_PROCESS_STEP_IDS.includes(
defaults.id as (typeof PAYMENT_PROCESS_STEP_IDS)[number],
) && !steps.some((step) => step.id === defaults.id),
);
return missing.length ? [...missing, ...steps] : steps;
}
function readOrderProcessSteps(value: unknown): OrderProcessStep[] {
if (!Array.isArray(value)) {
return DEFAULT_ORDER_PROCESS_STEPS;
@@ -351,7 +364,9 @@ function readOrderProcessSteps(value: unknown): OrderProcessStep[] {
})
.filter((step): step is OrderProcessStep => step !== null);
return steps.length ? steps : DEFAULT_ORDER_PROCESS_STEPS;
return steps.length
? ensurePaymentProcessSteps(steps)
: DEFAULT_ORDER_PROCESS_STEPS;
}
export function normalizeBusinessSettings(raw: unknown): BusinessSettings {