@b2y/ecommerce-common 1.3.0 → 1.3.1
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.
package/dbconnection/Connect.js
CHANGED
|
@@ -51,7 +51,8 @@ const initializeModels = (sequelize) => {
|
|
|
51
51
|
SubscriptionPlanFeature,
|
|
52
52
|
TenantSubscription,
|
|
53
53
|
ProductImport,
|
|
54
|
-
ProductImportFailureAudits
|
|
54
|
+
ProductImportFailureAudits,
|
|
55
|
+
PackagingBox
|
|
55
56
|
} = models;
|
|
56
57
|
Category.hasMany(Category, {
|
|
57
58
|
foreignKey: "ParentCategoryID",
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const { DataTypes } = require('sequelize');
|
|
2
|
+
module.exports = (sequelize) => {
|
|
3
|
+
return sequelize.define('PackagingBox', {
|
|
4
|
+
PackagingBoxID: {
|
|
5
|
+
type: DataTypes.UUID,
|
|
6
|
+
primaryKey: true,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
defaultValue: DataTypes.UUIDV4
|
|
9
|
+
},
|
|
10
|
+
TenantID: {
|
|
11
|
+
type: DataTypes.UUID,
|
|
12
|
+
allowNull: false,
|
|
13
|
+
references: {
|
|
14
|
+
model: 'Tenant',
|
|
15
|
+
key: 'TenantID'
|
|
16
|
+
},
|
|
17
|
+
onDelete: 'CASCADE',
|
|
18
|
+
onUpdate: 'CASCADE'
|
|
19
|
+
},
|
|
20
|
+
PackageType: {
|
|
21
|
+
type: DataTypes.STRING(255),
|
|
22
|
+
allowNull: false,
|
|
23
|
+
},
|
|
24
|
+
PackageName: {
|
|
25
|
+
type: DataTypes.STRING(100),
|
|
26
|
+
allowNull: false
|
|
27
|
+
},
|
|
28
|
+
Length: {
|
|
29
|
+
type: DataTypes.DECIMAL(10, 2),
|
|
30
|
+
allowNull: false
|
|
31
|
+
},
|
|
32
|
+
Width: {
|
|
33
|
+
type: DataTypes.DECIMAL(10, 2),
|
|
34
|
+
allowNull: false
|
|
35
|
+
},
|
|
36
|
+
Height: {
|
|
37
|
+
type: DataTypes.DECIMAL(10, 2),
|
|
38
|
+
allowNull: true
|
|
39
|
+
},
|
|
40
|
+
Unit: {
|
|
41
|
+
type: DataTypes.STRING(5),
|
|
42
|
+
allowNull: false
|
|
43
|
+
},
|
|
44
|
+
EmptyWeight: {
|
|
45
|
+
type: DataTypes.DECIMAL(10, 2),
|
|
46
|
+
allowNull: false
|
|
47
|
+
},
|
|
48
|
+
WeightUnit: {
|
|
49
|
+
type: DataTypes.STRING(5),
|
|
50
|
+
allowNull: false,
|
|
51
|
+
},
|
|
52
|
+
IsDefaultPackage: {
|
|
53
|
+
type: DataTypes.BOOLEAN,
|
|
54
|
+
defaultValue: false
|
|
55
|
+
},
|
|
56
|
+
CreatedBy: {
|
|
57
|
+
type: DataTypes.UUID,
|
|
58
|
+
allowNull: false
|
|
59
|
+
},
|
|
60
|
+
CreatedAt: {
|
|
61
|
+
type: DataTypes.DATE,
|
|
62
|
+
allowNull: false,
|
|
63
|
+
defaultValue: DataTypes.NOW
|
|
64
|
+
},
|
|
65
|
+
UpdatedBy: {
|
|
66
|
+
type: DataTypes.UUID,
|
|
67
|
+
allowNull: false
|
|
68
|
+
},
|
|
69
|
+
UpdatedAt: {
|
|
70
|
+
type: DataTypes.DATE,
|
|
71
|
+
allowNull: false,
|
|
72
|
+
defaultValue: DataTypes.NOW
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
tableName: 'PackagingBox',
|
|
76
|
+
timestamps: false
|
|
77
|
+
});
|
|
78
|
+
};
|
package/model/ProductVariant.js
CHANGED
|
@@ -51,6 +51,32 @@ module.exports = (sequelize) => {
|
|
|
51
51
|
type: DataTypes.BOOLEAN,
|
|
52
52
|
defaultValue: true
|
|
53
53
|
},
|
|
54
|
+
Weight: {
|
|
55
|
+
type: DataTypes.DECIMAL(10, 2),
|
|
56
|
+
allowNull: false
|
|
57
|
+
},
|
|
58
|
+
Unit: {
|
|
59
|
+
type: DataTypes.STRING(5),
|
|
60
|
+
allowNull: false
|
|
61
|
+
},
|
|
62
|
+
CountryCode: {
|
|
63
|
+
type: DataTypes.STRING(2),
|
|
64
|
+
allowNull: true
|
|
65
|
+
},
|
|
66
|
+
HSCode: {
|
|
67
|
+
type: DataTypes.STRING(10),
|
|
68
|
+
allowNull: true
|
|
69
|
+
},
|
|
70
|
+
PackagingBoxID: {
|
|
71
|
+
type: DataTypes.UUID,
|
|
72
|
+
allowNull: false,
|
|
73
|
+
references: {
|
|
74
|
+
model: 'PackagingBox',
|
|
75
|
+
key: 'PackagingBoxID'
|
|
76
|
+
},
|
|
77
|
+
onDelete: 'RESTRICT',
|
|
78
|
+
onUpdate: 'CASCADE'
|
|
79
|
+
},
|
|
54
80
|
GroupByAttributeValue: {
|
|
55
81
|
type: DataTypes.UUID,
|
|
56
82
|
allowNull: true,
|