@pintahub/database-schemas 2.2.0 → 2.2.2

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.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,48 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const CustomField = new Schema({
5
+ customize: {
6
+ type: Schema.Types.ObjectId,
7
+ index: true,
8
+ required: true,
9
+ },
10
+
11
+ type: {
12
+ type: String,
13
+ trim: true,
14
+ required: true,
15
+ },
16
+
17
+ label: {
18
+ type: String,
19
+ trim: true,
20
+ },
21
+
22
+ required: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
26
+
27
+ description: {
28
+ type: String,
29
+ trim: true,
30
+ },
31
+
32
+ placeholder: {
33
+ type: String,
34
+ trim: true,
35
+ },
36
+
37
+ updated_at: {
38
+ type: Date,
39
+ default: Date.now
40
+ },
41
+
42
+ created_at: {
43
+ type: Date,
44
+ default: Date.now
45
+ }
46
+ })
47
+
48
+ module.exports = CustomField
@@ -0,0 +1,35 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const Customize = new Schema({
5
+ product: {
6
+ type: Schema.Types.ObjectId,
7
+ index: true,
8
+ required: true,
9
+ },
10
+
11
+ status: {
12
+ type: String,
13
+ trim: true,
14
+ default: 'draft',
15
+ enum: ['draft', 'active'],
16
+ index: true,
17
+ },
18
+
19
+ version: {
20
+ type: String,
21
+ default: 'basic'
22
+ },
23
+
24
+ updated_at: {
25
+ type: Date,
26
+ default: Date.now
27
+ },
28
+
29
+ created_at: {
30
+ type: Date,
31
+ default: Date.now
32
+ }
33
+ })
34
+
35
+ module.exports = Customize
@@ -122,6 +122,10 @@ const Product = new Schema({
122
122
  type: Schema.Types.ObjectId,
123
123
  },
124
124
 
125
+ raw: {
126
+ type: Schema.Types.ObjectId,
127
+ },
128
+
125
129
  is_sale_off: {
126
130
  type: Boolean,
127
131
  default: false,
@@ -238,6 +242,10 @@ const Product = new Schema({
238
242
  index: true,
239
243
  },
240
244
 
245
+ customize: {
246
+ type: Schema.Types.ObjectId,
247
+ },
248
+
241
249
  updated_at: {
242
250
  type: Date,
243
251
  default: Date.now