@pintahub/database-schemas 2.1.7 → 2.1.9

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": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -38,6 +38,7 @@ const Collection = new Schema({
38
38
 
39
39
  products_count: {
40
40
  type: Number,
41
+ index: true,
41
42
  },
42
43
 
43
44
  show_on_homepage: {
@@ -0,0 +1,75 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const ExportJob = new Schema({
5
+ store: {
6
+ type: Schema.Types.ObjectId,
7
+ required: true,
8
+ index: true
9
+ },
10
+
11
+ zone: {
12
+ type: String,
13
+ trim: true,
14
+ required: true,
15
+ },
16
+
17
+ template: {
18
+ type: String,
19
+ trim: true,
20
+ },
21
+
22
+ filter: {
23
+ type: Schema.Types.Mixed,
24
+ default: {}
25
+ },
26
+
27
+ query: {
28
+ type: Schema.Types.Mixed,
29
+ default: {}
30
+ },
31
+
32
+ status: {
33
+ type: String,
34
+ trim: true,
35
+ default: 'pending',
36
+ enum: ['pending', 'completed', 'failed']
37
+ },
38
+
39
+ processing_rows: {
40
+ type: Number,
41
+ default: 0,
42
+ },
43
+
44
+ rows_count: {
45
+ type: Number,
46
+ },
47
+
48
+ path_file: {
49
+ type: String,
50
+ trim: true
51
+ },
52
+
53
+ error_message: {
54
+ type: String,
55
+ trim: true
56
+ },
57
+
58
+ created_by: {
59
+ type: Schema.Types.ObjectId,
60
+ },
61
+
62
+ updated_at: {
63
+ type: Date,
64
+ default: Date.now
65
+ },
66
+
67
+ created_at: {
68
+ type: Date,
69
+ default: Date.now,
70
+ index: true
71
+ }
72
+ })
73
+
74
+ module.exports = ExportJob
75
+