@managesome/eposmatic-toolkit 0.2.452 → 0.2.454

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 (32) hide show
  1. package/lib/constants/INTERNAL_ENUMS.d.ts +41 -0
  2. package/lib/constants/INTERNAL_ENUMS.js +52 -0
  3. package/lib/constants/WORKER_ENDPOINTS.d.ts +1 -0
  4. package/lib/constants/WORKER_ENDPOINTS.js +1 -0
  5. package/lib/constants/index.d.ts +1 -0
  6. package/lib/constants/index.js +1 -0
  7. package/lib/helpers/store/common-tenant-purchase-order-actions.d.ts +8 -0
  8. package/lib/helpers/store/common-tenant-purchase-order-actions.js +107 -0
  9. package/lib/helpers/store/common-warehouse-sale-order-invoice-actions.d.ts +16 -0
  10. package/lib/helpers/store/common-warehouse-sale-order-invoice-actions.js +59 -0
  11. package/lib/helpers/store/index.d.ts +3 -0
  12. package/lib/helpers/store/index.js +3 -0
  13. package/lib/helpers/store/tenant-purchase-orders-cart-actions.d.ts +24 -0
  14. package/lib/helpers/store/tenant-purchase-orders-cart-actions.js +395 -0
  15. package/lib/helpers/types/workers.d.ts +5 -1
  16. package/lib/schemas/models/index.d.ts +2 -0
  17. package/lib/schemas/models/index.js +2 -0
  18. package/lib/schemas/models/internal_invoices.d.ts +3 -3
  19. package/lib/schemas/models/internal_operational_roles.d.ts +77 -0
  20. package/lib/schemas/models/internal_operational_roles.js +88 -0
  21. package/lib/schemas/models/internal_staffs.d.ts +59 -0
  22. package/lib/schemas/models/internal_staffs.js +68 -0
  23. package/lib/schemas/models/warehouse_internal_movements.d.ts +3 -3
  24. package/lib/schemas/models/warehouse_sale_deliveries.d.ts +3 -3
  25. package/lib/schemas/models/warehouse_sale_invoices.d.ts +6 -6
  26. package/lib/schemas/types/index.d.ts +2 -0
  27. package/lib/schemas/types/index.js +2 -0
  28. package/lib/schemas/types/internal_operational_roles.d.ts +22 -0
  29. package/lib/schemas/types/internal_operational_roles.js +19 -0
  30. package/lib/schemas/types/internal_staffs.d.ts +15 -0
  31. package/lib/schemas/types/internal_staffs.js +2 -0
  32. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const InternalStaffSchema: 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
