@francesco_ksh/app-ksh-mgd-schemas 1.1.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.
@@ -0,0 +1,86 @@
1
+ const mongoose = require('mongoose');
2
+ const Schema = mongoose.Schema;
3
+ const moment = require('moment');
4
+ const consignmentListingSchema = new Schema({
5
+ items: [
6
+ {
7
+ images: {
8
+ type: Array,
9
+ },
10
+ brand: {
11
+ type: String,
12
+ },
13
+ retailLink: {
14
+ type: String,
15
+ },
16
+ otherInfo: {
17
+ type: String,
18
+ },
19
+ },
20
+ ],
21
+
22
+ author: {
23
+ type: Schema.Types.ObjectId,
24
+ ref: 'User',
25
+ },
26
+
27
+ contact: {
28
+ email: {
29
+ type: String,
30
+ },
31
+ phone: {
32
+ type: String,
33
+ },
34
+ firstName: {
35
+ type: String,
36
+ },
37
+ },
38
+
39
+ pickup: {
40
+ address: {
41
+ type: String,
42
+ },
43
+ stairs: {
44
+ type: Boolean,
45
+ },
46
+ elevator: {
47
+ type: Boolean,
48
+ },
49
+ flights: {
50
+ type: Number,
51
+ },
52
+ otherInfo: {
53
+ type: String,
54
+ },
55
+ coordinates: {
56
+ type: [Number],
57
+ required: true,
58
+ },
59
+ },
60
+ acceptedBy: {
61
+ type: Schema.Types.ObjectId,
62
+ ref: 'User',
63
+ },
64
+ declined: [
65
+ {
66
+ type: Schema.Types.ObjectId,
67
+ ref: 'User',
68
+ },
69
+ ],
70
+ status: {
71
+ type: String,
72
+ default: 'sent',
73
+ },
74
+ date: {
75
+ type: Date,
76
+ default: Date.now,
77
+ },
78
+ expiration: {
79
+ type: Date,
80
+ default: moment().add(7, 'days'),
81
+ },
82
+ });
83
+
84
+ consignmentListingSchema.index({ '$**': 'text' });
85
+
86
+ module.exports = consignmentListingSchema;
@@ -0,0 +1,18 @@
1
+ const mongoose = require('mongoose');
2
+ const Schema = mongoose.Schema;
3
+
4
+ const errorSchema = new Schema({
5
+ message: {},
6
+ type: {
7
+ type: String,
8
+ },
9
+ body: {
10
+ type: Object,
11
+ },
12
+ date: {
13
+ type: Date,
14
+ default: Date.now,
15
+ },
16
+ });
17
+
18
+ module.exports = errorSchema;
package/models/Etsy.js ADDED
@@ -0,0 +1,106 @@
1
+ const mongoose = require('mongoose');
2
+ const Schema = mongoose.Schema;
3
+
4
+ const etsySchema = new Schema({
5
+ shop_id: {
6
+ type: String,
7
+ },
8
+ storeUrl: {
9
+ type: String,
10
+ },
11
+ shop_name: {
12
+ type: String,
13
+ },
14
+ user_id: {
15
+ type: String,
16
+ },
17
+ PKCE: {
18
+ codeVerifier: {
19
+ type: String,
20
+ },
21
+ codeChallenge: {
22
+ type: String,
23
+ },
24
+ },
25
+ create_date: {
26
+ type: String,
27
+ },
28
+ title: {
29
+ type: String,
30
+ },
31
+ currency_code: {
32
+ type: String,
33
+ },
34
+ sale_message: {
35
+ type: String,
36
+ },
37
+ listing_active_count: {
38
+ type: String,
39
+ },
40
+ login_name: {
41
+ type: String,
42
+ },
43
+ url: {
44
+ type: String,
45
+ },
46
+ icon_url_fullxfull: {
47
+ type: String,
48
+ },
49
+ transaction_sold_count: {
50
+ type: String,
51
+ },
52
+ shipping_from_country_iso: {
53
+ type: String,
54
+ },
55
+ review_average: {
56
+ type: String,
57
+ },
58
+ requestAuth: {
59
+ type: Boolean,
60
+ default: false,
61
+ },
62
+ review_count: {
63
+ type: String,
64
+ },
65
+ etsyAuthCode: {
66
+ type: String,
67
+ },
68
+ pastUploads: {
69
+ uploading: {
70
+ type: Boolean,
71
+ default: false,
72
+ },
73
+ uploads: {
74
+ type: Array,
75
+ },
76
+ },
77
+ etsyTokens: {
78
+ access_token: {
79
+ type: String,
80
+ },
81
+ token_type: {
82
+ type: String,
83
+ },
84
+ refresh_token: {
85
+ type: String,
86
+ },
87
+ expires_in: {
88
+ type: String,
89
+ },
90
+ date: {
91
+ type: Date,
92
+ },
93
+ },
94
+ user: {
95
+ type: Schema.Types.ObjectId,
96
+ ref: 'User',
97
+ required: true,
98
+ },
99
+ type: { type: String, default: 'Etsy' },
100
+ date: {
101
+ type: Date,
102
+ default: Date.now,
103
+ },
104
+ });
105
+
106
+ module.exports = etsySchema;
@@ -0,0 +1,27 @@
1
+ const mongoose = require('mongoose');
2
+ const Schema = mongoose.Schema;
3
+
4
+ const feedbackSchema = new Schema({
5
+ type: {
6
+ type: String,
7
+ },
8
+ subject: {
9
+ type: String,
10
+ },
11
+ text: {
12
+ type: String,
13
+ },
14
+ rating: {
15
+ type: Number,
16
+ },
17
+ user: {
18
+ type: Schema.Types.ObjectId,
19
+ ref: 'User',
20
+ },
21
+ date: {
22
+ type: Date,
23
+ default: Date.now,
24
+ },
25
+ });
26
+
27
+ module.exports = feedbackSchema;