@b2y/ecommerce-common 1.1.1 → 1.1.4

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 (80) hide show
  1. package/README.md +4 -4
  2. package/constants/AppConstants.js +6 -6
  3. package/constants/ReportConstants.js +14 -14
  4. package/constants/StatusMessageConstants.js +17 -17
  5. package/dbconnection/Connect.js +432 -420
  6. package/enum/AccessModeEnum.js +7 -7
  7. package/enum/AddressTypeEnum.js +6 -6
  8. package/enum/BillingCycleEnum.js +5 -5
  9. package/enum/BooleanEnum.js +4 -4
  10. package/enum/BulkImportStatusEnum.js +7 -0
  11. package/enum/EntityTypeEnum.js +11 -11
  12. package/enum/FeatureTypeEnum.js +6 -6
  13. package/enum/GenderEnum.js +7 -7
  14. package/enum/NotificationStatusEnum.js +5 -5
  15. package/enum/NotificationTypeEnum.js +9 -9
  16. package/enum/OrderStatusEnum.js +7 -7
  17. package/enum/PaymentMethodEnum.js +6 -6
  18. package/enum/PaymentStatusEnum.js +6 -6
  19. package/enum/PaymentTypeEnum.js +6 -6
  20. package/enum/PlatformEnum.js +4 -4
  21. package/enum/RegistrationStatusEnum.js +5 -5
  22. package/enum/SortByEnum.js +7 -7
  23. package/enum/SubscriptionStatusEnum.js +7 -7
  24. package/index.js +22 -22
  25. package/model/Address.js +95 -95
  26. package/model/AttributeType.js +50 -50
  27. package/model/AttributeValue.js +64 -64
  28. package/model/Banner.js +78 -78
  29. package/model/Brand.js +76 -76
  30. package/model/Cart.js +76 -76
  31. package/model/Category.js +72 -72
  32. package/model/CategoryAttributeType.js +62 -62
  33. package/model/Colour.js +52 -52
  34. package/model/Customer.js +94 -94
  35. package/model/DeviceToken.js +51 -51
  36. package/model/Document.js +73 -70
  37. package/model/DynamicUIComponent.js +52 -52
  38. package/model/Feedback.js +79 -79
  39. package/model/Inventory.js +83 -83
  40. package/model/NotificationHistory.js +67 -67
  41. package/model/Order.js +94 -94
  42. package/model/OrderItem.js +98 -98
  43. package/model/OrderItemHistory.js +69 -69
  44. package/model/OrderStatus.js +48 -48
  45. package/model/Payment.js +101 -101
  46. package/model/PaymentMethod.js +36 -36
  47. package/model/PaymentStatus.js +36 -36
  48. package/model/PaymentType.js +36 -36
  49. package/model/Permission.js +55 -55
  50. package/model/Product.js +82 -82
  51. package/model/ProductGroup.js +48 -48
  52. package/model/ProductImport.js +55 -0
  53. package/model/ProductImportFailureAudits.js +58 -0
  54. package/model/ProductSpecification.js +65 -65
  55. package/model/ProductVariant.js +75 -75
  56. package/model/ProductVariantAttribute.js +58 -58
  57. package/model/Role.js +61 -61
  58. package/model/RolePermissionMapping.js +63 -63
  59. package/model/SpecificationType.js +41 -41
  60. package/model/Store.js +99 -99
  61. package/model/StoreUserMapping.js +44 -44
  62. package/model/SubscriptionFeature.js +49 -49
  63. package/model/SubscriptionPlan.js +66 -66
  64. package/model/SubscriptionPlanFeature.js +48 -48
  65. package/model/Tenant.js +91 -91
  66. package/model/TenantSettings.js +47 -47
  67. package/model/TenantSubscription.js +73 -73
  68. package/model/User.js +132 -132
  69. package/model/WishList.js +62 -62
  70. package/package.json +29 -29
  71. package/utility/AppUtil.js +65 -65
  72. package/utility/DateUtil.js +55 -55
  73. package/utility/ExcelUtil.js +125 -125
  74. package/utility/LocationUtility.js +130 -130
  75. package/utility/OrderTimeFilterUtil.js +88 -88
  76. package/utility/PdfUtil.js +64 -64
  77. package/utility/QueryUtil.js +261 -261
  78. package/utility/Razorpay.js +65 -65
  79. package/utility/ResolveAccessMode.js +38 -38
  80. package/utility/VariantPriceUtil.js +54 -54