+ createdAt: NativeDate;
12
+ updatedAt: NativeDate;
13
+ image_url: string;
14
+ phone_number: string;
15
+ uid: string;
16
+ display_name: string;
17
+ email: string;
18
+ email_verified: boolean;
19
+ phone_number_verified: boolean;
20
+ is_disabled: boolean;
21
+ role: import("../../constants").INTERNAL_USER_ROLES_ENUM;
22
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
23
+ createdAt: NativeDate;
24
+ updatedAt: NativeDate;
25
+ } & {
26
+ _id: import("mongoose").Types.ObjectId;
27
+ createdAt: NativeDate;
28
+ updatedAt: NativeDate;
29
+ image_url: string;
30
+ phone_number: string;
31
+ uid: string;
32
+ display_name: string;
33
+ email: string;
34
+ email_verified: boolean;
35
+ phone_number_verified: boolean;
36
+ is_disabled: boolean;
37
+ role: import("../../constants").INTERNAL_USER_ROLES_ENUM;
38
+ }>> & import("mongoose").FlatRecord<{
39
+ createdAt: NativeDate;
40
+ updatedAt: NativeDate;
41
+ } & {
42
+ _id: import("mongoose").Types.ObjectId;
43
+ createdAt: NativeDate;
44
+ updatedAt: NativeDate;
45
+ image_url: string;
46
+ phone_number: string;
47
+ uid: string;
48
+ display_name: string;
49
+ email: string;
50
+ email_verified: boolean;
51
+ phone_number_verified: boolean;
52
+ is_disabled: boolean;
53
+ role: import("../../constants").INTERNAL_USER_ROLES_ENUM;
54
+ }> & Required<{
55
+ _id: import("mongoose").Types.ObjectId;
56
+ }> & {
57
+ __v: number;
58
+ }>;
59
+ export declare const INTERNAL_STAFF_COLLECTION_NAME = "internal_staffs";
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INTERNAL_STAFF_COLLECTION_NAME = exports.InternalStaffSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const constants_1 = require("../../constants");
6
+ exports.InternalStaffSchema = new mongoose_1.Schema({
7
+ _id: {
8
+ type: mongoose_1.Schema.Types.ObjectId,
9
+ required: true,
10
+ immutable: true,
11
+ },
12
+ uid: {
13
+ type: String,
14
+ required: true,
15
+ immutable: true,
16
+ },
17
+ phone_number: {
18
+ type: String,
19
+ required: true,
20
+ minlength: 10,
21
+ immutable: true,
22
+ },
23
+ email: {
24
+ type: String,
25
+ default: null,
26
+ },
27
+ email_verified: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ display_name: {
32
+ type: String,
33
+ default: null,
34
+ },
35
+ image_url: {
36
+ type: String,
37
+ default: null,
38
+ },
39
+ is_disabled: {
40
+ type: Boolean,
41
+ default: false,
42
+ },
43
+ phone_number_verified: {
44
+ type: Boolean,
45
+ default: false,
46
+ },
47
+ role: {
48
+ type: String,
49
+ required: true,
50
+ enum: constants_1.ALL_INTERNAL_USER_ROLES,
51
+ },
52
+ createdAt: {
53
+ type: Date,
54
+ required: true,
55
+ immutable: true,
56
+ default: () => new Date(),
57
+ },
58
+ updatedAt: {
59
+ type: Date,
60
+ required: true,
61
+ default: () => new Date(),
62
+ },
63
+ }, {
64
+ timestamps: true,
65
+ versionKey: false,
66
+ minimize: false,
67
+ });
68
+ exports.INTERNAL_STAFF_COLLECTION_NAME = 'internal_staffs';
@@ -46,8 +46,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
46
46
  name: string;
47
47
  uid: string;
48
48
  };
49
- ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
50
49
  doc_number: string;
50
+ ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
51
51
  record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
52
52
  flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
53
53
  source_id: string;
@@ -164,8 +164,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
164
164
  name: string;
165
165
  uid: string;
166
166
  };
167
- ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
168
167
  doc_number: string;
168
+ ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
169
169
  record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
170
170
  flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
171
171
  source_id: string;
@@ -282,8 +282,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
282
282
  name: string;
283
283
  uid: string;
284
284
  };
285
- ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
286
285
  doc_number: string;
286
+ ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
287
287
  record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
288
288
  flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
289
289
  source_id: string;
@@ -44,12 +44,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
44
44
  name: string;
45
45
  } | null | undefined;
46
46
  cancelled_at?: NativeDate | null | undefined;
47
+ applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
47
48
  delivered_at?: NativeDate | null | undefined;
48
49
  delivered_by?: {
49
50
  _id: string;
50
51
  name: string;
51
52
  } | null | undefined;
52
- applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
53
53
  inventory_restocked?: boolean | null | undefined;
54
54
  returned_by?: {
55
55
  _id: string;
@@ -96,12 +96,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
96
96
  name: string;
97
97
  } | null | undefined;
98
98
  cancelled_at?: NativeDate | null | undefined;
99
+ applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
99
100
  delivered_at?: NativeDate | null | undefined;
100
101
  delivered_by?: {
101
102
  _id: string;
102
103
  name: string;
103
104
  } | null | undefined;
