@chevre/domain 21.20.0-alpha.54 → 21.20.0-alpha.55
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/searchActions.ts +12 -7
- package/lib/chevre/repo/acceptedOffer.d.ts +1 -1
- package/lib/chevre/repo/acceptedOffer.js +2 -1
- package/lib/chevre/repo/action.js +40 -36
- 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.js +10 -1
- package/lib/chevre/repo/order.js +15 -11
- package/lib/chevre/service/offer/event/authorize.js +9 -14
- package/lib/chevre/service/offer/event/factory.d.ts +1 -1
- package/lib/chevre/service/offer/event/factory.js +8 -21
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +7 -9
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +4 -0
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +47 -2
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.d.ts +2 -0
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +45 -1
- package/lib/chevre/service/offer/product/factory.js +2 -5
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +37 -8
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +16 -15
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +32 -0
- package/lib/chevre/service/task/confirmMoneyTransfer.js +4 -4
- package/lib/chevre/service/transaction/moneyTransfer.js +6 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +3 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +34 -37
- package/package.json +3 -3
|
@@ -5,20 +5,25 @@ import * as mongoose from 'mongoose';
|
|
|
5
5
|
|
|
6
6
|
// const project = { id: String(process.env.PROJECT_ID) };
|
|
7
7
|
|
|
8
|
+
mongoose.Model.on('index', (...args) => {
|
|
9
|
+
console.error('******** index event emitted. ********\n', args);
|
|
10
|
+
});
|
|
11
|
+
|
|
8
12
|
async function main() {
|
|
9
13
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
14
|
|
|
11
15
|
const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
|
|
12
16
|
const actions = await actionRepo.search(
|
|
13
17
|
{
|
|
14
|
-
typeOf: { $eq: chevre.factory.actionType.CheckAction },
|
|
18
|
+
// typeOf: { $eq: chevre.factory.actionType.CheckAction },
|
|
15
19
|
// project: { id: { $eq: project.id } },
|
|
16
|
-
object: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
20
|
+
// object: {
|
|
21
|
+
// movieTickets: {
|
|
22
|
+
// identifier: { $eq: '0947524082' },
|
|
23
|
+
// serviceOutput: { reservationFor: { id: { $eq: 'clhvvbpyn' } } }
|
|
24
|
+
// }
|
|
25
|
+
// }
|
|
26
|
+
instrument: { transactionNumber: { $eq: 'x' } }
|
|
22
27
|
},
|
|
23
28
|
['_id'],
|
|
24
29
|
[]
|
|
@@ -5,7 +5,7 @@ type IProjection4searchWithUnwoundAcceptedOffers = {
|
|
|
5
5
|
} & {
|
|
6
6
|
_id?: 0 | 1;
|
|
7
7
|
};
|
|
8
|
-
type IDistinctField = 'acceptedOffers.id' | 'acceptedOffers.itemOffered.reservationNumber' | 'acceptedOffers.itemOffered.reservationFor.id' | 'acceptedOffers.itemOffered.issuedThrough.id' | 'acceptedOffers.offeredThrough.identifier' | 'acceptedOffers.itemOffered.reservationFor.superEvent.location.branchCode';
|
|
8
|
+
type IDistinctField = 'acceptedOffers.id' | 'acceptedOffers.itemOffered.reservationNumber' | 'acceptedOffers.itemOffered.reservationFor.id' | 'acceptedOffers.itemOffered.issuedThrough.id' | 'acceptedOffers.offeredThrough.identifier' | 'acceptedOffers.itemOffered.reservationFor.superEvent.location.branchCode' | 'acceptedOffers.itemOffered.object.pendingTransaction.transactionNumber';
|
|
9
9
|
type IAcceptedOffer = factory.order.IAcceptedOffer<factory.order.IItemOffered>;
|
|
10
10
|
interface ISearchSlicedAcceptedOffersResult {
|
|
11
11
|
acceptedOffers: IAcceptedOffer[];
|
|
@@ -143,7 +143,8 @@ class MongoRepository {
|
|
|
143
143
|
typeOf: '$acceptedOffers.typeOf',
|
|
144
144
|
id: '$acceptedOffers.id',
|
|
145
145
|
offeredThrough: '$acceptedOffers.offeredThrough',
|
|
146
|
-
name: '$acceptedOffers.name'
|
|
146
|
+
name: '$acceptedOffers.name',
|
|
147
|
+
serialNumber: '$acceptedOffers.serialNumber'
|
|
147
148
|
});
|
|
148
149
|
}
|
|
149
150
|
if (typeof filter.limit === 'number' && filter.limit > 0) {
|
|
@@ -22,7 +22,7 @@ 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, _66;
|
|
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;
|
|
26
26
|
const andConditions = [];
|
|
27
27
|
const idNin = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$nin;
|
|
28
28
|
if (Array.isArray(idNin)) {
|
|
@@ -58,7 +58,11 @@ class MongoRepository {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const instrumentTransactionNumberEq = (_j = (_h = params.instrument) === null || _h === void 0 ? void 0 : _h.transactionNumber) === null || _j === void 0 ? void 0 : _j.$eq;
|
|
62
|
+
if (typeof instrumentTransactionNumberEq === 'string') {
|
|
63
|
+
andConditions.push({ 'instrument.transactionNumber': { $exists: true, $eq: instrumentTransactionNumberEq } });
|
|
64
|
+
}
|
|
65
|
+
const locationIdEq = (_l = (_k = params.location) === null || _k === void 0 ? void 0 : _k.id) === null || _l === void 0 ? void 0 : _l.$eq;
|
|
62
66
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
63
67
|
/* istanbul ignore else */
|
|
64
68
|
if (typeof locationIdEq === 'string') {
|
|
@@ -69,7 +73,7 @@ class MongoRepository {
|
|
|
69
73
|
}
|
|
70
74
|
});
|
|
71
75
|
}
|
|
72
|
-
const locationIdentifierEq = (
|
|
76
|
+
const locationIdentifierEq = (_o = (_m = params.location) === null || _m === void 0 ? void 0 : _m.identifier) === null || _o === void 0 ? void 0 : _o.$eq;
|
|
73
77
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
74
78
|
/* istanbul ignore else */
|
|
75
79
|
if (typeof locationIdentifierEq === 'string') {
|
|
@@ -80,7 +84,7 @@ class MongoRepository {
|
|
|
80
84
|
}
|
|
81
85
|
});
|
|
82
86
|
}
|
|
83
|
-
const objectMovieTicketsIdentifierEq = (
|
|
87
|
+
const objectMovieTicketsIdentifierEq = (_r = (_q = (_p = params.object) === null || _p === void 0 ? void 0 : _p.movieTickets) === null || _q === void 0 ? void 0 : _q.identifier) === null || _r === void 0 ? void 0 : _r.$eq;
|
|
84
88
|
if (typeof objectMovieTicketsIdentifierEq === 'string') {
|
|
85
89
|
andConditions.push({
|
|
86
90
|
'object.movieTickets.identifier': {
|
|
@@ -89,7 +93,7 @@ class MongoRepository {
|
|
|
89
93
|
}
|
|
90
94
|
});
|
|
91
95
|
}
|
|
92
|
-
const objectMovieTicketsServiceOutputReservationForIdEq = (
|
|
96
|
+
const objectMovieTicketsServiceOutputReservationForIdEq = (_w = (_v = (_u = (_t = (_s = params.object) === null || _s === void 0 ? void 0 : _s.movieTickets) === null || _t === void 0 ? void 0 : _t.serviceOutput) === null || _u === void 0 ? void 0 : _u.reservationFor) === null || _v === void 0 ? void 0 : _v.id) === null || _w === void 0 ? void 0 : _w.$eq;
|
|
93
97
|
if (typeof objectMovieTicketsServiceOutputReservationForIdEq === 'string') {
|
|
94
98
|
andConditions.push({
|
|
95
99
|
'object.movieTickets.serviceOutput.reservationFor.id': {
|
|
@@ -100,7 +104,7 @@ class MongoRepository {
|
|
|
100
104
|
}
|
|
101
105
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
102
106
|
/* istanbul ignore else */
|
|
103
|
-
const objectPaymentMethodIdEq = (
|
|
107
|
+
const objectPaymentMethodIdEq = (_y = (_x = params.object) === null || _x === void 0 ? void 0 : _x.paymentMethodId) === null || _y === void 0 ? void 0 : _y.$eq;
|
|
104
108
|
if (typeof objectPaymentMethodIdEq === 'string') {
|
|
105
109
|
andConditions.push({
|
|
106
110
|
'object.paymentMethodId': {
|
|
@@ -109,7 +113,7 @@ class MongoRepository {
|
|
|
109
113
|
}
|
|
110
114
|
});
|
|
111
115
|
}
|
|
112
|
-
const objectObjectPaymentMethodIdEq = (
|
|
116
|
+
const objectObjectPaymentMethodIdEq = (_1 = (_0 = (_z = params.object) === null || _z === void 0 ? void 0 : _z.object) === null || _0 === void 0 ? void 0 : _0.paymentMethodId) === null || _1 === void 0 ? void 0 : _1.$eq;
|
|
113
117
|
if (typeof objectObjectPaymentMethodIdEq === 'string') {
|
|
114
118
|
andConditions.push({
|
|
115
119
|
'object.object.paymentMethodId': {
|
|
@@ -118,7 +122,7 @@ class MongoRepository {
|
|
|
118
122
|
}
|
|
119
123
|
});
|
|
120
124
|
}
|
|
121
|
-
const objectReservationForIdEq = (
|
|
125
|
+
const objectReservationForIdEq = (_4 = (_3 = (_2 = params.object) === null || _2 === void 0 ? void 0 : _2.reservationFor) === null || _3 === void 0 ? void 0 : _3.id) === null || _4 === void 0 ? void 0 : _4.$eq;
|
|
122
126
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
123
127
|
/* istanbul ignore else */
|
|
124
128
|
if (typeof objectReservationForIdEq === 'string') {
|
|
@@ -129,7 +133,7 @@ class MongoRepository {
|
|
|
129
133
|
}
|
|
130
134
|
});
|
|
131
135
|
}
|
|
132
|
-
const objectReservationNumberEq = (
|
|
136
|
+
const objectReservationNumberEq = (_6 = (_5 = params.object) === null || _5 === void 0 ? void 0 : _5.reservationNumber) === null || _6 === void 0 ? void 0 : _6.$eq;
|
|
133
137
|
if (typeof objectReservationNumberEq === 'string') {
|
|
134
138
|
andConditions.push({
|
|
135
139
|
'object.reservationNumber': {
|
|
@@ -138,7 +142,7 @@ class MongoRepository {
|
|
|
138
142
|
}
|
|
139
143
|
});
|
|
140
144
|
}
|
|
141
|
-
const objectReservationNumberIn = (
|
|
145
|
+
const objectReservationNumberIn = (_8 = (_7 = params.object) === null || _7 === void 0 ? void 0 : _7.reservationNumber) === null || _8 === void 0 ? void 0 : _8.$in;
|
|
142
146
|
if (Array.isArray(objectReservationNumberIn)) {
|
|
143
147
|
andConditions.push({
|
|
144
148
|
'object.reservationNumber': {
|
|
@@ -147,7 +151,7 @@ class MongoRepository {
|
|
|
147
151
|
}
|
|
148
152
|
});
|
|
149
153
|
}
|
|
150
|
-
const objectPaymentMethodAccountIdEq = (
|
|
154
|
+
const objectPaymentMethodAccountIdEq = (_11 = (_10 = (_9 = params.object) === null || _9 === void 0 ? void 0 : _9.paymentMethod) === null || _10 === void 0 ? void 0 : _10.accountId) === null || _11 === void 0 ? void 0 : _11.$eq;
|
|
151
155
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
152
156
|
/* istanbul ignore else */
|
|
153
157
|
if (typeof objectPaymentMethodAccountIdEq === 'string') {
|
|
@@ -158,7 +162,7 @@ class MongoRepository {
|
|
|
158
162
|
}
|
|
159
163
|
});
|
|
160
164
|
}
|
|
161
|
-
const objectPaymentMethodPaymentMethodIdEq = (
|
|
165
|
+
const objectPaymentMethodPaymentMethodIdEq = (_14 = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.paymentMethod) === null || _13 === void 0 ? void 0 : _13.paymentMethodId) === null || _14 === void 0 ? void 0 : _14.$eq;
|
|
162
166
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
163
167
|
/* istanbul ignore else */
|
|
164
168
|
if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
|
|
@@ -169,7 +173,7 @@ class MongoRepository {
|
|
|
169
173
|
}
|
|
170
174
|
});
|
|
171
175
|
}
|
|
172
|
-
const objectPaymentMethodPaymentMethodIdIn = (
|
|
176
|
+
const objectPaymentMethodPaymentMethodIdIn = (_17 = (_16 = (_15 = params.object) === null || _15 === void 0 ? void 0 : _15.paymentMethod) === null || _16 === void 0 ? void 0 : _16.paymentMethodId) === null || _17 === void 0 ? void 0 : _17.$in;
|
|
173
177
|
if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
|
|
174
178
|
andConditions.push({
|
|
175
179
|
'object.paymentMethod.paymentMethodId': {
|
|
@@ -178,7 +182,7 @@ class MongoRepository {
|
|
|
178
182
|
}
|
|
179
183
|
});
|
|
180
184
|
}
|
|
181
|
-
const objectPaymentMethodTypeOfEq = (
|
|
185
|
+
const objectPaymentMethodTypeOfEq = (_20 = (_19 = (_18 = params.object) === null || _18 === void 0 ? void 0 : _18.paymentMethod) === null || _19 === void 0 ? void 0 : _19.typeOf) === null || _20 === void 0 ? void 0 : _20.$eq;
|
|
182
186
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
183
187
|
/* istanbul ignore else */
|
|
184
188
|
if (typeof objectPaymentMethodTypeOfEq === 'string') {
|
|
@@ -189,7 +193,7 @@ class MongoRepository {
|
|
|
189
193
|
}
|
|
190
194
|
});
|
|
191
195
|
}
|
|
192
|
-
const objectTypeOfEq = (
|
|
196
|
+
const objectTypeOfEq = (_22 = (_21 = params.object) === null || _21 === void 0 ? void 0 : _21.typeOf) === null || _22 === void 0 ? void 0 : _22.$eq;
|
|
193
197
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
194
198
|
/* istanbul ignore else */
|
|
195
199
|
if (typeof objectTypeOfEq === 'string') {
|
|
@@ -200,7 +204,7 @@ class MongoRepository {
|
|
|
200
204
|
}
|
|
201
205
|
});
|
|
202
206
|
}
|
|
203
|
-
const objectTypeOfIn = (
|
|
207
|
+
const objectTypeOfIn = (_24 = (_23 = params.object) === null || _23 === void 0 ? void 0 : _23.typeOf) === null || _24 === void 0 ? void 0 : _24.$in;
|
|
204
208
|
if (Array.isArray(objectTypeOfIn)) {
|
|
205
209
|
andConditions.push({
|
|
206
210
|
'object.typeOf': {
|
|
@@ -209,7 +213,7 @@ class MongoRepository {
|
|
|
209
213
|
}
|
|
210
214
|
});
|
|
211
215
|
}
|
|
212
|
-
const objectIdEq = (
|
|
216
|
+
const objectIdEq = (_26 = (_25 = params.object) === null || _25 === void 0 ? void 0 : _25.id) === null || _26 === void 0 ? void 0 : _26.$eq;
|
|
213
217
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
214
218
|
/* istanbul ignore else */
|
|
215
219
|
if (typeof objectIdEq === 'string') {
|
|
@@ -220,7 +224,7 @@ class MongoRepository {
|
|
|
220
224
|
}
|
|
221
225
|
});
|
|
222
226
|
}
|
|
223
|
-
const objectIdIn = (
|
|
227
|
+
const objectIdIn = (_28 = (_27 = params.object) === null || _27 === void 0 ? void 0 : _27.id) === null || _28 === void 0 ? void 0 : _28.$in;
|
|
224
228
|
if (Array.isArray(objectIdIn)) {
|
|
225
229
|
andConditions.push({
|
|
226
230
|
'object.id': {
|
|
@@ -229,7 +233,7 @@ class MongoRepository {
|
|
|
229
233
|
}
|
|
230
234
|
});
|
|
231
235
|
}
|
|
232
|
-
const objectOrderNumberIn = (
|
|
236
|
+
const objectOrderNumberIn = (_30 = (_29 = params.object) === null || _29 === void 0 ? void 0 : _29.orderNumber) === null || _30 === void 0 ? void 0 : _30.$in;
|
|
233
237
|
if (Array.isArray(objectOrderNumberIn)) {
|
|
234
238
|
andConditions.push({
|
|
235
239
|
'object.orderNumber': {
|
|
@@ -238,7 +242,7 @@ class MongoRepository {
|
|
|
238
242
|
}
|
|
239
243
|
});
|
|
240
244
|
}
|
|
241
|
-
const objectEventIdIn = (
|
|
245
|
+
const objectEventIdIn = (_33 = (_32 = (_31 = params.object) === null || _31 === void 0 ? void 0 : _31.event) === null || _32 === void 0 ? void 0 : _32.id) === null || _33 === void 0 ? void 0 : _33.$in;
|
|
242
246
|
if (Array.isArray(objectEventIdIn)) {
|
|
243
247
|
andConditions.push({
|
|
244
248
|
'object.event.id': {
|
|
@@ -247,7 +251,7 @@ class MongoRepository {
|
|
|
247
251
|
}
|
|
248
252
|
});
|
|
249
253
|
}
|
|
250
|
-
const objectAcceptedOfferSeatNumberIn = (
|
|
254
|
+
const objectAcceptedOfferSeatNumberIn = (_40 = (_39 = (_38 = (_37 = (_36 = (_35 = (_34 = params.object) === null || _34 === void 0 ? void 0 : _34.acceptedOffer) === null || _35 === void 0 ? void 0 : _35.itemOffered) === null || _36 === void 0 ? void 0 : _36.serviceOutput) === null || _37 === void 0 ? void 0 : _37.reservedTicket) === null || _38 === void 0 ? void 0 : _38.ticketedSeat) === null || _39 === void 0 ? void 0 : _39.seatNumber) === null || _40 === void 0 ? void 0 : _40.$in;
|
|
251
255
|
if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
|
|
252
256
|
andConditions.push({
|
|
253
257
|
'object.acceptedOffer.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatNumber': {
|
|
@@ -264,7 +268,7 @@ class MongoRepository {
|
|
|
264
268
|
});
|
|
265
269
|
}
|
|
266
270
|
else {
|
|
267
|
-
const typeOfEq = (
|
|
271
|
+
const typeOfEq = (_41 = params.typeOf) === null || _41 === void 0 ? void 0 : _41.$eq;
|
|
268
272
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
269
273
|
/* istanbul ignore else */
|
|
270
274
|
if (typeof typeOfEq === 'string') {
|
|
@@ -273,7 +277,7 @@ class MongoRepository {
|
|
|
273
277
|
});
|
|
274
278
|
}
|
|
275
279
|
}
|
|
276
|
-
const actionStatusIn = (
|
|
280
|
+
const actionStatusIn = (_42 = params.actionStatus) === null || _42 === void 0 ? void 0 : _42.$in;
|
|
277
281
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
278
282
|
/* istanbul ignore else */
|
|
279
283
|
if (Array.isArray(actionStatusIn)) {
|
|
@@ -304,7 +308,7 @@ class MongoRepository {
|
|
|
304
308
|
startDate: { $lte: startDateLte }
|
|
305
309
|
});
|
|
306
310
|
}
|
|
307
|
-
const fromLocationTypeOfIn = (
|
|
311
|
+
const fromLocationTypeOfIn = (_44 = (_43 = params.fromLocation) === null || _43 === void 0 ? void 0 : _43.typeOf) === null || _44 === void 0 ? void 0 : _44.$in;
|
|
308
312
|
if (Array.isArray(fromLocationTypeOfIn)) {
|
|
309
313
|
andConditions.push({
|
|
310
314
|
'fromLocation.typeOf': {
|
|
@@ -313,7 +317,7 @@ class MongoRepository {
|
|
|
313
317
|
}
|
|
314
318
|
});
|
|
315
319
|
}
|
|
316
|
-
const fromLocationAccountNumberIn = (
|
|
320
|
+
const fromLocationAccountNumberIn = (_46 = (_45 = params.fromLocation) === null || _45 === void 0 ? void 0 : _45.accountNumber) === null || _46 === void 0 ? void 0 : _46.$in;
|
|
317
321
|
if (Array.isArray(fromLocationAccountNumberIn)) {
|
|
318
322
|
andConditions.push({
|
|
319
323
|
'fromLocation.accountNumber': {
|
|
@@ -322,7 +326,7 @@ class MongoRepository {
|
|
|
322
326
|
}
|
|
323
327
|
});
|
|
324
328
|
}
|
|
325
|
-
const fromLocationAccountTypeIn = (
|
|
329
|
+
const fromLocationAccountTypeIn = (_48 = (_47 = params.fromLocation) === null || _47 === void 0 ? void 0 : _47.accountType) === null || _48 === void 0 ? void 0 : _48.$in;
|
|
326
330
|
if (Array.isArray(fromLocationAccountTypeIn)) {
|
|
327
331
|
andConditions.push({
|
|
328
332
|
'fromLocation.accountType': {
|
|
@@ -331,7 +335,7 @@ class MongoRepository {
|
|
|
331
335
|
}
|
|
332
336
|
});
|
|
333
337
|
}
|
|
334
|
-
const toLocationTypeOfIn = (
|
|
338
|
+
const toLocationTypeOfIn = (_50 = (_49 = params.toLocation) === null || _49 === void 0 ? void 0 : _49.typeOf) === null || _50 === void 0 ? void 0 : _50.$in;
|
|
335
339
|
if (Array.isArray(toLocationTypeOfIn)) {
|
|
336
340
|
andConditions.push({
|
|
337
341
|
'toLocation.typeOf': {
|
|
@@ -340,7 +344,7 @@ class MongoRepository {
|
|
|
340
344
|
}
|
|
341
345
|
});
|
|
342
346
|
}
|
|
343
|
-
const toLocationAccountNumberIn = (
|
|
347
|
+
const toLocationAccountNumberIn = (_52 = (_51 = params.toLocation) === null || _51 === void 0 ? void 0 : _51.accountNumber) === null || _52 === void 0 ? void 0 : _52.$in;
|
|
344
348
|
if (Array.isArray(toLocationAccountNumberIn)) {
|
|
345
349
|
andConditions.push({
|
|
346
350
|
'toLocation.accountNumber': {
|
|
@@ -349,7 +353,7 @@ class MongoRepository {
|
|
|
349
353
|
}
|
|
350
354
|
});
|
|
351
355
|
}
|
|
352
|
-
const toLocationAccountTypeIn = (
|
|
356
|
+
const toLocationAccountTypeIn = (_54 = (_53 = params.toLocation) === null || _53 === void 0 ? void 0 : _53.accountType) === null || _54 === void 0 ? void 0 : _54.$in;
|
|
353
357
|
if (Array.isArray(toLocationAccountTypeIn)) {
|
|
354
358
|
andConditions.push({
|
|
355
359
|
'toLocation.accountType': {
|
|
@@ -358,7 +362,7 @@ class MongoRepository {
|
|
|
358
362
|
}
|
|
359
363
|
});
|
|
360
364
|
}
|
|
361
|
-
const purposeTypeOfIn = (
|
|
365
|
+
const purposeTypeOfIn = (_56 = (_55 = params.purpose) === null || _55 === void 0 ? void 0 : _55.typeOf) === null || _56 === void 0 ? void 0 : _56.$in;
|
|
362
366
|
if (Array.isArray(purposeTypeOfIn)) {
|
|
363
367
|
andConditions.push({
|
|
364
368
|
'purpose.typeOf': {
|
|
@@ -367,7 +371,7 @@ class MongoRepository {
|
|
|
367
371
|
}
|
|
368
372
|
});
|
|
369
373
|
}
|
|
370
|
-
const purposeIdIn = (
|
|
374
|
+
const purposeIdIn = (_58 = (_57 = params.purpose) === null || _57 === void 0 ? void 0 : _57.id) === null || _58 === void 0 ? void 0 : _58.$in;
|
|
371
375
|
if (Array.isArray(purposeIdIn)) {
|
|
372
376
|
andConditions.push({
|
|
373
377
|
'purpose.id': {
|
|
@@ -376,7 +380,7 @@ class MongoRepository {
|
|
|
376
380
|
}
|
|
377
381
|
});
|
|
378
382
|
}
|
|
379
|
-
const purposeOrderNumberIn = (
|
|
383
|
+
const purposeOrderNumberIn = (_60 = (_59 = params.purpose) === null || _59 === void 0 ? void 0 : _59.orderNumber) === null || _60 === void 0 ? void 0 : _60.$in;
|
|
380
384
|
if (Array.isArray(purposeOrderNumberIn)) {
|
|
381
385
|
andConditions.push({
|
|
382
386
|
'purpose.orderNumber': {
|
|
@@ -385,7 +389,7 @@ class MongoRepository {
|
|
|
385
389
|
}
|
|
386
390
|
});
|
|
387
391
|
}
|
|
388
|
-
const resultTypeOfIn = (
|
|
392
|
+
const resultTypeOfIn = (_62 = (_61 = params.result) === null || _61 === void 0 ? void 0 : _61.typeOf) === null || _62 === void 0 ? void 0 : _62.$in;
|
|
389
393
|
if (Array.isArray(resultTypeOfIn)) {
|
|
390
394
|
andConditions.push({
|
|
391
395
|
'result.typeOf': {
|
|
@@ -394,7 +398,7 @@ class MongoRepository {
|
|
|
394
398
|
}
|
|
395
399
|
});
|
|
396
400
|
}
|
|
397
|
-
const resultIdIn = (
|
|
401
|
+
const resultIdIn = (_64 = (_63 = params.result) === null || _63 === void 0 ? void 0 : _63.id) === null || _64 === void 0 ? void 0 : _64.$in;
|
|
398
402
|
if (Array.isArray(resultIdIn)) {
|
|
399
403
|
andConditions.push({
|
|
400
404
|
'result.id': {
|
|
@@ -403,7 +407,7 @@ class MongoRepository {
|
|
|
403
407
|
}
|
|
404
408
|
});
|
|
405
409
|
}
|
|
406
|
-
const resultOrderNumberIn = (
|
|
410
|
+
const resultOrderNumberIn = (_66 = (_65 = params.result) === null || _65 === void 0 ? void 0 : _65.orderNumber) === null || _66 === void 0 ? void 0 : _66.$in;
|
|
407
411
|
if (Array.isArray(resultOrderNumberIn)) {
|
|
408
412
|
andConditions.push({
|
|
409
413
|
'result.orderNumber': {
|
|
@@ -412,7 +416,7 @@ class MongoRepository {
|
|
|
412
416
|
}
|
|
413
417
|
});
|
|
414
418
|
}
|
|
415
|
-
const resultCodeIn = (
|
|
419
|
+
const resultCodeIn = (_68 = (_67 = params.result) === null || _67 === void 0 ? void 0 : _67.code) === null || _68 === void 0 ? void 0 : _68.$in;
|
|
416
420
|
if (Array.isArray(resultCodeIn)) {
|
|
417
421
|
andConditions.push({
|
|
418
422
|
'result.code': {
|
|
@@ -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;
|
|
@@ -429,7 +429,7 @@ const indexes = [
|
|
|
429
429
|
}
|
|
430
430
|
],
|
|
431
431
|
[
|
|
432
|
-
{ 'acceptedOffers.itemOffered.reservedTicket.ticketedSeat.seatNumber': 1,
|
|
432
|
+
{ 'acceptedOffers.itemOffered.reservedTicket.ticketedSeat.seatNumber': 1, orderDate: -1 },
|
|
433
433
|
{
|
|
434
434
|
name: 'searchByReservedTicketTicketedSeatSeatNumber',
|
|
435
435
|
partialFilterExpression: {
|
|
@@ -437,6 +437,15 @@ const indexes = [
|
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
],
|
|
440
|
+
[
|
|
441
|
+
{ 'acceptedOffers.serialNumber': 1, orderDate: -1 },
|
|
442
|
+
{
|
|
443
|
+
name: 'searchByAcceptedOffersSerialNumber',
|
|
444
|
+
partialFilterExpression: {
|
|
445
|
+
'acceptedOffers.serialNumber': { $exists: true }
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
],
|
|
440
449
|
[
|
|
441
450
|
{ price: 1, orderDate: -1 },
|
|
442
451
|
{
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -23,7 +23,7 @@ class MongoRepository {
|
|
|
23
23
|
}
|
|
24
24
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
25
25
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
26
|
-
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;
|
|
26
|
+
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
27
|
const andConditions = [
|
|
28
28
|
{ typeOf: { $eq: factory.order.OrderType.Order } }
|
|
29
29
|
];
|
|
@@ -354,7 +354,11 @@ class MongoRepository {
|
|
|
354
354
|
if (typeof acceptedOffersSize === 'number') {
|
|
355
355
|
andConditions.push({ acceptedOffers: { $size: acceptedOffersSize } });
|
|
356
356
|
}
|
|
357
|
-
const
|
|
357
|
+
const serialNumberEq = (_u = (_t = params.acceptedOffers) === null || _t === void 0 ? void 0 : _t.serialNumber) === null || _u === void 0 ? void 0 : _u.$eq;
|
|
358
|
+
if (typeof serialNumberEq === 'string') {
|
|
359
|
+
andConditions.push({ 'acceptedOffers.serialNumber': { $exists: true, $eq: serialNumberEq } });
|
|
360
|
+
}
|
|
361
|
+
const itemOfferedIdentifierIn = (_x = (_w = (_v = params.acceptedOffers) === null || _v === void 0 ? void 0 : _v.itemOffered) === null || _w === void 0 ? void 0 : _w.identifier) === null || _x === void 0 ? void 0 : _x.$in;
|
|
358
362
|
if (Array.isArray(itemOfferedIdentifierIn)) {
|
|
359
363
|
andConditions.push({
|
|
360
364
|
'acceptedOffers.itemOffered.identifier': {
|
|
@@ -363,7 +367,7 @@ class MongoRepository {
|
|
|
363
367
|
}
|
|
364
368
|
});
|
|
365
369
|
}
|
|
366
|
-
const itemOfferedTypeOfIn = (
|
|
370
|
+
const itemOfferedTypeOfIn = (_0 = (_z = (_y = params.acceptedOffers) === null || _y === void 0 ? void 0 : _y.itemOffered) === null || _z === void 0 ? void 0 : _z.typeOf) === null || _0 === void 0 ? void 0 : _0.$in;
|
|
367
371
|
if (Array.isArray(itemOfferedTypeOfIn)) {
|
|
368
372
|
andConditions.push({
|
|
369
373
|
'acceptedOffers.itemOffered.typeOf': {
|
|
@@ -372,7 +376,7 @@ class MongoRepository {
|
|
|
372
376
|
}
|
|
373
377
|
});
|
|
374
378
|
}
|
|
375
|
-
const itemOfferedIssuedThroughTypeOfEq = (
|
|
379
|
+
const itemOfferedIssuedThroughTypeOfEq = (_4 = (_3 = (_2 = (_1 = params.acceptedOffers) === null || _1 === void 0 ? void 0 : _1.itemOffered) === null || _2 === void 0 ? void 0 : _2.issuedThrough) === null || _3 === void 0 ? void 0 : _3.typeOf) === null || _4 === void 0 ? void 0 : _4.$eq;
|
|
376
380
|
if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
|
|
377
381
|
andConditions.push({
|
|
378
382
|
'acceptedOffers.itemOffered.issuedThrough.typeOf': {
|
|
@@ -381,7 +385,7 @@ class MongoRepository {
|
|
|
381
385
|
}
|
|
382
386
|
});
|
|
383
387
|
}
|
|
384
|
-
const itemOfferedIssuedThroughIdIn = (
|
|
388
|
+
const itemOfferedIssuedThroughIdIn = (_8 = (_7 = (_6 = (_5 = params.acceptedOffers) === null || _5 === void 0 ? void 0 : _5.itemOffered) === null || _6 === void 0 ? void 0 : _6.issuedThrough) === null || _7 === void 0 ? void 0 : _7.id) === null || _8 === void 0 ? void 0 : _8.$in;
|
|
385
389
|
if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
|
|
386
390
|
andConditions.push({
|
|
387
391
|
'acceptedOffers.itemOffered.issuedThrough.id': {
|
|
@@ -390,7 +394,7 @@ class MongoRepository {
|
|
|
390
394
|
}
|
|
391
395
|
});
|
|
392
396
|
}
|
|
393
|
-
const itemOfferedProgramMembershipUsedIdentifierEq = (
|
|
397
|
+
const itemOfferedProgramMembershipUsedIdentifierEq = (_12 = (_11 = (_10 = (_9 = params.acceptedOffers) === null || _9 === void 0 ? void 0 : _9.itemOffered) === null || _10 === void 0 ? void 0 : _10.programMembershipUsed) === null || _11 === void 0 ? void 0 : _11.identifier) === null || _12 === void 0 ? void 0 : _12.$eq;
|
|
394
398
|
if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
|
|
395
399
|
andConditions.push({
|
|
396
400
|
'acceptedOffers.itemOffered.programMembershipUsed.identifier': {
|
|
@@ -399,7 +403,7 @@ class MongoRepository {
|
|
|
399
403
|
}
|
|
400
404
|
});
|
|
401
405
|
}
|
|
402
|
-
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (
|
|
406
|
+
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_18 = (_17 = (_16 = (_15 = (_14 = (_13 = params.acceptedOffers) === null || _13 === void 0 ? void 0 : _13.itemOffered) === null || _14 === void 0 ? void 0 : _14.programMembershipUsed) === null || _15 === void 0 ? void 0 : _15.issuedThrough) === null || _16 === void 0 ? void 0 : _16.serviceType) === null || _17 === void 0 ? void 0 : _17.codeValue) === null || _18 === void 0 ? void 0 : _18.$eq;
|
|
403
407
|
if (typeof itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
|
|
404
408
|
andConditions.push({
|
|
405
409
|
'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': {
|
|
@@ -561,11 +565,11 @@ class MongoRepository {
|
|
|
561
565
|
}
|
|
562
566
|
}
|
|
563
567
|
}
|
|
564
|
-
const paymentMethodIdentifierIn = (
|
|
568
|
+
const paymentMethodIdentifierIn = (_21 = (_20 = (_19 = params.paymentMethods) === null || _19 === void 0 ? void 0 : _19.paymentMethod) === null || _20 === void 0 ? void 0 : _20.identifier) === null || _21 === void 0 ? void 0 : _21.$in;
|
|
565
569
|
if (Array.isArray(paymentMethodIdentifierIn)) {
|
|
566
570
|
andConditions.push({ 'paymentMethods.paymentMethod.identifier': { $exists: true, $in: paymentMethodIdentifierIn } });
|
|
567
571
|
}
|
|
568
|
-
const paymentMethodsTypeOfIn = (
|
|
572
|
+
const paymentMethodsTypeOfIn = (_22 = params.paymentMethods) === null || _22 === void 0 ? void 0 : _22.typeOfs;
|
|
569
573
|
if (Array.isArray(paymentMethodsTypeOfIn)) {
|
|
570
574
|
// paymentMethod.identifierで検索(2023-11-15~)
|
|
571
575
|
// andConditions.push({ 'paymentMethods.typeOf': { $exists: true, $in: paymentMethodsTypeOfIn } });
|
|
@@ -595,7 +599,7 @@ class MongoRepository {
|
|
|
595
599
|
});
|
|
596
600
|
}
|
|
597
601
|
}
|
|
598
|
-
const paymentMethodAdditionalPropertyAll = (
|
|
602
|
+
const paymentMethodAdditionalPropertyAll = (_24 = (_23 = params.paymentMethods) === null || _23 === void 0 ? void 0 : _23.additionalProperty) === null || _24 === void 0 ? void 0 : _24.$all;
|
|
599
603
|
if (Array.isArray(paymentMethodAdditionalPropertyAll)) {
|
|
600
604
|
andConditions.push({
|
|
601
605
|
'paymentMethods.additionalProperty': {
|
|
@@ -604,7 +608,7 @@ class MongoRepository {
|
|
|
604
608
|
}
|
|
605
609
|
});
|
|
606
610
|
}
|
|
607
|
-
const paymentMethodAdditionalPropertyIn = (
|
|
611
|
+
const paymentMethodAdditionalPropertyIn = (_26 = (_25 = params.paymentMethods) === null || _25 === void 0 ? void 0 : _25.additionalProperty) === null || _26 === void 0 ? void 0 : _26.$in;
|
|
608
612
|
if (Array.isArray(paymentMethodAdditionalPropertyIn)) {
|
|
609
613
|
andConditions.push({
|
|
610
614
|
'paymentMethods.additionalProperty': {
|
|
@@ -33,21 +33,16 @@ function authorize(params) {
|
|
|
33
33
|
noOfferSpecified
|
|
34
34
|
})(repos);
|
|
35
35
|
let acceptedOffers4result = [];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
case factory.service.webAPI.Identifier.COA:
|
|
39
|
-
break;
|
|
40
|
-
case factory.service.webAPI.Identifier.Chevre:
|
|
41
|
-
// Chevre予約の場合、まず取引番号発行
|
|
42
|
-
const publishTransactionNumberResult = yield repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
|
|
43
|
-
transactionNumber = publishTransactionNumberResult.transactionNumber;
|
|
44
|
-
break;
|
|
45
|
-
default:
|
|
46
|
-
}
|
|
36
|
+
// Chevre予約の場合、まず取引番号発行
|
|
37
|
+
const { transactionNumber } = yield repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
|
|
47
38
|
// 承認アクションを開始
|
|
48
|
-
const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)(
|
|
49
|
-
|
|
50
|
-
:
|
|
39
|
+
const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
|
|
40
|
+
acceptedOffers: acceptedOffers,
|
|
41
|
+
event: event,
|
|
42
|
+
transaction: transaction,
|
|
43
|
+
pendingTransaction: { typeOf: factory.assetTransactionType.Reserve, transactionNumber },
|
|
44
|
+
broker: params.object.broker
|
|
45
|
+
});
|
|
51
46
|
const action = yield repos.action.start(actionAttributes);
|
|
52
47
|
try {
|
|
53
48
|
switch (bookingServiceIdentifire) {
|
|
@@ -16,7 +16,7 @@ export declare function createReserveTransactionStartParams(params: {
|
|
|
16
16
|
export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
17
17
|
acceptedOffers: factory.action.authorize.offer.eventService.IAcceptedOffer4chevre[];
|
|
18
18
|
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
|
|
19
|
-
pendingTransaction
|
|
19
|
+
pendingTransaction: factory.action.authorize.offer.eventService.IChevrePendingTransaction;
|
|
20
20
|
transaction: factory.transaction.ITransaction<factory.transactionType.PlaceOrder>;
|
|
21
21
|
broker?: factory.reservation.IBroker<factory.reservationType.EventReservation>;
|
|
22
22
|
}): factory.action.authorize.offer.eventService.IAttributes<factory.service.webAPI.Identifier.Chevre>;
|