@pintahub/database-schemas 2.1.8 → 2.2.0

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.8",
3
+ "version": "2.2.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
+
@@ -11,6 +11,25 @@ const ProductSource = new Schema({
11
11
  }
12
12
  })
13
13
 
14
+ const ProductMeta = new Schema({
15
+ _id: false,
16
+
17
+ main_color: {
18
+ type: String,
19
+ trim: true,
20
+ },
21
+
22
+ age_group: {
23
+ type: String,
24
+ trim: true,
25
+ },
26
+
27
+ gender: {
28
+ type: String,
29
+ trim: true,
30
+ },
31
+ })
32
+
14
33
  const Product = new Schema({
15
34
  store: {
16
35
  type: Schema.Types.ObjectId,
@@ -135,6 +154,11 @@ const Product = new Schema({
135
154
  type: Schema.Types.ObjectId,
136
155
  },
137
156
 
157
+ meta: {
158
+ type: ProductMeta,
159
+ default: {}
160
+ },
161
+
138
162
  is_imported: {//temporary filed for importing product
139
163
  type: Boolean,
140
164
  default: false,
@@ -79,6 +79,11 @@ const ProductFeature = new Schema({
79
79
  trim: true,
80
80
  },
81
81
 
82
+ material: {
83
+ type: String,
84
+ trim: true,
85
+ },
86
+
82
87
  reviews_count: {
83
88
  type: Number,
84
89
  default: 0,