@chevre/domain 21.4.0-alpha.4 → 21.4.0-alpha.6
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/createManyEventsIfNotExist.ts +6 -0
- package/lib/chevre/repo/event.js +31 -25
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +3 -0
- package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +4 -3
- package/lib/chevre/service/assetTransaction/reserve/factory.js +6 -2
- package/lib/chevre/service/event.js +14 -11
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +2 -1
- package/package.json +2 -2
|
@@ -5,6 +5,10 @@ import * as mongoose from 'mongoose';
|
|
|
5
5
|
import { chevre } from '../../../lib/index';
|
|
6
6
|
|
|
7
7
|
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
8
|
+
const ORGANIZER_ID = process.env.ORGANIZER_ID;
|
|
9
|
+
if (typeof ORGANIZER_ID !== 'string' || ORGANIZER_ID.length === 0) {
|
|
10
|
+
throw new Error('ORGANIZER_ID undefined');
|
|
11
|
+
}
|
|
8
12
|
|
|
9
13
|
// tslint:disable-next-line:max-func-body-length
|
|
10
14
|
async function main() {
|
|
@@ -15,6 +19,7 @@ async function main() {
|
|
|
15
19
|
const result = await eventRepo.createManyIfNotExist<chevre.factory.eventType.ScreeningEvent>([
|
|
16
20
|
{
|
|
17
21
|
attributes: {
|
|
22
|
+
organizer: { id: String(ORGANIZER_ID) },
|
|
18
23
|
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
19
24
|
project: { id: PROJECT_ID, typeOf: chevre.factory.organizationType.Project },
|
|
20
25
|
name: {
|
|
@@ -184,6 +189,7 @@ async function main() {
|
|
|
184
189
|
},
|
|
185
190
|
{
|
|
186
191
|
attributes: {
|
|
192
|
+
organizer: { id: String(ORGANIZER_ID) },
|
|
187
193
|
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
188
194
|
project: { id: PROJECT_ID, typeOf: chevre.factory.organizationType.Project },
|
|
189
195
|
name: {
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -51,7 +51,7 @@ class MongoRepository {
|
|
|
51
51
|
}
|
|
52
52
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
53
53
|
static CREATE_MONGO_CONDITIONS(conditions) {
|
|
54
|
-
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;
|
|
54
|
+
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;
|
|
55
55
|
const andConditions = [{ typeOf: { $eq: conditions.typeOf } }];
|
|
56
56
|
const projectIdEq = (_b = (_a = conditions.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
57
57
|
if (typeof projectIdEq === 'string') {
|
|
@@ -59,7 +59,13 @@ class MongoRepository {
|
|
|
59
59
|
'project.id': { $eq: projectIdEq }
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const organizerIdEq = (_d = (_c = conditions.organizer) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$eq;
|
|
63
|
+
if (typeof organizerIdEq === 'string') {
|
|
64
|
+
andConditions.push({
|
|
65
|
+
'organizer.id': { $exists: true, $eq: organizerIdEq }
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const idIn = (_e = conditions.id) === null || _e === void 0 ? void 0 : _e.$in;
|
|
63
69
|
if (Array.isArray(idIn)) {
|
|
64
70
|
andConditions.push({
|
|
65
71
|
_id: { $in: idIn }
|
|
@@ -114,17 +120,17 @@ class MongoRepository {
|
|
|
114
120
|
endDate: { $lte: conditions.endThrough }
|
|
115
121
|
});
|
|
116
122
|
}
|
|
117
|
-
const locationBranchCodeEq = (
|
|
123
|
+
const locationBranchCodeEq = (_g = (_f = conditions.location) === null || _f === void 0 ? void 0 : _f.branchCode) === null || _g === void 0 ? void 0 : _g.$eq;
|
|
118
124
|
if (typeof locationBranchCodeEq === 'string') {
|
|
119
125
|
andConditions.push({ 'location.branchCode': { $exists: true, $eq: locationBranchCodeEq } });
|
|
120
126
|
}
|
|
121
|
-
const locationBranchCodeIn = (
|
|
127
|
+
const locationBranchCodeIn = (_j = (_h = conditions.location) === null || _h === void 0 ? void 0 : _h.branchCode) === null || _j === void 0 ? void 0 : _j.$in;
|
|
122
128
|
if (Array.isArray(locationBranchCodeIn)) {
|
|
123
129
|
andConditions.push({ 'location.branchCode': { $exists: true, $in: locationBranchCodeIn } });
|
|
124
130
|
}
|
|
125
131
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
126
132
|
/* istanbul ignore else */
|
|
127
|
-
const hasOfferCatalogIdEq = (
|
|
133
|
+
const hasOfferCatalogIdEq = (_l = (_k = conditions.hasOfferCatalog) === null || _k === void 0 ? void 0 : _k.id) === null || _l === void 0 ? void 0 : _l.$eq;
|
|
128
134
|
if (typeof hasOfferCatalogIdEq === 'string') {
|
|
129
135
|
andConditions.push({
|
|
130
136
|
'hasOfferCatalog.id': {
|
|
@@ -133,7 +139,7 @@ class MongoRepository {
|
|
|
133
139
|
}
|
|
134
140
|
});
|
|
135
141
|
}
|
|
136
|
-
const additionalPropertyElemMatch = (
|
|
142
|
+
const additionalPropertyElemMatch = (_m = conditions.additionalProperty) === null || _m === void 0 ? void 0 : _m.$elemMatch;
|
|
137
143
|
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
138
144
|
andConditions.push({
|
|
139
145
|
additionalProperty: {
|
|
@@ -149,7 +155,7 @@ class MongoRepository {
|
|
|
149
155
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
150
156
|
/* istanbul ignore else */
|
|
151
157
|
if (params.offers !== undefined) {
|
|
152
|
-
const itemOfferedIdIn4event = (
|
|
158
|
+
const itemOfferedIdIn4event = (_p = (_o = params.offers.itemOffered) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$in;
|
|
153
159
|
if (Array.isArray(itemOfferedIdIn4event)) {
|
|
154
160
|
andConditions.push({
|
|
155
161
|
'offers.itemOffered.id': {
|
|
@@ -199,8 +205,8 @@ class MongoRepository {
|
|
|
199
205
|
}
|
|
200
206
|
}
|
|
201
207
|
}
|
|
202
|
-
const sellerMakesOfferElemMatch4event = (
|
|
203
|
-
if (typeof ((
|
|
208
|
+
const sellerMakesOfferElemMatch4event = (_s = (_r = (_q = params.offers) === null || _q === void 0 ? void 0 : _q.seller) === null || _r === void 0 ? void 0 : _r.makesOffer) === null || _s === void 0 ? void 0 : _s.$elemMatch;
|
|
209
|
+
if (typeof ((_t = sellerMakesOfferElemMatch4event === null || sellerMakesOfferElemMatch4event === void 0 ? void 0 : sellerMakesOfferElemMatch4event['availableAtOrFrom.id']) === null || _t === void 0 ? void 0 : _t.$eq) === 'string') {
|
|
204
210
|
andConditions.push({
|
|
205
211
|
'offers.seller.makesOffer': {
|
|
206
212
|
$exists: true,
|
|
@@ -208,7 +214,7 @@ class MongoRepository {
|
|
|
208
214
|
}
|
|
209
215
|
});
|
|
210
216
|
}
|
|
211
|
-
const reservationForIdentifierEq = (
|
|
217
|
+
const reservationForIdentifierEq = (_y = (_x = (_w = (_v = (_u = params.offers) === null || _u === void 0 ? void 0 : _u.itemOffered) === null || _v === void 0 ? void 0 : _v.serviceOutput) === null || _w === void 0 ? void 0 : _w.reservationFor) === null || _x === void 0 ? void 0 : _x.identifier) === null || _y === void 0 ? void 0 : _y.$eq;
|
|
212
218
|
if (typeof reservationForIdentifierEq === 'string') {
|
|
213
219
|
andConditions.push({
|
|
214
220
|
'offers.itemOffered.serviceOutput.reservationFor.identifier': {
|
|
@@ -217,7 +223,7 @@ class MongoRepository {
|
|
|
217
223
|
}
|
|
218
224
|
});
|
|
219
225
|
}
|
|
220
|
-
const reservationForArrivalBusStopBranchCodeEq = (
|
|
226
|
+
const reservationForArrivalBusStopBranchCodeEq = (_4 = (_3 = (_2 = (_1 = (_0 = (_z = params.offers) === null || _z === void 0 ? void 0 : _z.itemOffered) === null || _0 === void 0 ? void 0 : _0.serviceOutput) === null || _1 === void 0 ? void 0 : _1.reservationFor) === null || _2 === void 0 ? void 0 : _2.arrivalBusStop) === null || _3 === void 0 ? void 0 : _3.branchCode) === null || _4 === void 0 ? void 0 : _4.$eq;
|
|
221
227
|
if (typeof reservationForArrivalBusStopBranchCodeEq === 'string') {
|
|
222
228
|
andConditions.push({
|
|
223
229
|
'offers.itemOffered.serviceOutput.reservationFor.arrivalBusStop.branchCode': {
|
|
@@ -226,7 +232,7 @@ class MongoRepository {
|
|
|
226
232
|
}
|
|
227
233
|
});
|
|
228
234
|
}
|
|
229
|
-
const reservationForDepartureBusStopBranchCodeEq = (
|
|
235
|
+
const reservationForDepartureBusStopBranchCodeEq = (_10 = (_9 = (_8 = (_7 = (_6 = (_5 = params.offers) === null || _5 === void 0 ? void 0 : _5.itemOffered) === null || _6 === void 0 ? void 0 : _6.serviceOutput) === null || _7 === void 0 ? void 0 : _7.reservationFor) === null || _8 === void 0 ? void 0 : _8.departureBusStop) === null || _9 === void 0 ? void 0 : _9.branchCode) === null || _10 === void 0 ? void 0 : _10.$eq;
|
|
230
236
|
if (typeof reservationForDepartureBusStopBranchCodeEq === 'string') {
|
|
231
237
|
andConditions.push({
|
|
232
238
|
'offers.itemOffered.serviceOutput.reservationFor.departureBusStop.branchCode': {
|
|
@@ -260,7 +266,7 @@ class MongoRepository {
|
|
|
260
266
|
}
|
|
261
267
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
262
268
|
/* istanbul ignore else */
|
|
263
|
-
const superEventLocationIdEq = (
|
|
269
|
+
const superEventLocationIdEq = (_13 = (_12 = (_11 = params.superEvent) === null || _11 === void 0 ? void 0 : _11.location) === null || _12 === void 0 ? void 0 : _12.id) === null || _13 === void 0 ? void 0 : _13.$eq;
|
|
264
270
|
if (typeof superEventLocationIdEq === 'string') {
|
|
265
271
|
andConditions.push({
|
|
266
272
|
'superEvent.location.id': {
|
|
@@ -303,7 +309,7 @@ class MongoRepository {
|
|
|
303
309
|
});
|
|
304
310
|
}
|
|
305
311
|
}
|
|
306
|
-
const itemOfferedIdIn = (
|
|
312
|
+
const itemOfferedIdIn = (_16 = (_15 = (_14 = params.offers) === null || _14 === void 0 ? void 0 : _14.itemOffered) === null || _15 === void 0 ? void 0 : _15.id) === null || _16 === void 0 ? void 0 : _16.$in;
|
|
307
313
|
if (Array.isArray(itemOfferedIdIn)) {
|
|
308
314
|
andConditions.push({
|
|
309
315
|
'offers.itemOffered.id': {
|
|
@@ -312,7 +318,7 @@ class MongoRepository {
|
|
|
312
318
|
}
|
|
313
319
|
});
|
|
314
320
|
}
|
|
315
|
-
const itemOfferedTicketedSeatTypeOfIn = (
|
|
321
|
+
const itemOfferedTicketedSeatTypeOfIn = (_21 = (_20 = (_19 = (_18 = (_17 = params.offers) === null || _17 === void 0 ? void 0 : _17.itemOffered) === null || _18 === void 0 ? void 0 : _18.serviceOutput) === null || _19 === void 0 ? void 0 : _19.reservedTicket) === null || _20 === void 0 ? void 0 : _20.ticketedSeat) === null || _21 === void 0 ? void 0 : _21.typeOfs;
|
|
316
322
|
if (Array.isArray(itemOfferedTicketedSeatTypeOfIn)) {
|
|
317
323
|
andConditions.push({
|
|
318
324
|
'offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOf': {
|
|
@@ -321,7 +327,7 @@ class MongoRepository {
|
|
|
321
327
|
}
|
|
322
328
|
});
|
|
323
329
|
}
|
|
324
|
-
const itemOfferedServiceTypeIdIn = (
|
|
330
|
+
const itemOfferedServiceTypeIdIn = (_24 = (_23 = (_22 = params.offers) === null || _22 === void 0 ? void 0 : _22.itemOffered) === null || _23 === void 0 ? void 0 : _23.serviceType) === null || _24 === void 0 ? void 0 : _24.ids;
|
|
325
331
|
if (Array.isArray(itemOfferedServiceTypeIdIn)) {
|
|
326
332
|
andConditions.push({
|
|
327
333
|
'offers.itemOffered.serviceType.id': {
|
|
@@ -330,8 +336,8 @@ class MongoRepository {
|
|
|
330
336
|
}
|
|
331
337
|
});
|
|
332
338
|
}
|
|
333
|
-
const sellerMakesOfferElemMatch = (
|
|
334
|
-
if (typeof ((
|
|
339
|
+
const sellerMakesOfferElemMatch = (_27 = (_26 = (_25 = params.offers) === null || _25 === void 0 ? void 0 : _25.seller) === null || _26 === void 0 ? void 0 : _26.makesOffer) === null || _27 === void 0 ? void 0 : _27.$elemMatch;
|
|
340
|
+
if (typeof ((_28 = sellerMakesOfferElemMatch === null || sellerMakesOfferElemMatch === void 0 ? void 0 : sellerMakesOfferElemMatch['availableAtOrFrom.id']) === null || _28 === void 0 ? void 0 : _28.$eq) === 'string') {
|
|
335
341
|
andConditions.push({
|
|
336
342
|
'offers.seller.makesOffer': {
|
|
337
343
|
$exists: true,
|
|
@@ -368,7 +374,7 @@ class MongoRepository {
|
|
|
368
374
|
]
|
|
369
375
|
});
|
|
370
376
|
}
|
|
371
|
-
const locationIdEq = (
|
|
377
|
+
const locationIdEq = (_30 = (_29 = params.location) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$eq;
|
|
372
378
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
373
379
|
/* istanbul ignore else */
|
|
374
380
|
if (typeof locationIdEq === 'string') {
|
|
@@ -390,7 +396,7 @@ class MongoRepository {
|
|
|
390
396
|
});
|
|
391
397
|
}
|
|
392
398
|
}
|
|
393
|
-
const workPerformedIdentifierIn = (
|
|
399
|
+
const workPerformedIdentifierIn = (_31 = params.workPerformed) === null || _31 === void 0 ? void 0 : _31.identifiers;
|
|
394
400
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
395
401
|
/* istanbul ignore else */
|
|
396
402
|
if (Array.isArray(workPerformedIdentifierIn)) {
|
|
@@ -398,13 +404,13 @@ class MongoRepository {
|
|
|
398
404
|
'workPerformed.identifier': { $exists: true, $in: workPerformedIdentifierIn }
|
|
399
405
|
});
|
|
400
406
|
}
|
|
401
|
-
const workPerformedVersionEq = (
|
|
407
|
+
const workPerformedVersionEq = (_33 = (_32 = params.workPerformed) === null || _32 === void 0 ? void 0 : _32.version) === null || _33 === void 0 ? void 0 : _33.$eq;
|
|
402
408
|
if (typeof workPerformedVersionEq === 'string') {
|
|
403
409
|
andConditions.push({
|
|
404
410
|
'workPerformed.version': { $exists: true, $eq: workPerformedVersionEq }
|
|
405
411
|
});
|
|
406
412
|
}
|
|
407
|
-
const videoFormatTypeOfEq = (
|
|
413
|
+
const videoFormatTypeOfEq = (_35 = (_34 = params.videoFormat) === null || _34 === void 0 ? void 0 : _34.typeOf) === null || _35 === void 0 ? void 0 : _35.$eq;
|
|
408
414
|
if (typeof videoFormatTypeOfEq === 'string') {
|
|
409
415
|
andConditions.push({
|
|
410
416
|
'videoFormat.typeOf': {
|
|
@@ -413,7 +419,7 @@ class MongoRepository {
|
|
|
413
419
|
}
|
|
414
420
|
});
|
|
415
421
|
}
|
|
416
|
-
const videoFormatTypeOfIn = (
|
|
422
|
+
const videoFormatTypeOfIn = (_37 = (_36 = params.videoFormat) === null || _36 === void 0 ? void 0 : _36.typeOf) === null || _37 === void 0 ? void 0 : _37.$in;
|
|
417
423
|
if (Array.isArray(videoFormatTypeOfIn)) {
|
|
418
424
|
andConditions.push({
|
|
419
425
|
'videoFormat.typeOf': {
|
|
@@ -422,7 +428,7 @@ class MongoRepository {
|
|
|
422
428
|
}
|
|
423
429
|
});
|
|
424
430
|
}
|
|
425
|
-
const soundFormatTypeOfEq = (
|
|
431
|
+
const soundFormatTypeOfEq = (_39 = (_38 = params.soundFormat) === null || _38 === void 0 ? void 0 : _38.typeOf) === null || _39 === void 0 ? void 0 : _39.$eq;
|
|
426
432
|
if (typeof soundFormatTypeOfEq === 'string') {
|
|
427
433
|
andConditions.push({
|
|
428
434
|
'soundFormat.typeOf': {
|
|
@@ -431,7 +437,7 @@ class MongoRepository {
|
|
|
431
437
|
}
|
|
432
438
|
});
|
|
433
439
|
}
|
|
434
|
-
const soundFormatTypeOfIn = (
|
|
440
|
+
const soundFormatTypeOfIn = (_41 = (_40 = params.soundFormat) === null || _40 === void 0 ? void 0 : _40.typeOf) === null || _41 === void 0 ? void 0 : _41.$in;
|
|
435
441
|
if (Array.isArray(soundFormatTypeOfIn)) {
|
|
436
442
|
andConditions.push({
|
|
437
443
|
'soundFormat.typeOf': {
|
|
@@ -77,6 +77,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
|
|
|
77
77
|
aggregateEntranceGate?: any;
|
|
78
78
|
aggregateReservation?: any;
|
|
79
79
|
aggregateOffer?: any;
|
|
80
|
+
organizer?: any;
|
|
80
81
|
maximumAttendeeCapacity?: number | undefined;
|
|
81
82
|
remainingAttendeeCapacity?: number | undefined;
|
|
82
83
|
videoFormat?: any;
|
|
@@ -110,6 +111,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
|
|
|
110
111
|
aggregateEntranceGate?: any;
|
|
111
112
|
aggregateReservation?: any;
|
|
112
113
|
aggregateOffer?: any;
|
|
114
|
+
organizer?: any;
|
|
113
115
|
maximumAttendeeCapacity?: number | undefined;
|
|
114
116
|
remainingAttendeeCapacity?: number | undefined;
|
|
115
117
|
videoFormat?: any;
|
|
@@ -143,6 +145,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
|
|
|
143
145
|
aggregateEntranceGate?: any;
|
|
144
146
|
aggregateReservation?: any;
|
|
145
147
|
aggregateOffer?: any;
|
|
148
|
+
organizer?: any;
|
|
146
149
|
maximumAttendeeCapacity?: number | undefined;
|
|
147
150
|
remainingAttendeeCapacity?: number | undefined;
|
|
148
151
|
videoFormat?: any;
|
|
@@ -46,6 +46,7 @@ const schema = new mongoose_1.Schema({
|
|
|
46
46
|
aggregateEntranceGate: mongoose_1.SchemaTypes.Mixed,
|
|
47
47
|
aggregateReservation: mongoose_1.SchemaTypes.Mixed,
|
|
48
48
|
aggregateOffer: mongoose_1.SchemaTypes.Mixed,
|
|
49
|
+
organizer: mongoose_1.SchemaTypes.Mixed,
|
|
49
50
|
coaInfo: mongoose_1.SchemaTypes.Mixed
|
|
50
51
|
}, {
|
|
51
52
|
collection: 'events',
|
|
@@ -78,6 +79,12 @@ schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
|
|
|
78
79
|
schema.index({ 'project.id': 1, startDate: 1 }, {
|
|
79
80
|
name: 'searchByProjectId-v20220721'
|
|
80
81
|
});
|
|
82
|
+
schema.index({ 'organizer.id': 1, startDate: 1 }, {
|
|
83
|
+
name: 'searchByOrganizerId',
|
|
84
|
+
partialFilterExpression: {
|
|
85
|
+
'organizer.id': { $exists: true }
|
|
86
|
+
}
|
|
87
|
+
});
|
|
81
88
|
schema.index({ typeOf: 1, startDate: 1 }, { name: 'searchByTypeOf' });
|
|
82
89
|
schema.index({ eventStatus: 1, startDate: 1 }, { name: 'searchByEventStatus' });
|
|
83
90
|
schema.index({ name: 1, startDate: 1 }, { name: 'searchByName' });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MongoRepository as EventRepo } from '../../../repo/event';
|
|
1
|
+
import { IMinimizedIndividualEvent, MongoRepository as EventRepo } from '../../../repo/event';
|
|
2
2
|
import { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
3
3
|
import { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
4
4
|
import { MongoRepository as PlaceRepo } from '../../../repo/place';
|
|
@@ -28,5 +28,5 @@ export declare function aggregateScreeningEvent(params: {
|
|
|
28
28
|
id: string;
|
|
29
29
|
}): IAggregateScreeningEventOperation<void>;
|
|
30
30
|
export declare function aggregateByEvent(params: {
|
|
31
|
-
event: factory.
|
|
31
|
+
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
|
|
32
32
|
}): IAggregateScreeningEventOperation<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
+
import { IMinimizedIndividualEvent } from '../../../factory/event';
|
|
2
3
|
import { IAcceptedAddOn } from './factory/price';
|
|
3
4
|
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
4
5
|
export { IAcceptedAddOn };
|
|
@@ -46,9 +47,9 @@ export declare function createAdditionalTicketText(params: {
|
|
|
46
47
|
reservedTicket: factory.reservation.ITicket;
|
|
47
48
|
}): string | undefined;
|
|
48
49
|
export type IUnitPriceSpecification = factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.UnitPriceSpecification>;
|
|
49
|
-
export declare function createReservationFor(params: factory.
|
|
50
|
+
export declare function createReservationFor(params: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>): factory.assetTransaction.reserve.IReservationFor;
|
|
50
51
|
export declare function createIssuedThrough(params: {
|
|
51
|
-
reservationFor: factory.
|
|
52
|
+
reservationFor: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
|
|
52
53
|
}): {
|
|
53
54
|
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
54
55
|
};
|
|
@@ -61,7 +62,7 @@ export declare function createReservation(params: {
|
|
|
61
62
|
reserveDate: Date;
|
|
62
63
|
agent: factory.assetTransaction.reserve.IAgent;
|
|
63
64
|
reservationNumber: string;
|
|
64
|
-
reservationFor: factory.
|
|
65
|
+
reservationFor: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
|
|
65
66
|
reservedTicket: factory.reservation.ITicket;
|
|
66
67
|
additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
67
68
|
additionalTicketText?: string;
|
|
@@ -327,7 +327,9 @@ function createAdditionalTicketText(params) {
|
|
|
327
327
|
return (_b = (_a = params.acceptedOffer.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.additionalTicketText;
|
|
328
328
|
}
|
|
329
329
|
exports.createAdditionalTicketText = createAdditionalTicketText;
|
|
330
|
-
function createReservationFor(
|
|
330
|
+
function createReservationFor(
|
|
331
|
+
// params: factory.event.screeningEvent.IEvent | factory.event.event.IEvent
|
|
332
|
+
params) {
|
|
331
333
|
var _a, _b;
|
|
332
334
|
if (params.typeOf === factory.eventType.ScreeningEvent) {
|
|
333
335
|
return Object.assign({ endDate: params.endDate, id: params.id, location: params.location, name: params.name, startDate: params.startDate, superEvent: optimizeReservationSuperEvent(params), typeOf: params.typeOf }, (params.doorTime instanceof Date)
|
|
@@ -343,7 +345,9 @@ function createReservationFor(params) {
|
|
|
343
345
|
}
|
|
344
346
|
}
|
|
345
347
|
exports.createReservationFor = createReservationFor;
|
|
346
|
-
function optimizeReservationSuperEvent(
|
|
348
|
+
function optimizeReservationSuperEvent(
|
|
349
|
+
// params: factory.event.screeningEvent.IEvent
|
|
350
|
+
params) {
|
|
347
351
|
const superEvent = params.superEvent;
|
|
348
352
|
return Object.assign(Object.assign({ additionalProperty: (Array.isArray(superEvent.additionalProperty))
|
|
349
353
|
? superEvent.additionalProperty
|
|
@@ -92,6 +92,7 @@ function importFromCOA(params) {
|
|
|
92
92
|
const sellersWithSameBranchCode = yield repos.seller.search({
|
|
93
93
|
limit: 1,
|
|
94
94
|
page: 1,
|
|
95
|
+
project: { id: { $eq: project.id } },
|
|
95
96
|
branchCode: { $eq: params.locationBranchCode }
|
|
96
97
|
}, ['_id'], []);
|
|
97
98
|
const seller = sellersWithSameBranchCode.shift();
|
|
@@ -119,6 +120,7 @@ function importFromCOA(params) {
|
|
|
119
120
|
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
120
121
|
}
|
|
121
122
|
const screeningRooms = yield repos.place.searchScreeningRooms({
|
|
123
|
+
project: { id: { $eq: project.id } },
|
|
122
124
|
containedInPlace: { branchCode: { $eq: movieTheater.branchCode } }
|
|
123
125
|
});
|
|
124
126
|
const targetImportFrom = moment(`${moment(params.importFrom)
|
|
@@ -133,7 +135,8 @@ function importFromCOA(params) {
|
|
|
133
135
|
locationBranchCode: params.locationBranchCode,
|
|
134
136
|
movieTheater,
|
|
135
137
|
project: project,
|
|
136
|
-
saveScreeningEventSeries: params.saveScreeningEventSeries
|
|
138
|
+
saveScreeningEventSeries: params.saveScreeningEventSeries,
|
|
139
|
+
seller: { id: seller.id }
|
|
137
140
|
})(repos);
|
|
138
141
|
savedScreeningEventSeriesCount = savedEventsCount;
|
|
139
142
|
try {
|
|
@@ -145,7 +148,8 @@ function importFromCOA(params) {
|
|
|
145
148
|
screeningEventSerieses: screeningEventSerieses,
|
|
146
149
|
project: project,
|
|
147
150
|
targetImportFrom: targetImportFrom.toDate(),
|
|
148
|
-
targetImportThrough: targetImportThrough.toDate()
|
|
151
|
+
targetImportThrough: targetImportThrough.toDate(),
|
|
152
|
+
seller: { id: seller.id }
|
|
149
153
|
})(repos);
|
|
150
154
|
savedScreeningEventsCount = screeningEvents.length;
|
|
151
155
|
// COAから削除されたイベントをキャンセル済ステータスへ変更
|
|
@@ -234,7 +238,8 @@ function saveScreeningEventSeries(params) {
|
|
|
234
238
|
eizouKubuns: eizouKubuns,
|
|
235
239
|
joueihousikiKubuns: joueihousikiKubuns,
|
|
236
240
|
jimakufukikaeKubuns: jimakufukikaeKubuns,
|
|
237
|
-
availablePaymentMethodTypes
|
|
241
|
+
availablePaymentMethodTypes,
|
|
242
|
+
seller: params.seller
|
|
238
243
|
});
|
|
239
244
|
});
|
|
240
245
|
let savedEventsCount = 0;
|
|
@@ -362,7 +367,8 @@ function createScreeningEvents(params) {
|
|
|
362
367
|
screenRoom: screenRoom,
|
|
363
368
|
superEvent: screeningEventSeries,
|
|
364
369
|
serviceKubuns: serviceKubuns,
|
|
365
|
-
acousticKubuns: acousticKubuns
|
|
370
|
+
acousticKubuns: acousticKubuns,
|
|
371
|
+
seller: params.seller
|
|
366
372
|
});
|
|
367
373
|
screeningEvents.push(screeningEvent);
|
|
368
374
|
});
|
|
@@ -493,7 +499,8 @@ function createScreeningEventFromCOA(params) {
|
|
|
493
499
|
attendeeCount: 0,
|
|
494
500
|
maximumAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity,
|
|
495
501
|
remainingAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity,
|
|
496
|
-
additionalProperty
|
|
502
|
+
additionalProperty,
|
|
503
|
+
organizer: { id: params.seller.id }
|
|
497
504
|
};
|
|
498
505
|
}
|
|
499
506
|
function createScreeningEventAdditionalPropertyFromCOA(params) {
|
|
@@ -579,12 +586,8 @@ function createScreeningEventSeriesFromCOA(params) {
|
|
|
579
586
|
kanaName: params.movieTheater.kanaName,
|
|
580
587
|
typeOf: params.movieTheater.typeOf
|
|
581
588
|
},
|
|
582
|
-
//
|
|
583
|
-
|
|
584
|
-
// typeOf: factory.organizationType.Corporation,
|
|
585
|
-
// identifier: params.movieTheater.id,
|
|
586
|
-
// name: params.movieTheater.name
|
|
587
|
-
// },
|
|
589
|
+
// 必須化(2023-07-12~)
|
|
590
|
+
organizer: { id: params.seller.id },
|
|
588
591
|
videoFormat: params.eizouKubuns.filter((kubun) => kubun.kubunCode === params.filmFromCOA.kbnEizou)[0],
|
|
589
592
|
soundFormat: [],
|
|
590
593
|
workPerformed: {
|
|
@@ -4,7 +4,7 @@ export import WebAPIIdentifier = factory.service.webAPI.Identifier;
|
|
|
4
4
|
export type IAcceptedOffer4COA = factory.action.authorize.offer.seatReservation.IAcceptedOffer<factory.service.webAPI.Identifier.COA>;
|
|
5
5
|
export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
6
6
|
acceptedOffers: factory.action.authorize.offer.seatReservation.IAcceptedOffer<factory.service.webAPI.Identifier.COA>[];
|
|
7
|
-
event:
|
|
7
|
+
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
|
|
8
8
|
transaction: factory.transaction.ITransaction<factory.transactionType.PlaceOrder>;
|
|
9
9
|
}): factory.action.authorize.offer.seatReservation.IAttributes<WebAPIIdentifier.COA>;
|
|
10
10
|
/**
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as surfrock from '@surfrock/sdk';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
|
+
import { IMinimizedIndividualEvent } from '../../../factory/event';
|
|
3
4
|
export declare function createSeatInfoSyncIn(params: {
|
|
4
5
|
paymentMethodType: string;
|
|
5
6
|
paymentMethodId: string;
|
|
6
7
|
movieTickets: factory.action.trade.pay.IMovieTicket[];
|
|
7
|
-
event: factory.
|
|
8
|
+
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
|
|
8
9
|
purpose: factory.action.trade.pay.IPurpose;
|
|
9
10
|
seller: Pick<factory.seller.ISeller, 'paymentAccepted'>;
|
|
10
11
|
credentials: {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.
|
|
12
|
+
"@chevre/factory": "4.315.0-alpha.0",
|
|
13
13
|
"@cinerino/sdk": "3.160.0-alpha.2",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.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.4.0-alpha.
|
|
120
|
+
"version": "21.4.0-alpha.6"
|
|
121
121
|
}
|