agrs-sequelize-sdk 1.2.36 → 1.2.38
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/DynamicFeed.js +90 -0
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
module.exports = (sequelize, DataTypes) => {
|
|
2
|
+
const DynamicFeed = sequelize.define(
|
|
3
|
+
"DynamicFeed",
|
|
4
|
+
{
|
|
5
|
+
id: {
|
|
6
|
+
type: DataTypes.INTEGER,
|
|
7
|
+
primaryKey: true,
|
|
8
|
+
autoIncrement: true,
|
|
9
|
+
},
|
|
10
|
+
// Feed Details
|
|
11
|
+
feed_type: {
|
|
12
|
+
type: DataTypes.ENUM('N2S', 'Type-In', 'AFD', 'RSOC'),
|
|
13
|
+
allowNull: true,
|
|
14
|
+
},
|
|
15
|
+
feed: {
|
|
16
|
+
type: DataTypes.ENUM('Direct', 'Partner', '3rd Party'),
|
|
17
|
+
allowNull: true,
|
|
18
|
+
},
|
|
19
|
+
feed_name: {
|
|
20
|
+
type: DataTypes.STRING,
|
|
21
|
+
allowNull: false,
|
|
22
|
+
},
|
|
23
|
+
feed_short_name: {
|
|
24
|
+
type: DataTypes.STRING,
|
|
25
|
+
allowNull: true,
|
|
26
|
+
},
|
|
27
|
+
feed_logo: {
|
|
28
|
+
type: DataTypes.TEXT,
|
|
29
|
+
allowNull: true,
|
|
30
|
+
},
|
|
31
|
+
// Targeting Rules
|
|
32
|
+
accepted_devices: {
|
|
33
|
+
type: DataTypes.JSON,
|
|
34
|
+
allowNull: true,
|
|
35
|
+
},
|
|
36
|
+
search_engine: {
|
|
37
|
+
type: DataTypes.JSON,
|
|
38
|
+
allowNull: true,
|
|
39
|
+
},
|
|
40
|
+
country: {
|
|
41
|
+
type: DataTypes.STRING,
|
|
42
|
+
allowNull: true,
|
|
43
|
+
},
|
|
44
|
+
generated_url: {
|
|
45
|
+
type: DataTypes.STRING,
|
|
46
|
+
allowNull: false,
|
|
47
|
+
},
|
|
48
|
+
token: {
|
|
49
|
+
type: DataTypes.STRING,
|
|
50
|
+
allowNull: true,
|
|
51
|
+
},
|
|
52
|
+
is_active: {
|
|
53
|
+
type: DataTypes.BOOLEAN,
|
|
54
|
+
defaultValue: true,
|
|
55
|
+
allowNull: true,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
tableName: "dynamic_feeds",
|
|
60
|
+
indexes: [
|
|
61
|
+
{
|
|
62
|
+
fields: ["token"],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
fields: ["generated_url"],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
fields: ["is_active"],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
fields: ["feed_type"],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
fields: ["country"],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
DynamicFeed.associate = (models) => {
|
|
81
|
+
// Add associations here when needed
|
|
82
|
+
// Example:
|
|
83
|
+
// DynamicFeed.hasMany(models.FeedLogs, {
|
|
84
|
+
// foreignKey: "feed_id",
|
|
85
|
+
// as: "Logs",
|
|
86
|
+
// });
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return DynamicFeed;
|
|
90
|
+
};
|