@b2y/ecommerce-common 1.3.6 → 1.3.8

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 (98) hide show
  1. package/.idea/ecommerce-common.iml +11 -11
  2. package/.idea/modules.xml +7 -7
  3. package/.idea/vcs.xml +5 -5
  4. package/README.md +4 -4
  5. package/constants/AppConstants.js +15 -15
  6. package/constants/ReportConstants.js +14 -14
  7. package/constants/StatusMessageConstants.js +61 -61
  8. package/controller/LocationController.js +144 -144
  9. package/controller/SubscriptionAbstractController.js +91 -91
  10. package/controller/TenantAbstractController.js +152 -152
  11. package/controller/TenantSettingsAbstractController.js +243 -243
  12. package/dbconnection/Connect.js +498 -498
  13. package/enum/AccessModeEnum.js +8 -8
  14. package/enum/ActionByTypeEnum.js +4 -4
  15. package/enum/AddressTypeEnum.js +6 -6
  16. package/enum/BillingCycleEnum.js +5 -5
  17. package/enum/BooleanEnum.js +4 -4
  18. package/enum/BulkImportStatusEnum.js +6 -6
  19. package/enum/DimensionUnitEnum.js +6 -0
  20. package/enum/EntityTypeEnum.js +12 -12
  21. package/enum/FeatureTypeEnum.js +6 -6
  22. package/enum/GenderEnum.js +7 -7
  23. package/enum/NotificationStatusEnum.js +5 -5
  24. package/enum/NotificationTypeEnum.js +9 -9
  25. package/enum/OrderActionStatusEnum.js +7 -7
  26. package/enum/OrderStatusEnum.js +8 -7
  27. package/enum/PackageBoxTypeEnum.js +6 -6
  28. package/enum/PaymentMethodEnum.js +6 -6
  29. package/enum/PaymentStatusEnum.js +6 -6
  30. package/enum/PaymentTypeEnum.js +6 -6
  31. package/enum/PlatformEnum.js +4 -4
  32. package/enum/ReasonTypeEnum.js +6 -6
  33. package/enum/RegistrationStatusEnum.js +5 -5
  34. package/enum/SortByEnum.js +7 -7
  35. package/enum/SubscriptionStatusEnum.js +7 -7
  36. package/enum/WeightUnitEnum.js +7 -0
  37. package/index.js +28 -28
  38. package/model/Address.js +95 -95
  39. package/model/AttributeType.js +50 -50
  40. package/model/AttributeValue.js +64 -64
  41. package/model/Banner.js +78 -78
  42. package/model/Brand.js +76 -76
  43. package/model/Cart.js +76 -76
  44. package/model/Category.js +72 -72
  45. package/model/CategoryAttributeType.js +62 -62
  46. package/model/Colour.js +52 -52
  47. package/model/Customer.js +94 -94
  48. package/model/DeviceToken.js +51 -51
  49. package/model/Document.js +73 -73
  50. package/model/DynamicUIComponent.js +52 -52
  51. package/model/Feedback.js +79 -79
  52. package/model/Inventory.js +87 -87
  53. package/model/NotificationHistory.js +67 -67
  54. package/model/Order.js +84 -84
  55. package/model/OrderActionReason.js +99 -99
  56. package/model/OrderItem.js +98 -98
  57. package/model/OrderItemHistory.js +69 -69
  58. package/model/OrderStatus.js +48 -48
  59. package/model/PackagingBox.js +78 -78
  60. package/model/Payment.js +101 -101
  61. package/model/PaymentMethod.js +36 -36
  62. package/model/PaymentStatus.js +36 -36
  63. package/model/PaymentType.js +36 -36
  64. package/model/Permission.js +55 -55
  65. package/model/Product.js +97 -97
  66. package/model/ProductGroup.js +48 -48
  67. package/model/ProductImport.js +55 -55
  68. package/model/ProductImportFailureAudits.js +57 -57
  69. package/model/ProductSpecification.js +65 -65
  70. package/model/ProductVariant.js +111 -111
  71. package/model/ProductVariantAttribute.js +58 -58
  72. package/model/ReasonContextMapping.js +70 -70
  73. package/model/ReasonMaster.js +74 -74
  74. package/model/Role.js +61 -61
  75. package/model/RolePermissionMapping.js +63 -63
  76. package/model/SpecificationType.js +41 -41
  77. package/model/Store.js +99 -99
  78. package/model/StoreUserMapping.js +44 -44
  79. package/model/SubscriptionFeature.js +53 -53
  80. package/model/SubscriptionPlan.js +70 -70
  81. package/model/SubscriptionPlanFeature.js +48 -48
  82. package/model/Tenant.js +91 -91
  83. package/model/TenantSettings.js +47 -47
  84. package/model/TenantSubscription.js +73 -73
  85. package/model/User.js +132 -132
  86. package/model/WishList.js +62 -62
  87. package/package.json +30 -30
  88. package/scripts/QueryBuilder.js +162 -162
  89. package/utility/AppUtil.js +65 -65
  90. package/utility/DateUtil.js +55 -55
  91. package/utility/ExcelUtil.js +125 -125
  92. package/utility/LocationUtility.js +130 -130
  93. package/utility/OrderTimeFilterUtil.js +88 -88
  94. package/utility/PdfUtil.js +64 -64
  95. package/utility/QueryUtil.js +261 -261
  96. package/utility/Razorpay.js +65 -65
  97. package/utility/ResolveAccessMode.js +61 -61
  98. package/utility/VariantPriceUtil.js +54 -54
