sme-pos-package 1.0.7 → 1.0.9
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/index.d.mts +37 -2
- package/dist/index.mjs +17 -104
- package/dist/index.mjs.map +1 -1
- package/dist/tailwind.preset.d.mts +27 -0
- package/dist/tailwind.preset.mjs +2 -0
- package/dist/tailwind.preset.mjs.map +1 -0
- package/package.json +18 -30
- package/public/assets/images/bank-logos.png +0 -0
- package/public/assets/images/banner1.png +0 -0
- package/public/assets/images/banner2.png +0 -0
- package/public/assets/images/banner3.png +0 -0
- package/public/assets/images/banner4.png +0 -0
- package/public/assets/images/cashier.svg +9 -0
- package/public/assets/images/empty-cart.png +0 -0
- package/public/assets/images/empty-table-state.png +0 -0
- package/public/assets/images/layout-display/left-layout.png +0 -0
- package/public/assets/images/layout-display/right-layout.png +0 -0
- package/public/assets/images/modal-illustration.png +0 -0
- package/public/assets/images/order-empty-state.png +0 -0
- package/public/assets/images/order.png +0 -0
- package/public/assets/images/payment-success-label.png +0 -0
- package/public/assets/images/table-empty.png +0 -0
- package/public/assets/images/take-away.png +0 -0
- package/public/assets/lottie/loading.json +1 -0
- package/public/assets/lottie/soft_pos.json +1 -0
- package/public/assets/lottie/success.json +1 -0
- package/public/config.json +27 -0
- package/public/env.json +17 -0
- package/src/animations/success.json +9730 -0
- package/src/assets/icons/breadcrumbs-icon.tsx +85 -0
- package/src/assets/icons/cart-icon.tsx +14 -0
- package/src/assets/icons/common.tsx +270 -0
- package/src/assets/icons/customer-view-icon.tsx +20 -0
- package/src/assets/icons/dining-table.tsx +34 -0
- package/src/assets/icons/edit-line-icon.tsx +18 -0
- package/src/assets/icons/emenu-icon.tsx +39 -0
- package/src/assets/icons/file-close-line-icon.tsx +18 -0
- package/src/assets/icons/helper-icon.tsx +84 -0
- package/src/assets/icons/home-gear-line-icon.tsx +18 -0
- package/src/assets/icons/kanban-icon.tsx +16 -0
- package/src/assets/icons/loading-icon.tsx +45 -0
- package/src/assets/icons/logout-box-line-icon.tsx +18 -0
- package/src/assets/icons/order-icon.tsx +92 -0
- package/src/assets/icons/payment-icon.tsx +429 -0
- package/src/assets/icons/pincode.tsx +196 -0
- package/src/assets/icons/pos-connect-icon.tsx +67 -0
- package/src/assets/icons/pos-device-icon.tsx +52 -0
- package/src/assets/icons/pos-icon.tsx +75 -0
- package/src/assets/icons/printer-line-icon.tsx +18 -0
- package/src/assets/icons/star-icon.tsx +174 -0
- package/src/assets/icons/table-icon.tsx +77 -0
- package/src/assets/icons/user-add-line-icon.tsx +33 -0
- package/src/assets/icons/user-icon.tsx +65 -0
- package/src/components/common/button-action.tsx +46 -0
- package/src/components/common/button-icon.tsx +23 -0
- package/src/components/common/dropdown/index.tsx +79 -0
- package/src/components/common/empty-state.tsx +60 -0
- package/src/components/common/header/index.tsx +89 -0
- package/src/components/common/header/tabs.tsx +119 -0
- package/src/components/common/image.tsx +20 -0
- package/src/components/common/input/index.tsx +55 -0
- package/src/components/common/input/radio-group.tsx +75 -0
- package/src/components/common/input/text-area.tsx +28 -0
- package/src/components/common/modal/delete-confirm-modal-container.tsx +65 -0
- package/src/components/common/modal/index.ts +2 -0
- package/src/components/common/modal/modal-direction.tsx +125 -0
- package/src/components/common/modal/modal-header.tsx +37 -0
- package/src/components/common/modal/modal-wrapper.tsx +56 -0
- package/src/components/common/modal/modal-zoom.tsx +61 -0
- package/src/components/common/pagination.tsx +95 -0
- package/src/components/common/refresh-button.tsx +28 -0
- package/src/components/common/search-bar.tsx +27 -0
- package/src/components/common/search.tsx +59 -0
- package/src/components/common/skeleton.tsx +7 -0
- package/src/components/common/tabs-layout.tsx +98 -0
- package/src/components/common/use-check-session.tsx +19 -0
- package/src/components/customer-management/add-customer/add-customer-drawer.tsx +286 -0
- package/src/components/customer-management/add-customer/address-select.tsx +51 -0
- package/src/components/customer-management/choose-customer-drawer.tsx +177 -0
- package/src/components/customer-management/customer-info-drawer.tsx +166 -0
- package/src/components/customer-management/customer-no-data.tsx +18 -0
- package/src/components/emenu/emenu-qr-code.tsx +59 -0
- package/src/components/emenu/menu-link.tsx +67 -0
- package/src/components/index.ts +8 -0
- package/src/components/kanban-template/kitchen-template.tsx +60 -0
- package/src/components/kanban-template/pos-order-template.tsx +77 -0
- package/src/components/kanban-template/pos-template.tsx +170 -0
- package/src/components/kitchen-management/change-status-confirm-modal.tsx +61 -0
- package/src/components/kitchen-management/index.ts +1 -0
- package/src/components/kitchen-management/kitchen-order/index.tsx +153 -0
- package/src/components/kitchen-management/kitchen-order/line.tsx +78 -0
- package/src/components/kitchen-management/kitchen-order/state.tsx +52 -0
- package/src/components/kitchen-management/kitchen-status.tsx +69 -0
- package/src/components/kitchen-management/orders-kitchen-management.tsx +113 -0
- package/src/components/order-management/index.tsx +128 -0
- package/src/components/order-management/order-actions.tsx +46 -0
- package/src/components/order-management/order-detail/header.tsx +37 -0
- package/src/components/order-management/order-detail/index.ts +3 -0
- package/src/components/order-management/order-detail/information.tsx +96 -0
- package/src/components/order-management/order-detail/order-detail.tsx +84 -0
- package/src/components/order-management/order-detail/order-line.tsx +56 -0
- package/src/components/order-management/order-detail/summary.tsx +221 -0
- package/src/components/order-management/order-header.tsx +113 -0
- package/src/components/order-management/order-pagination.tsx +49 -0
- package/src/components/order-management/order-status.tsx +58 -0
- package/src/components/order-management/order-table.tsx +179 -0
- package/src/components/order-management/order-tabs.tsx +48 -0
- package/src/components/pos-management/add-product-from-barcode/index.tsx +97 -0
- package/src/components/pos-management/cart-content/action-line.tsx +81 -0
- package/src/components/pos-management/cart-content/cancel-order-line-modal.tsx +41 -0
- package/src/components/pos-management/cart-content/cart-item.tsx +173 -0
- package/src/components/pos-management/cart-content/cart-items.tsx +130 -0
- package/src/components/pos-management/cart-content/draft-orders/draft-order-line.tsx +67 -0
- package/src/components/pos-management/cart-content/draft-orders/index.tsx +40 -0
- package/src/components/pos-management/cart-content/edit-cart-modal.tsx +11 -0
- package/src/components/pos-management/cart-content/index.tsx +260 -0
- package/src/components/pos-management/cart-content/no-select-order.tsx +26 -0
- package/src/components/pos-management/cart-content/order-info/customer-info.tsx +53 -0
- package/src/components/pos-management/cart-content/order-info/index.tsx +109 -0
- package/src/components/pos-management/cart-content/order-total.tsx +36 -0
- package/src/components/pos-management/cart-content/orders-line.tsx +72 -0
- package/src/components/pos-management/menu-content/category-tab.tsx +38 -0
- package/src/components/pos-management/menu-content/create-order-modal.tsx +65 -0
- package/src/components/pos-management/menu-content/product-content.tsx +93 -0
- package/src/components/pos-management/menu-content/product-detail/info.tsx +28 -0
- package/src/components/pos-management/menu-content/product-detail/modal.tsx +148 -0
- package/src/components/pos-management/menu-content/product-detail/option.tsx +87 -0
- package/src/components/pos-management/menu-content/product-detail/quantity-control.tsx +155 -0
- package/src/components/pos-management/menu-content/product-detail/sale-keypad.tsx +100 -0
- package/src/components/pos-management/menu-content/product-item.tsx +65 -0
- package/src/components/pos-management/order-helper/cancel-order-confirm.tsx +43 -0
- package/src/components/pos-management/order-helper/history-call.tsx +105 -0
- package/src/components/pos-management/order-helper/order-helper-modal.tsx +116 -0
- package/src/components/pos-management/payment-content/bill/actions.tsx +46 -0
- package/src/components/pos-management/payment-content/bill/content.tsx +207 -0
- package/src/components/pos-management/payment-content/bill/index.tsx +18 -0
- package/src/components/pos-management/payment-content/card-payment/index.tsx +124 -0
- package/src/components/pos-management/payment-content/card-payment/pos-payment/pos-connect.tsx +183 -0
- package/src/components/pos-management/payment-content/card-payment/pos-payment/qr-connect.tsx +185 -0
- package/src/components/pos-management/payment-content/card-payment/waiting-for-payment-pos-modal.tsx +37 -0
- package/src/components/pos-management/payment-content/cash-payment/index.tsx +216 -0
- package/src/components/pos-management/payment-content/index.tsx +70 -0
- package/src/components/pos-management/payment-content/payment-info.tsx +67 -0
- package/src/components/pos-management/payment-content/payment-layout.tsx +16 -0
- package/src/components/pos-management/payment-content/payment-method-cards.tsx +99 -0
- package/src/components/pos-management/payment-content/qr-payment/index.tsx +118 -0
- package/src/components/pos-management/payment-content/qr-payment/qr_code.js +29 -0
- package/src/components/pos-management/payment-content/qr-payment/vietqr.js +436 -0
- package/src/components/pos-management/payment-content/session-close-modal.tsx +35 -0
- package/src/components/pos-management/payment-content/soft-pos-payment/index.tsx +48 -0
- package/src/components/pos-management/pos-helpers/back-confirm.tsx +45 -0
- package/src/components/pos-management/pos-helpers/index.tsx +135 -0
- package/src/components/pos-management/pos-helpers/layout-display-modal.tsx +99 -0
- package/src/components/pos-management/search.tsx +48 -0
- package/src/components/pos-management/table-content/filtered-tables.tsx +59 -0
- package/src/components/pos-management/table-content/floor-tabs.tsx +65 -0
- package/src/components/pos-management/table-content/index.tsx +76 -0
- package/src/components/pos-management/table-content/table-item.tsx +127 -0
- package/src/components/pos-management/table-content/tables.tsx +96 -0
- package/src/components/restaurant-management/add-floor-modal.tsx +133 -0
- package/src/components/restaurant-management/add-table-modal.tsx +198 -0
- package/src/components/restaurant-management/delete-floor-confirm-modal.tsx +42 -0
- package/src/components/restaurant-management/delete-table-confirm-modal.tsx +51 -0
- package/src/components/restaurant-management/header.tsx +22 -0
- package/src/components/restaurant-management/index.tsx +54 -0
- package/src/components/restaurant-management/left-side.tsx +51 -0
- package/src/components/restaurant-management/right-side.tsx +179 -0
- package/src/components/restaurant-management/table-empty.tsx +43 -0
- package/src/components/session-management/close-session-modal/actions.tsx +45 -0
- package/src/components/session-management/close-session-modal/close-session-confirm.tsx +157 -0
- package/src/components/session-management/close-session-modal/close-session-ticket.tsx +218 -0
- package/src/components/session-management/close-session-modal/container.tsx +25 -0
- package/src/components/session-management/close-session-modal/draft-orders-confirm.tsx +53 -0
- package/src/components/session-management/close-session-modal/draft-orders-summary.tsx +82 -0
- package/src/components/session-management/close-session-modal/draft-orders.tsx +34 -0
- package/src/components/session-management/close-session-modal/index.tsx +35 -0
- package/src/components/session-management/close-session-modal/order/index.ts +1 -0
- package/src/components/session-management/close-session-modal/order/order-line.tsx +64 -0
- package/src/components/session-management/close-session-modal/order/orders-in-draft.tsx +31 -0
- package/src/components/session-management/close-session-modal/session-summary.tsx +165 -0
- package/src/components/session-management/index.ts +1 -0
- package/src/components/session-management/open-shift/index.tsx +172 -0
- package/src/components/table-management/index.tsx +0 -0
- package/src/constants/api/index.ts +1 -0
- package/src/constants/headers.constant.tsx +24 -0
- package/src/constants/index.ts +1 -0
- package/src/constants/language.store.ts +21 -0
- package/src/constants/methods.constant.ts +10 -0
- package/src/constants/order-state.ts +8 -0
- package/src/constants/payment-color.constant.ts +26 -0
- package/src/constants/query.constant.ts +14 -0
- package/src/constants/routes.constants.ts +23 -0
- package/src/constants/template-name.constant.ts +9 -0
- package/src/hooks/bill/use-get-bill-information.ts +49 -0
- package/src/hooks/bill/use-print-bill.tsx +0 -0
- package/src/hooks/common/load-env-config.ts +98 -0
- package/src/hooks/common/use-back.ts +13 -0
- package/src/hooks/common/use-broadcast.ts +22 -0
- package/src/hooks/common/use-click-outside.ts +58 -0
- package/src/hooks/common/use-get-base64-photo.ts +71 -0
- package/src/hooks/common/use-get-query.ts +25 -0
- package/src/hooks/common/use-pos.ts +21 -0
- package/src/hooks/common/use-query-params.ts +89 -0
- package/src/hooks/common/use-speech.ts +36 -0
- package/src/hooks/customer/use-customer-provider.ts +247 -0
- package/src/hooks/floor/use-floor-provider.ts +172 -0
- package/src/hooks/kitchen/use-kitchen-provider.ts +80 -0
- package/src/hooks/order/use-get-point-reward.ts +50 -0
- package/src/hooks/order/use-loop-fetch-order.ts +30 -0
- package/src/hooks/order/use-order-items.ts +61 -0
- package/src/hooks/order/use-orders.ts +76 -0
- package/src/hooks/payment/use-payment-provider.ts +221 -0
- package/src/hooks/product/use-product-provider.ts +87 -0
- package/src/hooks/session/use-check-session.tsx +19 -0
- package/src/hooks/session/use-session-provider.ts +79 -0
- package/src/hooks/table/use-pos-table-provider.ts +193 -0
- package/src/index.css +5 -0
- package/src/index.ts +10 -0
- package/src/layouts/common.tsx +15 -0
- package/src/layouts/index.ts +4 -0
- package/src/layouts/pos-layout.tsx +33 -0
- package/src/layouts/pos-order-layout.tsx +43 -0
- package/src/layouts/sale-layout.tsx +25 -0
- package/src/locales/en.json +394 -0
- package/src/locales/vi.json +400 -0
- package/src/pages/index.ts +4 -0
- package/src/pages/login/index.tsx +128 -0
- package/src/pages/pincode/index.tsx +198 -0
- package/src/pages/pos/kitchen-management/layout.tsx +18 -0
- package/src/pages/pos/management-floor/index.tsx +7 -0
- package/src/pages/pos/management-order/index.tsx +7 -0
- package/src/pages/pos/management-order/order-detail/index.tsx +7 -0
- package/src/pages/pos/management-table/index.tsx +0 -0
- package/src/pages/pos/payment-success/index.tsx +75 -0
- package/src/provider/app-provider.tsx +56 -0
- package/src/provider/fallback/custom-error.tsx +26 -0
- package/src/provider/main-provider.tsx +41 -0
- package/src/provider/meta-provider.tsx +72 -0
- package/src/provider/modal-provider.tsx +48 -0
- package/src/provider/notification-provider.tsx +64 -0
- package/src/provider/pos-provider/close-session-provider/index.tsx +207 -0
- package/src/provider/pos-provider/customer-provider/index.tsx +30 -0
- package/src/provider/pos-provider/floor-provider/index.tsx +39 -0
- package/src/provider/pos-provider/index.ts +6 -0
- package/src/provider/pos-provider/kitchen-provider/index.tsx +30 -0
- package/src/provider/pos-provider/order-detail-provider/index.tsx +233 -0
- package/src/provider/pos-provider/order-provider/index.tsx +803 -0
- package/src/provider/pos-provider/payment-provider/index.tsx +30 -0
- package/src/provider/pos-provider/product-provider/index.tsx +30 -0
- package/src/provider/pos-provider/sale-provider/index.tsx +168 -0
- package/src/provider/pos-provider/session-provider/index.tsx +30 -0
- package/src/provider/pos-provider/socket-provider/index.tsx +118 -0
- package/src/provider/pos-provider/table-provider/index.tsx +30 -0
- package/src/provider/public-provider.tsx +104 -0
- package/src/provider/use-session-provider.ts +79 -0
- package/src/router/app-router.tsx +38 -0
- package/src/router/index.tsx +26 -0
- package/src/router/pos-route.tsx +75 -0
- package/src/router/protected-route.tsx +16 -0
- package/src/router/public-route.tsx +11 -0
- package/src/store/header/index.ts +21 -0
- package/src/store/session/index.ts +25 -0
- package/src/store/states/cart.state.ts +135 -0
- package/src/store/states/close-session.state.ts +20 -0
- package/src/store/states/customer.state.ts +19 -0
- package/src/store/states/payment.state.ts +14 -0
- package/src/styles/base.css +212 -0
- package/src/styles/common.css +65 -0
- package/src/styles/lib/tailwind.css +0 -0
- package/src/styles/lib/tailwind.theme.css +34 -0
- package/src/styles/loading.css +72 -0
- package/src/styles/main.css +5 -0
- package/src/styles/refreshing-content.css +55 -0
- package/src/styles/text.css +44 -0
- package/src/types/account.ts +61 -0
- package/src/types/branch.ts +6 -0
- package/src/types/category.ts +13 -0
- package/src/types/common.ts +4 -0
- package/src/types/customer.ts +52 -0
- package/src/types/dashboard.ts +18 -0
- package/src/types/edc.ts +37 -0
- package/src/types/export-e-invoice.ts +17 -0
- package/src/types/filter.d.ts +12 -0
- package/src/types/floor/floor.ts +16 -0
- package/src/types/floor.d.ts +36 -0
- package/src/types/index.ts +127 -0
- package/src/types/invoice.ts +32 -0
- package/src/types/modal.ts +15 -0
- package/src/types/notification.ts +12 -0
- package/src/types/order.ts +182 -0
- package/src/types/payment.ts +44 -0
- package/src/types/product/product.ts +47 -0
- package/src/types/product.ts +137 -0
- package/src/types/provider-info.d.ts +14 -0
- package/src/types/qr.d.ts +25 -0
- package/src/types/report.d.ts +43 -0
- package/src/types/sale.d.ts +68 -0
- package/src/types/search.d.ts +7 -0
- package/src/types/session.d.ts +30 -0
- package/src/types/shop-qr.d.ts +89 -0
- package/src/types/staff.d.ts +35 -0
- package/src/types/store.d.ts +25 -0
- package/src/types/table.d.ts +57 -0
- package/src/utils/close-session-ticket.tsx +129 -0
- package/src/utils/functions.ts +299 -0
- package/src/utils/i18n.ts +25 -0
- package/src/utils/pos/bill.ts +156 -0
- package/src/utils/pos/convert-order.ts +58 -0
- package/src/utils/pos/helpers.ts +48 -0
- package/src/utils/pos/session.ts +44 -0
- package/src/utils/storages/index.ts +1 -0
- package/src/utils/storages/local-storage.ts +72 -0
- package/tailwind.preset.ts +25 -0
- package/tsconfig.json +30 -0
- package/tsup.config.ts +30 -0
- package/dist/index.d.ts +0 -58
- package/dist/index.js +0 -145
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { ORDER_STATE } from "@constants/order-state";
|
|
2
|
+
import { TAttributeLine, TProduct } from "./product/product";
|
|
3
|
+
|
|
4
|
+
export type OrderStatus = "new" | "paid" | "recorded" | "invoiced" | "cancel";
|
|
5
|
+
|
|
6
|
+
export interface OrderItemData {
|
|
7
|
+
id: string;
|
|
8
|
+
status: OrderStatus;
|
|
9
|
+
date: string;
|
|
10
|
+
time: string;
|
|
11
|
+
price: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface OrderData {
|
|
15
|
+
id: number;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
table: string | boolean;
|
|
18
|
+
employee: string;
|
|
19
|
+
createDate: string;
|
|
20
|
+
createTime: string;
|
|
21
|
+
status: OrderStatus;
|
|
22
|
+
partnerId: string | number | boolean;
|
|
23
|
+
totalProducts: number;
|
|
24
|
+
amountTax: number;
|
|
25
|
+
rewardPoints: number;
|
|
26
|
+
total: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface OrderDetailItemType {
|
|
30
|
+
id: TProduct["id"];
|
|
31
|
+
lineId: number;
|
|
32
|
+
name: TProduct["name"];
|
|
33
|
+
quantity: number;
|
|
34
|
+
price: number;
|
|
35
|
+
image: string;
|
|
36
|
+
unitPrice: number;
|
|
37
|
+
subTotal?: number;
|
|
38
|
+
inchTotal?: number;
|
|
39
|
+
taxesId: number[];
|
|
40
|
+
tax: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ApiOrder {
|
|
44
|
+
id: number;
|
|
45
|
+
pos_reference: string;
|
|
46
|
+
amount_total: number;
|
|
47
|
+
date_order: string;
|
|
48
|
+
state: string;
|
|
49
|
+
table_id: string | number | boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ApiOrderDetail {
|
|
53
|
+
id: number;
|
|
54
|
+
session_id: { id: number; display_name: string };
|
|
55
|
+
table_id: string | number | boolean;
|
|
56
|
+
user_id: number;
|
|
57
|
+
partner_id: string | number | boolean;
|
|
58
|
+
date_order: string;
|
|
59
|
+
state: string;
|
|
60
|
+
amount_total: number;
|
|
61
|
+
amount_tax: number;
|
|
62
|
+
lines: number[];
|
|
63
|
+
pos_reference: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ProductImage {
|
|
67
|
+
id: number;
|
|
68
|
+
image_128: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface OrderStatusConfig {
|
|
72
|
+
bg: string;
|
|
73
|
+
label: string;
|
|
74
|
+
color: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface IPartner {
|
|
78
|
+
code: string;
|
|
79
|
+
id: number;
|
|
80
|
+
name: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type TPartnerRes = TDataRes<IPartner[]>;
|
|
84
|
+
|
|
85
|
+
export type TOrder = {
|
|
86
|
+
order_id: number;
|
|
87
|
+
code: string;
|
|
88
|
+
payment_method: number | string | null;
|
|
89
|
+
name: string;
|
|
90
|
+
updated_at: number;
|
|
91
|
+
status: number; //0->completed, 1->pending, 2->Need order
|
|
92
|
+
total_money: number | null;
|
|
93
|
+
eiv_code: string | null;
|
|
94
|
+
table_id?: number;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export type TOrderPayload = {
|
|
98
|
+
sessionId: number;
|
|
99
|
+
posReference: string;
|
|
100
|
+
amountTax: number;
|
|
101
|
+
amountTotal: number;
|
|
102
|
+
amountPaid: number;
|
|
103
|
+
amountReturn: number;
|
|
104
|
+
tableId?: number;
|
|
105
|
+
partnerId: boolean | number;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export interface OrderDetailItemType {
|
|
109
|
+
id: TProduct["id"];
|
|
110
|
+
lineId: number;
|
|
111
|
+
name: TProduct["name"];
|
|
112
|
+
quantity: number;
|
|
113
|
+
price: number;
|
|
114
|
+
image: string;
|
|
115
|
+
unitPrice: number;
|
|
116
|
+
subTotal?: number;
|
|
117
|
+
inchTotal?: number;
|
|
118
|
+
taxesId: number[];
|
|
119
|
+
tax: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type TKitchenOrder = {
|
|
123
|
+
create_date: string;
|
|
124
|
+
customer_count: number;
|
|
125
|
+
displayed: boolean;
|
|
126
|
+
floating_order_name: boolean;
|
|
127
|
+
generalNote: string;
|
|
128
|
+
id: number;
|
|
129
|
+
last_stage_change: string;
|
|
130
|
+
orderlines: TKitchenOrderLine[];
|
|
131
|
+
pos_order_id: number;
|
|
132
|
+
responsible: string;
|
|
133
|
+
stage_id: number;
|
|
134
|
+
table: TKitchenOrderTable;
|
|
135
|
+
tracking_number: string;
|
|
136
|
+
pickAttributeValue: TAttributeLine[];
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export type TKitchenOrderLine = {
|
|
140
|
+
pickAttributeValue: any[];
|
|
141
|
+
attribute_ids: any[];
|
|
142
|
+
id: number;
|
|
143
|
+
internal_note: string;
|
|
144
|
+
product_cancelled: number;
|
|
145
|
+
product_category_ids: number[];
|
|
146
|
+
product_id: number;
|
|
147
|
+
product_name: string;
|
|
148
|
+
product_quantity: number;
|
|
149
|
+
todo: boolean;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export type TKitchenOrderTable = {
|
|
153
|
+
color: string;
|
|
154
|
+
id: number;
|
|
155
|
+
seats: number;
|
|
156
|
+
table_number: number;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export type TKitchenOrderLineWithComplete = TKitchenOrderLine & {
|
|
160
|
+
isComplete: boolean;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type TChangeOrderStatusPayload = {
|
|
164
|
+
orderId: number;
|
|
165
|
+
stageId: number;
|
|
166
|
+
preparationDisplayId: number;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export type TBasicOrder = {
|
|
170
|
+
id: number;
|
|
171
|
+
table_id: number | false;
|
|
172
|
+
state: ORDER_STATE;
|
|
173
|
+
lines: number[];
|
|
174
|
+
create_date: Date;
|
|
175
|
+
pos_reference: string;
|
|
176
|
+
amount_total: number;
|
|
177
|
+
amount_tax: number;
|
|
178
|
+
user_id: number;
|
|
179
|
+
partner_id: number;
|
|
180
|
+
write_date?: Date;
|
|
181
|
+
payment_ids?: number[];
|
|
182
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type TCreateQRPayload = {
|
|
2
|
+
bill_id: string;
|
|
3
|
+
amount: string;
|
|
4
|
+
va_account_no: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type TPaymentQR = {
|
|
8
|
+
QR: string;
|
|
9
|
+
bank_account: string;
|
|
10
|
+
bank: string;
|
|
11
|
+
va_account: string;
|
|
12
|
+
error_code: null | string;
|
|
13
|
+
getQrContent: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type TPushPosPayload = {
|
|
17
|
+
invoice_id: number;
|
|
18
|
+
serial_number: string;
|
|
19
|
+
payment_method: 2;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type TPushQRToTerminal = {
|
|
23
|
+
serial_number: string;
|
|
24
|
+
qr: string;
|
|
25
|
+
order_id: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type TMakePaymentPayload = {
|
|
29
|
+
paymentMethodId: number;
|
|
30
|
+
amount: number;
|
|
31
|
+
paymentName: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type TCheckPaymentPayload = {
|
|
35
|
+
id: number;
|
|
36
|
+
orderId: number;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type TPaymentInfo = {
|
|
40
|
+
account_no: string;
|
|
41
|
+
amount: number;
|
|
42
|
+
bin_code: string;
|
|
43
|
+
narrative: string;
|
|
44
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type TProduct = {
|
|
2
|
+
id: number
|
|
3
|
+
name: string
|
|
4
|
+
lst_price: number
|
|
5
|
+
image_128: string
|
|
6
|
+
taxes_id: number[]
|
|
7
|
+
pos_categ_ids: number[]
|
|
8
|
+
attributeLines?: TAttributeLine[]
|
|
9
|
+
productCartKey?: string
|
|
10
|
+
attribute_line_ids?: number[]
|
|
11
|
+
pickAttributeValue?: TAttributeLine[]
|
|
12
|
+
tax: number
|
|
13
|
+
[key: string]: any
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type TAttributeOption = "multi" | "radio" | "pills" | "color" | "select"
|
|
17
|
+
|
|
18
|
+
export type TAttributeLine = {
|
|
19
|
+
id: number
|
|
20
|
+
name: string
|
|
21
|
+
value_string: TAttributeValue[]
|
|
22
|
+
type: TAttributeOption
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type TAttributeLineData = {
|
|
26
|
+
display_name: string
|
|
27
|
+
id: number
|
|
28
|
+
product_template_value_ids?: number[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type TAttributeValueData = {
|
|
32
|
+
attribute_line_id: number
|
|
33
|
+
name: string
|
|
34
|
+
id: number
|
|
35
|
+
price_extra: number
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type TAttributeValue = {
|
|
39
|
+
name: string
|
|
40
|
+
id: number
|
|
41
|
+
price_extra: number
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type TProductAttribute = {
|
|
45
|
+
attributeValueIds: number[]
|
|
46
|
+
display_type: TAttributeOption
|
|
47
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { TCategoryInProduct } from "./category";
|
|
2
|
+
import { TTable } from "./table";
|
|
3
|
+
|
|
4
|
+
export type TProductInBill = {
|
|
5
|
+
product_id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
amount: number;
|
|
8
|
+
img: string;
|
|
9
|
+
price: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type TProduct = {
|
|
13
|
+
id: number;
|
|
14
|
+
display_name: string;
|
|
15
|
+
image_128: string;
|
|
16
|
+
pos_categ_ids: number[];
|
|
17
|
+
lst_price: number;
|
|
18
|
+
taxes_id: number[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export interface TProductInCart extends TProduct {
|
|
22
|
+
quantity?: number;
|
|
23
|
+
qty: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type TOrderProduct = {
|
|
27
|
+
order_id: TTable["order_id"];
|
|
28
|
+
products: (TProduct & { amount: number })[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type TProductPayload = {
|
|
32
|
+
category_ids: number[];
|
|
33
|
+
code: string;
|
|
34
|
+
name: string;
|
|
35
|
+
price: number;
|
|
36
|
+
img: string;
|
|
37
|
+
cost: number;
|
|
38
|
+
tax: number;
|
|
39
|
+
status: number;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type TProductDetail = {
|
|
43
|
+
categories: TCategoryInProduct[];
|
|
44
|
+
product: {
|
|
45
|
+
category_ids: number[] | null;
|
|
46
|
+
code: string;
|
|
47
|
+
cost: number;
|
|
48
|
+
img: string;
|
|
49
|
+
name: string;
|
|
50
|
+
price: number;
|
|
51
|
+
status: number;
|
|
52
|
+
tax: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type TAddProductToOrderPayload = {
|
|
57
|
+
orderId: number;
|
|
58
|
+
productId: number;
|
|
59
|
+
qty: number;
|
|
60
|
+
priceUnit: number;
|
|
61
|
+
priceSubtotal: number;
|
|
62
|
+
priceSubtotalIncl: number;
|
|
63
|
+
taxIds: any;
|
|
64
|
+
attribute_value_ids?: number[];
|
|
65
|
+
note?: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type TOnChangeAddProductPayload = {
|
|
69
|
+
productId: number;
|
|
70
|
+
qty: number;
|
|
71
|
+
orderId: number;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type TOnChangeAddLinesOrderPayload = {
|
|
75
|
+
orderId: number;
|
|
76
|
+
productId: number;
|
|
77
|
+
qty: number;
|
|
78
|
+
priceUnit: number;
|
|
79
|
+
discount: number;
|
|
80
|
+
taxIds: number[];
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type TUpdateOrderTotalAmount = {
|
|
84
|
+
orderId: number;
|
|
85
|
+
amountTax: number;
|
|
86
|
+
amountTotal: number;
|
|
87
|
+
note?: string;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type TAddProductPayload = {
|
|
91
|
+
orderId: number;
|
|
92
|
+
productId: number;
|
|
93
|
+
qty: number;
|
|
94
|
+
discount: number;
|
|
95
|
+
customerNote: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type TUpdateOrderPayload = {
|
|
99
|
+
orderId: number;
|
|
100
|
+
state?: string;
|
|
101
|
+
tableId?: number;
|
|
102
|
+
partnerId?: number;
|
|
103
|
+
amount_return?: number;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export type TOnChangeQuantityProduct = {
|
|
107
|
+
id: number;
|
|
108
|
+
qty: number;
|
|
109
|
+
productId: number;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export type TOnUpdateOrderLineQuantity = {
|
|
113
|
+
orderId: number;
|
|
114
|
+
qty: number;
|
|
115
|
+
orderLineId: number;
|
|
116
|
+
priceSubtotal: number;
|
|
117
|
+
priceSubtotalIncl: number;
|
|
118
|
+
attributeValueIds?: number[];
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export type TGetProductImage = {
|
|
122
|
+
limit?: number;
|
|
123
|
+
offset?: number;
|
|
124
|
+
productIds: number[];
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type TOnProductQuantityChange = TOnUpdateOrderLineQuantity & {
|
|
128
|
+
amountTax: number;
|
|
129
|
+
amountTotal: number;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type TRemoveProductPayload = {
|
|
133
|
+
orderId: number;
|
|
134
|
+
amountTax: number;
|
|
135
|
+
amountTotal: number;
|
|
136
|
+
lineIds: number[];
|
|
137
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DeclarationStatusItem {
|
|
2
|
+
id: string
|
|
3
|
+
formality: number
|
|
4
|
+
taxCode: string
|
|
5
|
+
taxAuthorityFeedback: number
|
|
6
|
+
dateCreate: string
|
|
7
|
+
status: number
|
|
8
|
+
dateSign: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface DeclarationStatus {
|
|
12
|
+
success: boolean
|
|
13
|
+
data: DeclarationStatusItem[]
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TChannelPayment } from "./shop-qr";
|
|
2
|
+
import { TStaff } from "./staff";
|
|
3
|
+
|
|
4
|
+
export type ShopQRTab = {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type TQRData = {
|
|
11
|
+
channel?: TChannelPayment;
|
|
12
|
+
staffInfor?: TStaff;
|
|
13
|
+
strBase64?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type TVADefault = {
|
|
17
|
+
merchantID: number;
|
|
18
|
+
va_account_no: string;
|
|
19
|
+
date: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type TTransferRes = {
|
|
23
|
+
message: string;
|
|
24
|
+
amount: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type TTransaction = {
|
|
2
|
+
created_at: string
|
|
3
|
+
store_name: string
|
|
4
|
+
bill_id: string
|
|
5
|
+
card_id: string | null
|
|
6
|
+
va_account_receiver: string | null
|
|
7
|
+
amount: number
|
|
8
|
+
payment_channel: string | null
|
|
9
|
+
status: 'success' | 'fail' | 'pending'
|
|
10
|
+
bank_code: string
|
|
11
|
+
logo_url: string | null
|
|
12
|
+
credit: string | null
|
|
13
|
+
credit_status: boolean | null
|
|
14
|
+
credit_date: string | null
|
|
15
|
+
bill_url: string | null
|
|
16
|
+
settlement_time: string | null
|
|
17
|
+
credit_amount: number | null
|
|
18
|
+
commission_fee: number | null
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type TRecentTransaction = {
|
|
22
|
+
Type: 'QR' | 'Thẻ'
|
|
23
|
+
Amount: number
|
|
24
|
+
'Created date': string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type TExtendedTransactionStatus = TTransaction['status'] | 'all'
|
|
28
|
+
|
|
29
|
+
export type TPaymentMethod = 'card' | 'va'
|
|
30
|
+
export type TPaymentMethodValue = 0 | 1 | 2 | 3
|
|
31
|
+
// {
|
|
32
|
+
// QR: 0,
|
|
33
|
+
// CASH: 1,
|
|
34
|
+
// CARD: 2,
|
|
35
|
+
// LINK: 3,
|
|
36
|
+
// }
|
|
37
|
+
|
|
38
|
+
export type TSearchTxnParams = {
|
|
39
|
+
start_time: number
|
|
40
|
+
end_time: number
|
|
41
|
+
status: TExtendedTransactionStatus
|
|
42
|
+
customer_id: string | number
|
|
43
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type TDataRes<T> = {
|
|
2
|
+
length: number;
|
|
3
|
+
records: T;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type TFloor = {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
pos_config_ids: number[];
|
|
10
|
+
table_ids: number[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type TFloorRes = TDataRes<TFloor[]>;
|
|
14
|
+
|
|
15
|
+
export type TPosCategory = {
|
|
16
|
+
id: number;
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type TPosCategoryRes = TDataRes<TPosCategory[]>;
|
|
21
|
+
|
|
22
|
+
export type TTableRes = TDataRes<TTable[]>;
|
|
23
|
+
|
|
24
|
+
export type TPaymentIds = {
|
|
25
|
+
amount: number;
|
|
26
|
+
card_brand: boolean;
|
|
27
|
+
card_no: boolean;
|
|
28
|
+
cardholder_name: boolean;
|
|
29
|
+
currency_id: {
|
|
30
|
+
display_name: string;
|
|
31
|
+
id: number;
|
|
32
|
+
};
|
|
33
|
+
id: number;
|
|
34
|
+
payment_date: string;
|
|
35
|
+
payment_method_id: {
|
|
36
|
+
display_name: string;
|
|
37
|
+
id: number;
|
|
38
|
+
};
|
|
39
|
+
payment_method_payment_mode: boolean;
|
|
40
|
+
}[];
|
|
41
|
+
|
|
42
|
+
export type TOrder = {
|
|
43
|
+
amount_total: number;
|
|
44
|
+
amount_tax: number;
|
|
45
|
+
config_id: {
|
|
46
|
+
display_name: string;
|
|
47
|
+
id: number;
|
|
48
|
+
};
|
|
49
|
+
currency_id: {
|
|
50
|
+
id: number;
|
|
51
|
+
};
|
|
52
|
+
date_order: string | Date;
|
|
53
|
+
id: number;
|
|
54
|
+
lines: number[];
|
|
55
|
+
name: string;
|
|
56
|
+
partner_id: boolean;
|
|
57
|
+
pos_reference: string;
|
|
58
|
+
sequence_number: number;
|
|
59
|
+
session_id: number;
|
|
60
|
+
state: TOrderStatus;
|
|
61
|
+
tracking_number: string;
|
|
62
|
+
table_id: string | number | boolean;
|
|
63
|
+
user_id: number;
|
|
64
|
+
payment_ids: TPaymentIds;
|
|
65
|
+
write_date: string | Date;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type TOrderRes = TDataRes<TOrder[]>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type TCloseSessionRes = {
|
|
2
|
+
context: {
|
|
3
|
+
active_ids: number[];
|
|
4
|
+
active_model: string;
|
|
5
|
+
lang: string;
|
|
6
|
+
};
|
|
7
|
+
name: string;
|
|
8
|
+
res_id: number;
|
|
9
|
+
res_model: string;
|
|
10
|
+
target: string;
|
|
11
|
+
type: string;
|
|
12
|
+
view_mode: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type TSessionData = {
|
|
16
|
+
amount_authorized_diff: number | null;
|
|
17
|
+
default_cash_details: CashDetails;
|
|
18
|
+
is_manager: boolean;
|
|
19
|
+
non_cash_payment_methods: NonCashPaymentMethod[];
|
|
20
|
+
opening_notes: string;
|
|
21
|
+
orders_details: OrdersDetails;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type TCloseSessionItemProps = {
|
|
25
|
+
id: number;
|
|
26
|
+
title: string;
|
|
27
|
+
price: number;
|
|
28
|
+
subItems: { title: string; price: number }[];
|
|
29
|
+
icon: () => JSX.Element;
|
|
30
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export type TBankAccountItem = {
|
|
2
|
+
id: number;
|
|
3
|
+
bank_code: string;
|
|
4
|
+
prefix_va: string;
|
|
5
|
+
is_active: boolean;
|
|
6
|
+
account_no: string;
|
|
7
|
+
customer_id: number;
|
|
8
|
+
holder_name: string;
|
|
9
|
+
logo_url: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type TMMSBankAccountItem = {
|
|
13
|
+
name: string;
|
|
14
|
+
bank_code?: string;
|
|
15
|
+
holder_name: string;
|
|
16
|
+
is_internal_transfer: boolean;
|
|
17
|
+
id: number;
|
|
18
|
+
phone: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type TChannelPayment = {
|
|
22
|
+
id: number;
|
|
23
|
+
bank_account_no: string;
|
|
24
|
+
va_account_no: string;
|
|
25
|
+
parent_va: string;
|
|
26
|
+
va_type: "STAFF" | "STORE" | "BILL";
|
|
27
|
+
customer_id: number;
|
|
28
|
+
store_id: number;
|
|
29
|
+
staff_id: string | null;
|
|
30
|
+
channel: string | null;
|
|
31
|
+
created_at: string;
|
|
32
|
+
store_name: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type TQRPayment = {
|
|
36
|
+
QR: null;
|
|
37
|
+
bank_account: null;
|
|
38
|
+
bank: null;
|
|
39
|
+
va_account: null;
|
|
40
|
+
error_code: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type TChannelPaymentQR = {
|
|
44
|
+
id: number;
|
|
45
|
+
bank_account_no: string;
|
|
46
|
+
va_account_no: string;
|
|
47
|
+
qr_type: "O" | "M";
|
|
48
|
+
store_id: number;
|
|
49
|
+
store_name: string;
|
|
50
|
+
staff_id: string;
|
|
51
|
+
description: string;
|
|
52
|
+
status: "PAID" | "UNPAID" | "CANCELLED" | "EXPIRED";
|
|
53
|
+
amount: number;
|
|
54
|
+
bill_id: string;
|
|
55
|
+
qr_string: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type TChannelPaymentPayload = {
|
|
59
|
+
bank_account_no: string;
|
|
60
|
+
type: TChannelPayment["va_type"];
|
|
61
|
+
store_id?: string;
|
|
62
|
+
store_name?: string;
|
|
63
|
+
staff_id?: string;
|
|
64
|
+
channel?: string;
|
|
65
|
+
amount?: number | null;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type TChannelPaymentQRPayload = {
|
|
69
|
+
qr_type: string;
|
|
70
|
+
va_account_no: string;
|
|
71
|
+
amount: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
bill_id: string;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type TPayByLinkPayload = {
|
|
77
|
+
va_account_no: string;
|
|
78
|
+
bill_id: string;
|
|
79
|
+
amount: string;
|
|
80
|
+
is_ref_no: boolean;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type TCheckoutMerchant = {
|
|
84
|
+
appId: any;
|
|
85
|
+
orderId: string;
|
|
86
|
+
amount: string;
|
|
87
|
+
merchantId: number;
|
|
88
|
+
createdAt: number;
|
|
89
|
+
};
|