@@ -1,44 +1,44 @@
1
- const { DataTypes } = require('sequelize');
2
-
3
- module.exports = (sequelize) => {
4
- const StoreUserMapping = sequelize.define('StoreUserMapping', {
5
- StoreUserMappingID: {
6
- type: DataTypes.UUID,
7
- primaryKey: true,
8
- defaultValue: DataTypes.UUIDV4,
9
- },
10
- TenantID: {
11
- type: DataTypes.UUID,
12
- allowNull: false,
13
- },
14
- StoreID: {
15
- type: DataTypes.UUID,
16
- allowNull: false,
17
- },
18
- UserID: {
19
- type: DataTypes.UUID,
20
- allowNull: false,
21
- },
22
- CreatedBy: {
23
- type: DataTypes.UUID,
24
- allowNull: false,
25
- },
26
- CreatedAt: {
27
- type: DataTypes.DATE,
28
- defaultValue: DataTypes.NOW,
29
- },
30
- UpdatedBy: {
31
- type: DataTypes.UUID,
32
- allowNull: false,
33
- },
34
- UpdatedAt: {
35
- type: DataTypes.DATE,
36
- defaultValue: DataTypes.NOW,
37
- },
38
- }, {
39
- tableName: 'StoreUserMapping',
40
- timestamps: false,
41
- });
42
-
43
- return StoreUserMapping;
44
- };
1
+ const { DataTypes } = require('sequelize');
2
+
3
+ module.exports = (sequelize) => {
4
+ const StoreUserMapping = sequelize.define('StoreUserMapping', {
5
+ StoreUserMappingID: {
6
+ type: DataTypes.UUID,
7
+ primaryKey: true,
8
+ defaultValue: DataTypes.UUIDV4,
9
+ },
10
+ TenantID: {
11
+ type: DataTypes.UUID,
12
+ allowNull: false,
13
+ },
14
+ StoreID: {
15
+ type: DataTypes.UUID,
16
+ allowNull: false,
17
+ },
18
+ UserID: {
19
+ type: DataTypes.UUID,
20
+ allowNull: false,
21
+ },
22
+ CreatedBy: {
23
+ type: DataTypes.UUID,
24
+ allowNull: false,
25
+ },
26
+ CreatedAt: {
27
+ type: DataTypes.DATE,
28
+ defaultValue: DataTypes.NOW,
29
+ },
30
+ UpdatedBy: {
31
+ type: DataTypes.UUID,
32
+ allowNull: false,
33
+ },
34
+ UpdatedAt: {
35
+ type: DataTypes.DATE,
36
+ defaultValue: DataTypes.NOW,
37
+ },
38
+ }, {
39
+ tableName: 'StoreUserMapping',
40
+ timestamps: false,
41
+ });
42
+
43
+ return StoreUserMapping;
44
+ };
@@ -1,50 +1,50 @@
1
- const { DataTypes } = require('sequelize');
2
- const FeatureTypeEnum = require('../enum/FeatureTypeEnum');
3
- module.exports = (sequelize) => {
4
- return sequelize.define(
5
- "SubscriptionFeature",
6
- {
7
- SubscriptionFeatureID: {
8
- type: DataTypes.UUID,
9
- primaryKey: true,
10
- allowNull: false,
11
- defaultValue: DataTypes.UUIDV4,
12
- },
13
- FeatureName: {
14
- type: DataTypes.STRING(100),
15
- allowNull: false,
16
- },
17
- FeatureCode: {
18
- type: DataTypes.STRING(100),
19
- allowNull: false,
20
- unique: true,
21
- },
22
- FeatureType: {
23
- type: DataTypes.ENUM(...Object.values(FeatureTypeEnum)),
24
- allowNull: false,
25
- },
26
- CreatedBy: {
27
- type: DataTypes.UUID,
28
- allowNull: false,
29
- },
30
- CreatedAt: {
31
- type: DataTypes.DATE,
32
- allowNull: false,
33
- defaultValue: DataTypes.NOW,
34
- },
35
- UpdatedBy: {
36
- type: DataTypes.UUID,
37
- allowNull: false,
38
- },
39
- UpdatedAt: {
40
- type: DataTypes.DATE,
41
- allowNull: false,
42
- defaultValue: DataTypes.NOW,
43
- },
44
- },
45
- {
46
- tableName: "SubscriptionFeature",
47
- timestamps: false,
48
- }
49
- );
1
+ const { DataTypes } = require('sequelize');
2
+ const FeatureTypeEnum = require('../enum/FeatureTypeEnum');
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define(
5
+ "SubscriptionFeature",
6
+ {
7
+ SubscriptionFeatureID: {
8
+ type: DataTypes.UUID,
9
+ primaryKey: true,
10
+ allowNull: false,
11
+ defaultValue: DataTypes.UUIDV4,
12
+ },
13
+ FeatureName: {
14
+ type: DataTypes.STRING(100),
15
+ allowNull: false,
16
+ },
17
+ FeatureCode: {
18
+ type: DataTypes.STRING(100),
19
+ allowNull: false,
20
+ unique: true,
21
+ },
22
+ FeatureType: {
23
+ type: DataTypes.ENUM(...Object.values(FeatureTypeEnum)),
24
+ allowNull: false,
25
+ },
26
+ CreatedBy: {
27
+ type: DataTypes.UUID,
28
+ allowNull: false,
29
+ },
30
+ CreatedAt: {
31
+ type: DataTypes.DATE,
32
+ allowNull: false,
33
+ defaultValue: DataTypes.NOW,
34
+ },
35
+ UpdatedBy: {
36
+ type: DataTypes.UUID,
37
+ allowNull: false,
38
+ },
39
+ UpdatedAt: {
40
+ type: DataTypes.DATE,
41
+ allowNull: false,
42
+ defaultValue: DataTypes.NOW,
43
+ },
44
+ },
45
+ {
46
+ tableName: "SubscriptionFeature",
47
+ timestamps: false,
48
+ }
49
+ );
50
50
  };
