Add shipping cost groups and reject spam contact-form SMS.

Wire cart/checkout shipping fees with category groups and static rates, reject gibberish contact submissions, and SMS only valid Iranian mobiles.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-10-02 21:52:41 +03:30
co-authored by Cursor
parent 1a49576752
commit 88ef4e82a1
19 changed files with 1501 additions and 25 deletions
@@ -92,6 +92,12 @@ export type EPaymentSettings = {
gateways: PaymentGatewaysSettings;
};
/** Per-province override for the static flat shipping fee. */
export type StaticShippingProvinceException = {
provinceId: string;
amount: number;
};
/** Per-business store / sales settings. */
export type StoreSettings = {
onlineSellEnabled: boolean;
@@ -99,6 +105,14 @@ export type StoreSettings = {
torobEnabled: boolean;
orderProcessSteps: OrderProcessStep[];
ePayment: EPaymentSettings;
/**
* When true, every order uses `staticShippingAmount` and shipping cost groups are ignored.
*/
staticShippingEnabled: boolean;
/** Flat shipping fee in IRT applied to all orders when static shipping is enabled. */
staticShippingAmount: number;
/** Province-specific overrides of the static flat fee. */
staticShippingProvinceExceptions: StaticShippingProvinceException[];
};
/** Where website special-product carousels read from. */
@@ -356,6 +370,9 @@ export const DEFAULT_BUSINESS_SETTINGS: BusinessSettings = {
torobEnabled: false,
orderProcessSteps: DEFAULT_ORDER_PROCESS_STEPS,
ePayment: { ...DEFAULT_EPAYMENT_SETTINGS },
staticShippingEnabled: true,
staticShippingAmount: 0,
staticShippingProvinceExceptions: [],
},
modules: {
enabled: DEFAULT_ENABLED_BUSINESS_MODULES,