agrs-sequelize-sdk 1.2.71 → 1.2.73

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/Rule.js CHANGED
@@ -2,7 +2,7 @@ const { DataTypes } = require("sequelize");
2
2
 
3
3
  module.exports = (sequelize) => {
4
4
  const Rule = sequelize.define(
5
- "Rule",
5
+ "AutomationRule", // Change model name to avoid conflict
6
6
  {
7
7
  id: {
8
8
  type: DataTypes.UUID,
@@ -11,7 +11,7 @@ module.exports = (sequelize) => {
11
11
  },
12
12
  name: {
13
13
  type: DataTypes.STRING,
14
- allowNull: false,
14
+ allowNull: true,
15
15
  comment: "Rule name for identification",
16
16
  },
17
17
  code: {
@@ -77,7 +77,7 @@ module.exports = (sequelize) => {
77
77
 
78
78
  RuleAction.associate = (models) => {
79
79
  // An action belongs to a rule
80
- RuleAction.belongsTo(models.Rule, {
80
+ RuleAction.belongsTo(models.AutomationRule, {
81
81
  foreignKey: "ruleId",
82
82
  as: "rule",
83
83
  });
@@ -76,7 +76,7 @@ module.exports = (sequelize) => {
76
76
 
77
77
  RuleCondition.associate = (models) => {
78
78
  // A condition belongs to a rule
79
- RuleCondition.belongsTo(models.Rule, {
79
+ RuleCondition.belongsTo(models.AutomationRule, {
80
80
  foreignKey: "ruleId",
81
81
  as: "rule",
82
82
  });
@@ -92,7 +92,7 @@ module.exports = (sequelize) => {
92
92
 
93
93
  RuleExecution.associate = (models) => {
94
94
  // An execution belongs to a rule
95
- RuleExecution.belongsTo(models.Rule, {
95
+ RuleExecution.belongsTo(models.AutomationRule, {
96
96
  foreignKey: "ruleId",
97
97
  as: "rule",
98
98
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.2.71",
3
+ "version": "1.2.73",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",