@pintahub/database-schemas 1.4.7 → 1.4.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pintahub/database-schemas",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,52 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const Campaign = new Schema({
5
+ store: {
6
+ type: Schema.Types.ObjectId,
7
+ index: true,
8
+ required: true,
9
+ },
10
+
11
+ title: {
12
+ type: String,
13
+ trim: true,
14
+ },
15
+
16
+ tags: {
17
+ type: [String],
18
+ trim: true,
19
+ default: [],
20
+ index: true,
21
+ },
22
+
23
+ status: {
24
+ type: String,
25
+ default: 'draft',
26
+ trim: true,
27
+ index: true
28
+ },
29
+
30
+ is_temporary: {
31
+ type: Boolean,
32
+ default: true,
33
+ index: true,
34
+ },
35
+
36
+ group: {
37
+ type: Schema.Types.ObjectId,
38
+ },
39
+
40
+ updated_at: {
41
+ type: Date,
42
+ default: Date.now
43
+ },
44
+
45
+ created_at: {
46
+ type: Date,
47
+ default: Date.now
48
+ }
49
+ })
50
+
51
+ module.exports = Campaign
52
+
@@ -100,6 +100,10 @@ const Product = new Schema({
100
100
  type: Schema.Types.ObjectId,
101
101
  },
102
102
 
103
+ campaign: {
104
+ type: Schema.Types.ObjectId,
105
+ },
106
+
103
107
  last_synced_at: {
104
108
  type: Date,
105
109
  default: Date.now