@pintahub/database-schemas 1.3.5 → 1.3.7

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.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,37 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+ const Group = new Schema({
4
+ store: {
5
+ type: Schema.Types.ObjectId,
6
+ index: true,
7
+ required: true,
8
+ },
9
+
10
+ title: {
11
+ type: String,
12
+ trim: true,
13
+ },
14
+
15
+ label: {
16
+ type: String,
17
+ trim: true,
18
+ },
19
+
20
+ items_count: {
21
+ type: Number,
22
+ default: 0,
23
+ },
24
+
25
+ updated_at: {
26
+ type: Date,
27
+ default: Date.now
28
+ },
29
+
30
+ created_at: {
31
+ type: Date,
32
+ default: Date.now
33
+ }
34
+ })
35
+
36
+ module.exports = Group
37
+
@@ -0,0 +1,46 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+ const GroupItem = new Schema({
4
+ store: {
5
+ type: Schema.Types.ObjectId,
6
+ index: true,
7
+ required: true,
8
+ },
9
+
10
+ group: {
11
+ type: Schema.Types.ObjectId,
12
+ index: true,
13
+ required: true,
14
+ },
15
+
16
+ product: {
17
+ type: Schema.Types.ObjectId,
18
+ index: true,
19
+ required: true,
20
+ },
21
+
22
+ index: {
23
+ type: Number,
24
+ default: 0,
25
+ },
26
+
27
+ status: {
28
+ type: String,
29
+ default: 'active',
30
+ trim: true,
31
+ index: true
32
+ },
33
+
34
+ updated_at: {
35
+ type: Date,
36
+ default: Date.now
37
+ },
38
+
39
+ created_at: {
40
+ type: Date,
41
+ default: Date.now
42
+ }
43
+ })
44
+
45
+ module.exports = GroupItem
46
+