@chevre/domain 21.20.0-alpha.9 → 21.20.1
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/example/src/chevre/findTransactionById.ts +21 -0
- package/example/src/chevre/importCategoryCodesFromCOA.ts +2 -1
- package/example/src/chevre/importOffersFromCOA.ts +2 -1
- package/example/src/chevre/migrateActionInstrumentTransactionNumber.ts +93 -0
- package/example/src/chevre/migrateDeleteTransactionTasks.ts +119 -0
- package/example/src/chevre/migrateEventMakesOfferAvailableAtOrFrom.ts +87 -0
- package/example/src/chevre/migrateIAMMemberPOSRoles.ts +3 -2
- package/example/src/chevre/migrateOfferAvailableAtOrFrom.ts +63 -0
- package/example/src/chevre/{migrateOrderPaymentMethodIdentifier.ts → migrateOrderAcceptedOfferSerialNumber.ts} +18 -19
- package/example/src/chevre/onAssetTransactionStatusChanged.ts +36 -0
- package/example/src/chevre/retryTasks.ts +39 -0
- package/example/src/chevre/searchActions.ts +13 -7
- package/example/src/chevre/searchOrderAcceptedOffers.ts +13 -3
- package/example/src/chevre/searchOrders.ts +13 -15
- package/example/src/chevre/searchSlicedAcceptedOffersByOrderNumber.ts +28 -0
- package/example/src/chevre/sendOrder.ts +37 -0
- package/example/src/chevre/transaction/processPlaceOrder.ts +2 -3
- package/example/src/verifyToken.ts +44 -0
- package/lib/chevre/credentials.d.ts +2 -0
- package/lib/chevre/credentials.js +4 -2
- package/lib/chevre/errorHandler.js +3 -0
- package/lib/chevre/factory/order.d.ts +1 -0
- package/lib/chevre/factory/order.js +2 -1
- package/lib/chevre/factory/reservedAgentIdentifireNames.js +2 -1
- package/lib/chevre/factory/transaction.d.ts +10 -1
- package/lib/chevre/repo/acceptedOffer.d.ts +58 -2
- package/lib/chevre/repo/acceptedOffer.js +100 -4
- package/lib/chevre/repo/accountingReport.d.ts +33 -7
- package/lib/chevre/repo/accountingReport.js +157 -5
- package/lib/chevre/repo/action.d.ts +32 -8
- package/lib/chevre/repo/action.js +114 -54
- package/lib/chevre/repo/event.d.ts +20 -0
- package/lib/chevre/repo/event.js +22 -0
- package/lib/chevre/repo/member.d.ts +8 -1
- package/lib/chevre/repo/member.js +7 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +25 -11
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/order.js +38 -11
- package/lib/chevre/repo/offer.d.ts +42 -0
- package/lib/chevre/repo/offer.js +35 -0
- package/lib/chevre/repo/order.js +43 -20
- package/lib/chevre/repo/orderInTransaction.d.ts +44 -0
- package/lib/chevre/repo/orderInTransaction.js +164 -0
- package/lib/chevre/repo/paymentServiceProvider.js +2 -1
- package/lib/chevre/repo/person.js +1 -4
- package/lib/chevre/repo/task.d.ts +26 -3
- package/lib/chevre/repo/task.js +61 -46
- package/lib/chevre/repo/transaction.d.ts +2 -2
- package/lib/chevre/repo/transaction.js +13 -36
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/aggregation/event/importFromCOA.js +5 -5
- package/lib/chevre/service/assetTransaction/pay/factory.js +1 -6
- package/lib/chevre/service/assetTransaction/pay/potentialActions/createPayObjectServiceOutput.d.ts +9 -0
- package/lib/chevre/service/assetTransaction/pay/potentialActions/createPayObjectServiceOutput.js +143 -0
- package/lib/chevre/service/assetTransaction/pay/potentialActions.d.ts +11 -3
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +4 -165
- package/lib/chevre/service/assetTransaction/pay.d.ts +21 -4
- package/lib/chevre/service/assetTransaction/pay.js +64 -23
- package/lib/chevre/service/assetTransaction/reserve/factory.js +11 -14
- package/lib/chevre/service/assetTransaction/reserveCOA.d.ts +19 -0
- package/lib/chevre/service/assetTransaction/reserveCOA.js +46 -0
- package/lib/chevre/service/code.js +1 -1
- package/lib/chevre/service/delivery.js +2 -2
- package/lib/chevre/service/event/createEvent.js +1 -1
- package/lib/chevre/service/event.js +16 -24
- package/lib/chevre/service/moneyTransfer.js +1 -1
- package/lib/chevre/service/notification.js +71 -66
- package/lib/chevre/service/offer/any.d.ts +35 -0
- package/lib/chevre/service/offer/any.js +67 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +7 -0
- package/lib/chevre/service/offer/event/authorize.js +27 -17
- package/lib/chevre/service/offer/event/cancel.d.ts +2 -0
- package/lib/chevre/service/offer/event/cancel.js +13 -1
- package/lib/chevre/service/offer/event/factory.d.ts +1 -1
- package/lib/chevre/service/offer/event/factory.js +11 -22
- package/lib/chevre/service/offer/event/importFromCOA.js +6 -8
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
- package/lib/chevre/service/offer/event/voidTransaction.js +24 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +54 -0
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +138 -0
- package/lib/chevre/service/offer/eventServiceByCOA/cancel.d.ts +39 -0
- package/lib/chevre/service/offer/eventServiceByCOA/cancel.js +59 -0
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +25 -0
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +165 -0
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +10 -23
- package/lib/chevre/service/offer/eventServiceByCOA.d.ts +4 -89
- package/lib/chevre/service/offer/eventServiceByCOA.js +7 -292
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +10 -1
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +49 -3
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +1 -1
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.d.ts +2 -0
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +47 -2
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
- package/lib/chevre/service/offer/product/factory.js +2 -5
- package/lib/chevre/service/offer/product.d.ts +2 -0
- package/lib/chevre/service/offer/product.js +11 -23
- package/lib/chevre/service/order/confirmPayTransaction.d.ts +3 -1
- package/lib/chevre/service/order/confirmPayTransaction.js +4 -4
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +12 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +206 -7
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +51 -53
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +10 -25
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +16 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +91 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.d.ts +8 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +37 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +12 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +115 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +19 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +8 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +41 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +6 -10
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +116 -92
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +4 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +81 -84
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +18 -15
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +62 -1
- package/lib/chevre/service/order/onOrderStatusChanged.d.ts +3 -1
- package/lib/chevre/service/order/onOrderStatusChanged.js +5 -1
- package/lib/chevre/service/order/placeOrder.d.ts +3 -1
- package/lib/chevre/service/order/placeOrder.js +157 -50
- package/lib/chevre/service/order/returnOrder.js +25 -16
- package/lib/chevre/service/order/sendOrder.d.ts +5 -0
- package/lib/chevre/service/order/sendOrder.js +67 -33
- package/lib/chevre/service/payment/any/onPaid.js +1 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.d.ts +3 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.js +15 -9
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.d.ts +3 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.js +8 -5
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +2 -2
- package/lib/chevre/service/payment/any/onRefund.js +1 -1
- package/lib/chevre/service/payment/any.d.ts +6 -5
- package/lib/chevre/service/payment/any.js +3 -2
- package/lib/chevre/service/payment/creditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard.js +62 -74
- package/lib/chevre/service/payment/faceToFace.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket.js +1 -1
- package/lib/chevre/service/payment/paymentCard.d.ts +1 -1
- package/lib/chevre/service/payment.d.ts +5 -0
- package/lib/chevre/service/payment.js +40 -5
- package/lib/chevre/service/product.js +1 -1
- package/lib/chevre/service/reserve/cancelReservation.js +2 -2
- package/lib/chevre/service/reserve/checkInReservation.d.ts +1 -3
- package/lib/chevre/service/reserve/checkInReservation.js +6 -5
- package/lib/chevre/service/reserve/confirmReservation.js +1 -1
- package/lib/chevre/service/reserve/factory.js +0 -8
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +4 -4
- package/lib/chevre/service/reserve/searchByOrder.js +2 -1
- package/lib/chevre/service/reserve/useReservation.d.ts +1 -3
- package/lib/chevre/service/reserve/useReservation.js +10 -9
- package/lib/chevre/service/reserve/verifyToken4reservation.js +2 -0
- package/lib/chevre/service/task/confirmMoneyTransfer.js +4 -4
- package/lib/chevre/service/task/confirmPayTransaction.js +2 -1
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +30 -8
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +176 -29
- package/lib/chevre/service/task/createAccountingReport.d.ts +6 -0
- package/lib/chevre/service/task/createAccountingReport.js +80 -0
- package/lib/chevre/service/task/importOffersFromCOA.js +2 -1
- package/lib/chevre/service/task/onAuthorizationCreated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -7
- package/lib/chevre/service/task/pay.js +6 -0
- package/lib/chevre/service/task/placeOrder.js +9 -10
- package/lib/chevre/service/task/returnOrder.js +0 -3
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +3 -2
- package/lib/chevre/service/task/sendOrder.js +8 -4
- package/lib/chevre/service/task/useReservation.js +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +8 -12
- package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +2 -18
- package/lib/chevre/service/transaction/moneyTransfer.js +7 -6
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +17 -20
- package/lib/chevre/service/transaction/placeOrder.js +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/confirm.d.ts +51 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/confirm.js +268 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +3 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +22 -44
- package/lib/chevre/service/transaction/placeOrderInProgress/publishCode.d.ts +14 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishCode.js +41 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishConfirmationNumberIfNotExist.d.ts +18 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishConfirmationNumberIfNotExist.js +42 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishOrderNumberIfNotExist.d.ts +23 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishOrderNumberIfNotExist.js +46 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +34 -37
- package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +3 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +13 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/start.d.ts +19 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/start.js +46 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateStartRequest.d.ts +26 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateStartRequest.js +109 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +10 -23
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +20 -1
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +11 -73
- package/lib/chevre/service/transaction/placeOrderInProgress.js +13 -286
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +1 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +8 -3
- package/lib/chevre/service/transaction/returnOrder/preStart.js +78 -50
- package/lib/chevre/service/transaction/returnOrder.js +3 -10
- package/lib/chevre/service.js +0 -10
- package/lib/chevre/settings.d.ts +7 -3
- package/lib/chevre/settings.js +13 -4
- package/package.json +5 -9
- package/example/src/chevre/cleanAccountingReports.ts +0 -57
- package/example/src/chevre/migratePayTransactionPaymentMethodIdentifier.ts +0 -78
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.d.ts +0 -11
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.js +0 -30
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.d.ts +0 -7
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.js +0 -82
- package/lib/chevre/service/util.d.ts +0 -19
- package/lib/chevre/service/util.js +0 -126
|
@@ -22,9 +22,17 @@ class MongoRepository {
|
|
|
22
22
|
}
|
|
23
23
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
24
24
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
25
|
-
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, _58, _59, _60, _61, _62, _63, _64, _65;
|
|
25
|
+
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, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69;
|
|
26
26
|
const andConditions = [];
|
|
27
|
-
const
|
|
27
|
+
const idIn = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$in;
|
|
28
|
+
if (Array.isArray(idIn)) {
|
|
29
|
+
andConditions.push({ _id: { $in: idIn } });
|
|
30
|
+
}
|
|
31
|
+
const idNin = (_b = params.id) === null || _b === void 0 ? void 0 : _b.$nin;
|
|
32
|
+
if (Array.isArray(idNin)) {
|
|
33
|
+
andConditions.push({ _id: { $nin: idNin } });
|
|
34
|
+
}
|
|
35
|
+
const projectIdEq = (_d = (_c = params.project) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$eq;
|
|
28
36
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
29
37
|
/* istanbul ignore else */
|
|
30
38
|
if (typeof projectIdEq === 'string') {
|
|
@@ -36,7 +44,7 @@ class MongoRepository {
|
|
|
36
44
|
}
|
|
37
45
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
38
46
|
/* istanbul ignore else */
|
|
39
|
-
const agentTypeOfIn = (
|
|
47
|
+
const agentTypeOfIn = (_f = (_e = params.agent) === null || _e === void 0 ? void 0 : _e.typeOf) === null || _f === void 0 ? void 0 : _f.$in;
|
|
40
48
|
if (Array.isArray(agentTypeOfIn)) {
|
|
41
49
|
andConditions.push({
|
|
42
50
|
'agent.typeOf': {
|
|
@@ -45,7 +53,7 @@ class MongoRepository {
|
|
|
45
53
|
}
|
|
46
54
|
});
|
|
47
55
|
}
|
|
48
|
-
const agentIdIn = (
|
|
56
|
+
const agentIdIn = (_h = (_g = params.agent) === null || _g === void 0 ? void 0 : _g.id) === null || _h === void 0 ? void 0 : _h.$in;
|
|
49
57
|
if (Array.isArray(agentIdIn)) {
|
|
50
58
|
andConditions.push({
|
|
51
59
|
'agent.id': {
|
|
@@ -54,7 +62,11 @@ class MongoRepository {
|
|
|
54
62
|
}
|
|
55
63
|
});
|
|
56
64
|
}
|
|
57
|
-
const
|
|
65
|
+
const instrumentTransactionNumberEq = (_k = (_j = params.instrument) === null || _j === void 0 ? void 0 : _j.transactionNumber) === null || _k === void 0 ? void 0 : _k.$eq;
|
|
66
|
+
if (typeof instrumentTransactionNumberEq === 'string') {
|
|
67
|
+
andConditions.push({ 'instrument.transactionNumber': { $exists: true, $eq: instrumentTransactionNumberEq } });
|
|
68
|
+
}
|
|
69
|
+
const locationIdEq = (_m = (_l = params.location) === null || _l === void 0 ? void 0 : _l.id) === null || _m === void 0 ? void 0 : _m.$eq;
|
|
58
70
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
59
71
|
/* istanbul ignore else */
|
|
60
72
|
if (typeof locationIdEq === 'string') {
|
|
@@ -65,7 +77,7 @@ class MongoRepository {
|
|
|
65
77
|
}
|
|
66
78
|
});
|
|
67
79
|
}
|
|
68
|
-
const locationIdentifierEq = (
|
|
80
|
+
const locationIdentifierEq = (_p = (_o = params.location) === null || _o === void 0 ? void 0 : _o.identifier) === null || _p === void 0 ? void 0 : _p.$eq;
|
|
69
81
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
70
82
|
/* istanbul ignore else */
|
|
71
83
|
if (typeof locationIdentifierEq === 'string') {
|
|
@@ -76,7 +88,7 @@ class MongoRepository {
|
|
|
76
88
|
}
|
|
77
89
|
});
|
|
78
90
|
}
|
|
79
|
-
const objectMovieTicketsIdentifierEq = (
|
|
91
|
+
const objectMovieTicketsIdentifierEq = (_s = (_r = (_q = params.object) === null || _q === void 0 ? void 0 : _q.movieTickets) === null || _r === void 0 ? void 0 : _r.identifier) === null || _s === void 0 ? void 0 : _s.$eq;
|
|
80
92
|
if (typeof objectMovieTicketsIdentifierEq === 'string') {
|
|
81
93
|
andConditions.push({
|
|
82
94
|
'object.movieTickets.identifier': {
|
|
@@ -85,7 +97,7 @@ class MongoRepository {
|
|
|
85
97
|
}
|
|
86
98
|
});
|
|
87
99
|
}
|
|
88
|
-
const objectMovieTicketsServiceOutputReservationForIdEq = (
|
|
100
|
+
const objectMovieTicketsServiceOutputReservationForIdEq = (_x = (_w = (_v = (_u = (_t = params.object) === null || _t === void 0 ? void 0 : _t.movieTickets) === null || _u === void 0 ? void 0 : _u.serviceOutput) === null || _v === void 0 ? void 0 : _v.reservationFor) === null || _w === void 0 ? void 0 : _w.id) === null || _x === void 0 ? void 0 : _x.$eq;
|
|
89
101
|
if (typeof objectMovieTicketsServiceOutputReservationForIdEq === 'string') {
|
|
90
102
|
andConditions.push({
|
|
91
103
|
'object.movieTickets.serviceOutput.reservationFor.id': {
|
|
@@ -96,7 +108,7 @@ class MongoRepository {
|
|
|
96
108
|
}
|
|
97
109
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
98
110
|
/* istanbul ignore else */
|
|
99
|
-
const objectPaymentMethodIdEq = (
|
|
111
|
+
const objectPaymentMethodIdEq = (_z = (_y = params.object) === null || _y === void 0 ? void 0 : _y.paymentMethodId) === null || _z === void 0 ? void 0 : _z.$eq;
|
|
100
112
|
if (typeof objectPaymentMethodIdEq === 'string') {
|
|
101
113
|
andConditions.push({
|
|
102
114
|
'object.paymentMethodId': {
|
|
@@ -105,7 +117,7 @@ class MongoRepository {
|
|
|
105
117
|
}
|
|
106
118
|
});
|
|
107
119
|
}
|
|
108
|
-
const objectObjectPaymentMethodIdEq = (
|
|
120
|
+
const objectObjectPaymentMethodIdEq = (_2 = (_1 = (_0 = params.object) === null || _0 === void 0 ? void 0 : _0.object) === null || _1 === void 0 ? void 0 : _1.paymentMethodId) === null || _2 === void 0 ? void 0 : _2.$eq;
|
|
109
121
|
if (typeof objectObjectPaymentMethodIdEq === 'string') {
|
|
110
122
|
andConditions.push({
|
|
111
123
|
'object.object.paymentMethodId': {
|
|
@@ -114,7 +126,7 @@ class MongoRepository {
|
|
|
114
126
|
}
|
|
115
127
|
});
|
|
116
128
|
}
|
|
117
|
-
const objectReservationForIdEq = (
|
|
129
|
+
const objectReservationForIdEq = (_5 = (_4 = (_3 = params.object) === null || _3 === void 0 ? void 0 : _3.reservationFor) === null || _4 === void 0 ? void 0 : _4.id) === null || _5 === void 0 ? void 0 : _5.$eq;
|
|
118
130
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
119
131
|
/* istanbul ignore else */
|
|
120
132
|
if (typeof objectReservationForIdEq === 'string') {
|
|
@@ -125,7 +137,7 @@ class MongoRepository {
|
|
|
125
137
|
}
|
|
126
138
|
});
|
|
127
139
|
}
|
|
128
|
-
const objectReservationNumberEq = (
|
|
140
|
+
const objectReservationNumberEq = (_7 = (_6 = params.object) === null || _6 === void 0 ? void 0 : _6.reservationNumber) === null || _7 === void 0 ? void 0 : _7.$eq;
|
|
129
141
|
if (typeof objectReservationNumberEq === 'string') {
|
|
130
142
|
andConditions.push({
|
|
131
143
|
'object.reservationNumber': {
|
|
@@ -134,7 +146,7 @@ class MongoRepository {
|
|
|
134
146
|
}
|
|
135
147
|
});
|
|
136
148
|
}
|
|
137
|
-
const objectReservationNumberIn = (
|
|
149
|
+
const objectReservationNumberIn = (_9 = (_8 = params.object) === null || _8 === void 0 ? void 0 : _8.reservationNumber) === null || _9 === void 0 ? void 0 : _9.$in;
|
|
138
150
|
if (Array.isArray(objectReservationNumberIn)) {
|
|
139
151
|
andConditions.push({
|
|
140
152
|
'object.reservationNumber': {
|
|
@@ -143,7 +155,7 @@ class MongoRepository {
|
|
|
143
155
|
}
|
|
144
156
|
});
|
|
145
157
|
}
|
|
146
|
-
const objectPaymentMethodAccountIdEq = (
|
|
158
|
+
const objectPaymentMethodAccountIdEq = (_12 = (_11 = (_10 = params.object) === null || _10 === void 0 ? void 0 : _10.paymentMethod) === null || _11 === void 0 ? void 0 : _11.accountId) === null || _12 === void 0 ? void 0 : _12.$eq;
|
|
147
159
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
148
160
|
/* istanbul ignore else */
|
|
149
161
|
if (typeof objectPaymentMethodAccountIdEq === 'string') {
|
|
@@ -154,7 +166,7 @@ class MongoRepository {
|
|
|
154
166
|
}
|
|
155
167
|
});
|
|
156
168
|
}
|
|
157
|
-
const objectPaymentMethodPaymentMethodIdEq = (
|
|
169
|
+
const objectPaymentMethodPaymentMethodIdEq = (_15 = (_14 = (_13 = params.object) === null || _13 === void 0 ? void 0 : _13.paymentMethod) === null || _14 === void 0 ? void 0 : _14.paymentMethodId) === null || _15 === void 0 ? void 0 : _15.$eq;
|
|
158
170
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
159
171
|
/* istanbul ignore else */
|
|
160
172
|
if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
|
|
@@ -165,7 +177,7 @@ class MongoRepository {
|
|
|
165
177
|
}
|
|
166
178
|
});
|
|
167
179
|
}
|
|
168
|
-
const objectPaymentMethodPaymentMethodIdIn = (
|
|
180
|
+
const objectPaymentMethodPaymentMethodIdIn = (_18 = (_17 = (_16 = params.object) === null || _16 === void 0 ? void 0 : _16.paymentMethod) === null || _17 === void 0 ? void 0 : _17.paymentMethodId) === null || _18 === void 0 ? void 0 : _18.$in;
|
|
169
181
|
if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
|
|
170
182
|
andConditions.push({
|
|
171
183
|
'object.paymentMethod.paymentMethodId': {
|
|
@@ -174,7 +186,7 @@ class MongoRepository {
|
|
|
174
186
|
}
|
|
175
187
|
});
|
|
176
188
|
}
|
|
177
|
-
const objectPaymentMethodTypeOfEq = (
|
|
189
|
+
const objectPaymentMethodTypeOfEq = (_21 = (_20 = (_19 = params.object) === null || _19 === void 0 ? void 0 : _19.paymentMethod) === null || _20 === void 0 ? void 0 : _20.typeOf) === null || _21 === void 0 ? void 0 : _21.$eq;
|
|
178
190
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
179
191
|
/* istanbul ignore else */
|
|
180
192
|
if (typeof objectPaymentMethodTypeOfEq === 'string') {
|
|
@@ -185,7 +197,7 @@ class MongoRepository {
|
|
|
185
197
|
}
|
|
186
198
|
});
|
|
187
199
|
}
|
|
188
|
-
const objectTypeOfEq = (
|
|
200
|
+
const objectTypeOfEq = (_23 = (_22 = params.object) === null || _22 === void 0 ? void 0 : _22.typeOf) === null || _23 === void 0 ? void 0 : _23.$eq;
|
|
189
201
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
190
202
|
/* istanbul ignore else */
|
|
191
203
|
if (typeof objectTypeOfEq === 'string') {
|
|
@@ -196,7 +208,7 @@ class MongoRepository {
|
|
|
196
208
|
}
|
|
197
209
|
});
|
|
198
210
|
}
|
|
199
|
-
const objectTypeOfIn = (
|
|
211
|
+
const objectTypeOfIn = (_25 = (_24 = params.object) === null || _24 === void 0 ? void 0 : _24.typeOf) === null || _25 === void 0 ? void 0 : _25.$in;
|
|
200
212
|
if (Array.isArray(objectTypeOfIn)) {
|
|
201
213
|
andConditions.push({
|
|
202
214
|
'object.typeOf': {
|
|
@@ -205,7 +217,7 @@ class MongoRepository {
|
|
|
205
217
|
}
|
|
206
218
|
});
|
|
207
219
|
}
|
|
208
|
-
const objectIdEq = (
|
|
220
|
+
const objectIdEq = (_27 = (_26 = params.object) === null || _26 === void 0 ? void 0 : _26.id) === null || _27 === void 0 ? void 0 : _27.$eq;
|
|
209
221
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
210
222
|
/* istanbul ignore else */
|
|
211
223
|
if (typeof objectIdEq === 'string') {
|
|
@@ -216,7 +228,7 @@ class MongoRepository {
|
|
|
216
228
|
}
|
|
217
229
|
});
|
|
218
230
|
}
|
|
219
|
-
const objectIdIn = (
|
|
231
|
+
const objectIdIn = (_29 = (_28 = params.object) === null || _28 === void 0 ? void 0 : _28.id) === null || _29 === void 0 ? void 0 : _29.$in;
|
|
220
232
|
if (Array.isArray(objectIdIn)) {
|
|
221
233
|
andConditions.push({
|
|
222
234
|
'object.id': {
|
|
@@ -225,7 +237,7 @@ class MongoRepository {
|
|
|
225
237
|
}
|
|
226
238
|
});
|
|
227
239
|
}
|
|
228
|
-
const objectOrderNumberIn = (
|
|
240
|
+
const objectOrderNumberIn = (_31 = (_30 = params.object) === null || _30 === void 0 ? void 0 : _30.orderNumber) === null || _31 === void 0 ? void 0 : _31.$in;
|
|
229
241
|
if (Array.isArray(objectOrderNumberIn)) {
|
|
230
242
|
andConditions.push({
|
|
231
243
|
'object.orderNumber': {
|
|
@@ -234,7 +246,7 @@ class MongoRepository {
|
|
|
234
246
|
}
|
|
235
247
|
});
|
|
236
248
|
}
|
|
237
|
-
const objectEventIdIn = (
|
|
249
|
+
const objectEventIdIn = (_34 = (_33 = (_32 = params.object) === null || _32 === void 0 ? void 0 : _32.event) === null || _33 === void 0 ? void 0 : _33.id) === null || _34 === void 0 ? void 0 : _34.$in;
|
|
238
250
|
if (Array.isArray(objectEventIdIn)) {
|
|
239
251
|
andConditions.push({
|
|
240
252
|
'object.event.id': {
|
|
@@ -243,7 +255,7 @@ class MongoRepository {
|
|
|
243
255
|
}
|
|
244
256
|
});
|
|
245
257
|
}
|
|
246
|
-
const objectAcceptedOfferSeatNumberIn = (
|
|
258
|
+
const objectAcceptedOfferSeatNumberIn = (_41 = (_40 = (_39 = (_38 = (_37 = (_36 = (_35 = params.object) === null || _35 === void 0 ? void 0 : _35.acceptedOffer) === null || _36 === void 0 ? void 0 : _36.itemOffered) === null || _37 === void 0 ? void 0 : _37.serviceOutput) === null || _38 === void 0 ? void 0 : _38.reservedTicket) === null || _39 === void 0 ? void 0 : _39.ticketedSeat) === null || _40 === void 0 ? void 0 : _40.seatNumber) === null || _41 === void 0 ? void 0 : _41.$in;
|
|
247
259
|
if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
|
|
248
260
|
andConditions.push({
|
|
249
261
|
'object.acceptedOffer.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatNumber': {
|
|
@@ -260,7 +272,7 @@ class MongoRepository {
|
|
|
260
272
|
});
|
|
261
273
|
}
|
|
262
274
|
else {
|
|
263
|
-
const typeOfEq = (
|
|
275
|
+
const typeOfEq = (_42 = params.typeOf) === null || _42 === void 0 ? void 0 : _42.$eq;
|
|
264
276
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
265
277
|
/* istanbul ignore else */
|
|
266
278
|
if (typeof typeOfEq === 'string') {
|
|
@@ -269,7 +281,7 @@ class MongoRepository {
|
|
|
269
281
|
});
|
|
270
282
|
}
|
|
271
283
|
}
|
|
272
|
-
const actionStatusIn = (
|
|
284
|
+
const actionStatusIn = (_43 = params.actionStatus) === null || _43 === void 0 ? void 0 : _43.$in;
|
|
273
285
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
274
286
|
/* istanbul ignore else */
|
|
275
287
|
if (Array.isArray(actionStatusIn)) {
|
|
@@ -300,7 +312,7 @@ class MongoRepository {
|
|
|
300
312
|
startDate: { $lte: startDateLte }
|
|
301
313
|
});
|
|
302
314
|
}
|
|
303
|
-
const fromLocationTypeOfIn = (
|
|
315
|
+
const fromLocationTypeOfIn = (_45 = (_44 = params.fromLocation) === null || _44 === void 0 ? void 0 : _44.typeOf) === null || _45 === void 0 ? void 0 : _45.$in;
|
|
304
316
|
if (Array.isArray(fromLocationTypeOfIn)) {
|
|
305
317
|
andConditions.push({
|
|
306
318
|
'fromLocation.typeOf': {
|
|
@@ -309,7 +321,7 @@ class MongoRepository {
|
|
|
309
321
|
}
|
|
310
322
|
});
|
|
311
323
|
}
|
|
312
|
-
const fromLocationAccountNumberIn = (
|
|
324
|
+
const fromLocationAccountNumberIn = (_47 = (_46 = params.fromLocation) === null || _46 === void 0 ? void 0 : _46.accountNumber) === null || _47 === void 0 ? void 0 : _47.$in;
|
|
313
325
|
if (Array.isArray(fromLocationAccountNumberIn)) {
|
|
314
326
|
andConditions.push({
|
|
315
327
|
'fromLocation.accountNumber': {
|
|
@@ -318,7 +330,7 @@ class MongoRepository {
|
|
|
318
330
|
}
|
|
319
331
|
});
|
|
320
332
|
}
|
|
321
|
-
const fromLocationAccountTypeIn = (
|
|
333
|
+
const fromLocationAccountTypeIn = (_49 = (_48 = params.fromLocation) === null || _48 === void 0 ? void 0 : _48.accountType) === null || _49 === void 0 ? void 0 : _49.$in;
|
|
322
334
|
if (Array.isArray(fromLocationAccountTypeIn)) {
|
|
323
335
|
andConditions.push({
|
|
324
336
|
'fromLocation.accountType': {
|
|
@@ -327,7 +339,7 @@ class MongoRepository {
|
|
|
327
339
|
}
|
|
328
340
|
});
|
|
329
341
|
}
|
|
330
|
-
const toLocationTypeOfIn = (
|
|
342
|
+
const toLocationTypeOfIn = (_51 = (_50 = params.toLocation) === null || _50 === void 0 ? void 0 : _50.typeOf) === null || _51 === void 0 ? void 0 : _51.$in;
|
|
331
343
|
if (Array.isArray(toLocationTypeOfIn)) {
|
|
332
344
|
andConditions.push({
|
|
333
345
|
'toLocation.typeOf': {
|
|
@@ -336,7 +348,7 @@ class MongoRepository {
|
|
|
336
348
|
}
|
|
337
349
|
});
|
|
338
350
|
}
|
|
339
|
-
const toLocationAccountNumberIn = (
|
|
351
|
+
const toLocationAccountNumberIn = (_53 = (_52 = params.toLocation) === null || _52 === void 0 ? void 0 : _52.accountNumber) === null || _53 === void 0 ? void 0 : _53.$in;
|
|
340
352
|
if (Array.isArray(toLocationAccountNumberIn)) {
|
|
341
353
|
andConditions.push({
|
|
342
354
|
'toLocation.accountNumber': {
|
|
@@ -345,7 +357,7 @@ class MongoRepository {
|
|
|
345
357
|
}
|
|
346
358
|
});
|
|
347
359
|
}
|
|
348
|
-
const toLocationAccountTypeIn = (
|
|
360
|
+
const toLocationAccountTypeIn = (_55 = (_54 = params.toLocation) === null || _54 === void 0 ? void 0 : _54.accountType) === null || _55 === void 0 ? void 0 : _55.$in;
|
|
349
361
|
if (Array.isArray(toLocationAccountTypeIn)) {
|
|
350
362
|
andConditions.push({
|
|
351
363
|
'toLocation.accountType': {
|
|
@@ -354,7 +366,7 @@ class MongoRepository {
|
|
|
354
366
|
}
|
|
355
367
|
});
|
|
356
368
|
}
|
|
357
|
-
const purposeTypeOfIn = (
|
|
369
|
+
const purposeTypeOfIn = (_57 = (_56 = params.purpose) === null || _56 === void 0 ? void 0 : _56.typeOf) === null || _57 === void 0 ? void 0 : _57.$in;
|
|
358
370
|
if (Array.isArray(purposeTypeOfIn)) {
|
|
359
371
|
andConditions.push({
|
|
360
372
|
'purpose.typeOf': {
|
|
@@ -363,7 +375,7 @@ class MongoRepository {
|
|
|
363
375
|
}
|
|
364
376
|
});
|
|
365
377
|
}
|
|
366
|
-
const purposeIdIn = (
|
|
378
|
+
const purposeIdIn = (_59 = (_58 = params.purpose) === null || _58 === void 0 ? void 0 : _58.id) === null || _59 === void 0 ? void 0 : _59.$in;
|
|
367
379
|
if (Array.isArray(purposeIdIn)) {
|
|
368
380
|
andConditions.push({
|
|
369
381
|
'purpose.id': {
|
|
@@ -372,7 +384,7 @@ class MongoRepository {
|
|
|
372
384
|
}
|
|
373
385
|
});
|
|
374
386
|
}
|
|
375
|
-
const purposeOrderNumberIn = (
|
|
387
|
+
const purposeOrderNumberIn = (_61 = (_60 = params.purpose) === null || _60 === void 0 ? void 0 : _60.orderNumber) === null || _61 === void 0 ? void 0 : _61.$in;
|
|
376
388
|
if (Array.isArray(purposeOrderNumberIn)) {
|
|
377
389
|
andConditions.push({
|
|
378
390
|
'purpose.orderNumber': {
|
|
@@ -381,7 +393,7 @@ class MongoRepository {
|
|
|
381
393
|
}
|
|
382
394
|
});
|
|
383
395
|
}
|
|
384
|
-
const resultTypeOfIn = (
|
|
396
|
+
const resultTypeOfIn = (_63 = (_62 = params.result) === null || _62 === void 0 ? void 0 : _62.typeOf) === null || _63 === void 0 ? void 0 : _63.$in;
|
|
385
397
|
if (Array.isArray(resultTypeOfIn)) {
|
|
386
398
|
andConditions.push({
|
|
387
399
|
'result.typeOf': {
|
|
@@ -390,7 +402,7 @@ class MongoRepository {
|
|
|
390
402
|
}
|
|
391
403
|
});
|
|
392
404
|
}
|
|
393
|
-
const resultIdIn = (
|
|
405
|
+
const resultIdIn = (_65 = (_64 = params.result) === null || _64 === void 0 ? void 0 : _64.id) === null || _65 === void 0 ? void 0 : _65.$in;
|
|
394
406
|
if (Array.isArray(resultIdIn)) {
|
|
395
407
|
andConditions.push({
|
|
396
408
|
'result.id': {
|
|
@@ -399,7 +411,7 @@ class MongoRepository {
|
|
|
399
411
|
}
|
|
400
412
|
});
|
|
401
413
|
}
|
|
402
|
-
const resultOrderNumberIn = (
|
|
414
|
+
const resultOrderNumberIn = (_67 = (_66 = params.result) === null || _66 === void 0 ? void 0 : _66.orderNumber) === null || _67 === void 0 ? void 0 : _67.$in;
|
|
403
415
|
if (Array.isArray(resultOrderNumberIn)) {
|
|
404
416
|
andConditions.push({
|
|
405
417
|
'result.orderNumber': {
|
|
@@ -408,7 +420,7 @@ class MongoRepository {
|
|
|
408
420
|
}
|
|
409
421
|
});
|
|
410
422
|
}
|
|
411
|
-
const resultCodeIn = (
|
|
423
|
+
const resultCodeIn = (_69 = (_68 = params.result) === null || _68 === void 0 ? void 0 : _68.code) === null || _69 === void 0 ? void 0 : _69.$in;
|
|
412
424
|
if (Array.isArray(resultCodeIn)) {
|
|
413
425
|
andConditions.push({
|
|
414
426
|
'result.code': {
|
|
@@ -511,18 +523,16 @@ class MongoRepository {
|
|
|
511
523
|
/**
|
|
512
524
|
* アクション取消
|
|
513
525
|
*/
|
|
514
|
-
|
|
526
|
+
cancelWithVoid(params) {
|
|
515
527
|
return __awaiter(this, void 0, void 0, function* () {
|
|
516
528
|
const doc = yield this.actionModel.findOneAndUpdate({
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}, { actionStatus: factory.actionStatusType.CanceledActionStatus }, { new:
|
|
520
|
-
.select({ __v: 0, createdAt: 0, updatedAt: 0 })
|
|
529
|
+
_id: { $eq: params.id },
|
|
530
|
+
typeOf: { $eq: params.typeOf }
|
|
531
|
+
}, { actionStatus: factory.actionStatusType.CanceledActionStatus }, { new: false, projection: { _id: 1 } })
|
|
521
532
|
.exec();
|
|
522
533
|
if (doc === null) {
|
|
523
534
|
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
524
535
|
}
|
|
525
|
-
return doc.toObject();
|
|
526
536
|
});
|
|
527
537
|
}
|
|
528
538
|
/**
|
|
@@ -551,6 +561,27 @@ class MongoRepository {
|
|
|
551
561
|
// return doc.toObject();
|
|
552
562
|
});
|
|
553
563
|
}
|
|
564
|
+
/**
|
|
565
|
+
* アクション再開
|
|
566
|
+
*/
|
|
567
|
+
reStart(params) {
|
|
568
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
569
|
+
const doc = yield this.actionModel.findOneAndUpdate({
|
|
570
|
+
_id: { $eq: params.id },
|
|
571
|
+
actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
|
|
572
|
+
}, {
|
|
573
|
+
$set: {
|
|
574
|
+
actionStatus: factory.actionStatusType.ActiveActionStatus,
|
|
575
|
+
startDate: new Date()
|
|
576
|
+
},
|
|
577
|
+
$unset: { endDate: 1 }
|
|
578
|
+
}, { new: false, projection: { _id: 1 } })
|
|
579
|
+
.exec();
|
|
580
|
+
if (doc === null) {
|
|
581
|
+
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
}
|
|
554
585
|
/**
|
|
555
586
|
* 一定期間ActiveActionStatusのアクションをFailedActionStatusにする
|
|
556
587
|
*/
|
|
@@ -602,16 +633,16 @@ class MongoRepository {
|
|
|
602
633
|
* 取引に対するアクション検索時などに使用
|
|
603
634
|
*/
|
|
604
635
|
searchByPurpose(params) {
|
|
605
|
-
var _a, _b, _c, _d, _e, _f;
|
|
636
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
606
637
|
return __awaiter(this, void 0, void 0, function* () {
|
|
607
|
-
return this.search(Object.assign(Object.assign(Object.assign({ purpose: {
|
|
638
|
+
return this.search(Object.assign(Object.assign(Object.assign(Object.assign({ purpose: {
|
|
608
639
|
id: { $in: [params.purpose.id] },
|
|
609
640
|
typeOf: { $in: [params.purpose.typeOf] }
|
|
610
641
|
}, object: Object.assign(Object.assign({}, (typeof ((_b = (_a = params.object) === null || _a === void 0 ? void 0 : _a.typeOf) === null || _b === void 0 ? void 0 : _b.$eq) === 'string')
|
|
611
642
|
? { typeOf: { $eq: params.object.typeOf.$eq } }
|
|
612
643
|
: undefined), (typeof ((_d = (_c = params.object) === null || _c === void 0 ? void 0 : _c.paymentMethodId) === null || _d === void 0 ? void 0 : _d.$eq) === 'string')
|
|
613
644
|
? { paymentMethodId: { $eq: params.object.paymentMethodId.$eq } }
|
|
614
|
-
: undefined) }, (typeof ((_e = params.actionStatus) === null || _e === void 0 ? void 0 : _e.$eq) === 'string') ? { actionStatus: { $in: [params.actionStatus.$eq] } } : undefined), (typeof params.typeOf === 'string') ? { typeOf: { $eq: params.typeOf } } : undefined), (
|
|
645
|
+
: undefined) }, (typeof ((_e = params.actionStatus) === null || _e === void 0 ? void 0 : _e.$eq) === 'string') ? { actionStatus: { $in: [params.actionStatus.$eq] } } : undefined), (typeof params.typeOf === 'string') ? { typeOf: { $eq: params.typeOf } } : undefined), (Array.isArray((_f = params.id) === null || _f === void 0 ? void 0 : _f.$nin)) ? { id: { $nin: (_g = params.id) === null || _g === void 0 ? void 0 : _g.$nin } } : undefined), (typeof ((_h = params.sort) === null || _h === void 0 ? void 0 : _h.startDate) === 'number') ? { sort: params.sort } : undefined), [], []);
|
|
615
646
|
});
|
|
616
647
|
}
|
|
617
648
|
/**
|
|
@@ -648,12 +679,18 @@ class MongoRepository {
|
|
|
648
679
|
updateAuthorizeEventOfferAction(params) {
|
|
649
680
|
return __awaiter(this, void 0, void 0, function* () {
|
|
650
681
|
return this.actionModel.findOneAndUpdate({
|
|
651
|
-
typeOf: factory.actionType.AuthorizeAction,
|
|
652
|
-
_id: params.id,
|
|
653
|
-
|
|
682
|
+
// typeOf: factory.actionType.AuthorizeAction,
|
|
683
|
+
_id: { $eq: params.id },
|
|
684
|
+
// ActiveActionStatus->CompletedActionStatusで再実装(2024-01-15~)
|
|
685
|
+
// actionStatus: factory.actionStatusType.CompletedActionStatus
|
|
686
|
+
actionStatus: { $eq: factory.actionStatusType.ActiveActionStatus }
|
|
654
687
|
}, {
|
|
655
|
-
|
|
656
|
-
|
|
688
|
+
$set: {
|
|
689
|
+
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
690
|
+
object: params.object,
|
|
691
|
+
result: params.result,
|
|
692
|
+
endDate: new Date()
|
|
693
|
+
}
|
|
657
694
|
}, { new: true })
|
|
658
695
|
.exec()
|
|
659
696
|
.then((doc) => {
|
|
@@ -951,9 +988,32 @@ class MongoRepository {
|
|
|
951
988
|
}
|
|
952
989
|
getCursor(conditions, projection) {
|
|
953
990
|
return this.actionModel.find(conditions, projection)
|
|
954
|
-
.sort({ startDate: factory.sortType.
|
|
991
|
+
.sort({ startDate: factory.sortType.Descending })
|
|
955
992
|
.cursor();
|
|
956
993
|
}
|
|
994
|
+
/**
|
|
995
|
+
* 互換性維持対応専用
|
|
996
|
+
*/
|
|
997
|
+
fixInstrumentTransactionNumber(params) {
|
|
998
|
+
var _a, _b;
|
|
999
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1000
|
+
const pendingTransactionNumber = (_b = (_a = params.object) === null || _a === void 0 ? void 0 : _a.pendingTransaction) === null || _b === void 0 ? void 0 : _b.transactionNumber;
|
|
1001
|
+
const doc = yield this.actionModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
1002
|
+
$set: Object.assign({ 'instrument.transactionNumber': params.instrument.transactionNumber }, (typeof pendingTransactionNumber === 'string')
|
|
1003
|
+
? { 'object.pendingTransaction.transactionNumber': pendingTransactionNumber }
|
|
1004
|
+
: undefined)
|
|
1005
|
+
}, {
|
|
1006
|
+
new: true,
|
|
1007
|
+
projection: {
|
|
1008
|
+
_id: 1
|
|
1009
|
+
}
|
|
1010
|
+
})
|
|
1011
|
+
.exec();
|
|
1012
|
+
if (doc === null) {
|
|
1013
|
+
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
957
1017
|
// tslint:disable-next-line:max-func-body-length
|
|
958
1018
|
agggregateByStatus(params) {
|
|
959
1019
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -298,6 +298,26 @@ export declare class MongoRepository {
|
|
|
298
298
|
} | undefined;
|
|
299
299
|
}>;
|
|
300
300
|
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
301
|
+
addAvailableAtOrFrom(params: {
|
|
302
|
+
id: string;
|
|
303
|
+
offers: {
|
|
304
|
+
seller: {
|
|
305
|
+
makesOffer: factory.event.screeningEvent.ISellerMakesOffer;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
}): Promise<any>;
|
|
309
|
+
deleteAvailableAtOrFrom(params: {
|
|
310
|
+
id: string;
|
|
311
|
+
offers: {
|
|
312
|
+
seller: {
|
|
313
|
+
makesOffer: {
|
|
314
|
+
availableAtOrFrom: {
|
|
315
|
+
id: string;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
}): Promise<any>;
|
|
301
321
|
unsetUnnecessaryFields(params: {
|
|
302
322
|
filter: FilterQuery<any>;
|
|
303
323
|
$unset: IUnset<any>;
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -1069,6 +1069,28 @@ class MongoRepository {
|
|
|
1069
1069
|
.sort({ startDate: factory.sortType.Descending })
|
|
1070
1070
|
.cursor();
|
|
1071
1071
|
}
|
|
1072
|
+
addAvailableAtOrFrom(params) {
|
|
1073
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1074
|
+
return this.eventModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
1075
|
+
$push: {
|
|
1076
|
+
'offers.seller.makesOffer': params.offers.seller.makesOffer
|
|
1077
|
+
}
|
|
1078
|
+
})
|
|
1079
|
+
.exec();
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
deleteAvailableAtOrFrom(params) {
|
|
1083
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1084
|
+
return this.eventModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
1085
|
+
$pull: {
|
|
1086
|
+
'offers.seller.makesOffer': {
|
|
1087
|
+
'availableAtOrFrom.id': { $eq: params.offers.seller.makesOffer.availableAtOrFrom.id }
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
})
|
|
1091
|
+
.exec();
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1072
1094
|
unsetUnnecessaryFields(params) {
|
|
1073
1095
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1074
1096
|
return this.eventModel.updateMany(params.filter, { $unset: params.$unset })
|
|
@@ -76,9 +76,16 @@ export declare class MongoRepository {
|
|
|
76
76
|
id: string;
|
|
77
77
|
typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
|
|
78
78
|
};
|
|
79
|
-
hasRole?: factory.iam.
|
|
79
|
+
hasRole?: factory.iam.IMemberRole[];
|
|
80
80
|
image?: string;
|
|
81
81
|
name?: string;
|
|
82
|
+
/**
|
|
83
|
+
* 所属会員
|
|
84
|
+
*/
|
|
85
|
+
member?: factory.iam.IMemberOfWebApplication[];
|
|
86
|
+
};
|
|
87
|
+
$unset: {
|
|
88
|
+
'member.member'?: 1;
|
|
82
89
|
};
|
|
83
90
|
}): Promise<void>;
|
|
84
91
|
/**
|
|
@@ -181,7 +181,13 @@ class MongoRepository {
|
|
|
181
181
|
'member.id': { $eq: params.member.id },
|
|
182
182
|
'member.memberOf.id': { $eq: params.member.memberOf.id },
|
|
183
183
|
'member.memberOf.typeOf': { $eq: params.member.memberOf.typeOf }
|
|
184
|
-
}, Object.assign(Object.assign(Object.assign({ updatedAt: new Date() }, (Array.isArray(params.member.hasRole)) ? { 'member.hasRole': params.member.hasRole } : undefined), (typeof params.member.image === 'string') ? { 'member.image': params.member.image } : undefined), (typeof params.member.name === 'string') ? { 'member.name': params.member.name } : undefined))
|
|
184
|
+
}, Object.assign({ $set: Object.assign(Object.assign(Object.assign(Object.assign({ updatedAt: new Date() }, (Array.isArray(params.member.hasRole)) ? { 'member.hasRole': params.member.hasRole } : undefined), (typeof params.member.image === 'string') ? { 'member.image': params.member.image } : undefined), (typeof params.member.name === 'string') ? { 'member.name': params.member.name } : undefined), (Array.isArray(params.member.member)) ? { 'member.member': params.member.member } : undefined) }, (params.$unset['member.member'] === 1)
|
|
185
|
+
? {
|
|
186
|
+
$unset: {
|
|
187
|
+
'member.member': 1
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
: undefined))
|
|
185
191
|
.exec();
|
|
186
192
|
if (doc === null) {
|
|
187
193
|
throw new factory.errors.NotFound(this.memberModel.modelName);
|
|
@@ -9,7 +9,8 @@ exports.modelName = modelName;
|
|
|
9
9
|
const schemaDefinition = {
|
|
10
10
|
hasPart: [mongoose_1.SchemaTypes.Mixed],
|
|
11
11
|
mainEntity: mongoose_1.SchemaTypes.Mixed,
|
|
12
|
-
project: mongoose_1.SchemaTypes.Mixed
|
|
12
|
+
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
|
+
typeOf: String
|
|
13
14
|
};
|
|
14
15
|
const schemaOptions = {
|
|
15
16
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
2
2
|
declare const modelName = "Action";
|
|
3
|
-
declare function createSchema(): Schema;
|
|
4
3
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
4
|
+
declare function createSchema(): Schema;
|
|
5
5
|
export { modelName, indexes, createSchema };
|
|
@@ -54,17 +54,6 @@ const schemaOptions = {
|
|
|
54
54
|
versionKey: false
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
/**
|
|
58
|
-
* アクションスキーマ
|
|
59
|
-
*/
|
|
60
|
-
let schema;
|
|
61
|
-
function createSchema() {
|
|
62
|
-
if (schema === undefined) {
|
|
63
|
-
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
64
|
-
}
|
|
65
|
-
return schema;
|
|
66
|
-
}
|
|
67
|
-
exports.createSchema = createSchema;
|
|
68
57
|
const indexes = [
|
|
69
58
|
[
|
|
70
59
|
{ createdAt: 1 },
|
|
@@ -388,6 +377,31 @@ const indexes = [
|
|
|
388
377
|
'toLocation.accountType': { $exists: true }
|
|
389
378
|
}
|
|
390
379
|
}
|
|
380
|
+
],
|
|
381
|
+
[
|
|
382
|
+
{ 'instrument.transactionNumber': 1, startDate: -1 },
|
|
383
|
+
{
|
|
384
|
+
name: 'searchByInstrumentTransactionNumber',
|
|
385
|
+
partialFilterExpression: {
|
|
386
|
+
'instrument.transactionNumber': { $exists: true }
|
|
387
|
+
}
|
|
388
|
+
}
|
|
391
389
|
]
|
|
392
390
|
];
|
|
393
391
|
exports.indexes = indexes;
|
|
392
|
+
/**
|
|
393
|
+
* アクションスキーマ
|
|
394
|
+
*/
|
|
395
|
+
let schema;
|
|
396
|
+
function createSchema() {
|
|
397
|
+
if (schema === undefined) {
|
|
398
|
+
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
399
|
+
}
|
|
400
|
+
if (settings_1.MONGO_AUTO_INDEX) {
|
|
401
|
+
indexes.forEach((indexParams) => {
|
|
402
|
+
schema === null || schema === void 0 ? void 0 : schema.index(...indexParams);
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
return schema;
|
|
406
|
+
}
|
|
407
|
+
exports.createSchema = createSchema;
|