@b2y/ecommerce-common 1.3.6 → 1.3.7

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 (96) 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/EntityTypeEnum.js +12 -12
  20. package/enum/FeatureTypeEnum.js +6 -6
  21. package/enum/GenderEnum.js +7 -7
  22. package/enum/NotificationStatusEnum.js +5 -5
  23. package/enum/NotificationTypeEnum.js +9 -9
  24. package/enum/OrderActionStatusEnum.js +7 -7
  25. package/enum/OrderStatusEnum.js +7 -7
  26. package/enum/PackageBoxTypeEnum.js +6 -6
  27. package/enum/PaymentMethodEnum.js +6 -6
  28. package/enum/PaymentStatusEnum.js +6 -6
  29. package/enum/PaymentTypeEnum.js +6 -6
  30. package/enum/PlatformEnum.js +4 -4
  31. package/enum/ReasonTypeEnum.js +6 -6
  32. package/enum/RegistrationStatusEnum.js +5 -5
  33. package/enum/SortByEnum.js +7 -7
  34. package/enum/SubscriptionStatusEnum.js +7 -7
  35. package/index.js +28 -28
  36. package/model/Address.js +95 -95
  37. package/model/AttributeType.js +50 -50
  38. package/model/AttributeValue.js +64 -64
  39. package/model/Banner.js +78 -78
  40. package/model/Brand.js +76 -76
  41. package/model/Cart.js +76 -76
  42. package/model/Category.js +72 -72
  43. package/model/CategoryAttributeType.js +62 -62
  44. package/model/Colour.js +52 -52
  45. package/model/Customer.js +94 -94
  46. package/model/DeviceToken.js +51 -51
  47. package/model/Document.js +73 -73
  48. package/model/DynamicUIComponent.js +52 -52
  49. package/model/Feedback.js +79 -79
  50. package/model/Inventory.js +87 -87
  51. package/model/NotificationHistory.js +67 -67
  52. package/model/Order.js +84 -84
  53. package/model/OrderActionReason.js +99 -99
  54. package/model/OrderItem.js +98 -98
  55. package/model/OrderItemHistory.js +69 -69
  56. package/model/OrderStatus.js +48 -48
  57. package/model/PackagingBox.js +78 -78
  58. package/model/Payment.js +101 -101
  59. package/model/PaymentMethod.js +36 -36
  60. package/model/PaymentStatus.js +36 -36
  61. package/model/PaymentType.js +36 -36
  62. package/model/Permission.js +55 -55
  63. package/model/Product.js +97 -97
  64. package/model/ProductGroup.js +48 -48
  65. package/model/ProductImport.js +55 -55
  66. package/model/ProductImportFailureAudits.js +57 -57
  67. package/model/ProductSpecification.js +65 -65
  68. package/model/ProductVariant.js +111 -111
  69. package/model/ProductVariantAttribute.js +58 -58
  70. package/model/ReasonContextMapping.js +70 -70
  71. package/model/ReasonMaster.js +74 -74
  72. package/model/Role.js +61 -61
  73. package/model/RolePermissionMapping.js +63 -63
  74. package/model/SpecificationType.js +41 -41
  75. package/model/Store.js +99 -99
  76. package/model/StoreUserMapping.js +44 -44
  77. package/model/SubscriptionFeature.js +53 -53
  78. package/model/SubscriptionPlan.js +70 -70
  79. package/model/SubscriptionPlanFeature.js +48 -48
  80. package/model/Tenant.js +91 -91
  81. package/model/TenantSettings.js +47 -47
  82. package/model/TenantSubscription.js +73 -73
  83. package/model/User.js +132 -132
  84. package/model/WishList.js +62 -62
  85. package/package.json +30 -30
  86. package/scripts/QueryBuilder.js +162 -162
  87. package/utility/AppUtil.js +65 -65
  88. package/utility/DateUtil.js +55 -55
  89. package/utility/ExcelUtil.js +125 -125
  90. package/utility/LocationUtility.js +130 -130
  91. package/utility/OrderTimeFilterUtil.js +88 -88
  92. package/utility/PdfUtil.js +64 -64
  93. package/utility/QueryUtil.js +261 -261
  94. package/utility/Razorpay.js +65 -65
  95. package/utility/ResolveAccessMode.js +61 -61
  96. package/utility/VariantPriceUtil.js +54 -54
