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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "8.2.6",
3
+ "version": "8.2.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -192,8 +192,9 @@ const CustomerSchema = new mongoose.Schema({
192
192
  required: true
193
193
  },
194
194
  documentType: {
195
- type: String,
196
- required: true
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);
@@ -89,7 +89,15 @@ const ticketSchema = new mongoose.Schema({
89
89
  {
90
90
  description: {
91
91
  type: String,
92
- required: false,
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
  });
@@ -77,8 +77,9 @@ const unitSchema = new mongoose.Schema({
77
77
  required: true
78
78
  },
79
79
  documentType: {
80
- type: String,
81
- required: true
80
+ type: mongoose.Schema.Types.ObjectId,
81
+ ref: "DocumentType",
82
+ required: true,
82
83
  },
83
84
  document: {
84
85
  type: String,