@restaround/react 1.1.2 → 1.2.2
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/Events/Events.d.ts +1 -2
- package/dist/components/PublicMenu/Branches/Branches.d.ts +1 -1
- package/dist/components/PublicMenu/Customer/CustomerAddress/CustomerAddress.d.ts +2 -0
- package/dist/components/PublicMenu/Customer/CustomerAddress/index.d.ts +1 -0
- package/dist/components/PublicMenu/FloatingOrdersButton/FloatingOrdersButton.d.ts +2 -0
- package/dist/components/PublicMenu/FloatingOrdersButton/index.d.ts +1 -0
- package/dist/components/PublicMenu/Header/Header.d.ts +1 -1
- package/dist/components/PublicMenu/Modals/AddUpdateAddress/AddUpdateAddress.d.ts +3 -0
- package/dist/components/PublicMenu/Modals/AddUpdateAddress/index.d.ts +1 -0
- package/dist/components/PublicMenu/Modals/AddUpdateNote/AddUpdateNote.d.ts +3 -0
- package/dist/components/PublicMenu/Modals/AddUpdateNote/index.d.ts +1 -0
- package/dist/components/PublicMenu/Modals/Auth/Auth.d.ts +3 -0
- package/dist/components/PublicMenu/Modals/Auth/EmailStep.d.ts +8 -0
- package/dist/components/PublicMenu/Modals/Auth/OTPStep.d.ts +8 -0
- package/dist/components/PublicMenu/Modals/Auth/PhoneStep.d.ts +7 -0
- package/dist/components/PublicMenu/Modals/Auth/index.d.ts +1 -0
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawer.d.ts +2 -0
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerCart.d.ts +2 -0
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerCompleted.d.ts +2 -0
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerDetails.d.ts +2 -0
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerFooter.d.ts +5 -0
- package/dist/components/PublicMenu/OrderDrawer/index.d.ts +1 -0
- package/dist/components/PublicMenu/OrderItemsList/OrderItemsList.d.ts +5 -0
- package/dist/components/PublicMenu/OrderItemsList/OrderNoItems.d.ts +2 -0
- package/dist/components/PublicMenu/OrderItemsList/index.d.ts +1 -0
- package/dist/components/PublicMenu/OrderListItem/OptionsInfo/OptionsInfo.d.ts +9 -0
- package/dist/components/PublicMenu/OrderListItem/OrderListItem.d.ts +7 -0
- package/dist/components/PublicMenu/OrderListItem/index.d.ts +1 -0
- package/dist/components/PublicMenu/OrderStepper/OrderStepper.d.ts +7 -0
- package/dist/components/PublicMenu/OrderStepper/index.d.ts +1 -0
- package/dist/components/PublicMenu/ProductAddons/ProductAddons.d.ts +4 -4
- package/dist/components/PublicMenu/ProductDetails/ProductDetails.d.ts +2 -2
- package/dist/components/PublicMenu/ProductInOrder/ProductInOrder.d.ts +6 -0
- package/dist/components/PublicMenu/ProductInOrder/index.d.ts +1 -0
- package/dist/components/PublicMenu/ProductQuantity/ProductQuantity.d.ts +4 -3
- package/dist/components/PublicMenu/ProductVariants/ProductVariants.d.ts +2 -2
- package/dist/components/PublicMenu/ProductsGridItem/ProductsGridItem.d.ts +1 -1
- package/dist/components/PublicMenu/ProductsListItem/ProductsListItem.d.ts +1 -1
- package/dist/constants/analytics.d.ts +1 -1
- package/dist/constants/env.d.ts +1 -0
- package/dist/hooks/product.d.ts +4 -4
- package/dist/hooks/translation.d.ts +4 -2
- 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/index.d.ts +3 -3
- package/dist/models/index.esm.js.map +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/menu.d.ts +4 -3
- package/dist/models/models/category.d.ts +10 -0
- package/dist/models/models/index.d.ts +6 -0
- package/dist/models/models/menu.d.ts +30 -0
- package/dist/models/models/pricing.d.ts +17 -0
- package/dist/models/{addon.d.ts → modules/addon/models.d.ts} +0 -3
- package/dist/{utils/models/product.d.ts → models/modules/product/models.d.ts} +5 -4
- package/dist/modules/addon/index.d.ts +2 -0
- package/dist/{utils/models/addon.d.ts → modules/addon/models.d.ts} +0 -3
- package/dist/{utils/utils/addon.d.ts → modules/addon/utils.d.ts} +1 -1
- package/dist/modules/branch/index.d.ts +1 -0
- package/dist/modules/business/index.d.ts +1 -0
- package/dist/modules/common/index.d.ts +1 -0
- package/dist/modules/common/services.d.ts +1 -0
- package/dist/modules/customer/hooks.d.ts +3 -0
- package/dist/modules/customer/index.d.ts +4 -0
- package/dist/modules/customer/models.d.ts +47 -0
- package/dist/modules/customer/services.d.ts +7 -0
- package/dist/modules/customer/utils.d.ts +6 -0
- package/dist/modules/feature/hooks.d.ts +2 -0
- package/dist/modules/feature/index.d.ts +2 -0
- package/dist/modules/feature/models.d.ts +3 -0
- package/dist/modules/order/constants.d.ts +9 -0
- package/dist/modules/order/hooks.d.ts +22 -0
- package/dist/modules/order/index.d.ts +5 -0
- package/dist/modules/order/models.d.ts +80 -0
- package/dist/modules/order/services.d.ts +2 -0
- package/dist/modules/order/utils.d.ts +20 -0
- package/dist/modules/product/index.d.ts +2 -0
- package/dist/{models/product.d.ts → modules/product/models.d.ts} +5 -4
- package/dist/{utils/product.d.ts → modules/product/utils.d.ts} +9 -8
- package/dist/modules/view/constants.d.ts +15 -0
- package/dist/modules/view/index.d.ts +3 -0
- package/dist/modules/view/services.d.ts +2 -0
- package/dist/modules/view/utils.d.ts +6 -0
- package/dist/services/api/index.d.ts +5 -0
- package/dist/services/translation/index.d.ts +3 -0
- package/dist/services/translation/locales/az/auth.d.ts +7 -0
- package/dist/services/translation/locales/az/common.d.ts +6 -0
- package/dist/services/translation/locales/az/customer.d.ts +75 -0
- package/dist/services/translation/locales/az/error.d.ts +11 -0
- package/dist/services/translation/locales/az/events.d.ts +8 -0
- package/dist/services/translation/locales/az/index.d.ts +164 -0
- package/dist/services/translation/locales/az/order.d.ts +32 -0
- package/dist/services/translation/locales/az/pricing.d.ts +29 -0
- package/dist/services/translation/locales/en/auth.d.ts +2 -0
- package/dist/services/translation/locales/en/common.d.ts +2 -0
- package/dist/services/translation/locales/en/customer.d.ts +2 -0
- package/dist/services/translation/locales/en/error.d.ts +7 -0
- package/dist/services/translation/locales/en/events.d.ts +2 -0
- package/dist/services/translation/locales/en/index.d.ts +15 -0
- package/dist/services/translation/locales/en/order.d.ts +2 -0
- package/dist/services/translation/locales/en/pricing.d.ts +2 -0
- package/dist/services/translation/locales/et/auth.d.ts +7 -0
- package/dist/services/translation/locales/et/common.d.ts +6 -0
- package/dist/services/translation/locales/et/customer.d.ts +75 -0
- package/dist/services/translation/locales/et/error.d.ts +11 -0
- package/dist/services/translation/locales/et/events.d.ts +8 -0
- package/dist/services/translation/locales/et/index.d.ts +165 -0
- package/dist/services/translation/locales/et/order.d.ts +33 -0
- package/dist/services/translation/locales/et/pricing.d.ts +29 -0
- package/dist/services/translation/locales/index.d.ts +836 -0
- package/dist/services/translation/locales/nl/auth.d.ts +7 -0
- package/dist/services/translation/locales/nl/common.d.ts +6 -0
- package/dist/services/translation/locales/nl/customer.d.ts +75 -0
- package/dist/services/translation/locales/nl/error.d.ts +11 -0
- package/dist/services/translation/locales/nl/events.d.ts +8 -0
- package/dist/services/translation/locales/nl/index.d.ts +165 -0
- package/dist/services/translation/locales/nl/order.d.ts +33 -0
- package/dist/services/translation/locales/nl/pricing.d.ts +29 -0
- package/dist/services/translation/locales/ru/auth.d.ts +7 -0
- package/dist/services/translation/locales/ru/common.d.ts +6 -0
- package/dist/services/translation/locales/ru/customer.d.ts +75 -0
- package/dist/services/translation/locales/ru/error.d.ts +11 -0
- package/dist/services/translation/locales/ru/events.d.ts +8 -0
- package/dist/services/translation/locales/ru/index.d.ts +165 -0
- package/dist/services/translation/locales/ru/order.d.ts +33 -0
- package/dist/services/translation/locales/ru/pricing.d.ts +29 -0
- package/dist/services/translation/locales/tr/auth.d.ts +7 -0
- package/dist/services/translation/locales/tr/common.d.ts +6 -0
- package/dist/services/translation/locales/tr/customer.d.ts +75 -0
- package/dist/services/translation/locales/tr/error.d.ts +11 -0
- package/dist/services/translation/locales/tr/events.d.ts +8 -0
- package/dist/services/translation/locales/tr/index.d.ts +165 -0
- package/dist/services/translation/locales/tr/order.d.ts +33 -0
- package/dist/services/translation/locales/tr/pricing.d.ts +29 -0
- package/dist/store/order.d.ts +30 -0
- package/dist/styles/ui.css +1 -1
- package/dist/styles/ui.css.map +1 -1
- package/dist/utils/index.d.ts +3 -3
- 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 +3 -3
- package/dist/utils/models/menu.d.ts +4 -3
- package/dist/utils/modules/addon/models.d.ts +27 -0
- package/dist/utils/{addon.d.ts → modules/addon/utils.d.ts} +1 -1
- package/dist/utils/modules/branch/models.d.ts +11 -0
- package/dist/utils/modules/business/models.d.ts +20 -0
- package/dist/utils/modules/order/models.d.ts +80 -0
- package/dist/utils/modules/order/utils.d.ts +20 -0
- package/dist/utils/modules/product/models.d.ts +40 -0
- package/dist/utils/{utils/product.d.ts → modules/product/utils.d.ts} +9 -8
- package/dist/utils/utils/index.d.ts +3 -3
- package/package.json +17 -15
- package/dist/components/PublicMenu/Cart/Cart.d.ts +0 -2
- package/dist/components/PublicMenu/Cart/index.d.ts +0 -1
- package/dist/components/PublicMenu/CartDrawer/CartDrawer.d.ts +0 -2
- package/dist/components/PublicMenu/CartDrawer/index.d.ts +0 -1
- package/dist/components/PublicMenu/CartItem/CartItem.d.ts +0 -6
- package/dist/components/PublicMenu/CartItem/OptionsInfo/OptionsInfo.d.ts +0 -9
- package/dist/components/PublicMenu/CartItem/index.d.ts +0 -1
- package/dist/components/PublicMenu/CartStepper/CartStepper.d.ts +0 -6
- package/dist/components/PublicMenu/CartStepper/index.d.ts +0 -1
- package/dist/components/PublicMenu/ProductInCart/ProductInCart.d.ts +0 -6
- package/dist/components/PublicMenu/ProductInCart/index.d.ts +0 -1
- package/dist/constants/translations.d.ts +0 -212
- package/dist/hooks/cart.d.ts +0 -12
- package/dist/models/order.d.ts +0 -47
- package/dist/store/cart.d.ts +0 -23
- package/dist/utils/cart.d.ts +0 -7
- package/dist/utils/cart.test.d.ts +0 -1
- package/dist/utils/models/order.d.ts +0 -47
- package/dist/utils/utils/cart.d.ts +0 -7
- package/dist/utils/utils/cart.test.d.ts +0 -1
- /package/dist/components/PublicMenu/{CartItem → OrderListItem}/OptionsInfo/index.d.ts +0 -0
- /package/dist/models/{branch.d.ts → modules/branch/models.d.ts} +0 -0
- /package/dist/models/{business.d.ts → modules/business/models.d.ts} +0 -0
- /package/dist/{utils/models/branch.d.ts → modules/branch/models.d.ts} +0 -0
- /package/dist/{utils/models/business.d.ts → modules/business/models.d.ts} +0 -0
package/dist/models/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
export * from "
|
|
1
|
+
export * from "src/modules/business/models";
|
|
2
|
+
export * from "src/modules/product/models";
|
|
3
|
+
export * from "src/modules/branch/models";
|
|
3
4
|
export * from "./category";
|
|
4
5
|
export * from "./menu";
|
|
5
|
-
export * from "./product";
|
|
6
6
|
export * from "./pricing";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/modules/product/models.ts","../../../src/models/pricing.ts"],"sourcesContent":["import { MenuAddon } from \"../addon/models\";\n\nexport interface ProductTranslation {\n\tid: number;\n\tname: string;\n\tdescription?: string;\n\tlanguage: string;\n\tproductId?: number;\n}\n\nexport interface ProductVariantTranslation {\n\tid?: number;\n\ttitle: string;\n\tlanguage: string;\n}\n\nexport interface ProductVariant {\n\tid?: number;\n\tprice: number;\n\ttranslations: ProductVariantTranslation[];\n\tproductId?: number;\n\tremove?: boolean;\n}\n\nexport interface Product {\n\tid: number;\n\tcategoryId: number;\n\tvat?: number;\n\tprice: number;\n\tvolume?: string; // 100qr/250ml/1kq\n\timage160?: string;\n\timage580?: string;\n\timage1024?: string;\n\ttranslations: ProductTranslation[];\n\tvariants: ProductVariant[];\n\taddons: MenuAddon[];\n\tavailable?: boolean;\n\tvisible?: boolean;\n\tposition?: number;\n}\n\nexport enum ProductView {\n\tLIST = \"list\",\n\tGRID = \"grid\",\n}\n","export enum PlanType {\n\tAPPETIZER = \"appetizer\",\n\tMAIN_COURSE = \"mainCourse\",\n\tCHEFS_SPECIAL = \"chefsSpecial\",\n}\n\nexport interface PricingPlan {\n\ttitle: string;\n\tprice: {\n\t\tmonthly: number;\n\t\tannually: number;\n\t};\n\tdiscountedPrice?: number;\n}\n\nexport interface PricingPlans {\n\t[key: string]: PricingPlan;\n}\n\nexport type PricingInterval = \"monthly\" | \"annually\";\n"],"names":["ProductView","PlanType"],"mappings":"IAyCYA,ECzCAC,GDyCZ,SAAYD,GACXA,EAAA,KAAA,OACAA,EAAA,KAAA,MACA,CAHD,CAAYA,IAAAA,EAGX,CAAA,IC5CD,SAAYC,GACXA,EAAA,UAAA,YACAA,EAAA,YAAA,aACAA,EAAA,cAAA,cACA,CAJD,CAAYA,IAAAA,EAIX,CAAA"}
|
package/dist/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/modules/product/models.ts","../../../src/models/pricing.ts"],"sourcesContent":["import { MenuAddon } from \"../addon/models\";\n\nexport interface ProductTranslation {\n\tid: number;\n\tname: string;\n\tdescription?: string;\n\tlanguage: string;\n\tproductId?: number;\n}\n\nexport interface ProductVariantTranslation {\n\tid?: number;\n\ttitle: string;\n\tlanguage: string;\n}\n\nexport interface ProductVariant {\n\tid?: number;\n\tprice: number;\n\ttranslations: ProductVariantTranslation[];\n\tproductId?: number;\n\tremove?: boolean;\n}\n\nexport interface Product {\n\tid: number;\n\tcategoryId: number;\n\tvat?: number;\n\tprice: number;\n\tvolume?: string; // 100qr/250ml/1kq\n\timage160?: string;\n\timage580?: string;\n\timage1024?: string;\n\ttranslations: ProductTranslation[];\n\tvariants: ProductVariant[];\n\taddons: MenuAddon[];\n\tavailable?: boolean;\n\tvisible?: boolean;\n\tposition?: number;\n}\n\nexport enum ProductView {\n\tLIST = \"list\",\n\tGRID = \"grid\",\n}\n","export enum PlanType {\n\tAPPETIZER = \"appetizer\",\n\tMAIN_COURSE = \"mainCourse\",\n\tCHEFS_SPECIAL = \"chefsSpecial\",\n}\n\nexport interface PricingPlan {\n\ttitle: string;\n\tprice: {\n\t\tmonthly: number;\n\t\tannually: number;\n\t};\n\tdiscountedPrice?: number;\n}\n\nexport interface PricingPlans {\n\t[key: string]: PricingPlan;\n}\n\nexport type PricingInterval = \"monthly\" | \"annually\";\n"],"names":["ProductView","PlanType"],"mappings":"aAyCA,IAAYA,ECzCAC,EDyCAD,QAAAA,iBAAAA,GAAAA,EAAAA,QAAWA,cAAXA,oBAGX,CAAA,IAFA,KAAA,OACAA,EAAA,KAAA,OC3CWC,QAAAA,cAAAA,GAAAA,EAAAA,QAAQA,WAARA,iBAIX,CAAA,IAHA,UAAA,YACAA,EAAA,YAAA,aACAA,EAAA,cAAA"}
|
package/dist/models/menu.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as productModels from "src/modules/product/models";
|
|
2
|
+
import * as branchModels from "src/modules/branch/models";
|
|
3
3
|
import * as categoryModels from "./category";
|
|
4
|
-
import * as businessModels from "
|
|
4
|
+
import * as businessModels from "src/modules/business/models";
|
|
5
5
|
export interface PublicMenuData {
|
|
6
|
+
businessId: number;
|
|
6
7
|
branches: branchModels.Branch[];
|
|
7
8
|
branchId: number | null | undefined;
|
|
8
9
|
coverImage?: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as productModels from "src/modules/product/models";
|
|
2
|
+
import * as branchModels from "src/modules/branch/models";
|
|
3
|
+
import * as categoryModels from "./category";
|
|
4
|
+
import * as businessModels from "src/modules/business/models";
|
|
5
|
+
export interface PublicMenuData {
|
|
6
|
+
businessId: number;
|
|
7
|
+
branches: branchModels.Branch[];
|
|
8
|
+
branchId: number | null | undefined;
|
|
9
|
+
coverImage?: string;
|
|
10
|
+
logoImage?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
currency: string;
|
|
13
|
+
products: productModels.Product[];
|
|
14
|
+
categories: categoryModels.Category[];
|
|
15
|
+
language: string;
|
|
16
|
+
languages?: businessModels.BusinessLanguage[];
|
|
17
|
+
instagram?: string;
|
|
18
|
+
facebook?: string;
|
|
19
|
+
whatsapp?: string;
|
|
20
|
+
telegram?: string;
|
|
21
|
+
tiktok?: string;
|
|
22
|
+
rootPath?: string;
|
|
23
|
+
hostname?: string | null;
|
|
24
|
+
imageTag?: any;
|
|
25
|
+
onBranchSelect?: (branchId: number) => void;
|
|
26
|
+
onLanguageSelect?: (code: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface CategoryProductMap extends categoryModels.Category {
|
|
29
|
+
products: productModels.Product[];
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum PlanType {
|
|
2
|
+
APPETIZER = "appetizer",
|
|
3
|
+
MAIN_COURSE = "mainCourse",
|
|
4
|
+
CHEFS_SPECIAL = "chefsSpecial"
|
|
5
|
+
}
|
|
6
|
+
export interface PricingPlan {
|
|
7
|
+
title: string;
|
|
8
|
+
price: {
|
|
9
|
+
monthly: number;
|
|
10
|
+
annually: number;
|
|
11
|
+
};
|
|
12
|
+
discountedPrice?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PricingPlans {
|
|
15
|
+
[key: string]: PricingPlan;
|
|
16
|
+
}
|
|
17
|
+
export type PricingInterval = "monthly" | "annually";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { MenuAddon } from "
|
|
1
|
+
import { MenuAddon } from "../addon/models";
|
|
2
2
|
export interface ProductTranslation {
|
|
3
3
|
id: number;
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
language: string;
|
|
7
|
-
productId
|
|
7
|
+
productId?: number;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface ProductVariantTranslation {
|
|
10
10
|
id?: number;
|
|
11
11
|
title: string;
|
|
12
12
|
language: string;
|
|
@@ -14,7 +14,7 @@ export interface ProductVariantTranslations {
|
|
|
14
14
|
export interface ProductVariant {
|
|
15
15
|
id?: number;
|
|
16
16
|
price: number;
|
|
17
|
-
translations:
|
|
17
|
+
translations: ProductVariantTranslation[];
|
|
18
18
|
productId?: number;
|
|
19
19
|
remove?: boolean;
|
|
20
20
|
}
|
|
@@ -32,6 +32,7 @@ export interface Product {
|
|
|
32
32
|
addons: MenuAddon[];
|
|
33
33
|
available?: boolean;
|
|
34
34
|
visible?: boolean;
|
|
35
|
+
position?: number;
|
|
35
36
|
}
|
|
36
37
|
export declare enum ProductView {
|
|
37
38
|
LIST = "list",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MenuAddon, MenuAddonOption, MenuAddonOptionTranslation, MenuAddonTranslation } from "
|
|
1
|
+
import { MenuAddon, MenuAddonOption, MenuAddonOptionTranslation, MenuAddonTranslation } from "./models";
|
|
2
2
|
export declare const getAddonTranslation: (addon: MenuAddon, language: string) => MenuAddonTranslation;
|
|
3
3
|
export declare const getAddonOptionTranslation: (option: MenuAddonOption, language: string) => MenuAddonOptionTranslation;
|
|
4
4
|
export declare const getOptionPrice: ({ option, currency, language, }: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as models from "./models";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as models from "./models";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as services from "./services";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const logException: (error?: any, errorInfo?: {}) => Promise<Response>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare enum CustomerAuthStep {
|
|
2
|
+
PHONE = "PHONE",
|
|
3
|
+
OTP = "OTP",
|
|
4
|
+
EMAIL = "EMAIL"
|
|
5
|
+
}
|
|
6
|
+
export declare enum CustomerAddressType {
|
|
7
|
+
HOME = "HOME",
|
|
8
|
+
WORK = "WORK",
|
|
9
|
+
TRAVEL = "TRAVEL"
|
|
10
|
+
}
|
|
11
|
+
export interface CustomerAddress {
|
|
12
|
+
id?: number;
|
|
13
|
+
addressId?: number;
|
|
14
|
+
countryCode: string;
|
|
15
|
+
cityName: string;
|
|
16
|
+
street: string;
|
|
17
|
+
houseNumber: string;
|
|
18
|
+
additionalNumber?: string;
|
|
19
|
+
postCode?: string;
|
|
20
|
+
instructions?: string;
|
|
21
|
+
floor?: number;
|
|
22
|
+
longitude?: number;
|
|
23
|
+
latitude?: number;
|
|
24
|
+
title?: string;
|
|
25
|
+
type?: CustomerAddressType;
|
|
26
|
+
}
|
|
27
|
+
export interface CustomerAuthForm {
|
|
28
|
+
phoneNumber: string;
|
|
29
|
+
otp: string;
|
|
30
|
+
email: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CustomerAuthPhoneForm {
|
|
33
|
+
countryCode: string;
|
|
34
|
+
phoneNumber: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AuthResponse {
|
|
37
|
+
accessToken: string;
|
|
38
|
+
refreshToken: string;
|
|
39
|
+
}
|
|
40
|
+
export interface Customer {
|
|
41
|
+
id?: number;
|
|
42
|
+
email: string;
|
|
43
|
+
fullName: string;
|
|
44
|
+
address: CustomerAddress;
|
|
45
|
+
addresses?: CustomerAddress[];
|
|
46
|
+
}
|
|
47
|
+
export type CustomerUpdatePayload = Partial<Customer>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AuthResponse, Customer, CustomerUpdatePayload } from "./models";
|
|
2
|
+
export declare const getCustomer: () => Promise<Customer>;
|
|
3
|
+
export declare const loginCustomer: (phoneNumber: string) => Promise<{
|
|
4
|
+
status: number;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const verifyOTP: (otp: string, phoneNumber: string) => Promise<AuthResponse>;
|
|
7
|
+
export declare const update: (payload: CustomerUpdatePayload) => Promise<any>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FormErrors } from "@sorocraft/ui";
|
|
2
|
+
import { CustomerAddress, CustomerAuthForm, CustomerAuthPhoneForm, CustomerAuthStep } from "./models";
|
|
3
|
+
export declare const preparePhoneNumber: (form: CustomerAuthPhoneForm) => string;
|
|
4
|
+
export declare const validateForm: (form: CustomerAuthForm, step: CustomerAuthStep) => FormErrors;
|
|
5
|
+
export declare const validateAddressForm: (form: CustomerAddress) => FormErrors;
|
|
6
|
+
export declare const formatLine: (fields: (string | undefined)[]) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Order, OrderItem, SelectedAddons } from "./models";
|
|
2
|
+
export declare const useOrderPriceDetails: () => {
|
|
3
|
+
totalPriceWithTax: number;
|
|
4
|
+
totalPriceWithoutTax: number;
|
|
5
|
+
totalTax: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const usePrepareOrder: (existingOrderData?: Partial<Order>) => Order;
|
|
8
|
+
export declare const useTotalOrderItemsCount: () => number;
|
|
9
|
+
export declare const useOrderItemsTotalPrice: () => {
|
|
10
|
+
totalPrice: number;
|
|
11
|
+
formattedTotalPrice: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const useProductQuantityInOrder: ({ productId, variantId, selectedAddons, }: {
|
|
14
|
+
productId: number;
|
|
15
|
+
variantId?: number | null;
|
|
16
|
+
selectedAddons: SelectedAddons;
|
|
17
|
+
}) => number;
|
|
18
|
+
export declare const useProductQuantityInOrderWithAllVariants: (productId: number) => number;
|
|
19
|
+
export declare const useOrderItemPrice: (item: OrderItem) => {
|
|
20
|
+
totalPrice: number;
|
|
21
|
+
formattedTotalPrice: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export declare enum OrderType {
|
|
2
|
+
DINE_IN = "DINE_IN",
|
|
3
|
+
PICK_UP = "PICK_UP",
|
|
4
|
+
DELIVERY = "DELIVERY"
|
|
5
|
+
}
|
|
6
|
+
export declare enum OrderStatus {
|
|
7
|
+
PENDING = "PENDING",
|
|
8
|
+
CONFIRMED = "CONFIRMED",
|
|
9
|
+
PREPARING = "PREPARING",
|
|
10
|
+
READY = "READY",
|
|
11
|
+
COMPLETED = "COMPLETED",
|
|
12
|
+
CANCELLED = "CANCELLED"
|
|
13
|
+
}
|
|
14
|
+
export declare enum OrderItemStatus {
|
|
15
|
+
PENDING = "PENDING",
|
|
16
|
+
PREPARING = "PREPARING",
|
|
17
|
+
READY = "READY",
|
|
18
|
+
SERVED = "SERVED"
|
|
19
|
+
}
|
|
20
|
+
export declare enum PaymentMethod {
|
|
21
|
+
CASH = "CASH",
|
|
22
|
+
CARD = "CARD",
|
|
23
|
+
WALLET = "WALLET",
|
|
24
|
+
TERMINAL = "TERMINAL"
|
|
25
|
+
}
|
|
26
|
+
export interface OrderAddon {
|
|
27
|
+
id?: number;
|
|
28
|
+
addonId: number;
|
|
29
|
+
optionId: number;
|
|
30
|
+
price: number;
|
|
31
|
+
}
|
|
32
|
+
export interface SelectedAddons {
|
|
33
|
+
[key: number]: number | number[];
|
|
34
|
+
}
|
|
35
|
+
export interface OrderItemVariant {
|
|
36
|
+
id?: number;
|
|
37
|
+
variantId: number;
|
|
38
|
+
price: number;
|
|
39
|
+
}
|
|
40
|
+
export interface OrderItem {
|
|
41
|
+
id?: number;
|
|
42
|
+
productId: number;
|
|
43
|
+
orderId?: number;
|
|
44
|
+
quantity: number;
|
|
45
|
+
price: number;
|
|
46
|
+
variant?: OrderItemVariant;
|
|
47
|
+
addons: OrderAddon[];
|
|
48
|
+
note?: string;
|
|
49
|
+
status?: OrderItemStatus;
|
|
50
|
+
vat?: number;
|
|
51
|
+
isPaid?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface Order {
|
|
54
|
+
id?: number;
|
|
55
|
+
businessId?: number;
|
|
56
|
+
branchId?: number;
|
|
57
|
+
workingDayId?: number;
|
|
58
|
+
tableId?: number;
|
|
59
|
+
customerId?: number;
|
|
60
|
+
employeeId?: number;
|
|
61
|
+
orderType: OrderType;
|
|
62
|
+
totalPriceWithTax: number;
|
|
63
|
+
totalPriceWithoutTax: number;
|
|
64
|
+
totalTax: number;
|
|
65
|
+
items: OrderItem[];
|
|
66
|
+
status?: OrderStatus;
|
|
67
|
+
vat?: number;
|
|
68
|
+
paymentMethod?: PaymentMethod;
|
|
69
|
+
note?: string;
|
|
70
|
+
createdAt?: number;
|
|
71
|
+
updatedAt?: number;
|
|
72
|
+
}
|
|
73
|
+
export interface OrderItems {
|
|
74
|
+
[key: string]: OrderItem;
|
|
75
|
+
}
|
|
76
|
+
export declare enum OrderStep {
|
|
77
|
+
CART = "CART",
|
|
78
|
+
DETAILS = "DETAILS",
|
|
79
|
+
COMPLETED = "COMPLETED"
|
|
80
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Order, OrderAddon, OrderItem, SelectedAddons } from "./models";
|
|
2
|
+
export declare const getOrderAddonsPrice: (orderAddons: OrderAddon[], quantity: number) => number;
|
|
3
|
+
export declare const getOrderPrice: (order: Order, currency: string, language: string) => {
|
|
4
|
+
totalWithoutTax: number;
|
|
5
|
+
totalWithoutTaxFormatted: string;
|
|
6
|
+
totalTax: number;
|
|
7
|
+
totalTaxFormatted: string;
|
|
8
|
+
totalWithTax: number;
|
|
9
|
+
totalWithTaxFormatted: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const generateOrderItemsId: (productId: number, variantId: number | null, selectedAddons: SelectedAddons) => string;
|
|
12
|
+
export declare const getOrderItemPrice: (orderItem: OrderItem) => {
|
|
13
|
+
totalGross: number;
|
|
14
|
+
totalNet: number;
|
|
15
|
+
totalTax: number;
|
|
16
|
+
itemGrossPrice: number;
|
|
17
|
+
itemNetPrice: number;
|
|
18
|
+
itemTax: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const getSelectedAddonsFromOrderItems: (item: OrderItem) => SelectedAddons;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { MenuAddon } from "
|
|
1
|
+
import { MenuAddon } from "../addon/models";
|
|
2
2
|
export interface ProductTranslation {
|
|
3
3
|
id: number;
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
language: string;
|
|
7
|
-
productId
|
|
7
|
+
productId?: number;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface ProductVariantTranslation {
|
|
10
10
|
id?: number;
|
|
11
11
|
title: string;
|
|
12
12
|
language: string;
|
|
@@ -14,7 +14,7 @@ export interface ProductVariantTranslations {
|
|
|
14
14
|
export interface ProductVariant {
|
|
15
15
|
id?: number;
|
|
16
16
|
price: number;
|
|
17
|
-
translations:
|
|
17
|
+
translations: ProductVariantTranslation[];
|
|
18
18
|
productId?: number;
|
|
19
19
|
remove?: boolean;
|
|
20
20
|
}
|
|
@@ -32,6 +32,7 @@ export interface Product {
|
|
|
32
32
|
addons: MenuAddon[];
|
|
33
33
|
available?: boolean;
|
|
34
34
|
visible?: boolean;
|
|
35
|
+
position?: number;
|
|
35
36
|
}
|
|
36
37
|
export declare enum ProductView {
|
|
37
38
|
LIST = "list",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Product, ProductTranslation, ProductVariant,
|
|
2
|
-
import { MenuAddon
|
|
1
|
+
import { Product, ProductTranslation, ProductVariant, ProductVariantTranslation } from "./models";
|
|
2
|
+
import { MenuAddon } from "src/modules/addon/models";
|
|
3
|
+
import * as orderModels from "src/modules/order/models";
|
|
3
4
|
export declare const getProductTranslation: (product: Product, language: string) => ProductTranslation;
|
|
4
5
|
export declare const getProductRawPrice: (product: Product, quantity?: number) => number;
|
|
5
6
|
export declare const getProductPrice: (product: Product, currency: string, language: string, quantity?: number) => {
|
|
@@ -7,7 +8,7 @@ export declare const getProductPrice: (product: Product, currency: string, langu
|
|
|
7
8
|
formattedTotalPrice: string;
|
|
8
9
|
};
|
|
9
10
|
export declare const getProductVariant: (product: Product, variantId: number) => ProductVariant;
|
|
10
|
-
export declare const getSelectedOptionsTotalPrice: (product: Product, selectedAddons: SelectedAddons, quantity: number) => number;
|
|
11
|
+
export declare const getSelectedOptionsTotalPrice: (product: Product, selectedAddons: orderModels.SelectedAddons, quantity: number) => number;
|
|
11
12
|
export declare const getProductVariantRawPrice: (variantId: number, product: Product, quantity?: number) => number;
|
|
12
13
|
export declare const getProductVariantPrice: ({ variantId, currency, language, product, quantity, }: {
|
|
13
14
|
variantId: number;
|
|
@@ -19,25 +20,25 @@ export declare const getProductVariantPrice: ({ variantId, currency, language, p
|
|
|
19
20
|
totalPrice: number;
|
|
20
21
|
formattedTotalPrice: string;
|
|
21
22
|
};
|
|
22
|
-
export declare const getProductVariantTranslation: (variant: ProductVariant, language: string) =>
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const getProductVariantTranslation: (variant: ProductVariant, language: string) => ProductVariantTranslation;
|
|
24
|
+
export declare const getProductOrderRawPrice: ({ product, variantId, quantity, selectedAddons, noVat, }: {
|
|
24
25
|
product: Product;
|
|
25
26
|
variantId: number | null;
|
|
26
27
|
quantity: number;
|
|
27
|
-
selectedAddons: SelectedAddons;
|
|
28
|
+
selectedAddons: orderModels.SelectedAddons;
|
|
28
29
|
noVat?: boolean;
|
|
29
30
|
}) => {
|
|
30
31
|
price: number;
|
|
31
32
|
optionsPrice: number;
|
|
32
33
|
total: number;
|
|
33
34
|
};
|
|
34
|
-
export declare const
|
|
35
|
+
export declare const getProductOrderPrice: ({ product, variantId, quantity, currency, language, selectedAddons, noVat, }: {
|
|
35
36
|
product: Product;
|
|
36
37
|
variantId: number | null;
|
|
37
38
|
quantity: number;
|
|
38
39
|
currency: string;
|
|
39
40
|
language: string;
|
|
40
|
-
selectedAddons: SelectedAddons;
|
|
41
|
+
selectedAddons: orderModels.SelectedAddons;
|
|
41
42
|
noVat?: boolean;
|
|
42
43
|
}) => {
|
|
43
44
|
totalPrice: number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const MODALS: {
|
|
2
|
+
ADD_UPDATE_NOTES: string;
|
|
3
|
+
AUTH: string;
|
|
4
|
+
ADD_UPDATE_ADDRESS: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const SUPPORTED_LOCALES: string[];
|
|
7
|
+
export declare const DEFAULT_LANGUAGE = "en";
|
|
8
|
+
export declare const SUPPORTED_COUNTRIES: {
|
|
9
|
+
name: string;
|
|
10
|
+
code: string;
|
|
11
|
+
phoneCode: string;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const SUPPORTED_CITIES: {
|
|
14
|
+
AZ: string[];
|
|
15
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
Azerbaijan: string;
|
|
14
|
+
Baku: string;
|
|
15
|
+
Ganja: string;
|
|
16
|
+
Sumgayit: string;
|
|
17
|
+
Mingachevir: string;
|
|
18
|
+
Shirvan: string;
|
|
19
|
+
Naftalan: string;
|
|
20
|
+
Shaki: string;
|
|
21
|
+
Lenkoran: string;
|
|
22
|
+
Yevlakh: string;
|
|
23
|
+
Shamkir: string;
|
|
24
|
+
Guba: string;
|
|
25
|
+
Gusar: string;
|
|
26
|
+
Gabala: string;
|
|
27
|
+
Tartar: string;
|
|
28
|
+
Aghjabadi: string;
|
|
29
|
+
Aghdam: string;
|
|
30
|
+
Aghdash: string;
|
|
31
|
+
Astara: string;
|
|
32
|
+
Balakan: string;
|
|
33
|
+
Barda: string;
|
|
34
|
+
Beylagan: string;
|
|
35
|
+
Bilasuvar: string;
|
|
36
|
+
Jalilabad: string;
|
|
37
|
+
Dashkasan: string;
|
|
38
|
+
Fuzuli: string;
|
|
39
|
+
Gedebey: string;
|
|
40
|
+
Goranboy: string;
|
|
41
|
+
Goychay: string;
|
|
42
|
+
Hajigabul: string;
|
|
43
|
+
Imishli: string;
|
|
44
|
+
Ismayilli: string;
|
|
45
|
+
Kurdamir: string;
|
|
46
|
+
Lerik: string;
|
|
47
|
+
Masalli: string;
|
|
48
|
+
Neftchala: string;
|
|
49
|
+
Oghuz: string;
|
|
50
|
+
Gakh: string;
|
|
51
|
+
Gazakh: string;
|
|
52
|
+
Gobustan: string;
|
|
53
|
+
Saatly: string;
|
|
54
|
+
Sabirabad: string;
|
|
55
|
+
Salyan: string;
|
|
56
|
+
Samukh: string;
|
|
57
|
+
Siyezen: string;
|
|
58
|
+
Shabran: string;
|
|
59
|
+
Shamakhi: string;
|
|
60
|
+
Tovuz: string;
|
|
61
|
+
Ujar: string;
|
|
62
|
+
Khachmaz: string;
|
|
63
|
+
Khizi: string;
|
|
64
|
+
Khojaly: string;
|
|
65
|
+
Khojavend: string;
|
|
66
|
+
Yardimli: string;
|
|
67
|
+
Zagatala: string;
|
|
68
|
+
Zardab: string;
|
|
69
|
+
Zangilan: string;
|
|
70
|
+
Shusha: string;
|
|
71
|
+
Lachin: string;
|
|
72
|
+
Kalbajar: string;
|
|
73
|
+
Khankendi: string;
|
|
74
|
+
};
|
|
75
|
+
export default _default;
|