package/model/Cart.js CHANGED
@@ -1,77 +1,77 @@
1
- const { DataTypes } = require('sequelize');
2
-
3
- module.exports = (sequelize) => {
4
- return sequelize.define('Cart', {
5
- CartID: {
6
- type: DataTypes.UUID,
7
- primaryKey: true,
8
- allowNull: false,
9
- defaultValue: DataTypes.UUIDV4
10
- },
11
- TenantID: {
12
- type: DataTypes.UUID,
13
- allowNull: false,
14
- references: {
15
- model: 'Tenant',
16
- key: 'TenantID'
17
- },
18
- onDelete: 'CASCADE',
19
- onUpdate: 'CASCADE'
20
- },
21
- ProductVariantID: {
22
- type: DataTypes.UUID,
23
- allowNull: false,
24
- references: {
25
- model: 'ProductVariant',
26
- key: 'ProductVariantID'
27
- },
28
- onDelete: 'RESTRICT',
29
- onUpdate: 'CASCADE'
30
- },
31
- CustomerID: {
32
- type: DataTypes.UUID,
33
- allowNull: false,
34
- references: {
35
- model: 'Customer',
36
- key: 'CustomerID'
37
- },
38
- onDelete: 'RESTRICT',
39
- onUpdate: 'CASCADE'
40
- },
41
- InventoryID: {
42
- type: DataTypes.UUID,
43
- allowNull: true,
44
- references: {
45
- model: 'Inventory',
46
- key: 'InventoryID'
47
- },
48
- onDelete: 'SET NULL',
49
- onUpdate: 'CASCADE'
50
- },
51
- Quantity: {
52
- type: DataTypes.INTEGER,
53
- allowNull: false
54
- },
55
- CreatedBy: {
56
- type: DataTypes.UUID,
57
- allowNull: false
58
- },
59
- CreatedAt: {
60
- type: DataTypes.DATE,
61
- allowNull: false,
62
- defaultValue: DataTypes.NOW
63
- },
64
- UpdatedBy: {
65
- type: DataTypes.UUID,
66
- allowNull: false
67
- },
68
- UpdatedAt: {
69
- type: DataTypes.DATE,
70
- allowNull: false,
71
- defaultValue: DataTypes.NOW
72
- }
73
- }, {
74
- tableName: 'Cart',
75
- timestamps: false
76
- });
1
+ const { DataTypes } = require('sequelize');
2
+
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define('Cart', {
5
+ CartID: {
6
+ type: DataTypes.UUID,
7
+ primaryKey: true,
8
+ allowNull: false,
9
+ defaultValue: DataTypes.UUIDV4
10
+ },
11
+ TenantID: {
12
+ type: DataTypes.UUID,
13
+ allowNull: false,
14
+ references: {
15
+ model: 'Tenant',
16
+ key: 'TenantID'
17
+ },
18
+ onDelete: 'CASCADE',
19
+ onUpdate: 'CASCADE'
20
+ },
21
+ ProductVariantID: {
22
+ type: DataTypes.UUID,
23
+ allowNull: false,
24
+ references: {
25
+ model: 'ProductVariant',
26
+ key: 'ProductVariantID'
27
+ },
28
+ onDelete: 'RESTRICT',
29
+ onUpdate: 'CASCADE'
30
+ },
31
+ CustomerID: {
32
+ type: DataTypes.UUID,
33
+ allowNull: false,
34
+ references: {
35
+ model: 'Customer',
36
+ key: 'CustomerID'
37
+ },
38
+ onDelete: 'RESTRICT',
39
+ onUpdate: 'CASCADE'
40
+ },
41
+ InventoryID: {
42
+ type: DataTypes.UUID,
43
+ allowNull: true,
44
+ references: {
45
+ model: 'Inventory',
46
+ key: 'InventoryID'
47
+ },
48
+ onDelete: 'SET NULL',
49
+ onUpdate: 'CASCADE'
50
+ },
51
+ Quantity: {
52
+ type: DataTypes.INTEGER,
53
+ allowNull: false
54
+ },
55
+ CreatedBy: {
56
+ type: DataTypes.UUID,
57
+ allowNull: false
58
+ },
59
+ CreatedAt: {
60
+ type: DataTypes.DATE,
61
+ allowNull: false,
62
+ defaultValue: DataTypes.NOW
63
+ },
64
+ UpdatedBy: {
65
+ type: DataTypes.UUID,
66
+ allowNull: false
67
+ },
68
+ UpdatedAt: {
69
+ type: DataTypes.DATE,
70
+ allowNull: false,
71
+ defaultValue: DataTypes.NOW
72
+ }
73
+ }, {
74
+ tableName: 'Cart',
75
+ timestamps: false
76
+ });
77
77
  };