@@ -1,67 +1,67 @@
1
- const { DataTypes } = require('sequelize');
2
- const BillingCycleEnum = require('../enum/BillingCycleEnum');
3
- module.exports = (sequelize) => {
4
- return sequelize.define(
5
- "SubscriptionPlan",
6
- {
7
- SubscriptionPlanID: {
8
- type: DataTypes.UUID,
9
- primaryKey: true,
10
- allowNull: false,
11
- defaultValue: DataTypes.UUIDV4,
12
- },
13
- PlanName: {
14
- type: DataTypes.STRING(100),
15
- allowNull: false,
16
- },
17
- PlanCode: {
18
- type: DataTypes.STRING(50),
19
- allowNull: false,
20
- unique: true,
21
- },
22
- Price: {
23
- type: DataTypes.DECIMAL(10, 2),
24
- allowNull: false,
25
- },
26
- BillingCycle: {
27
- type: DataTypes.ENUM(...Object.values(BillingCycleEnum)),
28
- allowNull: false,
29
- },
30
- Currency: {
31
- type: DataTypes.STRING(10),
32
- allowNull: false,
33
- },
34
- TrialPeriodDays: {
35
- type: DataTypes.INTEGER,
36
- allowNull: false,
37
- defaultValue: 0
38
- },
39
- IsActive: {
40
- type: DataTypes.BOOLEAN,
41
- defaultValue: true,
42
- },
43
- CreatedBy: {
44
- type: DataTypes.UUID,
45
- allowNull: false,
46
- },
47
- CreatedAt: {
48
- type: DataTypes.DATE,
49
- allowNull: false,
50
- defaultValue: DataTypes.NOW,
51
- },
52
- UpdatedBy: {
53
- type: DataTypes.UUID,
54
- allowNull: false,
55
- },
56
- UpdatedAt: {
57
- type: DataTypes.DATE,
58
- allowNull: false,
59
- defaultValue: DataTypes.NOW,
60
- },
61
- },
62
- {
63
- tableName: "SubscriptionPlan",
64
- timestamps: false,
65
- }
66
- );
1
+ const { DataTypes } = require('sequelize');
2
+ const BillingCycleEnum = require('../enum/BillingCycleEnum');
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define(
5
+ "SubscriptionPlan",
6
+ {
7
+ SubscriptionPlanID: {
8
+ type: DataTypes.UUID,
9
+ primaryKey: true,
10
+ allowNull: false,
11
+ defaultValue: DataTypes.UUIDV4,
12
+ },
13
+ PlanName: {
14
+ type: DataTypes.STRING(100),
15
+ allowNull: false,
16
+ },
17
+ PlanCode: {
18
+ type: DataTypes.STRING(50),
19
+ allowNull: false,
20
+ unique: true,
21
+ },
22
+ Price: {
23
+ type: DataTypes.DECIMAL(10, 2),
24
+ allowNull: false,
25
+ },
26
+ BillingCycle: {
27
+ type: DataTypes.ENUM(...Object.values(BillingCycleEnum)),
28
+ allowNull: false,
29
+ },
30
+ Currency: {
31
+ type: DataTypes.STRING(10),
32
+ allowNull: false,
33
+ },
34
+ TrialPeriodDays: {
35
+ type: DataTypes.INTEGER,
36
+ allowNull: false,
37
+ defaultValue: 0
38
+ },
39
+ IsActive: {
40
+ type: DataTypes.BOOLEAN,
41
+ defaultValue: true,
42
+ },
43
+ CreatedBy: {
44
+ type: DataTypes.UUID,
45
+ allowNull: false,
46
+ },
47
+ CreatedAt: {
48
+ type: DataTypes.DATE,
49
+ allowNull: false,
50
+ defaultValue: DataTypes.NOW,
51
+ },
52
+ UpdatedBy: {
53
+ type: DataTypes.UUID,
54
+ allowNull: false,
55
+ },
56
+ UpdatedAt: {
57
+ type: DataTypes.DATE,
58
+ allowNull: false,
59
+ defaultValue: DataTypes.NOW,
60
+ },
61
+ },
62
+ {
63
+ tableName: "SubscriptionPlan",
64
+ timestamps: false,
65
+ }
66
+ );
67
67
  };
