@b2y/ecommerce-common 1.1.0 → 1.1.2

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.
@@ -50,6 +50,8 @@ const initializeModels = (sequelize) => {
50
50
  SubscriptionFeature,
51
51
  SubscriptionPlanFeature,
52
52
  TenantSubscription,
53
+ ProductImport,
54
+ ProductImportFailureAudits
53
55
  } = models;
54
56
  Category.hasMany(Category, {
55
57
  foreignKey: "ParentCategoryID",
@@ -414,7 +416,17 @@ const initializeModels = (sequelize) => {
414
416
  foreignKey: "SubscriptionPlanID",
415
417
  as: "SubscriptionPlan",
416
418
  });
419
+
420
+ // ProductImport and ProductImportFailureAudits
421
+ ProductImport.hasMany(ProductImportFailureAudits, {
422
+ foreignKey: 'ProductImportID',
423
+ as: "ProductImportFailureAudits",
424
+ });
417
425
 
426
+ ProductImportFailureAudits.belongsTo(ProductImport, {
427
+ foreignKey: 'ProductImportID',
428
+ as: 'ProductImport'
429
+ })
418
430
  return { ...models };
419
431
  };
420
432
  module.exports = initializeModels;
@@ -0,0 +1,7 @@
1
+ const BulkImportStatusEnum = Object.freeze({
2
+ SUCCESS: "Success",
3
+ FAILURE: "Failure",
4
+ PARTIAL_SUCCESS: "Partial Success"
5
+ });
6
+
7
+ module.exports = BulkImportStatusEnum;
@@ -0,0 +1,56 @@
1
+ const { DataTypes } = require("sequelize");
2
+ const BulkImportStatusEnum = require("../enum/BulkImportStatusEnum");
3
+ module.exports = (sequelize) => {
4
+ return sequelize.define(
5
+ "ProductImport",
6
+ {
7
+ ProductImportID: {
8
+ type: DataTypes.UUID,
9
+ primaryKey: true,
10
+ allowNull: false,
11
+ defaultValue: DataTypes.UUIDV4,
12
+ },
13
+ TenantID: {
14
+ type: DataTypes.UUID,
15
+ allowNull: false,
16
+ references: {
17
+ model: "Tenant",
18
+ key: "TenantID",
19
+ },
20
+ onDelete: "CASCADE",
21
+ onUpdate: "CASCADE",
22
+ },
23
+ FileName: {
24
+ type: DataTypes.STRING(100),
25
+ allowNull: false,
26
+ unique: true,
27
+ },
28
+ Status: {
29
+ type: DataTypes.ENUM(...Object.values(BulkImportStatusEnum)),
30
+ allowNull: false,
31
+ },
32
+ CreatedBy: {
33
+ type: DataTypes.UUID,
34
+ allowNull: false,
35
+ },
36
+ CreatedAt: {
37
+ type: DataTypes.DATE,
38
+ allowNull: false,
39
+ defaultValue: DataTypes.NOW,
40
+ },
41
+ UpdatedBy: {
42
+ type: DataTypes.UUID,
43
+ allowNull: false,
44
+ },
45
+ UpdatedAt: {
46
+ type: DataTypes.DATE,
47
+ allowNull: false,
48
+ defaultValue: DataTypes.NOW,
49
+ },
50
+ },
51
+ {
52
+ tableName: "ProductImport",
53
+ timestamps: false,
54
+ },
55
+ );
56
+ };
@@ -0,0 +1,58 @@
1
+ const { DataTypes } = require('sequelize');
2
+ module.exports = (sequelize) => {
3
+ return sequelize.define(
4
+ "ProductImportFailureAudits",
5
+ {
6
+ ProductImportFailureAuditsID: {
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
+ ProductImportID: {
23
+ type: DataTypes.UUID,
24
+ allowNull: false,
25
+ },
26
+ FailureReason: {
27
+ type: DataTypes.TEXT,
28
+ allowNull: false,
29
+ },
30
+ FailureRow: {
31
+ type: DataTypes.INTEGER,
32
+ allowNull: false,
33
+ },
34
+ CreatedBy: {
35
+ type: DataTypes.UUID,
36
+ allowNull: false,
37
+ },
38
+ CreatedAt: {
39
+ type: DataTypes.DATE,
40
+ allowNull: false,
41
+ defaultValue: DataTypes.NOW,
42
+ },
43
+ UpdatedBy: {
44
+ type: DataTypes.UUID,
45
+ allowNull: false,
46
+ },
47
+ UpdatedAt: {
48
+ type: DataTypes.DATE,
49
+ allowNull: false,
50
+ defaultValue: DataTypes.NOW,
51
+ },
52
+ },
53
+ {
54
+ tableName: "ProductImportFailureAudits",
55
+ timestamps: false,
56
+ },
57
+ );
58
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b2y/ecommerce-common",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "E-commerce common library",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,8 +27,9 @@ class PdfUtil {
27
27
  try {
28
28
  // Launch puppeteer
29
29
  browser = await puppeteer.launch({
30
+ executablePath: '/usr/bin/chromium',
30
31
  headless: true,
31
- args: ['--no-sandbox', '--disable-setuid-sandbox']
32
+ args: ['--no-sandbox', '--disable-setuid-sandbox','--disable-dev-shm-usage']
32
33
  });
33
34
 
34
35
  const page = await browser.newPage();