agrs-sequelize-sdk 1.1.71 → 1.1.72

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 (2) hide show
  1. package/models/Article.js +22 -1
  2. package/package.json +1 -1
package/models/Article.js CHANGED
@@ -78,6 +78,27 @@ module.exports = (sequelize, DataTypes) => {
78
78
  type: DataTypes.STRING,
79
79
  allowNull: false,
80
80
  defaultValue: "pending",
81
+ validate: {
82
+ isIn: [
83
+ [
84
+ "pending",
85
+ "approved",
86
+ "rejected",
87
+ "disapproved",
88
+ "duplicated",
89
+ "keyword_already_exists",
90
+ "invalid_vertical",
91
+ "invalid_language",
92
+ "in_review",
93
+ "error",
94
+ ],
95
+ ],
96
+ },
97
+ },
98
+ originalStatus: {
99
+ type: DataTypes.STRING,
100
+ allowNull: true,
101
+ comment: "Original status from Predicto before any mapping",
81
102
  },
82
103
  creationType: {
83
104
  type: DataTypes.STRING,
@@ -124,7 +145,7 @@ module.exports = (sequelize, DataTypes) => {
124
145
  };
125
146
 
126
147
  Article.prototype.isAvailableForCampaign = function () {
127
- return this.status === "approved";
148
+ return ["approved", "keyword_already_exists"].includes(this.status);
128
149
  };
129
150
 
130
151
  return Article;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.1.71",
3
+ "version": "1.1.72",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",