@pintahub/database-schemas 1.8.5 → 1.8.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.8.5",
3
+ "version": "1.8.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,6 +3,14 @@ const ImageObject = require('./ImageObject')
3
3
  const PriceRange = require('./PriceRange')
4
4
 
5
5
 
6
+ const ProductSource = new Schema({
7
+ _id: false,
8
+
9
+ job: {
10
+ type: Schema.Types.ObjectId,
11
+ }
12
+ })
13
+
6
14
  const Product = new Schema({
7
15
  store: {
8
16
  type: Schema.Types.ObjectId,
@@ -109,6 +117,7 @@ const Product = new Schema({
109
117
 
110
118
  group: {
111
119
  type: Schema.Types.ObjectId,
120
+ index: true,
112
121
  },
113
122
 
114
123
  last_synced_at: {
@@ -167,6 +176,10 @@ const Product = new Schema({
167
176
  trim: true,
168
177
  },
169
178
 
179
+ source: {
180
+ type: ProductSource,
181
+ },
182
+
170
183
  updated_at: {
171
184
  type: Date,
172
185
  default: Date.now
@@ -0,0 +1,52 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const ProductImport = new Schema({
5
+ store: {
6
+ type: Schema.Types.ObjectId,
7
+ index: true,
8
+ required: true,
9
+ },
10
+
11
+ url: {
12
+ type: String,
13
+ trim: true,
14
+ required: true,
15
+ },
16
+
17
+ status: {
18
+ type: String,
19
+ trim: true,
20
+ default: 'pending',
21
+ index: true,
22
+ },
23
+
24
+ platform: {
25
+ type: String,
26
+ trim: true,
27
+ default: '',
28
+ },
29
+
30
+ auto_detect: {
31
+ type: Boolean,
32
+ default: false,
33
+ },
34
+
35
+ products: {
36
+ type: [Schema.Types.ObjectId],
37
+ default: [],
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
+ index: true,
49
+ }
50
+ })
51
+
52
+ module.exports = ProductImport