payservedb 8.2.6 → 8.2.8
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 +1 -1
- package/src/models/customer.js +4 -2
- package/src/models/tickets.js +51 -1
- package/src/models/units.js +3 -2
package/package.json
CHANGED
package/src/models/customer.js
CHANGED
|
@@ -192,8 +192,9 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
192
192
|
required: true
|
|
193
193
|
},
|
|
194
194
|
documentType: {
|
|
195
|
-
type:
|
|
196
|
-
|
|
195
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
196
|
+
ref: "DocumentType",
|
|
197
|
+
required: true,
|
|
197
198
|
},
|
|
198
199
|
document: {
|
|
199
200
|
type: String,
|
|
@@ -201,6 +202,7 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
204
|
]
|
|
205
|
+
|
|
204
206
|
});
|
|
205
207
|
|
|
206
208
|
const Customer = mongoose.model('Customer', CustomerSchema);
|
package/src/models/tickets.js
CHANGED
|
@@ -89,7 +89,15 @@ const ticketSchema = new mongoose.Schema({
|
|
|
89
89
|
{
|
|
90
90
|
description: {
|
|
91
91
|
type: String,
|
|
92
|
-
required:
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
quantity: {
|
|
95
|
+
type: Number,
|
|
96
|
+
required: true,
|
|
97
|
+
},
|
|
98
|
+
unitPrice: {
|
|
99
|
+
type: Number,
|
|
100
|
+
required: true,
|
|
93
101
|
},
|
|
94
102
|
amount: {
|
|
95
103
|
type: Number,
|
|
@@ -121,6 +129,48 @@ const ticketSchema = new mongoose.Schema({
|
|
|
121
129
|
type: Boolean,
|
|
122
130
|
required: false,
|
|
123
131
|
},
|
|
132
|
+
ongoingSince: {
|
|
133
|
+
type: Date,
|
|
134
|
+
required: false,
|
|
135
|
+
},
|
|
136
|
+
totalOngoingDuration: {
|
|
137
|
+
type: Number, // in milliseconds
|
|
138
|
+
default: 0,
|
|
139
|
+
},
|
|
140
|
+
cancellationReason: {
|
|
141
|
+
type: String,
|
|
142
|
+
required: false,
|
|
143
|
+
},
|
|
144
|
+
cancellationReason: {
|
|
145
|
+
type: String,
|
|
146
|
+
required: false,
|
|
147
|
+
},
|
|
148
|
+
cancelledAt: {
|
|
149
|
+
type: Date,
|
|
150
|
+
required: false,
|
|
151
|
+
},
|
|
152
|
+
cancelledBy: {
|
|
153
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
154
|
+
ref: 'User',
|
|
155
|
+
required: false,
|
|
156
|
+
},
|
|
157
|
+
reopenedReason: {
|
|
158
|
+
type: String,
|
|
159
|
+
required: false,
|
|
160
|
+
},
|
|
161
|
+
reopenedAt: {
|
|
162
|
+
type: Date,
|
|
163
|
+
required: false,
|
|
164
|
+
},
|
|
165
|
+
reopenedBy: {
|
|
166
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
167
|
+
ref: 'User',
|
|
168
|
+
required: false,
|
|
169
|
+
},
|
|
170
|
+
reopenCount: {
|
|
171
|
+
type: Number,
|
|
172
|
+
default: 0,
|
|
173
|
+
},
|
|
124
174
|
}, {
|
|
125
175
|
timestamps: true,
|
|
126
176
|
});
|
package/src/models/units.js
CHANGED