package/model/Category.js CHANGED
@@ -1,73 +1,73 @@
1
- const { DataTypes } = require('sequelize');
2
-
3
- module.exports = (sequelize) => {
4
- return sequelize.define('Category', {
5
- CategoryID: {
6
- type: DataTypes.UUID,
7
- primaryKey: true,
8
- allowNull: false,
9
- defaultValue: DataTypes.UUIDV4
10
- },
11
- TenantID: {
12
- type: DataTypes.UUID,
13
- allowNull: false,
14
- references: {
15
- model: 'Tenant',
16
- key: 'TenantID'
17
- },
18
- onDelete: 'CASCADE',
19
- onUpdate: 'CASCADE'
20
- },
21
- CategoryName: {
22
- type: DataTypes.STRING(255),
23
- allowNull: false
24
- },
25
- ParentCategoryID: {
26
- type: DataTypes.UUID,
27
- references: {
28
- model: 'Category',
29
- key: 'CategoryID'
30
- },
31
- onDelete: 'SET NULL',
32
- onUpdate: 'CASCADE'
33
- },
34
- CategoryDescription: {
35
- type: DataTypes.TEXT
36
- },
37
- IsActive: {
38
- type: DataTypes.BOOLEAN,
39
- defaultValue: true
40
- },
41
- CreatedBy: {
42
- type: DataTypes.UUID,
43
- allowNull: false
44
- },
45
- CreatedAt: {
46
- type: DataTypes.DATE,
47
- allowNull: false,
48
- defaultValue: DataTypes.NOW
49
- },
50
- UpdatedBy: {
51
- type: DataTypes.UUID,
52
- allowNull: false
53
- },
54
- UpdatedAt: {
55
- type: DataTypes.DATE,
56
- allowNull: false,
57
- defaultValue: DataTypes.NOW
58
- }
59
- }, {
60
- tableName: 'Category',
61
- timestamps: false,
62
- indexes: [
63
- {
64
- name: "idx_category_unique_tenant_categoryname",
65
- unique: true,
66
- fields: [
67
- sequelize.literal('LOWER("CategoryName")'),
68
- "TenantID"
69
- ]
70
- }
71
- ]
72
- });
1
+ const { DataTypes } = require('sequelize');
2
+
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define('Category', {
5
+ CategoryID: {
6
+ type: DataTypes.UUID,
7
+ primaryKey: true,
8
+ allowNull: false,
9
+ defaultValue: DataTypes.UUIDV4
10
+ },
11
+ TenantID: {
12
+ type: DataTypes.UUID,
13
+ allowNull: false,
14
+ references: {
15
+ model: 'Tenant',
16
+ key: 'TenantID'
17
+ },
18
+ onDelete: 'CASCADE',
19
+ onUpdate: 'CASCADE'
20
+ },
21
+ CategoryName: {
22
+ type: DataTypes.STRING(255),
23
+ allowNull: false
24
+ },
25
+ ParentCategoryID: {
26
+ type: DataTypes.UUID,
27
+ references: {
28
+ model: 'Category',
29
+ key: 'CategoryID'
30
+ },
31
+ onDelete: 'SET NULL',
32
+ onUpdate: 'CASCADE'
33
+ },
34
+ CategoryDescription: {
35
+ type: DataTypes.TEXT
36
+ },
37
+ IsActive: {
38
+ type: DataTypes.BOOLEAN,
39
+ defaultValue: true
40
+ },
41
+ CreatedBy: {
42
+ type: DataTypes.UUID,
43
+ allowNull: false
44
+ },
45
+ CreatedAt: {
46
+ type: DataTypes.DATE,
47
+ allowNull: false,
48
+ defaultValue: DataTypes.NOW
49
+ },
50
+ UpdatedBy: {
51
+ type: DataTypes.UUID,
52
+ allowNull: false
53
+ },
54
+ UpdatedAt: {
55
+ type: DataTypes.DATE,
56
+ allowNull: false,
57
+ defaultValue: DataTypes.NOW
58
+ }
59
+ }, {
60
+ tableName: 'Category',
61
+ timestamps: false,
62
+ indexes: [
63
+ {
64
+ name: "idx_category_unique_tenant_categoryname",
65
+ unique: true,
66
+ fields: [
67
+ sequelize.literal('LOWER("CategoryName")'),
68
+ "TenantID"
69
+ ]
70
+ }
71
+ ]
72
+ });
73
73
  };
