@tabres/react 1.0.19 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerDetails.d.ts +2 -2
- package/dist/components/PublicMenu/ProductVariants/ProductVariants.d.ts +1 -1
- package/dist/constants/constants/env.d.ts +1 -1
- package/dist/constants/env.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/constants/env.d.ts +1 -1
- package/dist/models/index.esm.js.map +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/modules/addon/models.d.ts +7 -0
- package/dist/models/modules/customer/services.d.ts +3 -1
- package/dist/models/modules/order/constants.d.ts +2 -5
- package/dist/models/modules/order/hooks.d.ts +3 -7
- package/dist/models/modules/order/models.d.ts +55 -18
- package/dist/models/modules/order/services.d.ts +2 -1
- package/dist/models/modules/order/utils/item-price.d.ts +3 -0
- package/dist/models/modules/order/utils.d.ts +3 -19
- package/dist/models/modules/product/models.d.ts +13 -1
- package/dist/models/modules/product/utils/listing-price.d.ts +9 -0
- package/dist/models/modules/product/utils/order-price.d.ts +11 -0
- package/dist/models/modules/product/utils.d.ts +2 -42
- package/dist/models/services/api/client.d.ts +3 -0
- package/dist/modules/addon/models.d.ts +7 -0
- package/dist/modules/addon/utils.d.ts +0 -9
- package/dist/modules/customer/services.d.ts +3 -1
- package/dist/modules/order/constants.d.ts +2 -5
- package/dist/modules/order/hooks.d.ts +3 -7
- package/dist/modules/order/hooks.price.test.d.ts +1 -0
- package/dist/modules/order/models.d.ts +55 -18
- package/dist/modules/order/preview.d.ts +8 -0
- package/dist/modules/order/preview.test.d.ts +1 -0
- package/dist/modules/order/services.d.ts +2 -1
- package/dist/modules/order/utils/item-price.d.ts +3 -0
- package/dist/modules/order/utils/item-price.test.d.ts +1 -0
- package/dist/modules/order/utils.d.ts +3 -19
- package/dist/modules/product/models.d.ts +13 -1
- package/dist/modules/product/utils/listing-price.d.ts +9 -0
- package/dist/modules/product/utils/listing-price.test.d.ts +1 -0
- package/dist/modules/product/utils/order-price.d.ts +11 -0
- package/dist/modules/product/utils/order-price.test.d.ts +1 -0
- package/dist/modules/product/utils.d.ts +2 -42
- package/dist/services/api/client.d.ts +3 -0
- package/dist/styles/ui.css +1 -1
- package/dist/styles/ui.css.map +1 -1
- package/dist/utils/components/PublicMenu/OrderMethods/OrderMethods.types.d.ts +9 -0
- package/dist/utils/components/PublicMenu/ProductsGridItem/ProductsGridItem.types.d.ts +13 -0
- package/dist/utils/constants/env.d.ts +1 -0
- package/dist/utils/hooks/translation.d.ts +5 -0
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/models/index.d.ts +16 -0
- package/dist/utils/modules/addon/models.d.ts +7 -0
- package/dist/utils/modules/addon/utils.d.ts +0 -9
- package/dist/utils/modules/branch/hooks.d.ts +16 -0
- package/dist/utils/modules/branch/utils.d.ts +7 -0
- package/dist/utils/modules/business/constants.d.ts +2 -0
- package/dist/utils/modules/business/hooks.d.ts +15 -0
- package/dist/utils/modules/common/services.d.ts +1 -0
- package/dist/utils/modules/customer/hooks.d.ts +5 -0
- package/dist/utils/modules/customer/services.d.ts +11 -0
- package/dist/utils/modules/menu/hooks.d.ts +1 -0
- package/dist/utils/modules/menu/index.d.ts +3 -0
- package/dist/utils/modules/order/constants.d.ts +2 -5
- package/dist/utils/modules/order/hooks.d.ts +14 -0
- package/dist/utils/modules/order/index.d.ts +5 -0
- package/dist/utils/modules/order/models.d.ts +55 -18
- package/dist/utils/modules/order/services.d.ts +5 -0
- package/dist/utils/modules/order/utils/item-price.d.ts +3 -0
- package/dist/utils/modules/order/utils.d.ts +3 -19
- package/dist/utils/modules/product/hooks.d.ts +9 -0
- package/dist/utils/modules/product/index.d.ts +3 -0
- package/dist/utils/modules/product/models.d.ts +13 -1
- package/dist/utils/modules/product/utils/listing-price.d.ts +9 -0
- package/dist/utils/modules/product/utils/order-price.d.ts +11 -0
- package/dist/utils/modules/product/utils.d.ts +3 -43
- package/dist/utils/modules/store/hooks.d.ts +6 -0
- package/dist/utils/modules/table/hooks.d.ts +4 -0
- package/dist/utils/modules/view/hooks.d.ts +2 -0
- package/dist/utils/modules/view/index.d.ts +4 -0
- package/dist/utils/modules/view/models.d.ts +7 -0
- package/dist/utils/modules/view/services.d.ts +2 -0
- package/dist/utils/services/api/client.d.ts +3 -0
- package/dist/utils/services/translation/index.d.ts +3 -0
- package/dist/utils/services/translation/locales/az/auth.d.ts +7 -0
- package/dist/utils/services/translation/locales/az/branch.d.ts +14 -0
- package/dist/utils/services/translation/locales/az/common.d.ts +6 -0
- package/dist/utils/services/translation/locales/az/customer.d.ts +17 -0
- package/dist/utils/services/translation/locales/az/error.d.ts +20 -0
- package/dist/utils/services/translation/locales/az/events.d.ts +8 -0
- package/dist/utils/services/translation/locales/az/index.d.ts +149 -0
- package/dist/utils/services/translation/locales/az/order.d.ts +47 -0
- package/dist/utils/services/translation/locales/az/pricing.d.ts +35 -0
- package/dist/utils/services/translation/locales/en/auth.d.ts +2 -0
- package/dist/utils/services/translation/locales/en/branch.d.ts +10 -0
- package/dist/utils/services/translation/locales/en/common.d.ts +2 -0
- package/dist/utils/services/translation/locales/en/customer.d.ts +2 -0
- package/dist/utils/services/translation/locales/en/error.d.ts +17 -0
- package/dist/utils/services/translation/locales/en/events.d.ts +2 -0
- package/dist/utils/services/translation/locales/en/index.d.ts +34 -0
- package/dist/utils/services/translation/locales/en/order.d.ts +2 -0
- package/dist/utils/services/translation/locales/en/pricing.d.ts +2 -0
- package/dist/utils/services/translation/locales/et/auth.d.ts +7 -0
- package/dist/utils/services/translation/locales/et/branch.d.ts +13 -0
- package/dist/utils/services/translation/locales/et/common.d.ts +6 -0
- package/dist/utils/services/translation/locales/et/customer.d.ts +17 -0
- package/dist/utils/services/translation/locales/et/error.d.ts +20 -0
- package/dist/utils/services/translation/locales/et/events.d.ts +8 -0
- package/dist/utils/services/translation/locales/et/index.d.ts +147 -0
- package/dist/utils/services/translation/locales/et/order.d.ts +46 -0
- package/dist/utils/services/translation/locales/et/pricing.d.ts +35 -0
- package/dist/utils/services/translation/locales/hr/auth.d.ts +7 -0
- package/dist/utils/services/translation/locales/hr/branch.d.ts +14 -0
- package/dist/utils/services/translation/locales/hr/common.d.ts +6 -0
- package/dist/utils/services/translation/locales/hr/customer.d.ts +17 -0
- package/dist/utils/services/translation/locales/hr/error.d.ts +20 -0
- package/dist/utils/services/translation/locales/hr/events.d.ts +8 -0
- package/dist/utils/services/translation/locales/hr/index.d.ts +149 -0
- package/dist/utils/services/translation/locales/hr/order.d.ts +47 -0
- package/dist/utils/services/translation/locales/hr/pricing.d.ts +35 -0
- package/dist/utils/services/translation/locales/index.d.ts +1212 -0
- package/dist/utils/services/translation/locales/nl/auth.d.ts +7 -0
- package/dist/utils/services/translation/locales/nl/branch.d.ts +13 -0
- package/dist/utils/services/translation/locales/nl/common.d.ts +6 -0
- package/dist/utils/services/translation/locales/nl/customer.d.ts +17 -0
- package/dist/utils/services/translation/locales/nl/error.d.ts +20 -0
- package/dist/utils/services/translation/locales/nl/events.d.ts +8 -0
- package/dist/utils/services/translation/locales/nl/index.d.ts +147 -0
- package/dist/utils/services/translation/locales/nl/order.d.ts +46 -0
- package/dist/utils/services/translation/locales/nl/pricing.d.ts +35 -0
- package/dist/utils/services/translation/locales/pl/auth.d.ts +7 -0
- package/dist/utils/services/translation/locales/pl/branch.d.ts +14 -0
- package/dist/utils/services/translation/locales/pl/common.d.ts +6 -0
- package/dist/utils/services/translation/locales/pl/customer.d.ts +17 -0
- package/dist/utils/services/translation/locales/pl/error.d.ts +20 -0
- package/dist/utils/services/translation/locales/pl/events.d.ts +8 -0
- package/dist/utils/services/translation/locales/pl/index.d.ts +149 -0
- package/dist/utils/services/translation/locales/pl/order.d.ts +47 -0
- package/dist/utils/services/translation/locales/pl/pricing.d.ts +35 -0
- package/dist/utils/services/translation/locales/pt/auth.d.ts +7 -0
- package/dist/utils/services/translation/locales/pt/branch.d.ts +14 -0
- package/dist/utils/services/translation/locales/pt/common.d.ts +6 -0
- package/dist/utils/services/translation/locales/pt/customer.d.ts +17 -0
- package/dist/utils/services/translation/locales/pt/error.d.ts +20 -0
- package/dist/utils/services/translation/locales/pt/events.d.ts +8 -0
- package/dist/utils/services/translation/locales/pt/index.d.ts +149 -0
- package/dist/utils/services/translation/locales/pt/order.d.ts +47 -0
- package/dist/utils/services/translation/locales/pt/pricing.d.ts +35 -0
- package/dist/utils/services/translation/locales/ru/auth.d.ts +7 -0
- package/dist/utils/services/translation/locales/ru/branch.d.ts +13 -0
- package/dist/utils/services/translation/locales/ru/common.d.ts +6 -0
- package/dist/utils/services/translation/locales/ru/customer.d.ts +17 -0
- package/dist/utils/services/translation/locales/ru/error.d.ts +20 -0
- package/dist/utils/services/translation/locales/ru/events.d.ts +8 -0
- package/dist/utils/services/translation/locales/ru/index.d.ts +147 -0
- package/dist/utils/services/translation/locales/ru/order.d.ts +46 -0
- package/dist/utils/services/translation/locales/ru/pricing.d.ts +35 -0
- package/dist/utils/services/translation/locales/tr/auth.d.ts +7 -0
- package/dist/utils/services/translation/locales/tr/branch.d.ts +13 -0
- package/dist/utils/services/translation/locales/tr/common.d.ts +6 -0
- package/dist/utils/services/translation/locales/tr/customer.d.ts +17 -0
- package/dist/utils/services/translation/locales/tr/error.d.ts +20 -0
- package/dist/utils/services/translation/locales/tr/events.d.ts +8 -0
- package/dist/utils/services/translation/locales/tr/index.d.ts +147 -0
- package/dist/utils/services/translation/locales/tr/order.d.ts +46 -0
- package/dist/utils/services/translation/locales/tr/pricing.d.ts +35 -0
- package/dist/utils/store/index.d.ts +7 -0
- package/dist/utils/store/order.d.ts +42 -0
- package/package.json +1 -1
- package/dist/components/Pricing/Pricing.d.ts +0 -11
- package/dist/components/Pricing/PricingPlanAmount.d.ts +0 -9
- package/dist/components/Pricing/index.d.ts +0 -1
- package/dist/models/modules/addon/utils.d.ts +0 -14
- package/dist/models/services/api/index.d.ts +0 -5
- package/dist/services/api/index.d.ts +0 -5
|
@@ -31,6 +31,7 @@ export declare enum PaymentMethod {
|
|
|
31
31
|
}
|
|
32
32
|
export interface OrderAddonOption {
|
|
33
33
|
optionId: number;
|
|
34
|
+
/** Gross unit price (listingPrice from the menu listing). */
|
|
34
35
|
price: number;
|
|
35
36
|
}
|
|
36
37
|
export interface OrderAddon {
|
|
@@ -44,6 +45,7 @@ export interface SelectedAddons {
|
|
|
44
45
|
export interface OrderItemVariant {
|
|
45
46
|
id?: number;
|
|
46
47
|
variantId: number;
|
|
48
|
+
/** Gross unit price (listingPrice from the menu listing). */
|
|
47
49
|
price: number;
|
|
48
50
|
}
|
|
49
51
|
export interface OrderItem {
|
|
@@ -51,12 +53,16 @@ export interface OrderItem {
|
|
|
51
53
|
productId: number;
|
|
52
54
|
orderId?: number;
|
|
53
55
|
quantity: number;
|
|
54
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Gross unit price (listingPrice) at the moment the line was added. The
|
|
58
|
+
* server recomputes authoritative totals on create/preview; this value is
|
|
59
|
+
* what the cart UI displays.
|
|
60
|
+
*/
|
|
61
|
+
price?: number;
|
|
55
62
|
variant?: OrderItemVariant;
|
|
56
63
|
addons: OrderAddon[];
|
|
57
64
|
note?: string;
|
|
58
65
|
status?: OrderItemStatus;
|
|
59
|
-
vat?: number;
|
|
60
66
|
isPaid?: boolean;
|
|
61
67
|
sellUnitType: productModels.SellUnitType;
|
|
62
68
|
}
|
|
@@ -68,20 +74,13 @@ export interface Order {
|
|
|
68
74
|
tableId?: number;
|
|
69
75
|
employeeId?: number;
|
|
70
76
|
orderType: OrderType;
|
|
71
|
-
totalPriceWithTax: number;
|
|
72
|
-
totalPriceWithTaxAndFees?: number;
|
|
73
|
-
totalPriceWithoutTax: number;
|
|
74
|
-
totalTax: number;
|
|
75
77
|
items: OrderItem[];
|
|
76
78
|
status?: OrderStatus;
|
|
77
|
-
vat?: number;
|
|
78
79
|
paymentMethod?: PaymentMethod;
|
|
79
80
|
note?: string;
|
|
80
81
|
createdAt?: number;
|
|
81
82
|
updatedAt?: number;
|
|
82
83
|
customer?: customerModels.Customer;
|
|
83
|
-
deliveryFee?: number;
|
|
84
|
-
serviceFee?: number;
|
|
85
84
|
currency?: string;
|
|
86
85
|
trackingId?: string;
|
|
87
86
|
}
|
|
@@ -98,15 +97,53 @@ export interface OrderPayload extends Order {
|
|
|
98
97
|
customerId: number;
|
|
99
98
|
language?: string;
|
|
100
99
|
}
|
|
101
|
-
export
|
|
100
|
+
export interface CalculatePreviewItemRequest {
|
|
101
|
+
orderItemsId: string;
|
|
102
|
+
productId: number;
|
|
103
|
+
quantity: number;
|
|
104
|
+
variant?: {
|
|
105
|
+
variantId: number;
|
|
106
|
+
};
|
|
107
|
+
addons?: Array<{
|
|
108
|
+
addonId: number;
|
|
109
|
+
options: Array<{
|
|
110
|
+
optionId: number;
|
|
111
|
+
}>;
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
export interface CalculatePreviewRequest {
|
|
115
|
+
businessId?: number;
|
|
116
|
+
branchId: number;
|
|
117
|
+
orderType: OrderType;
|
|
118
|
+
items: CalculatePreviewItemRequest[];
|
|
119
|
+
}
|
|
120
|
+
export interface CalculatePreviewTax {
|
|
121
|
+
branchTaxId: number;
|
|
122
|
+
name: Record<string, string>;
|
|
123
|
+
rate: number;
|
|
124
|
+
type: "percentage" | "fixed";
|
|
125
|
+
addToListingPrice: boolean;
|
|
126
|
+
amount: number;
|
|
127
|
+
}
|
|
128
|
+
export interface CalculatePreviewLine {
|
|
129
|
+
orderItemsId: string;
|
|
130
|
+
productId: number;
|
|
131
|
+
quantity: number;
|
|
132
|
+
price: number;
|
|
133
|
+
taxes: CalculatePreviewTax[];
|
|
134
|
+
}
|
|
135
|
+
export interface CalculatePreviewResponse {
|
|
136
|
+
totalPriceWithoutTax: number;
|
|
102
137
|
totalPriceWithTax: number;
|
|
103
138
|
totalPriceWithTaxAndFees: number;
|
|
104
|
-
totalPriceWithoutTax: number;
|
|
105
139
|
totalTax: number;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
140
|
+
deliveryFee: number;
|
|
141
|
+
serviceFee: number;
|
|
142
|
+
items: CalculatePreviewLine[];
|
|
143
|
+
taxes: CalculatePreviewTax[];
|
|
144
|
+
}
|
|
145
|
+
export interface OrderPreviewState {
|
|
146
|
+
data: CalculatePreviewResponse | null;
|
|
147
|
+
isLoading: boolean;
|
|
148
|
+
error: string | null;
|
|
149
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CalculatePreviewRequest, CalculatePreviewResponse, OrderPayload } from "./models";
|
|
2
|
+
export declare const createOrder: (order: OrderPayload) => Promise<{
|
|
3
|
+
trackingId: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const calculate: (payload: CalculatePreviewRequest, signal?: AbortSignal) => Promise<CalculatePreviewResponse>;
|
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
import { IconType } from "@sorocraft/ui";
|
|
2
|
-
import { Order, OrderAddon, OrderItem, OrderStatus, OrderType, SelectedAddons } from "./models";
|
|
2
|
+
import { CalculatePreviewResponse, Order, OrderAddon, OrderItem, OrderStatus, OrderType, SelectedAddons } from "./models";
|
|
3
3
|
import * as addonModels from "../addon/models";
|
|
4
4
|
import * as branchModels from "../branch/models";
|
|
5
5
|
import { OrderErrors } from "./constants";
|
|
6
|
-
export declare const calculatSingleAddonTotalPrice: (addon: OrderAddon) => number;
|
|
7
|
-
export declare function calculateTotalAddonPrice(addons?: OrderAddon[], quantity?: number): number;
|
|
8
|
-
export declare const getOrderPrice: (order: Order, currency: string, language: string) => {
|
|
9
|
-
totalWithoutTax: number;
|
|
10
|
-
totalWithoutTaxFormatted: string;
|
|
11
|
-
totalTax: number;
|
|
12
|
-
totalTaxFormatted: string;
|
|
13
|
-
totalWithTax: number;
|
|
14
|
-
totalWithTaxFormatted: string;
|
|
15
|
-
};
|
|
16
6
|
export declare const generateOrderItemsId: (productId: number, variantId: number | null, selectedAddons?: SelectedAddons) => string;
|
|
17
|
-
export declare const getOrderItemPrice: (orderItem: OrderItem) => {
|
|
18
|
-
totalGross: number;
|
|
19
|
-
totalNet: number;
|
|
20
|
-
totalTax: number;
|
|
21
|
-
itemGrossPrice: number;
|
|
22
|
-
itemNetPrice: number;
|
|
23
|
-
itemTax: number;
|
|
24
|
-
};
|
|
25
7
|
export declare const getSelectedAddonsFromOrderItems: (item: OrderItem) => SelectedAddons;
|
|
26
8
|
export declare const getStatusIcon: (status: OrderStatus) => IconType;
|
|
27
9
|
export declare const buildSelectedAddonsPayload: (productAddons?: addonModels.MenuAddon[], selectedAddons?: SelectedAddons) => OrderAddon[];
|
|
28
10
|
export declare const getDefaultOrderType: (settings: branchModels.BranchSettings, isOpen: boolean, isDelivering: boolean) => OrderType | null;
|
|
11
|
+
export declare const isValidPreviewResponse: (data: unknown) => data is CalculatePreviewResponse;
|
|
29
12
|
export declare const getOrderErrorMessages: (field: keyof Order) => OrderErrors;
|
|
13
|
+
export * from "./utils/item-price";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as orderModels from "src/modules/order/models";
|
|
2
|
+
import { Product } from "./models";
|
|
3
|
+
export declare const useProductQuantity: ({ productId, variantId, selectedAddons, }: {
|
|
4
|
+
productId: number;
|
|
5
|
+
variantId?: number;
|
|
6
|
+
selectedAddons: orderModels.SelectedAddons;
|
|
7
|
+
}) => number;
|
|
8
|
+
export declare const useList: () => Product[];
|
|
9
|
+
export declare const useProductById: (productId: number) => Product;
|
|
@@ -5,7 +5,13 @@ export interface LocalizedContent {
|
|
|
5
5
|
}
|
|
6
6
|
export interface ProductVariant {
|
|
7
7
|
id?: number;
|
|
8
|
+
/** Net price (tax-exclusive) — server-of-record value. */
|
|
8
9
|
price: number;
|
|
10
|
+
/**
|
|
11
|
+
* Gross price for menu display: net price plus any branch taxes flagged
|
|
12
|
+
* `addToListingPrice`. Equals `price` when no branch context is supplied.
|
|
13
|
+
*/
|
|
14
|
+
listingPrice: number;
|
|
9
15
|
/** Title keyed by language code, e.g. { en: "Large", az: "Böyük" }. */
|
|
10
16
|
title: Record<string, string>;
|
|
11
17
|
productId?: number;
|
|
@@ -14,8 +20,14 @@ export interface ProductVariant {
|
|
|
14
20
|
export interface Product {
|
|
15
21
|
id: number;
|
|
16
22
|
categoryId: number;
|
|
17
|
-
|
|
23
|
+
/** Net price (tax-exclusive). Nullable when the product has no own price (variant-only). */
|
|
18
24
|
price: number;
|
|
25
|
+
/**
|
|
26
|
+
* Gross price for menu display: net price plus any branch taxes flagged
|
|
27
|
+
* `addToListingPrice`. Equals `price` when no branch context is supplied,
|
|
28
|
+
* and is null when `price` itself is null.
|
|
29
|
+
*/
|
|
30
|
+
listingPrice?: number | null;
|
|
19
31
|
volume?: string;
|
|
20
32
|
image160?: string;
|
|
21
33
|
image580?: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Product, ProductVariant } from "../models";
|
|
2
|
+
import { MenuAddonOption } from "src/models";
|
|
3
|
+
export declare const getUnitListingPrice: (item: {
|
|
4
|
+
price?: number | null;
|
|
5
|
+
listingPrice?: number | null;
|
|
6
|
+
}) => number;
|
|
7
|
+
export declare const getProductListingPrice: (product: Product, currency: string, language: string) => string;
|
|
8
|
+
export declare const getVariantListingPrice: (variant: ProductVariant, currency: string, language: string) => string;
|
|
9
|
+
export declare const getOptionListingPrice: (option: MenuAddonOption, currency: string, language: string) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as orderModels from "src/modules/order/models";
|
|
2
|
+
import { Product } from "../models";
|
|
3
|
+
export declare const getAllSelectedOptionsListingPrice: (product: Pick<Product, "addons">, selectedAddons?: orderModels.SelectedAddons) => number;
|
|
4
|
+
export declare const getProductOrderPrice: ({ product, quantity, language, currency, variantId, selectedAddons, }: {
|
|
5
|
+
product: Product;
|
|
6
|
+
quantity: number;
|
|
7
|
+
language: string;
|
|
8
|
+
currency: string;
|
|
9
|
+
variantId?: number;
|
|
10
|
+
selectedAddons?: Record<number, number | number[]>;
|
|
11
|
+
}) => string;
|
|
@@ -1,52 +1,10 @@
|
|
|
1
1
|
import { LocalizedContent, Product, ProductVariant, SellUnitType } from "./models";
|
|
2
2
|
import { MenuAddon } from "src/modules/addon/models";
|
|
3
|
-
import * as orderModels from "src/modules/order/models";
|
|
4
|
-
export declare const calculateTotalPrice: (price?: number, quantity?: number, vat?: number) => number;
|
|
5
3
|
export declare const getProductTranslation: (product: Pick<Product, "translations">, language: string) => LocalizedContent;
|
|
6
|
-
export declare const getProductRawPrice: (product: Pick<Product, "price" | "vat">, quantity?: number) => number;
|
|
7
|
-
export declare const getProductPrice: (product: Pick<Product, "price" | "vat">, currency: string, language: string, quantity?: number) => {
|
|
8
|
-
totalPrice: number;
|
|
9
|
-
formattedTotalPrice: string;
|
|
10
|
-
};
|
|
11
4
|
export declare const getProductVariant: (product: Pick<Product, "variants">, variantId: number) => ProductVariant;
|
|
12
|
-
export declare const getSelectedOptionsTotalPrice: (product: Product, selectedAddons: orderModels.SelectedAddons, quantity: number) => number;
|
|
13
|
-
export declare const getProductVariantRawPrice: (variantId: number, product: Pick<Product, "variants" | "vat">, quantity?: number) => number;
|
|
14
|
-
export declare const getProductVariantPrice: ({ variantId, currency, language, product, quantity, }: {
|
|
15
|
-
variantId: number;
|
|
16
|
-
currency?: string;
|
|
17
|
-
language?: string;
|
|
18
|
-
product: Pick<Product, "variants" | "vat">;
|
|
19
|
-
quantity?: number;
|
|
20
|
-
}) => {
|
|
21
|
-
totalPrice: number;
|
|
22
|
-
formattedTotalPrice: string;
|
|
23
|
-
};
|
|
24
5
|
export declare const getProductVariantTranslation: (variant: ProductVariant, language: string) => string;
|
|
25
|
-
export declare const getProductOrderRawPrice: ({ product, variantId, quantity, selectedAddons, noVat, }: {
|
|
26
|
-
product: Product;
|
|
27
|
-
variantId: number | null;
|
|
28
|
-
quantity: number;
|
|
29
|
-
selectedAddons: orderModels.SelectedAddons;
|
|
30
|
-
noVat?: boolean;
|
|
31
|
-
}) => {
|
|
32
|
-
price: number;
|
|
33
|
-
optionsPrice: number;
|
|
34
|
-
total: number;
|
|
35
|
-
};
|
|
36
|
-
export declare const getProductOrderPrice: ({ product, variantId, quantity, currency, language, selectedAddons, noVat, }: {
|
|
37
|
-
product: Product;
|
|
38
|
-
variantId: number | null;
|
|
39
|
-
quantity: number;
|
|
40
|
-
currency: string;
|
|
41
|
-
language: string;
|
|
42
|
-
selectedAddons: orderModels.SelectedAddons;
|
|
43
|
-
noVat?: boolean;
|
|
44
|
-
}) => {
|
|
45
|
-
totalPrice: number;
|
|
46
|
-
formattedTotalPrice: string;
|
|
47
|
-
};
|
|
48
6
|
export declare const getProductAddon: (product: Product, addonId: number) => MenuAddon;
|
|
49
|
-
export declare const getPriceSuffix: (sellUnitType: SellUnitType) => "" | " /
|
|
7
|
+
export declare const getPriceSuffix: (sellUnitType: SellUnitType) => "" | " / l" | " / kg";
|
|
50
8
|
export declare const getProductSellUnitShortCuts: (sellUnitType: SellUnitType) => {
|
|
51
9
|
"50gr": number;
|
|
52
10
|
"100gr": number;
|
|
@@ -183,3 +141,5 @@ export declare const getProductSellUnitShortCuts: (sellUnitType: SellUnitType) =
|
|
|
183
141
|
"10l"?: undefined;
|
|
184
142
|
"20l"?: undefined;
|
|
185
143
|
};
|
|
144
|
+
export * from "./utils/listing-price";
|
|
145
|
+
export * from "./utils/order-price";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as orderModels from "src/modules/order/models";
|
|
2
|
+
export declare const useInitialOrder: ({ defaultOrderType, defaultPaymentMethod, defaultBranchId, }: {
|
|
3
|
+
defaultOrderType: orderModels.OrderType;
|
|
4
|
+
defaultPaymentMethod: orderModels.PaymentMethod;
|
|
5
|
+
defaultBranchId: number;
|
|
6
|
+
}) => Partial<orderModels.Order>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"WEEKDAY-0": string;
|
|
3
|
+
"WEEKDAY-1": string;
|
|
4
|
+
"WEEKDAY-2": string;
|
|
5
|
+
"WEEKDAY-3": string;
|
|
6
|
+
"WEEKDAY-4": string;
|
|
7
|
+
"WEEKDAY-5": string;
|
|
8
|
+
"WEEKDAY-6": string;
|
|
9
|
+
Closed: string;
|
|
10
|
+
"Opening Hours": string;
|
|
11
|
+
"Delivery Hours": string;
|
|
12
|
+
Feedback: string;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"Unknown address": string;
|
|
3
|
+
"No address available": string;
|
|
4
|
+
"Update Delivery Address": string;
|
|
5
|
+
Country: string;
|
|
6
|
+
City: string;
|
|
7
|
+
"Baker Street": string;
|
|
8
|
+
Address: string;
|
|
9
|
+
"House number": string;
|
|
10
|
+
"Additional number": string;
|
|
11
|
+
"Example: Door code is 555": string;
|
|
12
|
+
"Delivery Instructions": string;
|
|
13
|
+
Floor: string;
|
|
14
|
+
"Enter address": string;
|
|
15
|
+
"House No.": string;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
SOMETHING_WRONG: string;
|
|
3
|
+
FIELD_REQUIRED: string;
|
|
4
|
+
"Unsupported country code": string;
|
|
5
|
+
"Invalid OTP": string;
|
|
6
|
+
INVALID_OTP: string;
|
|
7
|
+
OTP_RATE_LIMIT_EXCEEDED: string;
|
|
8
|
+
"Invalid Email Address": string;
|
|
9
|
+
FEATURE_NOT_AVAILABLE_FOR_SEGMENT: string;
|
|
10
|
+
ORDER_TYPE_DISABLED_FOR_BUSINESS: string;
|
|
11
|
+
ORDER_TYPE_DISABLED_AT_THIS_TIME: string;
|
|
12
|
+
COUNTRY_REQUIRED: string;
|
|
13
|
+
CITY_REQUIRED: string;
|
|
14
|
+
STREET_REQUIRED: string;
|
|
15
|
+
STREET_NUMBER_REQUIRED: string;
|
|
16
|
+
OUT_OF_DELIVERY_RANGE: string;
|
|
17
|
+
NO_ORDER_TYPE: string;
|
|
18
|
+
INVALID_ADDRESS: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
error: {
|
|
3
|
+
SOMETHING_WRONG: string;
|
|
4
|
+
FIELD_REQUIRED: string;
|
|
5
|
+
"Unsupported country code": string;
|
|
6
|
+
"Invalid OTP": string;
|
|
7
|
+
INVALID_OTP: string;
|
|
8
|
+
OTP_RATE_LIMIT_EXCEEDED: string;
|
|
9
|
+
"Invalid Email Address": string;
|
|
10
|
+
FEATURE_NOT_AVAILABLE_FOR_SEGMENT: string;
|
|
11
|
+
ORDER_TYPE_DISABLED_FOR_BUSINESS: string;
|
|
12
|
+
ORDER_TYPE_DISABLED_AT_THIS_TIME: string;
|
|
13
|
+
COUNTRY_REQUIRED: string;
|
|
14
|
+
CITY_REQUIRED: string;
|
|
15
|
+
STREET_REQUIRED: string;
|
|
16
|
+
STREET_NUMBER_REQUIRED: string;
|
|
17
|
+
OUT_OF_DELIVERY_RANGE: string;
|
|
18
|
+
NO_ORDER_TYPE: string;
|
|
19
|
+
INVALID_ADDRESS: string;
|
|
20
|
+
};
|
|
21
|
+
common: {
|
|
22
|
+
Save: string;
|
|
23
|
+
Cancel: string;
|
|
24
|
+
Continue: string;
|
|
25
|
+
};
|
|
26
|
+
order: {
|
|
27
|
+
"View order": string;
|
|
28
|
+
"Remove from order": string;
|
|
29
|
+
"Update order": string;
|
|
30
|
+
"Add to order": string;
|
|
31
|
+
Add: string;
|
|
32
|
+
"Your order": string;
|
|
33
|
+
Subtotal: string;
|
|
34
|
+
"Empty order": string;
|
|
35
|
+
"You don't have any items in your order": string;
|
|
36
|
+
"Add items": string;
|
|
37
|
+
"Add an order note": string;
|
|
38
|
+
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
39
|
+
"Your Order is Completed!": string;
|
|
40
|
+
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
41
|
+
Delivery: string;
|
|
42
|
+
"Dine in": string;
|
|
43
|
+
Pickup: string;
|
|
44
|
+
Cash: string;
|
|
45
|
+
"POS Terminal": string;
|
|
46
|
+
"Order summary": string;
|
|
47
|
+
Items: string;
|
|
48
|
+
Tax: string;
|
|
49
|
+
Total: string;
|
|
50
|
+
"Special instructions, allergies, etc.": string;
|
|
51
|
+
"Go to checkout": string;
|
|
52
|
+
"Place order": string;
|
|
53
|
+
Continue: string;
|
|
54
|
+
"Not available": string;
|
|
55
|
+
"In order": string;
|
|
56
|
+
"Product choices": string;
|
|
57
|
+
"Track order": string;
|
|
58
|
+
"Minimum order amount for delivery is {{amount}}": string;
|
|
59
|
+
"This field is required": string;
|
|
60
|
+
"Please select a table": string;
|
|
61
|
+
"Please enter an address": string;
|
|
62
|
+
"Please choose product": string;
|
|
63
|
+
Table: string;
|
|
64
|
+
"Select Table": string;
|
|
65
|
+
Card: string;
|
|
66
|
+
"Closed Now": string;
|
|
67
|
+
"Delivery Fee": string;
|
|
68
|
+
"Play video": string;
|
|
69
|
+
" / kg": string;
|
|
70
|
+
" / l": string;
|
|
71
|
+
};
|
|
72
|
+
customer: {
|
|
73
|
+
"Unknown address": string;
|
|
74
|
+
"No address available": string;
|
|
75
|
+
"Update Delivery Address": string;
|
|
76
|
+
Country: string;
|
|
77
|
+
City: string;
|
|
78
|
+
"Baker Street": string;
|
|
79
|
+
Address: string;
|
|
80
|
+
"House number": string;
|
|
81
|
+
"Additional number": string;
|
|
82
|
+
"Example: Door code is 555": string;
|
|
83
|
+
"Delivery Instructions": string;
|
|
84
|
+
Floor: string;
|
|
85
|
+
"Enter address": string;
|
|
86
|
+
"House No.": string;
|
|
87
|
+
};
|
|
88
|
+
auth: {
|
|
89
|
+
"Create an account or log in": string;
|
|
90
|
+
"Phone number": string;
|
|
91
|
+
"I don't have an email": string;
|
|
92
|
+
"We sent a confirmation code to {{address}}": string;
|
|
93
|
+
};
|
|
94
|
+
events: {
|
|
95
|
+
Events: string;
|
|
96
|
+
"Scrolled to Category": string;
|
|
97
|
+
"Category Selected": string;
|
|
98
|
+
"Product Details": string;
|
|
99
|
+
"Product Added to Order": string;
|
|
100
|
+
};
|
|
101
|
+
pricing: {
|
|
102
|
+
"Get Started": string;
|
|
103
|
+
"Choose Plan": string;
|
|
104
|
+
"Smart QR Menu": string;
|
|
105
|
+
"Link-in-bio": string;
|
|
106
|
+
"Menu Analytics": string;
|
|
107
|
+
"Unlimited Products": string;
|
|
108
|
+
"Unlimited Categories": string;
|
|
109
|
+
"Product variants": string;
|
|
110
|
+
"Product options": string;
|
|
111
|
+
"Sales reports": string;
|
|
112
|
+
"24/7 Support": string;
|
|
113
|
+
"Multiple Branches": string;
|
|
114
|
+
"Order Management": string;
|
|
115
|
+
"Table Management": string;
|
|
116
|
+
"Mobile App for Owners & Staff": string;
|
|
117
|
+
"Point of Sale (POS)": string;
|
|
118
|
+
"Delivery Management": string;
|
|
119
|
+
"Third-Party Delivery Integrations": string;
|
|
120
|
+
"TabresPay with Mobile": string;
|
|
121
|
+
"Event management": string;
|
|
122
|
+
"Unlimited Users": string;
|
|
123
|
+
"/ month": string;
|
|
124
|
+
monthly: string;
|
|
125
|
+
annually: string;
|
|
126
|
+
"Flexible Plans for Every Business - Simple Pricing, More Value!": string;
|
|
127
|
+
"Choose a pricing plan that fits your business. Subscribe monthly or annually and save more with long-term plans!": string;
|
|
128
|
+
"Unlimited Languages": string;
|
|
129
|
+
"30-day money-back guarantee": string;
|
|
130
|
+
"Limited Time Only": string;
|
|
131
|
+
"/ lifetime": string;
|
|
132
|
+
"Try for free": string;
|
|
133
|
+
"No credit card needed": string;
|
|
134
|
+
};
|
|
135
|
+
branch: {
|
|
136
|
+
"WEEKDAY-0": string;
|
|
137
|
+
"WEEKDAY-1": string;
|
|
138
|
+
"WEEKDAY-2": string;
|
|
139
|
+
"WEEKDAY-3": string;
|
|
140
|
+
"WEEKDAY-4": string;
|
|
141
|
+
"WEEKDAY-5": string;
|
|
142
|
+
"WEEKDAY-6": string;
|
|
143
|
+
Closed: string;
|
|
144
|
+
"Opening Hours": string;
|
|
145
|
+
"Delivery Hours": string;
|
|
146
|
+
Feedback: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"View order": string;
|
|
3
|
+
"Remove from order": string;
|
|
4
|
+
"Update order": string;
|
|
5
|
+
"Add to order": string;
|
|
6
|
+
Add: string;
|
|
7
|
+
"Your order": string;
|
|
8
|
+
Subtotal: string;
|
|
9
|
+
"Empty order": string;
|
|
10
|
+
"You don't have any items in your order": string;
|
|
11
|
+
"Add items": string;
|
|
12
|
+
"Add an order note": string;
|
|
13
|
+
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
14
|
+
"Your Order is Completed!": string;
|
|
15
|
+
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
16
|
+
Delivery: string;
|
|
17
|
+
"Dine in": string;
|
|
18
|
+
Pickup: string;
|
|
19
|
+
Cash: string;
|
|
20
|
+
"POS Terminal": string;
|
|
21
|
+
"Order summary": string;
|
|
22
|
+
Items: string;
|
|
23
|
+
Tax: string;
|
|
24
|
+
Total: string;
|
|
25
|
+
"Special instructions, allergies, etc.": string;
|
|
26
|
+
"Go to checkout": string;
|
|
27
|
+
"Place order": string;
|
|
28
|
+
Continue: string;
|
|
29
|
+
"Not available": string;
|
|
30
|
+
"In order": string;
|
|
31
|
+
"Product choices": string;
|
|
32
|
+
"Track order": string;
|
|
33
|
+
"Minimum order amount for delivery is {{amount}}": string;
|
|
34
|
+
"This field is required": string;
|
|
35
|
+
"Please select a table": string;
|
|
36
|
+
"Please enter an address": string;
|
|
37
|
+
"Please choose product": string;
|
|
38
|
+
Table: string;
|
|
39
|
+
"Select Table": string;
|
|
40
|
+
Card: string;
|
|
41
|
+
"Closed Now": string;
|
|
42
|
+
"Delivery Fee": string;
|
|
43
|
+
"Play video": string;
|
|
44
|
+
" / kg": string;
|
|
45
|
+
" / l": string;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"Get Started": string;
|
|
3
|
+
"Choose Plan": string;
|
|
4
|
+
"Smart QR Menu": string;
|
|
5
|
+
"Link-in-bio": string;
|
|
6
|
+
"Menu Analytics": string;
|
|
7
|
+
"Unlimited Products": string;
|
|
8
|
+
"Unlimited Categories": string;
|
|
9
|
+
"Product variants": string;
|
|
10
|
+
"Product options": string;
|
|
11
|
+
"Sales reports": string;
|
|
12
|
+
"24/7 Support": string;
|
|
13
|
+
"Multiple Branches": string;
|
|
14
|
+
"Order Management": string;
|
|
15
|
+
"Table Management": string;
|
|
16
|
+
"Mobile App for Owners & Staff": string;
|
|
17
|
+
"Point of Sale (POS)": string;
|
|
18
|
+
"Delivery Management": string;
|
|
19
|
+
"Third-Party Delivery Integrations": string;
|
|
20
|
+
"TabresPay with Mobile": string;
|
|
21
|
+
"Event management": string;
|
|
22
|
+
"Unlimited Users": string;
|
|
23
|
+
"/ month": string;
|
|
24
|
+
monthly: string;
|
|
25
|
+
annually: string;
|
|
26
|
+
"Flexible Plans for Every Business - Simple Pricing, More Value!": string;
|
|
27
|
+
"Choose a pricing plan that fits your business. Subscribe monthly or annually and save more with long-term plans!": string;
|
|
28
|
+
"Unlimited Languages": string;
|
|
29
|
+
"30-day money-back guarantee": string;
|
|
30
|
+
"Limited Time Only": string;
|
|
31
|
+
"/ lifetime": string;
|
|
32
|
+
"Try for free": string;
|
|
33
|
+
"No credit card needed": string;
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|