@@ -1,49 +1,49 @@
1
- const { DataTypes } = require('sequelize');
2
-
3
- module.exports = (sequelize) => {
4
- return sequelize.define(
5
- "SubscriptionPlanFeature",
6
- {
7
- SubscriptionPlanFeatureID: {
8
- type: DataTypes.UUID,
9
- primaryKey: true,
10
- allowNull: false,
11
- defaultValue: DataTypes.UUIDV4,
12
- },
13
- SubscriptionPlanID: {
14
- type: DataTypes.UUID,
15
- allowNull: false,
16
- },
17
- SubscriptionFeatureID: {
18
- type: DataTypes.UUID,
19
- allowNull: false,
20
- },
21
- FeatureValue: {
22
- type: DataTypes.STRING(100),
23
- allowNull: false,
24
- },
25
- CreatedBy: {
26
- type: DataTypes.UUID,
27
- allowNull: false,
28
- },
29
- CreatedAt: {
30
- type: DataTypes.DATE,
31
- allowNull: false,
32
- defaultValue: DataTypes.NOW,
33
- },
34
- UpdatedBy: {
35
- type: DataTypes.UUID,
36
- allowNull: false,
37
- },
38
- UpdatedAt: {
39
- type: DataTypes.DATE,
40
- allowNull: false,
41
- defaultValue: DataTypes.NOW,
42
- },
43
- },
44
- {
45
- tableName: "SubscriptionPlanFeature",
46
- timestamps: false,
47
- }
48
- );
1
+ const { DataTypes } = require('sequelize');
2
+
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define(
5
+ "SubscriptionPlanFeature",
6
+ {
7
+ SubscriptionPlanFeatureID: {
8
+ type: DataTypes.UUID,
9
+ primaryKey: true,
10
+ allowNull: false,
11
+ defaultValue: DataTypes.UUIDV4,
12
+ },
13
+ SubscriptionPlanID: {
14
+ type: DataTypes.UUID,
15
+ allowNull: false,
16
+ },
17
+ SubscriptionFeatureID: {
18
+ type: DataTypes.UUID,
19
+ allowNull: false,
20
+ },
21
+ FeatureValue: {
22
+ type: DataTypes.STRING(100),
23
+ allowNull: false,
24
+ },
25
+ CreatedBy: {
26
+ type: DataTypes.UUID,
27
+ allowNull: false,
28
+ },
29
+ CreatedAt: {
30
+ type: DataTypes.DATE,
31
+ allowNull: false,
32
+ defaultValue: DataTypes.NOW,
33
+ },
34
+ UpdatedBy: {
35
+ type: DataTypes.UUID,
36
+ allowNull: false,
37
+ },
38
+ UpdatedAt: {
39
+ type: DataTypes.DATE,
40
+ allowNull: false,
41
+ defaultValue: DataTypes.NOW,
42
+ },
43
+ },
44
+ {
45
+ tableName: "SubscriptionPlanFeature",
46
+ timestamps: false,
47
+ }
48
+ );
49
49
  };