@@ -1,63 +1,63 @@
1
- const { DataTypes } = require('sequelize');
2
-
3
- module.exports = (sequelize) => {
4
- return sequelize.define('CategoryAttributeType', {
5
- CategoryAttributeTypeID: {
6
- type: DataTypes.UUID,
7
- primaryKey: true,
8
- allowNull: false,
9
- defaultValue: DataTypes.UUIDV4
10
- },
11
- CategoryID: {
12
- type: DataTypes.UUID,
13
- allowNull: false,
14
- references: {
15
- model: 'Category',
16
- key: 'CategoryID'
17
- },
18
- onDelete: 'CASCADE',
19
- onUpdate: 'CASCADE'
20
- },
21
- AttributeTypeID: {
22
- type: DataTypes.UUID,
23
- allowNull: false,
24
- references: {
25
- model: 'AttributeType',
26
- key: 'AttributeTypeID'
27
- },
28
- onDelete: 'CASCADE',
29
- onUpdate: 'CASCADE'
30
- },
31
- SortOrder: {
32
- type: DataTypes.INTEGER,
33
- defaultValue: 0
34
- },
35
- CreatedBy: {
36
- type: DataTypes.UUID,
37
- allowNull: false
38
- },
39
- CreatedAt: {
40
- type: DataTypes.DATE,
41
- allowNull: false,
42
- defaultValue: DataTypes.NOW
43
- },
44
- UpdatedBy: {
45
- type: DataTypes.UUID,
46
- allowNull: false
47
- },
48
- UpdatedAt: {
49
- type: DataTypes.DATE,
50
- allowNull: false,
51
- defaultValue: DataTypes.NOW
52
- }
53
- }, {
54
- tableName: 'CategoryAttributeType',
55
- timestamps: false,
56
- indexes: [
57
- {
58
- unique: true,
59
- fields: ['CategoryID', 'AttributeTypeID']
60
- }
61
- ]
62
- });
1
+ const { DataTypes } = require('sequelize');
2
+
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define('CategoryAttributeType', {
5
+ CategoryAttributeTypeID: {
6
+ type: DataTypes.UUID,
7
+ primaryKey: true,
8
+ allowNull: false,
9
+ defaultValue: DataTypes.UUIDV4
10
+ },
11
+ CategoryID: {
12
+ type: DataTypes.UUID,
13
+ allowNull: false,
14
+ references: {
15
+ model: 'Category',
16
+ key: 'CategoryID'
17
+ },
18
+ onDelete: 'CASCADE',
19
+ onUpdate: 'CASCADE'
20
+ },
21
+ AttributeTypeID: {
22
+ type: DataTypes.UUID,
23
+ allowNull: false,
24
+ references: {
25
+ model: 'AttributeType',
26
+ key: 'AttributeTypeID'
27
+ },
28
+ onDelete: 'CASCADE',
29
+ onUpdate: 'CASCADE'
30
+ },
31
+ SortOrder: {
32
+ type: DataTypes.INTEGER,
33
+ defaultValue: 0
34
+ },
35
+ CreatedBy: {
36
+ type: DataTypes.UUID,
37
+ allowNull: false
38
+ },
39
+ CreatedAt: {
40
+ type: DataTypes.DATE,
41
+ allowNull: false,
42
+ defaultValue: DataTypes.NOW
43
+ },
44
+ UpdatedBy: {
45
+ type: DataTypes.UUID,
46
+ allowNull: false
47
+ },
48
+ UpdatedAt: {
49
+ type: DataTypes.DATE,
50
+ allowNull: false,
51
+ defaultValue: DataTypes.NOW
52
+ }
53
+ }, {
54
+ tableName: 'CategoryAttributeType',
55
+ timestamps: false,
56
+ indexes: [
57
+ {
58
+ unique: true,
59
+ fields: ['CategoryID', 'AttributeTypeID']
60
+ }
61
+ ]
62
+ });
63
63
  };
