@managesome/eposmatic-toolkit 0.2.454 → 0.2.457

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.
Files changed (190) hide show
  1. package/lib/constants/WORKER_ENDPOINTS.d.ts +2 -0
  2. package/lib/constants/WORKER_ENDPOINTS.js +3 -0
  3. package/lib/helpers/store/common-warehouse-internal-movement-actions.d.ts +12 -0
  4. package/lib/helpers/store/common-warehouse-internal-movement-actions.js +33 -0
  5. package/lib/helpers/store/common-warehouse-purchase-order-receipt-actions.d.ts +12 -0
  6. package/lib/helpers/store/common-warehouse-purchase-order-receipt-actions.js +37 -0
  7. package/lib/helpers/store/index.d.ts +2 -0
  8. package/lib/helpers/store/index.js +2 -0
  9. package/lib/helpers/types/workers.d.ts +16 -1
  10. package/lib/schemas/models/index.d.ts +1 -0
  11. package/lib/schemas/models/index.js +1 -0
  12. package/lib/schemas/models/warehouse_internal_movements.d.ts +3 -3
  13. package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.d.ts +3 -3
  14. package/lib/schemas/models/warehouse_sale_deliveries.d.ts +3 -3
  15. package/lib/schemas/models/warehouse_sale_invoices.d.ts +3 -3
  16. package/lib/schemas/types/index.d.ts +2 -0
  17. package/lib/schemas/types/index.js +2 -0
  18. package/package.json +1 -1
  19. package/lib/constants/PURCHASE_ORDER.d.ts +0 -16
  20. package/lib/constants/PURCHASE_ORDER.js +0 -100
  21. package/lib/constants/RFQ.d.ts +0 -0
  22. package/lib/constants/RFQ.js +0 -1
  23. package/lib/helpers/order/generate-purchase-order-rfq.d.ts +0 -3
  24. package/lib/helpers/order/generate-purchase-order-rfq.js +0 -64
  25. package/lib/helpers/order/generate-purchase-order.d.ts +0 -11
  26. package/lib/helpers/order/generate-purchase-order.js +0 -196
  27. package/lib/helpers/store/all-purchase-orders-actions.d.ts +0 -13
  28. package/lib/helpers/store/all-purchase-orders-actions.js +0 -56
  29. package/lib/helpers/store/all-sale-orders-actions.d.ts +0 -2
  30. package/lib/helpers/store/all-sale-orders-actions.js +0 -8
  31. package/lib/helpers/store/all-warehouse-sale-orders-actions.d.ts +0 -2
  32. package/lib/helpers/store/all-warehouse-sale-orders-actions.js +0 -8
  33. package/lib/helpers/store/common-purchase-order-actions.d.ts +0 -31
  34. package/lib/helpers/store/common-purchase-order-actions.js +0 -543
  35. package/lib/helpers/store/common-sale-order-actions.d.ts +0 -5
  36. package/lib/helpers/store/common-sale-order-actions.js +0 -65
  37. package/lib/helpers/store/purchase-order-rfq-cart-actions.d.ts +0 -19
  38. package/lib/helpers/store/purchase-order-rfq-cart-actions.js +0 -373
  39. package/lib/helpers/store/purchase-orders-cart-actions.d.ts +0 -57
  40. package/lib/helpers/store/purchase-orders-cart-actions.js +0 -486
  41. package/lib/helpers/types/purchase-order-cart-actions.d.ts +0 -26
  42. package/lib/helpers/types/purchase-order-cart-actions.js +0 -2
  43. package/lib/helpers/utils/invoice-x-report-helpers.d.ts +0 -58
  44. package/lib/helpers/utils/invoice-x-report-helpers.js +0 -1432
  45. package/lib/helpers/utils/purchase-order-engine.d.ts +0 -9
  46. package/lib/helpers/utils/purchase-order-engine.js +0 -34
  47. package/lib/helpers/utils/purchase-order-receipt-engine.d.ts +0 -149
  48. package/lib/helpers/utils/purchase-order-receipt-engine.js +0 -214
  49. package/lib/helpers/utils/purchase-order-x-report-helpers.d.ts +0 -58
  50. package/lib/helpers/utils/purchase-order-x-report-helpers.js +0 -1440
  51. package/lib/helpers/utils/sale-order-x-report-helpers.d.ts +0 -44
  52. package/lib/helpers/utils/sale-order-x-report-helpers.js +0 -22
  53. package/lib/helpers/utils/sale-x-report-helpers.d.ts +0 -58
  54. package/lib/helpers/utils/sale-x-report-helpers.js +0 -1456
  55. package/lib/helpers/utils/terminal-devices-helpers.d.ts +0 -2
  56. package/lib/helpers/utils/terminal-devices-helpers.js +0 -13
  57. package/lib/helpers/utils/void-purchase-order-items-helpers.d.ts +0 -3
  58. package/lib/helpers/utils/void-purchase-order-items-helpers.js +0 -38
  59. package/lib/helpers/utils/void-purchase-order-items-report-helpers.d.ts +0 -13
  60. package/lib/helpers/utils/void-purchase-order-items-report-helpers.js +0 -22
  61. package/lib/schemas/models/applied-order-discounts.d.ts +0 -80
  62. package/lib/schemas/models/applied-order-discounts.js +0 -106
  63. package/lib/schemas/models/brand.d.ts +0 -45
  64. package/lib/schemas/models/brand.js +0 -45
  65. package/lib/schemas/models/category.d.ts +0 -60
  66. package/lib/schemas/models/category.js +0 -67
  67. package/lib/schemas/models/dinein_table_fingerprints.d.ts +0 -65
  68. package/lib/schemas/models/dinein_table_fingerprints.js +0 -85
  69. package/lib/schemas/models/expense_category.d.ts +0 -83
  70. package/lib/schemas/models/expense_category.js +0 -64
  71. package/lib/schemas/models/internal_movements.d.ts +0 -357
  72. package/lib/schemas/models/internal_movements.js +0 -323
  73. package/lib/schemas/models/inventory.d.ts +0 -99
  74. package/lib/schemas/models/inventory.js +0 -87
  75. package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +0 -154
  76. package/lib/schemas/models/inventory_lot_serial_numbers.js +0 -193
  77. package/lib/schemas/models/item.d.ts +0 -11269
  78. package/lib/schemas/models/item.js +0 -333
  79. package/lib/schemas/models/menu.d.ts +0 -941
  80. package/lib/schemas/models/menu.js +0 -69
  81. package/lib/schemas/models/order.d.ts +0 -15437
  82. package/lib/schemas/models/order.js +0 -891
  83. package/lib/schemas/models/purchase_order_receipts.d.ts +0 -165
  84. package/lib/schemas/models/purchase_order_receipts.js +0 -151
  85. package/lib/schemas/models/purchase_order_rfq.d.ts +0 -1959
  86. package/lib/schemas/models/purchase_order_rfq.js +0 -328
  87. package/lib/schemas/models/purchase_order_rfqs.d.ts +0 -1959
  88. package/lib/schemas/models/purchase_order_rfqs.js +0 -328
  89. package/lib/schemas/models/purchase_order_vendor_returns.d.ts +0 -234
  90. package/lib/schemas/models/purchase_order_vendor_returns.js +0 -188
  91. package/lib/schemas/models/purchase_orders.d.ts +0 -2678
  92. package/lib/schemas/models/purchase_orders.js +0 -336
  93. package/lib/schemas/models/rider.d.ts +0 -65
  94. package/lib/schemas/models/rider.js +0 -74
  95. package/lib/schemas/models/sale_order_deliveries.d.ts +0 -167
  96. package/lib/schemas/models/sale_order_deliveries.js +0 -155
  97. package/lib/schemas/models/sale_order_invoices.d.ts +0 -227
  98. package/lib/schemas/models/sale_order_invoices.js +0 -206
  99. package/lib/schemas/models/sale_order_rfq.d.ts +0 -1938
  100. package/lib/schemas/models/sale_order_rfq.js +0 -309
  101. package/lib/schemas/models/sale_orders.d.ts +0 -1943
  102. package/lib/schemas/models/sale_orders.js +0 -324
  103. package/lib/schemas/models/tenant.d.ts +0 -528
  104. package/lib/schemas/models/tenant.js +0 -755
  105. package/lib/schemas/models/tenant_staff.d.ts +0 -932
  106. package/lib/schemas/models/tenant_staff.js +0 -96
  107. package/lib/schemas/models/track_order_number.d.ts +0 -413
  108. package/lib/schemas/models/track_order_number.js +0 -45
  109. package/lib/schemas/models/void_purchase_order_items.d.ts +0 -176
  110. package/lib/schemas/models/void_purchase_order_items.js +0 -177
  111. package/lib/schemas/models/void_warehouse_invoice_items.d.ts +0 -176
  112. package/lib/schemas/models/void_warehouse_invoice_items.js +0 -176
  113. package/lib/schemas/models/wallet.d.ts +0 -38
  114. package/lib/schemas/models/wallet.js +0 -37
  115. package/lib/schemas/models/warehouse-communications.d.ts +0 -228
  116. package/lib/schemas/models/warehouse-communications.js +0 -216
  117. package/lib/schemas/models/warehouse.d.ts +0 -162
  118. package/lib/schemas/models/warehouse.js +0 -222
  119. package/lib/schemas/models/warehouse_staff.d.ts +0 -65
  120. package/lib/schemas/models/warehouse_staff.js +0 -78
  121. package/lib/schemas/models/warehouse_track_order_number.d.ts +0 -50
  122. package/lib/schemas/models/warehouse_track_order_number.js +0 -52
  123. package/lib/schemas/types/applied-order-discounts.d.ts +0 -22
  124. package/lib/schemas/types/applied-order-discounts.js +0 -2
  125. package/lib/schemas/types/brand.d.ts +0 -32
  126. package/lib/schemas/types/brand.js +0 -2
  127. package/lib/schemas/types/category.d.ts +0 -15
  128. package/lib/schemas/types/category.js +0 -2
  129. package/lib/schemas/types/expense_category.d.ts +0 -20
  130. package/lib/schemas/types/expense_category.js +0 -2
  131. package/lib/schemas/types/internal_movements.d.ts +0 -73
  132. package/lib/schemas/types/internal_movements.js +0 -2
  133. package/lib/schemas/types/inventory.d.ts +0 -48
  134. package/lib/schemas/types/inventory.js +0 -2
  135. package/lib/schemas/types/inventory_lot_serial_numbers.d.ts +0 -85
  136. package/lib/schemas/types/inventory_lot_serial_numbers.js +0 -4
  137. package/lib/schemas/types/item.d.ts +0 -89
  138. package/lib/schemas/types/item.js +0 -2
  139. package/lib/schemas/types/menu.d.ts +0 -17
  140. package/lib/schemas/types/menu.js +0 -2
  141. package/lib/schemas/types/order.d.ts +0 -242
  142. package/lib/schemas/types/order.js +0 -2
  143. package/lib/schemas/types/purchase_order_common.d.ts +0 -39
  144. package/lib/schemas/types/purchase_order_common.js +0 -2
  145. package/lib/schemas/types/purchase_order_receipts.d.ts +0 -39
  146. package/lib/schemas/types/purchase_order_receipts.js +0 -21
  147. package/lib/schemas/types/purchase_order_rfq.d.ts +0 -33
  148. package/lib/schemas/types/purchase_order_rfq.js +0 -2
  149. package/lib/schemas/types/purchase_order_rfqs.d.ts +0 -33
  150. package/lib/schemas/types/purchase_order_rfqs.js +0 -2
  151. package/lib/schemas/types/purchase_order_vendor_returns.d.ts +0 -49
  152. package/lib/schemas/types/purchase_order_vendor_returns.js +0 -42
  153. package/lib/schemas/types/purchase_orders.d.ts +0 -33
  154. package/lib/schemas/types/purchase_orders.js +0 -2
  155. package/lib/schemas/types/rider.d.ts +0 -16
  156. package/lib/schemas/types/rider.js +0 -2
  157. package/lib/schemas/types/sale_order_common.d.ts +0 -39
  158. package/lib/schemas/types/sale_order_common.js +0 -2
  159. package/lib/schemas/types/sale_order_deliveries.d.ts +0 -67
  160. package/lib/schemas/types/sale_order_deliveries.js +0 -2
  161. package/lib/schemas/types/sale_order_invoices.d.ts +0 -49
  162. package/lib/schemas/types/sale_order_invoices.js +0 -2
  163. package/lib/schemas/types/sale_order_rfq.d.ts +0 -25
  164. package/lib/schemas/types/sale_order_rfq.js +0 -2
  165. package/lib/schemas/types/sale_orders.d.ts +0 -30
  166. package/lib/schemas/types/sale_orders.js +0 -2
  167. package/lib/schemas/types/tenant.d.ts +0 -205
  168. package/lib/schemas/types/tenant.js +0 -2
  169. package/lib/schemas/types/tenant_staff.d.ts +0 -22
  170. package/lib/schemas/types/tenant_staff.js +0 -2
  171. package/lib/schemas/types/track_order_number.d.ts +0 -10
  172. package/lib/schemas/types/track_order_number.js +0 -2
  173. package/lib/schemas/types/void_purchase_order_items.d.ts +0 -37
  174. package/lib/schemas/types/void_purchase_order_items.js +0 -2
  175. package/lib/schemas/types/void_warehouse_invoice_items.d.ts +0 -37
  176. package/lib/schemas/types/void_warehouse_invoice_items.js +0 -2
  177. package/lib/schemas/types/wallet.d.ts +0 -7
  178. package/lib/schemas/types/wallet.js +0 -2
  179. package/lib/schemas/types/warehouse-communications.d.ts +0 -54
  180. package/lib/schemas/types/warehouse-communications.js +0 -2
  181. package/lib/schemas/types/warehouse.d.ts +0 -49
  182. package/lib/schemas/types/warehouse.js +0 -2
  183. package/lib/schemas/types/warehouse_purchase_order_common.d.ts +0 -39
  184. package/lib/schemas/types/warehouse_purchase_order_common.js +0 -2
  185. package/lib/schemas/types/warehouse_sale_order_common.d.ts +0 -39
  186. package/lib/schemas/types/warehouse_sale_order_common.js +0 -2
  187. package/lib/schemas/types/warehouse_staff.d.ts +0 -17
  188. package/lib/schemas/types/warehouse_staff.js +0 -2
  189. package/lib/schemas/types/warehouse_track_order_number.d.ts +0 -11
  190. package/lib/schemas/types/warehouse_track_order_number.js +0 -2
