agrs-sequelize-sdk 1.0.37 → 1.0.39

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/models/Ad.js CHANGED
@@ -75,6 +75,7 @@ module.exports = (sequelize, DataTypes) => {
75
75
  publish:{
76
76
  type: DataTypes.BOOLEAN,
77
77
  allowNull: true,
78
+ defaultValue: true,
78
79
  },
79
80
  createdTime: {
80
81
  type: DataTypes.DATE,
@@ -87,6 +88,7 @@ module.exports = (sequelize, DataTypes) => {
87
88
  Draft: {
88
89
  type: DataTypes.BOOLEAN,
89
90
  allowNull: true,
91
+ defaultValue: false,
90
92
  },
91
93
  UserCreated: {
92
94
  type: DataTypes.STRING,
@@ -152,7 +154,7 @@ module.exports = (sequelize, DataTypes) => {
152
154
  // Save current state to AdHistory
153
155
  await sequelize.models.AdHistory.create({
154
156
  AdID: ad.AdID,
155
- DataSnapshot: ad.get(), // Save the full Ad data as JSON
157
+ DataSnapshot: ad._previousDataValues, // Save the full Ad data as JSON
156
158
  });
157
159
  } else if (ad.previous('publish') === false && ad.publish === true) {
158
160
  // Delete the latest history entry
package/models/AdSet.js CHANGED
@@ -47,6 +47,7 @@ module.exports = (sequelize, DataTypes) => {
47
47
  Draft: {
48
48
  type: DataTypes.BOOLEAN,
49
49
  allowNull: true,
50
+ defaultValue: false,
50
51
  },
51
52
  UserCreated: {
52
53
  type: DataTypes.STRING,
@@ -55,6 +56,7 @@ module.exports = (sequelize, DataTypes) => {
55
56
  publish:{
56
57
  type: DataTypes.BOOLEAN,
57
58
  allowNull: true,
59
+ defaultValue: true,
58
60
  },
59
61
  CampaignID: {
60
62
  type: DataTypes.STRING,
@@ -86,7 +88,7 @@ module.exports = (sequelize, DataTypes) => {
86
88
  // Save current state to AdSetHistory
87
89
  await sequelize.models.AdSetHistory.create({
88
90
  AdSetID: adSet.AdSetID,
89
- DataSnapshot: adSet.get(), // Save the full AdSet data as JSON
91
+ DataSnapshot: adSet._previousDataValues, // Save the full AdSet data as JSON
90
92
  });
91
93
  } else if (adSet.previous('publish') === false && adSet.publish === true) {
92
94
  // Delete the latest history entry
@@ -51,10 +51,12 @@ module.exports = (sequelize, DataTypes) => {
51
51
  Draft: {
52
52
  type: DataTypes.BOOLEAN,
53
53
  allowNull: true,
54
+ defaultValue: false,
54
55
  },
55
56
  publish: {
56
57
  type: DataTypes.BOOLEAN,
57
58
  allowNull: true,
59
+ defaultValue: true,
58
60
  },
59
61
  UserCreated: {
60
62
  type: DataTypes.STRING,
@@ -88,7 +90,7 @@ module.exports = (sequelize, DataTypes) => {
88
90
  // Save current state to CampaignHistory
89
91
  await sequelize.models.CampaignHistory.create({
90
92
  CampaignID: campaign.CampaignID,
91
- DataSnapshot: campaign.get(), // Store current state as JSON
93
+ DataSnapshot: campaign._previousDataValues, // Store current state as JSON
92
94
  });
93
95
  } else if (campaign.previous('publish') === false && campaign.publish === true) {
94
96
  // Delete the latest history entry
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",