package/model/Customer.js CHANGED
@@ -1,95 +1,95 @@
1
- const { DataTypes } = require('sequelize');
2
- const GenderEnum = require('../enum/GenderEnum');
3
- const RegistrationStatusEnum = require('../enum/RegistrationStatusEnum');
4
- module.exports = (sequelize) => {
5
- return sequelize.define('Customer', {
6
- CustomerID: {
7
- type: DataTypes.UUID,
8
- primaryKey: true,
9
- allowNull: false,
10
- defaultValue: DataTypes.UUIDV4
11
- },
12
- TenantID: {
13
- type: DataTypes.UUID,
14
- allowNull: false,
15
- references: {
16
- model: 'Tenant',
17
- key: 'TenantID'
18
- },
19
- onDelete: 'CASCADE',
20
- onUpdate: 'CASCADE'
21
- },
22
- FirstName: {
23
- type: DataTypes.STRING(255),
24
- allowNull: true
25
- },
26
- LastName: {
27
- type: DataTypes.STRING(255),
28
- allowNull: true
29
- },
30
- Email: {
31
- type: DataTypes.STRING(100),
32
- allowNull: true,
33
- },
34
- Password: {
35
- type: DataTypes.STRING(255)
36
- },
37
- CountryCallingCode: {
38
- type: DataTypes.STRING(5),
39
- allowNull: false
40
- },
41
- PhoneNumber: {
42
- type: DataTypes.STRING(20),
43
- allowNull: false,
44
- },
45
- Gender: {
46
- type: DataTypes.ENUM(...Object.values(GenderEnum)),
47
- },
48
- DOB: {
49
- type: DataTypes.DATE
50
- },
51
- RegistrationStatus: {
52
- type: DataTypes.ENUM(...Object.values(RegistrationStatusEnum)),
53
- defaultValue: RegistrationStatusEnum.INITIATED
54
- },
55
- OTP: {
56
- type: DataTypes.STRING(10)
57
- },
58
- OTPExpiry: {
59
- type: DataTypes.DATE
60
- },
61
- CreatedBy: {
62
- type: DataTypes.UUID,
63
- allowNull: false
64
- },
65
- CreatedAt: {
66
- type: DataTypes.DATE,
67
- allowNull: false,
68
- defaultValue: DataTypes.NOW
69
- },
70
- UpdatedBy: {
71
- type: DataTypes.UUID,
72
- allowNull: false
73
- },
74
- UpdatedAt: {
75
- type: DataTypes.DATE,
76
- allowNull: false,
77
- defaultValue: DataTypes.NOW
78
- }
79
- }, {
80
- tableName: 'Customer',
81
- timestamps: false,
82
- indexes: [
83
- {
84
- name: "UQ_Customer_Tenant_Email",
85
- unique: true,
86
- fields: ["TenantID", "Email"],
87
- },
88
- {
89
- name: "UQ_Customer_Tenant_Phone",
90
- unique: true,
91
- fields: ["TenantID", "CountryCallingCode", "PhoneNumber"],
92
- },
93
- ],
94
- });
1
+ const { DataTypes } = require('sequelize');
2
+ const GenderEnum = require('../enum/GenderEnum');
3
+ const RegistrationStatusEnum = require('../enum/RegistrationStatusEnum');
4
+ module.exports = (sequelize) => {
5
+ return sequelize.define('Customer', {
6
+ CustomerID: {
7
+ type: DataTypes.UUID,
8
+ primaryKey: true,
9
+ allowNull: false,
10
+ defaultValue: DataTypes.UUIDV4
11
+ },
12
+ TenantID: {
13
+ type: DataTypes.UUID,
14
+ allowNull: false,
15
+ references: {
16
+ model: 'Tenant',
17
+ key: 'TenantID'
18
+ },
19
+ onDelete: 'CASCADE',
20
+ onUpdate: 'CASCADE'
21
+ },
22
+ FirstName: {
23
+ type: DataTypes.STRING(255),
24
+ allowNull: true
25
+ },
26
+ LastName: {
27
+ type: DataTypes.STRING(255),
28
+ allowNull: true
29
+ },
30
+ Email: {
31
+ type: DataTypes.STRING(100),
32
+ allowNull: true,
33
+ },
34
+ Password: {
35
+ type: DataTypes.STRING(255)
36
+ },
37
+ CountryCallingCode: {
38
+ type: DataTypes.STRING(5),
39
+ allowNull: false
40
+ },
41
+ PhoneNumber: {
42
+ type: DataTypes.STRING(20),
43
+ allowNull: false,
44
+ },
45
+ Gender: {
46
+ type: DataTypes.ENUM(...Object.values(GenderEnum)),
47
+ },
48
+ DOB: {
49
+ type: DataTypes.DATE
50
+ },
51
+ RegistrationStatus: {
52
+ type: DataTypes.ENUM(...Object.values(RegistrationStatusEnum)),
53
+ defaultValue: RegistrationStatusEnum.INITIATED
54
+ },
55
+ OTP: {
56
+ type: DataTypes.STRING(10)
57
+ },
58
+ OTPExpiry: {
59
+ type: DataTypes.DATE
60
+ },
61
+ CreatedBy: {
62
+ type: DataTypes.UUID,
63
+ allowNull: false
64
+ },
65
+ CreatedAt: {
66
+ type: DataTypes.DATE,
67
+ allowNull: false,
68
+ defaultValue: DataTypes.NOW
69
+ },
70
+ UpdatedBy: {
71
+ type: DataTypes.UUID,
72
+ allowNull: false
73
+ },
74
+ UpdatedAt: {
75
+ type: DataTypes.DATE,
76
+ allowNull: false,
77
+ defaultValue: DataTypes.NOW
78
+ }
79
+ }, {
80
+ tableName: 'Customer',
81
+ timestamps: false,
82
+ indexes: [
83
+ {
84
+ name: "UQ_Customer_Tenant_Email",
85
+ unique: true,
86
+ fields: ["TenantID", "Email"],
87
+ },
88
+ {
89
+ name: "UQ_Customer_Tenant_Phone",
90
+ unique: true,
91
+ fields: ["TenantID", "CountryCallingCode", "PhoneNumber"],
92
+ },
93
+ ],
94
+ });
95
95
  };
@@ -1,52 +1,52 @@
1
- const { DataTypes } = require('sequelize');
2
- const PlatformEnum = require('../enum/PlatformEnum');
3
- module.exports = (sequelize) => {
4
- return sequelize.define('DeviceToken', {
5
- DeviceTokenID: {
6
- type: DataTypes.UUID,
7
- primaryKey: true,
8
- allowNull: false,
9
- defaultValue: DataTypes.UUIDV4
10
- },
11
- FCMToken: {
12
- type: DataTypes.STRING(255),
13
- allowNull: false
14
- },
15
- DeviceID: {
16
- type: DataTypes.STRING(100),
17
- allowNull: false
18
- },
19
- DeviceName: {
20
- type: DataTypes.STRING(100),
21
- allowNull: false
22
- },
23
- Platform: {
24
- type: DataTypes.ENUM(...Object.values(PlatformEnum)),
25
- },
26
- IsActive: {
27
- type: DataTypes.BOOLEAN,
28
- defaultValue: true
29
- },
30
- CreatedBy: {
31
- type: DataTypes.UUID,
32
- allowNull: false
33
- },
34
- CreatedAt: {
35
- type: DataTypes.DATE,
36
- allowNull: false,
37
- defaultValue: DataTypes.NOW
38
- },
39
- UpdatedBy: {
40
- type: DataTypes.UUID,
41
- allowNull: false
42
- },
43
- UpdatedAt: {
44
- type: DataTypes.DATE,
45
- allowNull: false,
46
- defaultValue: DataTypes.NOW
47
- }
48
- }, {
49
- tableName: 'DeviceToken',
50
- timestamps: false
51
- });
1
+ const { DataTypes } = require('sequelize');
2
+ const PlatformEnum = require('../enum/PlatformEnum');
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define('DeviceToken', {
5
+ DeviceTokenID: {
6
+ type: DataTypes.UUID,
7
+ primaryKey: true,
8
+ allowNull: false,
9
+ defaultValue: DataTypes.UUIDV4
10
+ },
11
+ FCMToken: {
12
+ type: DataTypes.STRING(255),
13
+ allowNull: false
14
+ },
15
+ DeviceID: {
16
+ type: DataTypes.STRING(100),
17
+ allowNull: false
18
+ },
19
+ DeviceName: {
20
+ type: DataTypes.STRING(100),
21
+ allowNull: false
22
+ },
23
+ Platform: {
24
+ type: DataTypes.ENUM(...Object.values(PlatformEnum)),
25
+ },
26
+ IsActive: {
27
+ type: DataTypes.BOOLEAN,
28
+ defaultValue: true
29
+ },
30
+ CreatedBy: {
31
+ type: DataTypes.UUID,
32
+ allowNull: false
33
+ },
34
+ CreatedAt: {
35
+ type: DataTypes.DATE,
36
+ allowNull: false,
37
+ defaultValue: DataTypes.NOW
38
+ },
39
+ UpdatedBy: {
40
+ type: DataTypes.UUID,
41
+ allowNull: false
42
+ },
43
+ UpdatedAt: {
44
+ type: DataTypes.DATE,
45
+ allowNull: false,
46
+ defaultValue: DataTypes.NOW
47
+ }
48
+ }, {
49
+ tableName: 'DeviceToken',
50
+ timestamps: false
51
+ });
52
52
  };
package/model/Document.js CHANGED
@@ -1,74 +1,74 @@
1
- const { DataTypes } = require('sequelize');
2
- const { STORAGE_TYPES } = require('@b2y/document-module');
3
-
4
- module.exports = (sequelize) => {
5
- return sequelize.define('Document', {
6
- DocumentID: {
7
- type: DataTypes.UUID,
8
- primaryKey: true,
9
- allowNull: false,
10
- defaultValue: DataTypes.UUIDV4
11
- },
12
- TenantID: {
13
- type: DataTypes.UUID,
14
- allowNull: false,
15
- references: {
16
- model: 'Tenant',
17
- key: 'TenantID'
18
- },
19
- onDelete: 'CASCADE'
20
- },
21
- EntityType: {
22
- type: DataTypes.STRING(50),
23
- allowNull: false
24
- },
25
- EntityID: {
26
- type: DataTypes.UUID,
27
- allowNull: false
28
- },
29
- DocumentUrl: {
30
- type: DataTypes.STRING(500),
31
- allowNull: false
32
- },
33
- StorageType: {
34
- type: DataTypes.ENUM(...Object.values(STORAGE_TYPES)),
35
- allowNull: false,
36
- defaultValue: STORAGE_TYPES.LOCAL_DRIVE
37
- },
38
- MimeType: {
39
- type: DataTypes.STRING(100)
40
- },
41
- SizeInBytes: {
42
- type: DataTypes.BIGINT
43
- },
44
- SortOrder: {
45
- type: DataTypes.INTEGER,
46
- allowNull: false,
47
- defaultValue: 0
48
- },
49
- DocumentDescription: {
50
- type: DataTypes.STRING(255)
51
- },
52
- CreatedBy: {
53
- type: DataTypes.UUID,
54
- allowNull: false
55
- },
56
- CreatedAt: {
57
- type: DataTypes.DATE,
58
- allowNull: false,
59
- defaultValue: DataTypes.NOW
60
- },
61
- UpdatedBy: {
62
- type: DataTypes.UUID,
63
- allowNull: false
64
- },
65
- UpdatedAt: {
66
- type: DataTypes.DATE,
67
- allowNull: false,
68
- defaultValue: DataTypes.NOW
69
- }
70
- }, {
71
- tableName: 'Document',
72
- timestamps: false
73
- });
1
+ const { DataTypes } = require('sequelize');
2
+ const { STORAGE_TYPES } = require('@b2y/document-module');
3
+
4
+ module.exports = (sequelize) => {
5
+ return sequelize.define('Document', {
6
+ DocumentID: {
7
+ type: DataTypes.UUID,
8
+ primaryKey: true,
9
+ allowNull: false,
10
+ defaultValue: DataTypes.UUIDV4
11
+ },
12
+ TenantID: {
13
+ type: DataTypes.UUID,
14
+ allowNull: false,
15
+ references: {
16
+ model: 'Tenant',
17
+ key: 'TenantID'
18
+ },
19
+ onDelete: 'CASCADE'
20
+ },
21
+ EntityType: {
22
+ type: DataTypes.STRING(50),
23
+ allowNull: false
24
+ },
25
+ EntityID: {
26
+ type: DataTypes.UUID,
27
+ allowNull: false
28
+ },
29
+ DocumentUrl: {
30
+ type: DataTypes.STRING(500),
31
+ allowNull: false
32
+ },
33
+ StorageType: {
34
+ type: DataTypes.ENUM(...Object.values(STORAGE_TYPES)),
35
+ allowNull: false,
36
+ defaultValue: STORAGE_TYPES.LOCAL_DRIVE
37
+ },
38
+ MimeType: {
39
+ type: DataTypes.STRING(100)
40
+ },
41
+ SizeInBytes: {
42
+ type: DataTypes.BIGINT
43
+ },
44
+ SortOrder: {
45
+ type: DataTypes.INTEGER,
46
+ allowNull: false,
47
+ defaultValue: 0
48
+ },
49
+ DocumentDescription: {
50
+ type: DataTypes.STRING(255)
51
+ },
52
+ CreatedBy: {
53
+ type: DataTypes.UUID,
54
+ allowNull: false
55
+ },
56
+ CreatedAt: {
57
+ type: DataTypes.DATE,
58
+ allowNull: false,
59
+ defaultValue: DataTypes.NOW
60
+ },
61
+ UpdatedBy: {
62
+ type: DataTypes.UUID,
63
+ allowNull: false
64
+ },
65
+ UpdatedAt: {
66
+ type: DataTypes.DATE,
67
+ allowNull: false,
68
+ defaultValue: DataTypes.NOW
69
+ }
70
+ }, {
71
+ tableName: 'Document',
72
+ timestamps: false
73
+ });
74
74
  };
@@ -1,53 +1,53 @@
1
- const { DataTypes } = require('sequelize');
2
- const PlatformEnum = require('../enum/PlatformEnum');
3
- module.exports = (sequelize) => {
4
- return sequelize.define('DynamicUIComponent', {
5
- ComponentID: {
6
- type: DataTypes.UUID,
7
- primaryKey: true,
8
- allowNull: false,
9
- defaultValue: DataTypes.UUIDV4
10
- },
11
- ComponentName: {
12
- type: DataTypes.STRING(100),
13
- allowNull: false,
14
- unique: true
15
- },
16
- ComponentCode: {
17
- type: DataTypes.JSON,
18
- allowNull: false
19
- },
20
- Platform: {
21
- type: DataTypes.ENUM(...Object.values(PlatformEnum)),
22
- },
23
- Version: {
24
- type: DataTypes.STRING(10),
25
- allowNull: false
26
- },
27
- IsActive: {
28
- type: DataTypes.BOOLEAN,
29
- defaultValue: true
30
- },
31
- CreatedBy: {
32
- type: DataTypes.UUID,
33
- allowNull: false
34
- },
35
- CreatedAt: {
36
- type: DataTypes.DATE,
37
- allowNull: false,
38
- defaultValue: DataTypes.NOW
39
- },
40
- UpdatedBy: {
41
- type: DataTypes.UUID,
42
- allowNull: false
43
- },
44
- UpdatedAt: {
45
- type: DataTypes.DATE,
46
- allowNull: false,
47
- defaultValue: DataTypes.NOW
48
- }
49
- }, {
50
- tableName: 'DynamicUIComponent',
51
- timestamps: false
52
- });
1
+ const { DataTypes } = require('sequelize');
2
+ const PlatformEnum = require('../enum/PlatformEnum');
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define('DynamicUIComponent', {
5
+ ComponentID: {
6
+ type: DataTypes.UUID,
7
+ primaryKey: true,
8
+ allowNull: false,
9
+ defaultValue: DataTypes.UUIDV4
10
+ },
11
+ ComponentName: {
12
+ type: DataTypes.STRING(100),
13
+ allowNull: false,
14
+ unique: true
15
+ },
16
+ ComponentCode: {
17
+ type: DataTypes.JSON,
18
+ allowNull: false
19
+ },
20
+ Platform: {
21
+ type: DataTypes.ENUM(...Object.values(PlatformEnum)),
22
+ },
23
+ Version: {
24
+ type: DataTypes.STRING(10),
25
+ allowNull: false
26
+ },
27
+ IsActive: {
28
+ type: DataTypes.BOOLEAN,
29
+ defaultValue: true
30
+ },
31
+ CreatedBy: {
32
+ type: DataTypes.UUID,
33
+ allowNull: false
34
+ },
35
+ CreatedAt: {
36
+ type: DataTypes.DATE,
37
+ allowNull: false,
38
+ defaultValue: DataTypes.NOW
39
+ },
40
+ UpdatedBy: {
41
+ type: DataTypes.UUID,
42
+ allowNull: false
43
+ },
44
+ UpdatedAt: {
45
+ type: DataTypes.DATE,
46
+ allowNull: false,
47
+ defaultValue: DataTypes.NOW
48
+ }
49
+ }, {
50
+ tableName: 'DynamicUIComponent',
51
+ timestamps: false
52
+ });
53
53
  };