@@ -1,2 +0,0 @@
1
- import { ITerminalDevice } from '../../schemas';
2
- export declare function getTerminalDeviceWithPrice<T extends Partial<ITerminalDevice> | ITerminalDevice>(terminalDevice: T, writeable?: boolean): T;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTerminalDeviceWithPrice = getTerminalDeviceWithPrice;
4
- const price_conversion_1 = require("./price-conversion");
5
- function getTerminalDeviceWithPrice(terminalDevice, writeable) {
6
- const convertToPrice = writeable ? price_conversion_1.convertPriceToCents : price_conversion_1.convertPriceFromCents;
7
- return {
8
- ...terminalDevice,
9
- ...(terminalDevice.total_orders_amount != null
10
- ? { total_orders: convertToPrice(terminalDevice.total_orders_amount) }
11
- : {}),
12
- };
13
- }
@@ -1,3 +0,0 @@
1
- import { WarehouseIVoidPurchaseOrderItem } from '../../schemas';
2
- export declare function getVoidPurchaseOrderItemFromCents<T extends Partial<WarehouseIVoidPurchaseOrderItem> | WarehouseIVoidPurchaseOrderItem>(voidPurchaseOrderItem: T): T;
3
- export declare function getFetchedVoidPurchaseOrderItems(voidItems: WarehouseIVoidPurchaseOrderItem[]): WarehouseIVoidPurchaseOrderItem[];
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVoidPurchaseOrderItemFromCents = getVoidPurchaseOrderItemFromCents;
4
- exports.getFetchedVoidPurchaseOrderItems = getFetchedVoidPurchaseOrderItems;
5
- const common_order_actions_1 = require("../store/common-order-actions");
6
- const price_conversion_1 = require("./price-conversion");
7
- function getVoidPurchaseOrderItemFromCents(voidPurchaseOrderItem) {
8
- return {
9
- ...voidPurchaseOrderItem,
10
- ...(typeof voidPurchaseOrderItem.subtotal === 'number'
11
- ? {
12
- subtotal: (0, price_conversion_1.convertPriceFromCents)(voidPurchaseOrderItem.subtotal),
13
- }
14
- : {}),
15
- ...(typeof voidPurchaseOrderItem.total_adjusted_subtotal === 'number'
16
- ? {
17
- total_adjusted_subtotal: (0, price_conversion_1.convertPriceFromCents)(voidPurchaseOrderItem.total_adjusted_subtotal),
18
- }
19
- : {}),
20
- ...(voidPurchaseOrderItem.adjustments != null
21
- ? {
22
- adjustments: voidPurchaseOrderItem.adjustments.map((adjustment) => ({
23
- ...adjustment,
24
- ...(typeof adjustment.subtotal === 'number'
25
- ? {
26
- subtotal: (0, price_conversion_1.convertPriceFromCents)(adjustment.subtotal),
27
- }
28
- : {}),
29
- })),
30
- }
31
- : {}),
32
- };
33
- }
34
- function getFetchedVoidPurchaseOrderItems(voidItems) {
35
- return voidItems
36
- .map((voidPurchaseOrderItem) => getVoidPurchaseOrderItemFromCents(voidPurchaseOrderItem))
37
- .sort(common_order_actions_1.sortByCreatedAt);
38
- }
@@ -1,13 +0,0 @@
1
- import { CURRENCY_SYMBOL_ENUM } from '../../constants';
2
- import { WarehouseIVoidPurchaseOrderItem } from '../../schemas';
3
- export interface IVoidPurchaseOrderItemsReportProps {
4
- data: WarehouseIVoidPurchaseOrderItem[];
5
- warehouseName: string | undefined;
6
- from: Date | null;
7
- to: Date | null;
8
- width?: number;
9
- monochrome?: boolean;
10
- currency_symbol: CURRENCY_SYMBOL_ENUM | undefined;
11
- }
12
- export declare function getVoidPurchaseOrderItemsReportHtml(props: IVoidPurchaseOrderItemsReportProps): string;
13
- export declare function getVoidPurchaseOrderItemsReportReceiptHtml(props: IVoidPurchaseOrderItemsReportProps): string;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVoidPurchaseOrderItemsReportHtml = getVoidPurchaseOrderItemsReportHtml;
4
- exports.getVoidPurchaseOrderItemsReportReceiptHtml = getVoidPurchaseOrderItemsReportReceiptHtml;
5
- const void_items_report_helpers_1 = require("./void-items-report-helpers");
6
- function toCommonProps(props) {
7
- return {
8
- data: props.data,
9
- tenantName: props.warehouseName,
10
- from: props.from,
11
- to: props.to,
12
- width: props.width,
13
- monochrome: props.monochrome,
14
- currency_symbol: props.currency_symbol,
15
- };
16
- }
17
- function getVoidPurchaseOrderItemsReportHtml(props) {
18
- return (0, void_items_report_helpers_1.getVoidItemsReportHtml)(toCommonProps(props));
19
- }
20
- function getVoidPurchaseOrderItemsReportReceiptHtml(props) {
21
- return (0, void_items_report_helpers_1.getVoidItemsReportReceiptHtml)(toCommonProps(props));
22
- }
@@ -1,80 +0,0 @@
1
- import { Schema } from 'mongoose';
2
- export declare const AppliedOrderDiscountsSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
3
- timestamps: true;
4
- versionKey: false;
5
- minimize: false;
6
- }, {
7
- createdAt: NativeDate;
8
- updatedAt: NativeDate;
9
- } & {
10
- _id: import("mongoose").Types.ObjectId;
11
- type: import("../../constants").DISCOUNT_TYPE_ENUM;
12
- name: string;
13
- tenant_id: string;
14
- order_id: import("mongoose").Types.ObjectId;
15
- discount_id: string;
16
- applicability: import("../../constants").DISCOUNT_APPLICABILITY_ENUM;
17
- platform: import("../../constants").PLATFORMS_ENUM;
18
- order_amount: number;
19
- discount_amount: number;
20
- reason: string;
21
- staff_id: string;
22
- staff_phone: string;
23
- staff_name: string;
24
- createdAt_mins: number;
25
- createdAt: NativeDate;
26
- updatedAt: NativeDate;
27
- discount_rate?: number | null | undefined;
28
- reference_number?: string | null | undefined;
29
- }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
30
- createdAt: NativeDate;
31
- updatedAt: NativeDate;
32
- } & {
33
- _id: import("mongoose").Types.ObjectId;
34
- type: import("../../constants").DISCOUNT_TYPE_ENUM;
35
- name: string;
36
- tenant_id: string;
37
- order_id: import("mongoose").Types.ObjectId;
38
- discount_id: string;
39
- applicability: import("../../constants").DISCOUNT_APPLICABILITY_ENUM;
40
- platform: import("../../constants").PLATFORMS_ENUM;
41
- order_amount: number;
42
- discount_amount: number;
43
- reason: string;
44
- staff_id: string;
45
- staff_phone: string;
46
- staff_name: string;
47
- createdAt_mins: number;
48
- createdAt: NativeDate;
49
- updatedAt: NativeDate;
50
- discount_rate?: number | null | undefined;
51
- reference_number?: string | null | undefined;
52
- }>> & import("mongoose").FlatRecord<{
53
- createdAt: NativeDate;
54
- updatedAt: NativeDate;
55
- } & {
56
- _id: import("mongoose").Types.ObjectId;
57
- type: import("../../constants").DISCOUNT_TYPE_ENUM;
58
- name: string;
59
- tenant_id: string;
60
- order_id: import("mongoose").Types.ObjectId;
61
- discount_id: string;
62
- applicability: import("../../constants").DISCOUNT_APPLICABILITY_ENUM;
63
- platform: import("../../constants").PLATFORMS_ENUM;
64
- order_amount: number;
65
- discount_amount: number;
66
- reason: string;
67
- staff_id: string;
68
- staff_phone: string;
69
- staff_name: string;
70
- createdAt_mins: number;
71
- createdAt: NativeDate;
72
- updatedAt: NativeDate;
73
- discount_rate?: number | null | undefined;
74
- reference_number?: string | null | undefined;
75
- }> & Required<{
76
- _id: import("mongoose").Types.ObjectId;
77
- }> & {
78
- __v: number;
79
- }>;
80
- export declare const APPLIED_ORDER_DISCOUNTS_COLLECTION_NAME = "applied_order_discounts";
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APPLIED_ORDER_DISCOUNTS_COLLECTION_NAME = exports.AppliedOrderDiscountsSchema = void 0;
4
- const mongoose_1 = require("mongoose");
5
- const constants_1 = require("../../constants");
6
- exports.AppliedOrderDiscountsSchema = new mongoose_1.Schema({
7
- _id: {
8
- type: mongoose_1.Schema.Types.ObjectId,
9
- required: true,
10
- immutable: true,
11
- },
12
- tenant_id: {
13
- type: String,
14
- required: true,
15
- immutable: true,
16
- ref: 'tenants',
17
- },
18
- order_id: {
19
- type: mongoose_1.Schema.Types.ObjectId,
20
- required: true,
21
- immutable: true,
22
- },
23
- discount_id: {
24
- type: String,
25
- required: true,
26
- },
27
- type: {
28
- type: String,
29
- required: true,
30
- enum: constants_1.ALL_DISCOUNT_TYPES,
31
- },
32
- applicability: {
33
- type: String,
34
- required: true,
35
- enum: constants_1.ALL_DISCOUNT_APPLICABILITY_TYPES,
36
- },
37
- platform: {
38
- type: String,
39
- enum: constants_1.ALL_PLATFORMS,
40
- required: true,
41
- },
42
- name: {
43
- type: String,
44
- required: true,
45
- },
46
- order_amount: {
47
- type: Number,
48
- required: true,
49
- min: 0,
50
- },
51
- discount_amount: {
52
- type: Number,
53
- required: true,
54
- min: 0,
55
- },
56
- discount_rate: {
57
- type: Number,
58
- required: false,
59
- default: null,
60
- },
61
- reason: {
62
- type: String,
63
- required: true,
64
- },
65
- reference_number: {
66
- type: String,
67
- required: false,
68
- },
69
- staff_id: {
70
- type: String,
71
- required: true,
72
- },
73
- staff_phone: {
74
- type: String,
75
- required: true,
76
- },
77
- staff_name: {
78
- type: String,
79
- required: true,
80
- },
81
- createdAt_mins: {
82
- type: Number,
83
- required: true,
84
- immutable: true,
85
- default: () => {
86
- const date = new Date();
87
- return Math.floor(date.getHours() * 60 + date.getMinutes());
88
- },
89
- },
90
- createdAt: {
91
- type: mongoose_1.Schema.Types.Date,
92
- required: true,
93
- default: () => new Date(),
94
- immutable: true,
95
- },
96
- updatedAt: {
97
- type: mongoose_1.Schema.Types.Date,
98
- required: true,
99
- default: () => new Date(),
100
- },
101
- }, {
102
- timestamps: true,
103
- versionKey: false,
104
- minimize: false,
105
- });
106
- exports.APPLIED_ORDER_DISCOUNTS_COLLECTION_NAME = 'applied_order_discounts';
@@ -1,45 +0,0 @@
1
- import { Schema } from 'mongoose';
2
- import { MULTI_TENANT_WEBSITE_TYPE_ENUM } from '../../constants';
3
- export declare const BrandSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
4
- timestamps: true;
5
- versionKey: false;
6
- minimize: false;
7
- }, {
8
- createdAt: NativeDate;
9
- updatedAt: NativeDate;
10
- } & {
11
- _id: string;
12
- name: string;
13
- createdAt: NativeDate;
14
- updatedAt: NativeDate;
15
- image_url: string;
16
- multi_tenant_website: string;
17
- website_display_type: MULTI_TENANT_WEBSITE_TYPE_ENUM;
18
- }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
19
- createdAt: NativeDate;
20
- updatedAt: NativeDate;
21
- } & {
22
- _id: string;
23
- name: string;
24
- createdAt: NativeDate;
25
- updatedAt: NativeDate;
26
- image_url: string;
27
- multi_tenant_website: string;
28
- website_display_type: MULTI_TENANT_WEBSITE_TYPE_ENUM;
29
- }>> & import("mongoose").FlatRecord<{
30
- createdAt: NativeDate;
31
- updatedAt: NativeDate;
32
- } & {
33
- _id: string;
34
- name: string;
35
- createdAt: NativeDate;
36
- updatedAt: NativeDate;
37
- image_url: string;
38
- multi_tenant_website: string;
39
- website_display_type: MULTI_TENANT_WEBSITE_TYPE_ENUM;
40
- }> & Required<{
41
- _id: string;
42
- }> & {
43
- __v: number;
44
- }>;
45
- export declare const BRANDS_COLLECTION_NAME = "brands";
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BRANDS_COLLECTION_NAME = exports.BrandSchema = void 0;
4
- const mongoose_1 = require("mongoose");
5
- const constants_1 = require("../../constants");
6
- exports.BrandSchema = new mongoose_1.Schema({
7
- _id: {
8
- type: String,
9
- required: true,
10
- immutable: true,
11
- },
12
- name: {
13
- type: String,
14
- required: true,
15
- },
16
- image_url: {
17
- type: String,
18
- required: true,
19
- },
20
- multi_tenant_website: {
21
- type: String,
22
- default: null,
23
- },
24
- website_display_type: {
25
- type: String,
26
- enum: constants_1.ALL_MULTI_TENANT_WEBSITE_TYPES,
27
- default: constants_1.MULTI_TENANT_WEBSITE_TYPE_ENUM.DEFAULT,
28
- },
29
- createdAt: {
30
- type: mongoose_1.Schema.Types.Date,
31
- required: true,
32
- default: () => new Date(),
33
- immutable: true,
34
- },
35
- updatedAt: {
36
- type: mongoose_1.Schema.Types.Date,
37
- required: true,
38
- default: () => new Date(),
39
- },
40
- }, {
41
- timestamps: true,
42
- versionKey: false,
43
- minimize: false,
44
- });
45
- exports.BRANDS_COLLECTION_NAME = 'brands';
@@ -1,60 +0,0 @@
1
- import { Schema } from 'mongoose';
2
- import { CATEGORY_DISPLAY_TYPE_ENUM } from '../../constants';
3
- export declare const CategorySchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
4
- timestamps: true;
5
- versionKey: false;
6
- minimize: false;
7
- }, {
8
- createdAt: NativeDate;
9
- updatedAt: NativeDate;
10
- } & {
11
- _id: import("mongoose").Types.ObjectId;
12
- name: string;
13
- tenants: string[];
14
- createdAt: NativeDate;
15
- updatedAt: NativeDate;
16
- image_url: string;
17
- brand_id: string;
18
- subtitle: string;
19
- active: boolean;
20
- sort_id: number;
21
- display_type: CATEGORY_DISPLAY_TYPE_ENUM;
22
- banner_url?: string | null | undefined;
23
- }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
24
- createdAt: NativeDate;
25
- updatedAt: NativeDate;
26
- } & {
27
- _id: import("mongoose").Types.ObjectId;
28
- name: string;
29
- tenants: string[];
30
- createdAt: NativeDate;
31
- updatedAt: NativeDate;
32
- image_url: string;
33
- brand_id: string;
34
- subtitle: string;
35
- active: boolean;
36
- sort_id: number;
37
- display_type: CATEGORY_DISPLAY_TYPE_ENUM;
38
- banner_url?: string | null | undefined;
39
- }>> & import("mongoose").FlatRecord<{
40
- createdAt: NativeDate;
41
- updatedAt: NativeDate;
42
- } & {
43
- _id: import("mongoose").Types.ObjectId;
44
- name: string;
45
- tenants: string[];
46
- createdAt: NativeDate;
47
- updatedAt: NativeDate;
48
- image_url: string;
49
- brand_id: string;
50
- subtitle: string;
51
- active: boolean;
52
- sort_id: number;
53
- display_type: CATEGORY_DISPLAY_TYPE_ENUM;
54
- banner_url?: string | null | undefined;
55
- }> & Required<{
56
- _id: import("mongoose").Types.ObjectId;
57
- }> & {
58
- __v: number;
59
- }>;
60
- export declare const CATEGORIES_COLLECTION_NAME = "categories";
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CATEGORIES_COLLECTION_NAME = exports.CategorySchema = void 0;
4
- const mongoose_1 = require("mongoose");
5
- const constants_1 = require("../../constants");
6
- exports.CategorySchema = new mongoose_1.Schema({
7
- _id: {
8
- type: mongoose_1.Schema.Types.ObjectId,
9
- required: true,
10
- immutable: true,
11
- },
12
- brand_id: {
13
- type: String,
14
- required: true,
15
- immutable: true,
16
- ref: 'brands',
17
- },
18
- tenants: {
19
- type: [{ type: String, ref: 'tenants' }],
20
- required: true,
21
- },
22
- image_url: {
23
- type: String,
24
- required: true,
25
- },
26
- banner_url: {
27
- type: String,
28
- required: false,
29
- },
30
- name: {
31
- type: String,
32
- required: true,
33
- },
34
- subtitle: {
35
- type: String,
36
- default: '',
37
- },
38
- active: {
39
- type: Boolean,
40
- required: true,
41
- },
42
- sort_id: {
43
- type: Number,
44
- required: true,
45
- },
46
- display_type: {
47
- type: String,
48
- enum: constants_1.ALL_CATEGORY_DISPLAY_TYPES,
49
- default: constants_1.CATEGORY_DISPLAY_TYPE_ENUM.REGULAR,
50
- },
51
- createdAt: {
52
- type: mongoose_1.Schema.Types.Date,
53
- required: true,
54
- default: () => new Date(),
55
- immutable: true,
56
- },
57
- updatedAt: {
58
- type: mongoose_1.Schema.Types.Date,
59
- required: true,
60
- default: () => new Date(),
61
- },
62
- }, {
63
- timestamps: true,
64
- versionKey: false,
65
- minimize: false,
66
- });
67
- exports.CATEGORIES_COLLECTION_NAME = 'categories';
@@ -1,65 +0,0 @@
1
- import { Schema } from 'mongoose';
2
- export declare const DineinTableFingerprintSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
3
- timestamps: true;
4
- versionKey: false;
5
- minimize: false;
6
- }, {
7
- createdAt: NativeDate;
8
- updatedAt: NativeDate;
9
- } & {
10
- _id: import("mongoose").Types.ObjectId;
11
- name: string;
12
- tenant_id: string;
13
- order_id: import("mongoose").Types.ObjectId;
14
- createdAt_mins: number;
15
- createdAt: NativeDate;
16
- updatedAt: NativeDate;
17
- order_number: number;
18
- table_id: import("mongoose").Types.ObjectId;
19
- dinein_floor_id: import("mongoose").Types.ObjectId;
20
- num_of_seats: number;
21
- table_type: import("../../constants").TABLE_TYPE_ENUM;
22
- num_of_guests: number;
23
- order_placed_at: NativeDate;
24
- }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
25
- createdAt: NativeDate;
26
- updatedAt: NativeDate;
27
- } & {
28
- _id: import("mongoose").Types.ObjectId;
29
- name: string;
30
- tenant_id: string;
31
- order_id: import("mongoose").Types.ObjectId;
32
- createdAt_mins: number;
33
- createdAt: NativeDate;
34
- updatedAt: NativeDate;
35
- order_number: number;
36
- table_id: import("mongoose").Types.ObjectId;
37
- dinein_floor_id: import("mongoose").Types.ObjectId;
38
- num_of_seats: number;
39
- table_type: import("../../constants").TABLE_TYPE_ENUM;
40
- num_of_guests: number;
41
- order_placed_at: NativeDate;
42
- }>> & import("mongoose").FlatRecord<{
43
- createdAt: NativeDate;
44
- updatedAt: NativeDate;
45
- } & {
46
- _id: import("mongoose").Types.ObjectId;
47
- name: string;
48
- tenant_id: string;
49
- order_id: import("mongoose").Types.ObjectId;
50
- createdAt_mins: number;
51
- createdAt: NativeDate;
52
- updatedAt: NativeDate;
53
- order_number: number;
54
- table_id: import("mongoose").Types.ObjectId;
55
- dinein_floor_id: import("mongoose").Types.ObjectId;
56
- num_of_seats: number;
57
- table_type: import("../../constants").TABLE_TYPE_ENUM;
58
- num_of_guests: number;
59
- order_placed_at: NativeDate;
60
- }> & Required<{
61
- _id: import("mongoose").Types.ObjectId;
62
- }> & {
63
- __v: number;
64
- }>;
65
- export declare const DINEIN_TABLES_FINGERPRINT_COLLECTION_NAME = "dinein_tables_fingerprints";
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DINEIN_TABLES_FINGERPRINT_COLLECTION_NAME = exports.DineinTableFingerprintSchema = void 0;
4
- const mongoose_1 = require("mongoose");
5
- const constants_1 = require("../../constants");
6
- exports.DineinTableFingerprintSchema = new mongoose_1.Schema({
7
- _id: {
8
- type: mongoose_1.Schema.Types.ObjectId,
9
- required: true,
10
- immutable: true,
11
- },
12
- table_id: {
13
- type: mongoose_1.Schema.Types.ObjectId,
14
- required: true,
15
- immutable: true,
16
- ref: 'dinein_tables',
17
- },
18
- tenant_id: {
19
- type: String,
20
- required: true,
21
- immutable: true,
22
- ref: 'tenants',
23
- },
24
- dinein_floor_id: {
25
- type: mongoose_1.Schema.Types.ObjectId,
26
- required: true,
27
- immutable: true,
28
- ref: 'dinein_floors',
29
- },
30
- order_id: {
31
- type: mongoose_1.Schema.Types.ObjectId,
32
- ref: 'orders',
33
- default: null,
34
- },
35
- order_number: {
36
- type: Number,
37
- default: null,
38
- },
39
- name: {
40
- type: String,
41
- required: true,
42
- },
43
- num_of_seats: {
44
- type: Number,
45
- required: true,
46
- },
47
- table_type: {
48
- type: String,
49
- enum: constants_1.ALL_TABLE_TYPES,
50
- required: true,
51
- },
52
- num_of_guests: {
53
- type: Number,
54
- required: true,
55
- },
56
- order_placed_at: {
57
- type: mongoose_1.Schema.Types.Date,
58
- default: null,
59
- },
60
- createdAt_mins: {
61
- type: Number,
62
- required: true,
63
- immutable: true,
64
- default: () => {
65
- const date = new Date();
66
- return Math.floor(date.getHours() * 60 + date.getMinutes());
67
- },
68
- },
69
- createdAt: {
70
- type: mongoose_1.Schema.Types.Date,
71
- required: true,
72
- default: () => new Date(),
73
- immutable: true,
74
- },
75
- updatedAt: {
76
- type: mongoose_1.Schema.Types.Date,
77
- required: true,
78
- default: () => new Date(),
79
- },
80
- }, {
81
- timestamps: true,
82
- versionKey: false,
83
- minimize: false,
84
- });
85
- exports.DINEIN_TABLES_FINGERPRINT_COLLECTION_NAME = 'dinein_tables_fingerprints';