@chevre/domain 21.2.0-alpha.91 → 21.2.0-alpha.92
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/lib/chevre/repo/action.js +45 -27
- package/lib/chevre/repo/mongoose/schemas/action.js +6 -0
- package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +1 -0
- package/lib/chevre/service/order/onOrderUpdated.d.ts +1 -0
- package/lib/chevre/service/order/onOrderUpdated.js +1 -1
- package/package.json +3 -3
|
@@ -21,7 +21,7 @@ class MongoRepository {
|
|
|
21
21
|
}
|
|
22
22
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
23
23
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53;
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57;
|
|
25
25
|
const andConditions = [];
|
|
26
26
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
27
27
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
@@ -106,7 +106,25 @@ class MongoRepository {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
const
|
|
109
|
+
const objectReservationNumberEq = (_v = (_u = params.object) === null || _u === void 0 ? void 0 : _u.reservationNumber) === null || _v === void 0 ? void 0 : _v.$eq;
|
|
110
|
+
if (typeof objectReservationNumberEq === 'string') {
|
|
111
|
+
andConditions.push({
|
|
112
|
+
'object.reservationNumber': {
|
|
113
|
+
$exists: true,
|
|
114
|
+
$eq: objectReservationNumberEq
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
const objectReservationNumberIn = (_x = (_w = params.object) === null || _w === void 0 ? void 0 : _w.reservationNumber) === null || _x === void 0 ? void 0 : _x.$in;
|
|
119
|
+
if (Array.isArray(objectReservationNumberIn)) {
|
|
120
|
+
andConditions.push({
|
|
121
|
+
'object.reservationNumber': {
|
|
122
|
+
$exists: true,
|
|
123
|
+
$in: objectReservationNumberIn
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
const objectPaymentMethodAccountIdEq = (_0 = (_z = (_y = params.object) === null || _y === void 0 ? void 0 : _y.paymentMethod) === null || _z === void 0 ? void 0 : _z.accountId) === null || _0 === void 0 ? void 0 : _0.$eq;
|
|
110
128
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
111
129
|
/* istanbul ignore else */
|
|
112
130
|
if (typeof objectPaymentMethodAccountIdEq === 'string') {
|
|
@@ -117,7 +135,7 @@ class MongoRepository {
|
|
|
117
135
|
}
|
|
118
136
|
});
|
|
119
137
|
}
|
|
120
|
-
const objectPaymentMethodPaymentMethodIdEq = (
|
|
138
|
+
const objectPaymentMethodPaymentMethodIdEq = (_3 = (_2 = (_1 = params.object) === null || _1 === void 0 ? void 0 : _1.paymentMethod) === null || _2 === void 0 ? void 0 : _2.paymentMethodId) === null || _3 === void 0 ? void 0 : _3.$eq;
|
|
121
139
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
122
140
|
/* istanbul ignore else */
|
|
123
141
|
if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
|
|
@@ -128,7 +146,7 @@ class MongoRepository {
|
|
|
128
146
|
}
|
|
129
147
|
});
|
|
130
148
|
}
|
|
131
|
-
const objectPaymentMethodPaymentMethodIdIn = (
|
|
149
|
+
const objectPaymentMethodPaymentMethodIdIn = (_6 = (_5 = (_4 = params.object) === null || _4 === void 0 ? void 0 : _4.paymentMethod) === null || _5 === void 0 ? void 0 : _5.paymentMethodId) === null || _6 === void 0 ? void 0 : _6.$in;
|
|
132
150
|
if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
|
|
133
151
|
andConditions.push({
|
|
134
152
|
'object.paymentMethod.paymentMethodId': {
|
|
@@ -137,7 +155,7 @@ class MongoRepository {
|
|
|
137
155
|
}
|
|
138
156
|
});
|
|
139
157
|
}
|
|
140
|
-
const objectPaymentMethodTypeOfEq = (
|
|
158
|
+
const objectPaymentMethodTypeOfEq = (_9 = (_8 = (_7 = params.object) === null || _7 === void 0 ? void 0 : _7.paymentMethod) === null || _8 === void 0 ? void 0 : _8.typeOf) === null || _9 === void 0 ? void 0 : _9.$eq;
|
|
141
159
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
142
160
|
/* istanbul ignore else */
|
|
143
161
|
if (typeof objectPaymentMethodTypeOfEq === 'string') {
|
|
@@ -148,7 +166,7 @@ class MongoRepository {
|
|
|
148
166
|
}
|
|
149
167
|
});
|
|
150
168
|
}
|
|
151
|
-
const objectTypeOfEq = (
|
|
169
|
+
const objectTypeOfEq = (_11 = (_10 = params.object) === null || _10 === void 0 ? void 0 : _10.typeOf) === null || _11 === void 0 ? void 0 : _11.$eq;
|
|
152
170
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
153
171
|
/* istanbul ignore else */
|
|
154
172
|
if (typeof objectTypeOfEq === 'string') {
|
|
@@ -159,7 +177,7 @@ class MongoRepository {
|
|
|
159
177
|
}
|
|
160
178
|
});
|
|
161
179
|
}
|
|
162
|
-
const objectTypeOfIn = (
|
|
180
|
+
const objectTypeOfIn = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.typeOf) === null || _13 === void 0 ? void 0 : _13.$in;
|
|
163
181
|
if (Array.isArray(objectTypeOfIn)) {
|
|
164
182
|
andConditions.push({
|
|
165
183
|
'object.typeOf': {
|
|
@@ -168,7 +186,7 @@ class MongoRepository {
|
|
|
168
186
|
}
|
|
169
187
|
});
|
|
170
188
|
}
|
|
171
|
-
const objectIdEq = (
|
|
189
|
+
const objectIdEq = (_15 = (_14 = params.object) === null || _14 === void 0 ? void 0 : _14.id) === null || _15 === void 0 ? void 0 : _15.$eq;
|
|
172
190
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
173
191
|
/* istanbul ignore else */
|
|
174
192
|
if (typeof objectIdEq === 'string') {
|
|
@@ -179,7 +197,7 @@ class MongoRepository {
|
|
|
179
197
|
}
|
|
180
198
|
});
|
|
181
199
|
}
|
|
182
|
-
const objectIdIn = (
|
|
200
|
+
const objectIdIn = (_17 = (_16 = params.object) === null || _16 === void 0 ? void 0 : _16.id) === null || _17 === void 0 ? void 0 : _17.$in;
|
|
183
201
|
if (Array.isArray(objectIdIn)) {
|
|
184
202
|
andConditions.push({
|
|
185
203
|
'object.id': {
|
|
@@ -188,7 +206,7 @@ class MongoRepository {
|
|
|
188
206
|
}
|
|
189
207
|
});
|
|
190
208
|
}
|
|
191
|
-
const objectOrderNumberIn = (
|
|
209
|
+
const objectOrderNumberIn = (_19 = (_18 = params.object) === null || _18 === void 0 ? void 0 : _18.orderNumber) === null || _19 === void 0 ? void 0 : _19.$in;
|
|
192
210
|
if (Array.isArray(objectOrderNumberIn)) {
|
|
193
211
|
andConditions.push({
|
|
194
212
|
'object.orderNumber': {
|
|
@@ -197,7 +215,7 @@ class MongoRepository {
|
|
|
197
215
|
}
|
|
198
216
|
});
|
|
199
217
|
}
|
|
200
|
-
const objectEventIdIn = (
|
|
218
|
+
const objectEventIdIn = (_22 = (_21 = (_20 = params.object) === null || _20 === void 0 ? void 0 : _20.event) === null || _21 === void 0 ? void 0 : _21.id) === null || _22 === void 0 ? void 0 : _22.$in;
|
|
201
219
|
if (Array.isArray(objectEventIdIn)) {
|
|
202
220
|
andConditions.push({
|
|
203
221
|
'object.event.id': {
|
|
@@ -206,7 +224,7 @@ class MongoRepository {
|
|
|
206
224
|
}
|
|
207
225
|
});
|
|
208
226
|
}
|
|
209
|
-
const objectAcceptedOfferSeatNumberIn = (
|
|
227
|
+
const objectAcceptedOfferSeatNumberIn = (_29 = (_28 = (_27 = (_26 = (_25 = (_24 = (_23 = params.object) === null || _23 === void 0 ? void 0 : _23.acceptedOffer) === null || _24 === void 0 ? void 0 : _24.itemOffered) === null || _25 === void 0 ? void 0 : _25.serviceOutput) === null || _26 === void 0 ? void 0 : _26.reservedTicket) === null || _27 === void 0 ? void 0 : _27.ticketedSeat) === null || _28 === void 0 ? void 0 : _28.seatNumber) === null || _29 === void 0 ? void 0 : _29.$in;
|
|
210
228
|
if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
|
|
211
229
|
andConditions.push({
|
|
212
230
|
'object.acceptedOffer.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatNumber': {
|
|
@@ -223,7 +241,7 @@ class MongoRepository {
|
|
|
223
241
|
});
|
|
224
242
|
}
|
|
225
243
|
else {
|
|
226
|
-
const typeOfEq = (
|
|
244
|
+
const typeOfEq = (_30 = params.typeOf) === null || _30 === void 0 ? void 0 : _30.$eq;
|
|
227
245
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
228
246
|
/* istanbul ignore else */
|
|
229
247
|
if (typeof typeOfEq === 'string') {
|
|
@@ -232,7 +250,7 @@ class MongoRepository {
|
|
|
232
250
|
});
|
|
233
251
|
}
|
|
234
252
|
}
|
|
235
|
-
const actionStatusIn = (
|
|
253
|
+
const actionStatusIn = (_31 = params.actionStatus) === null || _31 === void 0 ? void 0 : _31.$in;
|
|
236
254
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
237
255
|
/* istanbul ignore else */
|
|
238
256
|
if (Array.isArray(actionStatusIn)) {
|
|
@@ -263,7 +281,7 @@ class MongoRepository {
|
|
|
263
281
|
startDate: { $lte: startDateLte }
|
|
264
282
|
});
|
|
265
283
|
}
|
|
266
|
-
const fromLocationTypeOfIn = (
|
|
284
|
+
const fromLocationTypeOfIn = (_33 = (_32 = params.fromLocation) === null || _32 === void 0 ? void 0 : _32.typeOf) === null || _33 === void 0 ? void 0 : _33.$in;
|
|
267
285
|
if (Array.isArray(fromLocationTypeOfIn)) {
|
|
268
286
|
andConditions.push({
|
|
269
287
|
'fromLocation.typeOf': {
|
|
@@ -272,7 +290,7 @@ class MongoRepository {
|
|
|
272
290
|
}
|
|
273
291
|
});
|
|
274
292
|
}
|
|
275
|
-
const fromLocationAccountNumberIn = (
|
|
293
|
+
const fromLocationAccountNumberIn = (_35 = (_34 = params.fromLocation) === null || _34 === void 0 ? void 0 : _34.accountNumber) === null || _35 === void 0 ? void 0 : _35.$in;
|
|
276
294
|
if (Array.isArray(fromLocationAccountNumberIn)) {
|
|
277
295
|
andConditions.push({
|
|
278
296
|
'fromLocation.accountNumber': {
|
|
@@ -281,7 +299,7 @@ class MongoRepository {
|
|
|
281
299
|
}
|
|
282
300
|
});
|
|
283
301
|
}
|
|
284
|
-
const fromLocationAccountTypeIn = (
|
|
302
|
+
const fromLocationAccountTypeIn = (_37 = (_36 = params.fromLocation) === null || _36 === void 0 ? void 0 : _36.accountType) === null || _37 === void 0 ? void 0 : _37.$in;
|
|
285
303
|
if (Array.isArray(fromLocationAccountTypeIn)) {
|
|
286
304
|
andConditions.push({
|
|
287
305
|
'fromLocation.accountType': {
|
|
@@ -290,7 +308,7 @@ class MongoRepository {
|
|
|
290
308
|
}
|
|
291
309
|
});
|
|
292
310
|
}
|
|
293
|
-
const toLocationTypeOfIn = (
|
|
311
|
+
const toLocationTypeOfIn = (_39 = (_38 = params.toLocation) === null || _38 === void 0 ? void 0 : _38.typeOf) === null || _39 === void 0 ? void 0 : _39.$in;
|
|
294
312
|
if (Array.isArray(toLocationTypeOfIn)) {
|
|
295
313
|
andConditions.push({
|
|
296
314
|
'toLocation.typeOf': {
|
|
@@ -299,7 +317,7 @@ class MongoRepository {
|
|
|
299
317
|
}
|
|
300
318
|
});
|
|
301
319
|
}
|
|
302
|
-
const toLocationAccountNumberIn = (
|
|
320
|
+
const toLocationAccountNumberIn = (_41 = (_40 = params.toLocation) === null || _40 === void 0 ? void 0 : _40.accountNumber) === null || _41 === void 0 ? void 0 : _41.$in;
|
|
303
321
|
if (Array.isArray(toLocationAccountNumberIn)) {
|
|
304
322
|
andConditions.push({
|
|
305
323
|
'toLocation.accountNumber': {
|
|
@@ -308,7 +326,7 @@ class MongoRepository {
|
|
|
308
326
|
}
|
|
309
327
|
});
|
|
310
328
|
}
|
|
311
|
-
const toLocationAccountTypeIn = (
|
|
329
|
+
const toLocationAccountTypeIn = (_43 = (_42 = params.toLocation) === null || _42 === void 0 ? void 0 : _42.accountType) === null || _43 === void 0 ? void 0 : _43.$in;
|
|
312
330
|
if (Array.isArray(toLocationAccountTypeIn)) {
|
|
313
331
|
andConditions.push({
|
|
314
332
|
'toLocation.accountType': {
|
|
@@ -317,7 +335,7 @@ class MongoRepository {
|
|
|
317
335
|
}
|
|
318
336
|
});
|
|
319
337
|
}
|
|
320
|
-
const purposeTypeOfIn = (
|
|
338
|
+
const purposeTypeOfIn = (_45 = (_44 = params.purpose) === null || _44 === void 0 ? void 0 : _44.typeOf) === null || _45 === void 0 ? void 0 : _45.$in;
|
|
321
339
|
if (Array.isArray(purposeTypeOfIn)) {
|
|
322
340
|
andConditions.push({
|
|
323
341
|
'purpose.typeOf': {
|
|
@@ -326,7 +344,7 @@ class MongoRepository {
|
|
|
326
344
|
}
|
|
327
345
|
});
|
|
328
346
|
}
|
|
329
|
-
const purposeIdIn = (
|
|
347
|
+
const purposeIdIn = (_47 = (_46 = params.purpose) === null || _46 === void 0 ? void 0 : _46.id) === null || _47 === void 0 ? void 0 : _47.$in;
|
|
330
348
|
if (Array.isArray(purposeIdIn)) {
|
|
331
349
|
andConditions.push({
|
|
332
350
|
'purpose.id': {
|
|
@@ -335,7 +353,7 @@ class MongoRepository {
|
|
|
335
353
|
}
|
|
336
354
|
});
|
|
337
355
|
}
|
|
338
|
-
const purposeOrderNumberIn = (
|
|
356
|
+
const purposeOrderNumberIn = (_49 = (_48 = params.purpose) === null || _48 === void 0 ? void 0 : _48.orderNumber) === null || _49 === void 0 ? void 0 : _49.$in;
|
|
339
357
|
if (Array.isArray(purposeOrderNumberIn)) {
|
|
340
358
|
andConditions.push({
|
|
341
359
|
'purpose.orderNumber': {
|
|
@@ -344,7 +362,7 @@ class MongoRepository {
|
|
|
344
362
|
}
|
|
345
363
|
});
|
|
346
364
|
}
|
|
347
|
-
const resultTypeOfIn = (
|
|
365
|
+
const resultTypeOfIn = (_51 = (_50 = params.result) === null || _50 === void 0 ? void 0 : _50.typeOf) === null || _51 === void 0 ? void 0 : _51.$in;
|
|
348
366
|
if (Array.isArray(resultTypeOfIn)) {
|
|
349
367
|
andConditions.push({
|
|
350
368
|
'result.typeOf': {
|
|
@@ -353,7 +371,7 @@ class MongoRepository {
|
|
|
353
371
|
}
|
|
354
372
|
});
|
|
355
373
|
}
|
|
356
|
-
const resultIdIn = (
|
|
374
|
+
const resultIdIn = (_53 = (_52 = params.result) === null || _52 === void 0 ? void 0 : _52.id) === null || _53 === void 0 ? void 0 : _53.$in;
|
|
357
375
|
if (Array.isArray(resultIdIn)) {
|
|
358
376
|
andConditions.push({
|
|
359
377
|
'result.id': {
|
|
@@ -362,7 +380,7 @@ class MongoRepository {
|
|
|
362
380
|
}
|
|
363
381
|
});
|
|
364
382
|
}
|
|
365
|
-
const resultOrderNumberIn = (
|
|
383
|
+
const resultOrderNumberIn = (_55 = (_54 = params.result) === null || _54 === void 0 ? void 0 : _54.orderNumber) === null || _55 === void 0 ? void 0 : _55.$in;
|
|
366
384
|
if (Array.isArray(resultOrderNumberIn)) {
|
|
367
385
|
andConditions.push({
|
|
368
386
|
'result.orderNumber': {
|
|
@@ -371,7 +389,7 @@ class MongoRepository {
|
|
|
371
389
|
}
|
|
372
390
|
});
|
|
373
391
|
}
|
|
374
|
-
const resultCodeIn = (
|
|
392
|
+
const resultCodeIn = (_57 = (_56 = params.result) === null || _56 === void 0 ? void 0 : _56.code) === null || _57 === void 0 ? void 0 : _57.$in;
|
|
375
393
|
if (Array.isArray(resultCodeIn)) {
|
|
376
394
|
andConditions.push({
|
|
377
395
|
'result.code': {
|
|
@@ -177,6 +177,12 @@ schema.index({ 'object.reservationFor.id': 1, startDate: -1 }, {
|
|
|
177
177
|
'object.reservationFor.id': { $exists: true }
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
+
schema.index({ 'object.reservationNumber': 1, startDate: -1 }, {
|
|
181
|
+
name: 'searchByObjectReservationNumber',
|
|
182
|
+
partialFilterExpression: {
|
|
183
|
+
'object.reservationNumber': { $exists: true }
|
|
184
|
+
}
|
|
185
|
+
});
|
|
180
186
|
schema.index({ 'object.reservedTicket.ticketType.id': 1, startDate: -1 }, {
|
|
181
187
|
name: 'searchByObjectReservedTicketTicketTypeId',
|
|
182
188
|
partialFilterExpression: {
|
|
@@ -8,6 +8,7 @@ export declare function getOrderWithToken(params: {
|
|
|
8
8
|
}): Promise<factory.order.IOrder | IOrderWithToken>;
|
|
9
9
|
export type IUpdatedOrder4inform = Pick<factory.order.IOrder, 'typeOf' | 'orderNumber' | 'name' | 'additionalProperty' | 'project'> & {
|
|
10
10
|
orderStatus?: undefined;
|
|
11
|
+
updatedAt: Date;
|
|
11
12
|
};
|
|
12
13
|
export declare function createInformTasks(order: factory.order.IOrder | IOrderWithToken | IUpdatedOrder4inform): factory.task.IAttributes<factory.taskName.TriggerWebhook>[];
|
|
13
14
|
export declare function createConfirmReservationActionObject4ChevreByOrder(params: {
|
|
@@ -15,7 +15,7 @@ const factory_1 = require("./onOrderStatusChanged/factory");
|
|
|
15
15
|
function onOrderUpdated(params) {
|
|
16
16
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
let tasks = [];
|
|
18
|
-
tasks = (0, factory_1.createInformTasks)(Object.assign(Object.assign({ typeOf: factory.order.OrderType.Order, orderNumber: params.orderNumber, project: { id: params.project.id, typeOf: factory.organizationType.Project } }, (typeof params.name === 'string') ? { name: params.name } : undefined), (Array.isArray(params.additionalProperty)) ? { additionalProperty: params.additionalProperty } : undefined));
|
|
18
|
+
tasks = (0, factory_1.createInformTasks)(Object.assign(Object.assign({ typeOf: factory.order.OrderType.Order, orderNumber: params.orderNumber, project: { id: params.project.id, typeOf: factory.organizationType.Project }, updatedAt: params.updatedAt }, (typeof params.name === 'string') ? { name: params.name } : undefined), (Array.isArray(params.additionalProperty)) ? { additionalProperty: params.additionalProperty } : undefined));
|
|
19
19
|
yield repos.task.saveMany(tasks, { emitImmediately: true });
|
|
20
20
|
});
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.313.0-alpha.
|
|
13
|
-
"@cinerino/sdk": "3.157.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.313.0-alpha.23",
|
|
13
|
+
"@cinerino/sdk": "3.157.0-alpha.6",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"postversion": "git push origin --tags",
|
|
118
118
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
119
119
|
},
|
|
120
|
-
"version": "21.2.0-alpha.
|
|
120
|
+
"version": "21.2.0-alpha.92"
|
|
121
121
|
}
|