package/model/Tenant.js CHANGED
@@ -1,91 +1,91 @@
1
- const { DataTypes } = require('sequelize');
2
-
3
- module.exports = (sequelize) => {
4
- return sequelize.define('Tenant', {
5
- TenantID: {
6
- type: DataTypes.UUID,
7
- primaryKey: true,
8
- allowNull: false,
9
- defaultValue: DataTypes.UUIDV4
10
- },
11
- CompanyName: {
12
- type: DataTypes.STRING(255),
13
- allowNull: false,
14
- unique: true
15
- },
16
- CompanyCode: {
17
- type: DataTypes.INTEGER,
18
- allowNull: false,
19
- unique: true
20
- },
21
- Email: {
22
- type: DataTypes.STRING(100),
23
- allowNull: false,
24
- unique: true
25
- },
26
- PhoneNumber: {
27
- type: DataTypes.STRING(20),
28
- allowNull: false,
29
- unique: true
30
- },
31
- CountryCallingCode: {
32
- type: DataTypes.STRING(5),
33
- allowNull: false
34
- },
35
- GSTNo: {
36
- type: DataTypes.STRING(20),
37
- allowNull: true
38
- },
39
- CustomerPortalDomain:{
40
- type: DataTypes.STRING(255),
41
- allowNull: false,
42
- unique: true
43
- },
44
- AdminPortalDomain:{
45
- type: DataTypes.STRING(255),
46
- allowNull: false,
47
- unique: true
48
- },
49
- AddressLine: {
50
- type: DataTypes.STRING(500),
51
- allowNull: false
52
- },
53
- CityName: {
54
- type: DataTypes.STRING(100),
55
- allowNull: false
56
- },
57
- StateCode: {
58
- type: DataTypes.STRING(3),
59
- allowNull: false
60
- },
61
- CountryCode: {
62
- type: DataTypes.CHAR(2),
63
- allowNull: false
64
- },
65
- Zipcode: {
66
- type: DataTypes.STRING(20),
67
- allowNull: false
68
- },
69
- CreatedBy: {
70
- type: DataTypes.UUID,
71
- allowNull: false
72
- },
73
- CreatedAt: {
74
- type: DataTypes.DATE,
75
- allowNull: false,
76
- defaultValue: DataTypes.NOW
77
- },
78
- UpdatedBy: {
79
- type: DataTypes.UUID,
80
- allowNull: false
81
- },
82
- UpdatedAt: {
83
- type: DataTypes.DATE,
84
- allowNull: false,
85
- defaultValue: DataTypes.NOW
86
- }
87
- }, {
88
- tableName: 'Tenant',
89
- timestamps: false
90
- });
91
- };
1
+ const { DataTypes } = require('sequelize');
2
+
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define('Tenant', {
5
+ TenantID: {
6
+ type: DataTypes.UUID,
7
+ primaryKey: true,
8
+ allowNull: false,
9
+ defaultValue: DataTypes.UUIDV4
10
+ },
11
+ CompanyName: {
12
+ type: DataTypes.STRING(255),
13
+ allowNull: false,
14
+ unique: true
15
+ },
16
+ CompanyCode: {
17
+ type: DataTypes.INTEGER,
18
+ allowNull: false,
19
+ unique: true
20
+ },
21
+ Email: {
22
+ type: DataTypes.STRING(100),
23
+ allowNull: false,
24
+ unique: true
25
+ },
26
+ PhoneNumber: {
27
+ type: DataTypes.STRING(20),
28
+ allowNull: false,
29
+ unique: true
30
+ },
31
+ CountryCallingCode: {
32
+ type: DataTypes.STRING(5),
33
+ allowNull: false
34
+ },
35
+ GSTNo: {
36
+ type: DataTypes.STRING(20),
37
+ allowNull: true
38
+ },
39
+ CustomerPortalDomain:{
40
+ type: DataTypes.STRING(255),
41
+ allowNull: false,
42
+ unique: true
43
+ },
44
+ AdminPortalDomain:{
45
+ type: DataTypes.STRING(255),
46
+ allowNull: false,
47
+ unique: true
48
+ },
49
+ AddressLine: {
50
+ type: DataTypes.STRING(500),
51
+ allowNull: false
52
+ },
53
+ CityName: {
54
+ type: DataTypes.STRING(100),
55
+ allowNull: false
56
+ },
57
+ StateCode: {
58
+ type: DataTypes.STRING(3),
59
+ allowNull: false
60
+ },
61
+ CountryCode: {
62
+ type: DataTypes.CHAR(2),
63
+ allowNull: false
64
+ },
65
+ Zipcode: {
66
+ type: DataTypes.STRING(20),
67
+ allowNull: false
68
+ },
69
+ CreatedBy: {
70
+ type: DataTypes.UUID,
71
+ allowNull: false
72
+ },
73
+ CreatedAt: {
74
+ type: DataTypes.DATE,
75
+ allowNull: false,
76
+ defaultValue: DataTypes.NOW
77
+ },
78
+ UpdatedBy: {
79
+ type: DataTypes.UUID,
80
+ allowNull: false
81
+ },
82
+ UpdatedAt: {
83
+ type: DataTypes.DATE,
84
+ allowNull: false,
85
+ defaultValue: DataTypes.NOW
86
+ }
87
+ }, {
88
+ tableName: 'Tenant',
89
+ timestamps: false
90
+ });
91
+ };