@managesome/eposmatic-toolkit 0.2.418 → 0.2.420

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 (43) hide show
  1. package/lib/constants/ENUMS.d.ts +51 -0
  2. package/lib/constants/ENUMS.js +68 -1
  3. package/lib/helpers/types/workers.d.ts +4 -4
  4. package/lib/helpers/utils/index.d.ts +1 -0
  5. package/lib/helpers/utils/index.js +1 -0
  6. package/lib/helpers/utils/internal-amount-helpers.d.ts +20 -0
  7. package/lib/helpers/utils/internal-amount-helpers.js +31 -0
  8. package/lib/schemas/models/index.d.ts +3 -1
  9. package/lib/schemas/models/index.js +3 -1
  10. package/lib/schemas/models/internal_customers.d.ts +93 -0
  11. package/lib/schemas/models/internal_customers.js +116 -0
  12. package/lib/schemas/models/internal_invoices.d.ts +86 -0
  13. package/lib/schemas/models/internal_invoices.js +109 -0
  14. package/lib/schemas/models/internal_leads.d.ts +3 -3
  15. package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +18 -18
  16. package/lib/schemas/models/item_transactions.d.ts +3 -3
  17. package/lib/schemas/models/order.d.ts +108 -108
  18. package/lib/schemas/models/purchase_order_receipts.d.ts +3 -3
  19. package/lib/schemas/models/purchase_order_rfq.d.ts +6 -6
  20. package/lib/schemas/models/purchase_order_vendor_returns.d.ts +15 -15
  21. package/lib/schemas/models/purchase_orders.d.ts +3 -3
  22. package/lib/schemas/models/sale_order_deliveries.d.ts +18 -18
  23. package/lib/schemas/models/sale_order_invoices.d.ts +12 -12
  24. package/lib/schemas/models/sale_order_rfq.d.ts +6 -6
  25. package/lib/schemas/models/sale_orders.d.ts +3 -3
  26. package/lib/schemas/models/void_order_items.d.ts +3 -3
  27. package/lib/schemas/models/void_purchase_order_items.d.ts +6 -6
  28. package/lib/schemas/models/void_warehouse_invoice_items.d.ts +6 -6
  29. package/lib/schemas/models/warehouse_internal_movements.d.ts +357 -0
  30. package/lib/schemas/models/warehouse_internal_movements.js +323 -0
  31. package/lib/schemas/models/warehouse_inventory_transactions.d.ts +3 -3
  32. package/lib/schemas/models/warehouse_invoices.d.ts +3 -3
  33. package/lib/schemas/models/warehouse_item_transactions.d.ts +6 -6
  34. package/lib/schemas/models/warehouse_items.d.ts +12 -12
  35. package/lib/schemas/types/index.d.ts +3 -1
  36. package/lib/schemas/types/index.js +3 -1
  37. package/lib/schemas/types/internal_customers.d.ts +26 -0
  38. package/lib/schemas/types/internal_customers.js +2 -0
  39. package/lib/schemas/types/internal_invoices.d.ts +24 -0
  40. package/lib/schemas/types/internal_invoices.js +2 -0
  41. package/lib/schemas/types/warehouse_internal_movements.d.ts +73 -0
  42. package/lib/schemas/types/warehouse_internal_movements.js +2 -0
  43. package/package.json +1 -1
@@ -14,7 +14,6 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
14
14
  transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
15
15
  transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
16
16
  inventory_code: string;
17
- warehouse_id: string;
18
17
  quantity_left: number;
19
18
  unit_price: number;
20
19
  remaining_stock_price: number;
@@ -22,6 +21,7 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
22
21
  previous_quantity_left: number;
23
22
  previous_unit_price: number;
24
23
  previous_remaining_stock_price: number;
24
+ warehouse_id: string;
25
25
  order_id?: import("mongoose").Types.ObjectId | null | undefined;
26
26
  description?: string | null | undefined;
27
27
  order_number?: number | null | undefined;
@@ -38,7 +38,6 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
38
38
  transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
39
39
  transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
40
40
  inventory_code: string;
41
- warehouse_id: string;
42
41
  quantity_left: number;
43
42
  unit_price: number;
44
43
  remaining_stock_price: number;
@@ -46,6 +45,7 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
46
45
  previous_quantity_left: number;
47
46
  previous_unit_price: number;