104
- applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
105
105
  inventory_restocked?: boolean | null | undefined;
106
106
  returned_by?: {
107
107
  _id: string;
@@ -148,12 +148,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
148
148
  name: string;
149
149
  } | null | undefined;
150
150
  cancelled_at?: NativeDate | null | undefined;
151
+ applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
151
152
  delivered_at?: NativeDate | null | undefined;
152
153
  delivered_by?: {
153
154
  _id: string;
154
155
  name: string;
155
156
  } | null | undefined;
156
- applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
157
157
  inventory_restocked?: boolean | null | undefined;
158
158
  returned_by?: {
159
159
  _id: string;
@@ -35,10 +35,10 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
35
35
  amount: number;
36
36
  payments: any[];
37
37
  warehouse_id: string;
38
- doc_number: number;
39
- invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
40
38
  doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
41
39
  sale_order_id: import("mongoose").Types.ObjectId;
40
+ doc_number: number;
41
+ invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
42
42
  amount_paid?: number | null | undefined;
43
43
  cancel_reason?: string | null | undefined;
44
44
  is_gst_inclusive?: boolean | null | undefined;
@@ -107,10 +107,10 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
107
107
  amount: number;
108
108
  payments: any[];
109
109
  warehouse_id: string;
110
- doc_number: number;
111
- invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
112
110
  doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
113
111
  sale_order_id: import("mongoose").Types.ObjectId;
112
+ doc_number: number;
113
+ invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
114
114
  amount_paid?: number | null | undefined;
115
115
  cancel_reason?: string | null | undefined;
116
116
  is_gst_inclusive?: boolean | null | undefined;
@@ -179,10 +179,10 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
179
179
  amount: number;
180
180
  payments: any[];
181
181
  warehouse_id: string;
182
- doc_number: number;
183
- invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
184
182
  doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
185
183
  sale_order_id: import("mongoose").Types.ObjectId;
184
+ doc_number: number;
185
+ invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
186
186
  amount_paid?: number | null | undefined;
187
187
  cancel_reason?: string | null | undefined;
188
188
  is_gst_inclusive?: boolean | null | undefined;
@@ -27,6 +27,8 @@ export * from './instore_shifts';
27
27
  export * from './internal_customers';
28
28
  export * from './internal_invoices';
29
29
  export * from './internal_leads';
30
+ export * from './internal_operational_roles';
31
+ export * from './internal_staffs';
30
32
  export * from './inventories';
31
33
  export * from './inventory_categories';
32
34
  export * from './inventory_transactions';
@@ -43,6 +43,8 @@ __exportStar(require("./instore_shifts"), exports);
43
43
  __exportStar(require("./internal_customers"), exports);
44
44
  __exportStar(require("./internal_invoices"), exports);
45
45
  __exportStar(require("./internal_leads"), exports);
46
+ __exportStar(require("./internal_operational_roles"), exports);
47
+ __exportStar(require("./internal_staffs"), exports);
46
48
  __exportStar(require("./inventories"), exports);
47
49
  __exportStar(require("./inventory_categories"), exports);
48
50
  __exportStar(require("./inventory_transactions"), exports);
@@ -0,0 +1,22 @@
1
+ import { INTERNAL_USER_PERMISSIONS_ENUM, INTERNAL_USER_ROLES_ENUM } from '../../constants';
2
+ export interface IInternalOperationalRoles {
3
+ _id: string;
4
+ roles: {
5
+ [INTERNAL_USER_ROLES_ENUM.SUPER_ADMIN]: INTERNAL_USER_PERMISSIONS_ENUM[];
6
+ [INTERNAL_USER_ROLES_ENUM.HOD]: INTERNAL_USER_PERMISSIONS_ENUM[];
7
+ [INTERNAL_USER_ROLES_ENUM.SUPPORT_HEAD]: INTERNAL_USER_PERMISSIONS_ENUM[];
8
+ [INTERNAL_USER_ROLES_ENUM.SUPPORT_TEAM]: INTERNAL_USER_PERMISSIONS_ENUM[];
9
+ [INTERNAL_USER_ROLES_ENUM.SALES_HEAD]: INTERNAL_USER_PERMISSIONS_ENUM[];
10
+ [INTERNAL_USER_ROLES_ENUM.SALES_TEAM]: INTERNAL_USER_PERMISSIONS_ENUM[];
11
+ [INTERNAL_USER_ROLES_ENUM.MARKETING_HEAD]: INTERNAL_USER_PERMISSIONS_ENUM[];
12
+ [INTERNAL_USER_ROLES_ENUM.MARKETING_TEAM]: INTERNAL_USER_PERMISSIONS_ENUM[];
13
+ [INTERNAL_USER_ROLES_ENUM.HR_HEAD]: INTERNAL_USER_PERMISSIONS_ENUM[];
14
+ [INTERNAL_USER_ROLES_ENUM.HR_TEAM]: INTERNAL_USER_PERMISSIONS_ENUM[];
15
+ [INTERNAL_USER_ROLES_ENUM.DEVELOPER]: INTERNAL_USER_PERMISSIONS_ENUM[];
16
+ [INTERNAL_USER_ROLES_ENUM.FINANCE]: INTERNAL_USER_PERMISSIONS_ENUM[];
17
+ [INTERNAL_USER_ROLES_ENUM.VIEWER]: INTERNAL_USER_PERMISSIONS_ENUM[];
18
+ };
19
+ createdAt: Date;
20
+ updatedAt: Date;
21
+ }
22
+ export declare const DefaultInternalOperationalRoles: IInternalOperationalRoles['roles'];
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultInternalOperationalRoles = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.DefaultInternalOperationalRoles = {
6
+ [constants_1.INTERNAL_USER_ROLES_ENUM.SUPER_ADMIN]: constants_1.ALL_INTERNAL_USER_PERMISSIONS,
7
+ [constants_1.INTERNAL_USER_ROLES_ENUM.HOD]: [],
8
+ [constants_1.INTERNAL_USER_ROLES_ENUM.SUPPORT_HEAD]: [],
9
+ [constants_1.INTERNAL_USER_ROLES_ENUM.SUPPORT_TEAM]: [],
10
+ [constants_1.INTERNAL_USER_ROLES_ENUM.SALES_HEAD]: [],
11
+ [constants_1.INTERNAL_USER_ROLES_ENUM.SALES_TEAM]: [],
12
+ [constants_1.INTERNAL_USER_ROLES_ENUM.MARKETING_HEAD]: [],
13
+ [constants_1.INTERNAL_USER_ROLES_ENUM.MARKETING_TEAM]: [],
14
+ [constants_1.INTERNAL_USER_ROLES_ENUM.HR_HEAD]: [],
15
+ [constants_1.INTERNAL_USER_ROLES_ENUM.HR_TEAM]: [],
16
+ [constants_1.INTERNAL_USER_ROLES_ENUM.DEVELOPER]: [],
17
+ [constants_1.INTERNAL_USER_ROLES_ENUM.FINANCE]: [],
18
+ [constants_1.INTERNAL_USER_ROLES_ENUM.VIEWER]: [],
19
+ };
@@ -0,0 +1,15 @@
1
+ import { INTERNAL_USER_ROLES_ENUM } from '../../constants';
2
+ export interface IInternalStaff {
3
+ _id: string;
4
+ uid: string;
5
+ email: string | null;
6
+ email_verified: boolean;
7
+ display_name: string | null;
8
+ image_url: string | null;
9
+ phone_number: string;
10
+ phone_number_verified: boolean;
11
+ role: INTERNAL_USER_ROLES_ENUM;
12
+ is_disabled: boolean;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ }
@@ -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.452",
3
+ "version": "0.2.454",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",