package/model/Colour.js CHANGED
@@ -1,53 +1,53 @@
1
- const { DataTypes } = require('sequelize');
2
-
3
- module.exports = (sequelize) => {
4
- return sequelize.define('Colour', {
5
- ColourID: {
6
- type: DataTypes.INTEGER,
7
- primaryKey: true,
8
- allowNull: false,
9
- autoIncrement: true
10
- },
11
- Name: {
12
- type: DataTypes.STRING(50),
13
- allowNull: false
14
- },
15
- HexCode: {
16
- type: DataTypes.STRING(10),
17
- allowNull: false,
18
- unique: true
19
- },
20
- IsActive: {
21
- type: DataTypes.BOOLEAN,
22
- defaultValue: true
23
- },
24
- CreatedBy: {
25
- type: DataTypes.UUID,
26
- allowNull: false
27
- },
28
- CreatedAt: {
29
- type: DataTypes.DATE,
30
- allowNull: false,
31
- defaultValue: DataTypes.NOW
32
- },
33
- UpdatedBy: {
34
- type: DataTypes.UUID,
35
- allowNull: false
36
- },
37
- UpdatedAt: {
38
- type: DataTypes.DATE,
39
- allowNull: false,
40
- defaultValue: DataTypes.NOW
41
- }
42
- }, {
43
- tableName: 'Colour',
44
- indexes: [
45
- {
46
- name: "idx_colour_name_lower_unique",
47
- unique: true,
48
- fields: sequelize.literal('LOWER("Name")')
49
- }
50
- ],
51
- timestamps: false
52
- });
1
+ const { DataTypes } = require('sequelize');
2
+
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define('Colour', {
5
+ ColourID: {
6
+ type: DataTypes.INTEGER,
7
+ primaryKey: true,
8
+ allowNull: false,
9
+ autoIncrement: true
10
+ },
11
+ Name: {
12
+ type: DataTypes.STRING(50),
13
+ allowNull: false
14
+ },
15
+ HexCode: {
16
+ type: DataTypes.STRING(10),
17
+ allowNull: false,
18
+ unique: true
19
+ },
20
+ IsActive: {
21
+ type: DataTypes.BOOLEAN,
22
+ defaultValue: true
23
+ },
24
+ CreatedBy: {
25
+ type: DataTypes.UUID,
26
+ allowNull: false
27
+ },
28
+ CreatedAt: {
29
+ type: DataTypes.DATE,
30
+ allowNull: false,
31
+ defaultValue: DataTypes.NOW
32
+ },
33
+ UpdatedBy: {
34
+ type: DataTypes.UUID,
35
+ allowNull: false
36
+ },
37
+ UpdatedAt: {
38
+ type: DataTypes.DATE,
39
+ allowNull: false,
40
+ defaultValue: DataTypes.NOW
41
+ }
42
+ }, {
43
+ tableName: 'Colour',
44
+ indexes: [
45
+ {
46
+ name: "idx_colour_name_lower_unique",
47
+ unique: true,
48
+ fields: sequelize.literal('LOWER("Name")')
49
+ }
50
+ ],
51
+ timestamps: false
52
+ });
53
53
  };