48
47
  previous_remaining_stock_price: number;
48
+ warehouse_id: string;
49
49
  order_id?: import("mongoose").Types.ObjectId | null | undefined;
50
50
  description?: string | null | undefined;
51
51
  order_number?: number | null | undefined;
@@ -62,7 +62,6 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
62
62
  transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
63
63
  transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
64
64
  inventory_code: string;
65
- warehouse_id: string;
66
65
  quantity_left: number;
67
66
  unit_price: number;
68
67
  remaining_stock_price: number;
@@ -70,6 +69,7 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
70
69
  previous_quantity_left: number;
71
70
  previous_unit_price: number;
72
71
  previous_remaining_stock_price: number;
72
+ warehouse_id: string;
73
73
  order_id?: import("mongoose").Types.ObjectId | null | undefined;
74
74
  description?: string | null | undefined;
75
75
  order_number?: number | null | undefined;
@@ -873,7 +873,6 @@ export declare const WarehouseClientInvoicesSchema: Schema<any, import("mongoose
873
873
  amount_collected: number;
874
874
  is_deleted: boolean;
875
875
  order_status_updated_at: NativeDate;
876
- warehouse_id: string;
877
876
  staff_details: {
878
877
  staff_id: string;
879
878
  staff_name: string;
@@ -882,6 +881,7 @@ export declare const WarehouseClientInvoicesSchema: Schema<any, import("mongoose
882
881
  };
883
882
  order_settled_at: NativeDate;
884
883
  order_settled_at_mins: number;
884
+ warehouse_id: string;
885
885
  client_id: import("mongoose").Types.ObjectId;
886
886
  client_name: string;
887
887
  cancel_reason?: string | null | undefined;
@@ -1761,7 +1761,6 @@ export declare const WarehouseClientInvoicesSchema: Schema<any, import("mongoose
1761
1761
  amount_collected: number;
1762
1762
  is_deleted: boolean;
1763
1763
  order_status_updated_at: NativeDate;
1764
- warehouse_id: string;
1765
1764
  staff_details: {
1766
1765
  staff_id: string;
1767
1766
  staff_name: string;
@@ -1770,6 +1769,7 @@ export declare const WarehouseClientInvoicesSchema: Schema<any, import("mongoose
1770
1769
  };
1771
1770
  order_settled_at: NativeDate;
1772
1771
  order_settled_at_mins: number;
1772
+ warehouse_id: string;
1773
1773
  client_id: import("mongoose").Types.ObjectId;
1774
1774
  client_name: string;
1775
1775
  cancel_reason?: string | null | undefined;
@@ -2649,7 +2649,6 @@ export declare const WarehouseClientInvoicesSchema: Schema<any, import("mongoose
2649
2649
  amount_collected: number;
2650
2650
  is_deleted: boolean;
2651
2651
  order_status_updated_at: NativeDate;
2652
- warehouse_id: string;
2653
2652
  staff_details: {
2654
2653
  staff_id: string;
2655
2654
  staff_name: string;
@@ -2658,6 +2657,7 @@ export declare const WarehouseClientInvoicesSchema: Schema<any, import("mongoose
2658
2657
  };
2659
2658
  order_settled_at: NativeDate;
2660
2659
  order_settled_at_mins: number;
2660
+ warehouse_id: string;
2661
2661
  client_id: import("mongoose").Types.ObjectId;
2662
2662
  client_name: string;
2663
2663
  cancel_reason?: string | null | undefined;
@@ -17,11 +17,11 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
17
17
  order_number: number;
18
18
  quantity: number;
19
19
  item_id: import("mongoose").Types.ObjectId;
20
- warehouse_id: string;
21
- selling_price: number;
22
20
  item_name: string;
23
21
  category_name: string;
22
+ selling_price: number;
24
23
  cost_price: number;
24
+ warehouse_id: string;
25
25
  order_id?: import("mongoose").Types.ObjectId | null | undefined;
26
26
  description?: string | null | undefined;
27
27
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
@@ -38,11 +38,11 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
38
38
  order_number: number;
39
39
  quantity: number;
40
40
  item_id: import("mongoose").Types.ObjectId;
41
- warehouse_id: string;
42
- selling_price: number;
43
41
  item_name: string;
44
42
  category_name: string;
43
+ selling_price: number;
45
44
  cost_price: number;
45
+ warehouse_id: string;
46
46
  order_id?: import("mongoose").Types.ObjectId | null | undefined;
47
47
  description?: string | null | undefined;
48
48
  }>> & import("mongoose").FlatRecord<{
@@ -59,11 +59,11 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
59
59
  order_number: number;
60
60
  quantity: number;
61
61
  item_id: import("mongoose").Types.ObjectId;
62
- warehouse_id: string;
63
- selling_price: number;
64
62
  item_name: string;
65
63
  category_name: string;
64
+ selling_price: number;
66
65
  cost_price: number;
66
+ warehouse_id: string;
67
67
  order_id?: import("mongoose").Types.ObjectId | null | undefined;
68
68
  description?: string | null | undefined;
69
69
  }> & Required<{
@@ -32,19 +32,19 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
32
32
  }>;
33
33
  hide_name: boolean;
34
34
  keywords: string[];
35
- warehouse_id: string;
36
35
  unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
37
36
  threshold_quantity: number;
38
37
  quantity_left: number;
39
38
  unit_price: number;
40
39
  remaining_stock_price: number;
41
- purchase_price: {
40
+ tracking_mode: TRACKING_MODE_ENUM;
41
+ selling_price: {
42
42
  BASE_PRICE: number;
43
43
  };
44
- selling_price: {
44
+ warehouse_id: string;
45
+ purchase_price: {
45
46
  BASE_PRICE: number;
46
47
  };
47
- tracking_mode: TRACKING_MODE_ENUM;
48
48
  expiry_tracked: boolean;
49
49
  expiration_days: number;
50
50
  best_before_days: number;
@@ -78,19 +78,19 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
78
78
  }>;
79
79
  hide_name: boolean;
80
80
  keywords: string[];
81
- warehouse_id: string;
82
81
  unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
83
82
  threshold_quantity: number;
84
83
  quantity_left: number;
85
84
  unit_price: number;
86
85
  remaining_stock_price: number;
87
- purchase_price: {
86
+ tracking_mode: TRACKING_MODE_ENUM;
87
+ selling_price: {
88
88
  BASE_PRICE: number;
89
89
  };
90
- selling_price: {
90
+ warehouse_id: string;
91
+ purchase_price: {
91
92
  BASE_PRICE: number;
92
93
  };
93
- tracking_mode: TRACKING_MODE_ENUM;
94
94
  expiry_tracked: boolean;
95
95
  expiration_days: number;
96
96
  best_before_days: number;
@@ -124,19 +124,19 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
124
124
  }>;
125
125
  hide_name: boolean;
126
126
  keywords: string[];
127
- warehouse_id: string;
128
127
  unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
129
128
  threshold_quantity: number;
130
129
  quantity_left: number;
131
130
  unit_price: number;
132
131
  remaining_stock_price: number;
133
- purchase_price: {
132
+ tracking_mode: TRACKING_MODE_ENUM;
133
+ selling_price: {
134
134
  BASE_PRICE: number;
135
135
  };
136
- selling_price: {
136
+ warehouse_id: string;
137
+ purchase_price: {
137
138
  BASE_PRICE: number;
138
139
  };
139
- tracking_mode: TRACKING_MODE_ENUM;
140
140
  expiry_tracked: boolean;
141
141
  expiration_days: number;
142
142
  best_before_days: number;
@@ -24,8 +24,9 @@ export * from './gift_cards';
24
24
  export * from './halfhalf_setup';
25
25
  export * from './instore_shift_sessions';
26
26
  export * from './instore_shifts';
27
+ export * from './internal_customers';
28
+ export * from './internal_invoices';
27
29
  export * from './internal_leads';
28
- export * from './internal_movements';
29
30
  export * from './inventory';
30
31
  export * from './inventory_categories';
31
32
  export * from './inventory_lot_serial_numbers';
@@ -78,6 +79,7 @@ export * from './warehouse-activity-logs';
78
79
  export * from './warehouse-communications';
79
80
  export * from './warehouse_categories';
80
81
  export * from './warehouse_clients';
82
+ export * from './warehouse_internal_movements';
81
83
  export * from './warehouse_inventory_transactions';
82
84
  export * from './warehouse_invoices';
83
85
  export * from './warehouse_item_transactions';
@@ -40,8 +40,9 @@ __exportStar(require("./gift_cards"), exports);
40
40
  __exportStar(require("./halfhalf_setup"), exports);
41
41
  __exportStar(require("./instore_shift_sessions"), exports);
42
42
  __exportStar(require("./instore_shifts"), exports);
43
+ __exportStar(require("./internal_customers"), exports);
44
+ __exportStar(require("./internal_invoices"), exports);
43
45
  __exportStar(require("./internal_leads"), exports);
44
- __exportStar(require("./internal_movements"), exports);
45
46
  __exportStar(require("./inventory"), exports);
46
47
  __exportStar(require("./inventory_categories"), exports);
47
48
  __exportStar(require("./inventory_lot_serial_numbers"), exports);
@@ -94,6 +95,7 @@ __exportStar(require("./warehouse-activity-logs"), exports);
94
95
  __exportStar(require("./warehouse-communications"), exports);
95
96
  __exportStar(require("./warehouse_categories"), exports);
96
97
  __exportStar(require("./warehouse_clients"), exports);
98
+ __exportStar(require("./warehouse_internal_movements"), exports);
97
99
  __exportStar(require("./warehouse_inventory_transactions"), exports);
98
100
  __exportStar(require("./warehouse_invoices"), exports);
99
101
  __exportStar(require("./warehouse_item_transactions"), exports);
@@ -0,0 +1,26 @@
1
+ import { INTERNAL_CUSTOMER_BILLING_CYCLE_ENUM, INTERNAL_CUSTOMER_PAYMENT_METHOD_ENUM, INTERNAL_CUSTOMER_SUBSCRIPTION_PLAN_ENUM, INTERNAL_CUSTOMER_SUBSCRIPTION_SERVICE_ENUM, INTERNAL_CUSTOMER_TYPE_ENUM, INTERNAL_INVOICE_STATUS_ENUM, SUBSCRIPTION_STATUS_ENUM } from '../../constants';
2
+ export interface IInternalCustomer {
3
+ _id: string;
4
+ ref_id: string;
5
+ customer_type: INTERNAL_CUSTOMER_TYPE_ENUM;
6
+ full_name: string;
7
+ email: string | null;
8
+ phone_number: string;
9
+ company_name?: string | null;
10
+ tax_number?: string | null;
11
+ invoice_notes: string;
12
+ personal_notes: string;
13
+ active: boolean;
14
+ payment_channel: INTERNAL_CUSTOMER_PAYMENT_METHOD_ENUM;
15
+ subscription_plan: INTERNAL_CUSTOMER_SUBSCRIPTION_PLAN_ENUM;
16
+ subscription_services: INTERNAL_CUSTOMER_SUBSCRIPTION_SERVICE_ENUM[];
17
+ subscription_status: SUBSCRIPTION_STATUS_ENUM;
18
+ billing_cycle: INTERNAL_CUSTOMER_BILLING_CYCLE_ENUM | null;
19
+ last_invoice_id: string | null;
20
+ last_invoice_number: string | null;
21
+ last_invoice_status: INTERNAL_INVOICE_STATUS_ENUM | null;
22
+ last_invoice_due_date: Date | null;
23
+ last_invoice_paid_at: Date | null;
24
+ createdAt: Date;
25
+ updatedAt: Date;
26
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import { INTERNAL_INVOICE_STATUS_ENUM, INTERNAL_INVOICE_TYPE_ENUM, SUBSCRIPTION_HARDWARE_ENUM } from '../../constants';
2
+ export interface IInternalInvoice {
3
+ _id: string;
4
+ customer_id: string;
5
+ ref_id: string | null;
6
+ customer_name: string;
7
+ tax_number: string | null;
8
+ invoice_number: string;
9
+ invoice_type: INTERNAL_INVOICE_TYPE_ENUM;
10
+ hardware: SUBSCRIPTION_HARDWARE_ENUM[] | null;
11
+ subtotal: number;
12
+ discount_amount: number;
13
+ tax_amount: number;
14
+ grand_total: number;
15
+ notes: string;
16
+ status: INTERNAL_INVOICE_STATUS_ENUM;
17
+ payment_terms: string | null;
18
+ payment_method: string | null;
19
+ issue_date: Date;
20
+ due_date: Date | null;
21
+ paid_at: Date | null;
22
+ createdAt: Date;
23
+ updatedAt: Date;
24
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,73 @@
1
+ import { INTERNAL_MOVEMENT_EDIT_REQUEST_STATUS_ENUM, INTERNAL_MOVEMENT_FLOW_ENUM, INTERNAL_MOVEMENT_LOCATION_TYPE_ENUM, INTERNAL_MOVEMENT_RECORD_TYPE_ENUM, INTERNAL_MOVEMENT_STATUS_ENUM, REF_TYPE_ENUM } from '../../constants';
2
+ export interface IWarehouseInternalMovementActorRef {
3
+ uid: string;
4
+ name: string;
5
+ }
6
+ export interface IWarehouseInternalMovementItem {
7
+ _id: string;
8
+ item_id: string;
9
+ inventory_code: string;
10
+ item_name: string;
11
+ quantity: number;
12
+ received_qty: number;
13
+ notes?: string | null;
14
+ }
15
+ export interface IWarehouseInternalMovementStatusMeta {
16
+ requested_at?: Date | null;
17
+ approved_at?: Date | null;
18
+ dispatched_at?: Date | null;
19
+ delivered_at?: Date | null;
20
+ received_at?: Date | null;
21
+ cancelled_at?: Date | null;
22
+ requested_by?: IWarehouseInternalMovementActorRef | null;
23
+ approved_by?: IWarehouseInternalMovementActorRef | null;
24
+ dispatched_by?: IWarehouseInternalMovementActorRef | null;
25
+ delivered_by?: IWarehouseInternalMovementActorRef | null;
26
+ received_by?: IWarehouseInternalMovementActorRef | null;
27
+ cancelled_by?: IWarehouseInternalMovementActorRef | null;
28
+ }
29
+ export interface IWarehouseInternalMovementEditRequestMeta {
30
+ edit_request_status: INTERNAL_MOVEMENT_EDIT_REQUEST_STATUS_ENUM;
31
+ edit_requested_at?: Date | null;
32
+ edit_requested_by?: IWarehouseInternalMovementActorRef | null;
33
+ edit_request_note?: string | null;
34
+ edit_request_reviewed_at?: Date | null;
35
+ edit_request_reviewed_by?: IWarehouseInternalMovementActorRef | null;
36
+ edit_request_decision_note?: string | null;
37
+ edit_approved_for_context_id?: string | null;
38
+ }
39
+ export interface IWarehouseInternalMovementCancelRequestMeta {
40
+ cancel_request_status: INTERNAL_MOVEMENT_EDIT_REQUEST_STATUS_ENUM;
41
+ cancel_requested_at?: Date | null;
42
+ cancel_requested_by?: IWarehouseInternalMovementActorRef | null;
43
+ cancel_request_note?: string | null;
44
+ cancel_request_reviewed_at?: Date | null;
45
+ cancel_request_reviewed_by?: IWarehouseInternalMovementActorRef | null;
46
+ cancel_request_decision_note?: string | null;
47
+ }
48
+ export interface IWarehouseInternalMovement extends IWarehouseInternalMovementStatusMeta, IWarehouseInternalMovementEditRequestMeta, IWarehouseInternalMovementCancelRequestMeta {
49
+ _id: string;
50
+ ref_id: string;
51
+ ref_type: REF_TYPE_ENUM;
52
+ doc_number: string;
53
+ record_type: INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
54
+ status: INTERNAL_MOVEMENT_STATUS_ENUM;
55
+ flow: INTERNAL_MOVEMENT_FLOW_ENUM;
56
+ source_id: string;
57
+ source_type: INTERNAL_MOVEMENT_LOCATION_TYPE_ENUM;
58
+ source_name: string;
59
+ destination_id: string;
60
+ destination_type: INTERNAL_MOVEMENT_LOCATION_TYPE_ENUM;
61
+ destination_name: string;
62
+ items: IWarehouseInternalMovementItem[];
63
+ total_items: number;
64
+ total_quantity: number;
65
+ parent_movement_id?: string | null;
66
+ notes?: string | null;
67
+ created_by: IWarehouseInternalMovementActorRef;
68
+ updated_by?: IWarehouseInternalMovementActorRef | null;
69
+ cancelled_reason?: string | null;
70
+ is_deleted: boolean;
71
+ createdAt: Date;
72
+ updatedAt: Date;
73
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.418",
3
+ "version": "0.2.420",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",