@chevre/domain 21.4.0-alpha.2 → 21.4.0-alpha.21
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/cleanActions.ts +23 -0
- package/example/src/chevre/cleanEventsByMovieTheater.ts +32 -0
- package/example/src/chevre/createDeleteTransactionTasksOfDeletedPeople.ts +126 -0
- package/example/src/chevre/createManyEventsIfNotExist.ts +6 -0
- package/example/src/chevre/migrateEventOrganizer.ts +125 -0
- package/example/src/chevre/migrateReservationProvider.ts +117 -0
- package/example/src/chevre/migrateScreeningRoomOrganizer.ts +91 -0
- package/example/src/chevre/processReserve.ts +0 -1
- package/example/src/chevre/searchEvents.ts +1 -9
- package/example/src/chevre/searchProductOffers.ts +6 -0
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/repo/action.d.ts +6 -0
- package/lib/chevre/repo/action.js +13 -0
- package/lib/chevre/repo/assetTransaction.d.ts +4 -1
- package/lib/chevre/repo/assetTransaction.js +6 -12
- package/lib/chevre/repo/event.d.ts +25 -4
- package/lib/chevre/repo/event.js +122 -60
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +7 -4
- package/lib/chevre/repo/mongoose/schemas/event.js +15 -2
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -6
- package/lib/chevre/repo/mongoose/schemas/place.js +9 -2
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -0
- package/lib/chevre/repo/mongoose/schemas/reservation.js +6 -3
- package/lib/chevre/repo/order.d.ts +21 -0
- package/lib/chevre/repo/order.js +54 -62
- package/lib/chevre/repo/place.d.ts +57 -16
- package/lib/chevre/repo/place.js +112 -167
- package/lib/chevre/repo/product.d.ts +2 -4
- package/lib/chevre/repo/product.js +52 -7
- package/lib/chevre/repo/productOffer.d.ts +19 -4
- package/lib/chevre/repo/productOffer.js +37 -14
- package/lib/chevre/repo/reservation.d.ts +33 -21
- package/lib/chevre/repo/reservation.js +97 -79
- package/lib/chevre/repo/seller.d.ts +4 -3
- package/lib/chevre/repo/seller.js +40 -38
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +3 -2
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/account/validation.js +9 -1
- package/lib/chevre/service/assetTransaction/pay.js +9 -1
- package/lib/chevre/service/assetTransaction/registerService.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +10 -4
- package/lib/chevre/service/assetTransaction/reserve/factory.js +21 -40
- package/lib/chevre/service/assetTransaction/reserve.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/reserve.js +7 -22
- package/lib/chevre/service/event/createEvent.d.ts +9 -0
- package/lib/chevre/service/event/createEvent.js +86 -0
- package/lib/chevre/service/event.d.ts +2 -0
- package/lib/chevre/service/event.js +26 -26
- package/lib/chevre/service/moneyTransfer.js +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -1
- package/lib/chevre/service/offer/event/authorize.js +6 -2
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +16 -2
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +1 -1
- package/lib/chevre/service/offer/product/searchProductOffers.js +1 -1
- package/lib/chevre/service/order/returnOrder.js +8 -1
- package/lib/chevre/service/order/sendOrder.js +8 -1
- package/lib/chevre/service/payment/creditCard.js +9 -1
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +2 -1
- package/lib/chevre/service/payment/movieTicket/validation.js +9 -1
- package/lib/chevre/service/payment/movieTicket.js +19 -2
- package/lib/chevre/service/payment/paymentCard.js +1 -3
- package/lib/chevre/service/reserve/cancelReservation.js +15 -28
- package/lib/chevre/service/reserve/confirmReservation.js +12 -30
- package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +3 -0
- package/lib/chevre/service/reserve/verifyToken4reservation.js +3 -1
- package/lib/chevre/service/task/{syncScreeningRooms.d.ts → createEvent.d.ts} +1 -1
- package/lib/chevre/service/task/{syncScreeningRooms.js → createEvent.js} +10 -4
- package/lib/chevre/service/task/onAuthorizationCreated.js +1 -0
- package/lib/chevre/service/task/returnPayTransaction.js +1 -0
- package/lib/chevre/service/transaction/moneyTransfer.js +9 -1
- package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress.js +9 -6
- package/lib/chevre/service/transaction/returnOrder.js +9 -3
- package/package.json +3 -3
- package/example/src/chevre/findByOrderNumberAndReservationId.ts +0 -20
- package/example/src/chevre/findScreeningRoomsByBranchCode.ts +0 -27
- package/example/src/chevre/migrateEventOffersItemOfferedAvailableChannel.ts +0 -90
- package/example/src/chevre/migrateEventOffersItemOfferedTypeOf.ts +0 -75
- package/example/src/chevre/migrateSSKTEventCOAEndpoint.ts +0 -64
- package/example/src/chevre/migrateScreeningEventSeriesVersion.ts +0 -79
- package/example/src/chevre/searchScreeningRooms.ts +0 -33
- package/example/src/chevre/syncScreeningRooms.ts +0 -21
- package/example/src/chevre/syncScreeningRoomsAll.ts +0 -41
|
@@ -40,7 +40,7 @@ function start(params) {
|
|
|
40
40
|
throw new factory.errors.ArgumentNull('object.itemOffered.id');
|
|
41
41
|
}
|
|
42
42
|
// プロダクト確認
|
|
43
|
-
const product = yield repos.product.findById({ id: productId });
|
|
43
|
+
const product = yield repos.product.findById({ id: productId }, [], []);
|
|
44
44
|
const transactionNumber = params.transactionNumber;
|
|
45
45
|
if (typeof transactionNumber !== 'string' || transactionNumber.length === 0) {
|
|
46
46
|
throw new factory.errors.ArgumentNull('transactionNumber');
|
|
@@ -124,7 +124,7 @@ function createTransactionObject(params) {
|
|
|
124
124
|
function createPermitService(params) {
|
|
125
125
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
126
126
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
127
|
-
const product = yield repos.product.findById({ id: params.issuedThrough.id });
|
|
127
|
+
const product = yield repos.product.findById({ id: params.issuedThrough.id }, [], []);
|
|
128
128
|
const permitServiceEndpoint = (_a = product.availableChannel) === null || _a === void 0 ? void 0 : _a.serviceUrl;
|
|
129
129
|
const permitServiceAuthorizeServerDomain = (_c = (_b = product.availableChannel) === null || _b === void 0 ? void 0 : _b.credentials) === null || _c === void 0 ? void 0 : _c.authorizeServerDomain;
|
|
130
130
|
const permitServiceClientId = (_e = (_d = product.availableChannel) === null || _d === void 0 ? void 0 : _d.credentials) === null || _e === void 0 ? void 0 : _e.clientId;
|
|
@@ -1,10 +1,16 @@
|
|
|
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 };
|
|
5
6
|
export declare function createStartParams(params: factory.assetTransaction.reserve.IStartParamsWithoutDetail & {
|
|
7
|
+
provider: {
|
|
8
|
+
/**
|
|
9
|
+
* 販売者ID
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
6
13
|
reservationNumber: string;
|
|
7
|
-
disablePendingReservations: boolean;
|
|
8
14
|
useHoldStockByTransactionNumber: boolean;
|
|
9
15
|
}): factory.assetTransaction.IStartParams<factory.assetTransactionType.Reserve>;
|
|
10
16
|
/**
|
|
@@ -46,9 +52,9 @@ export declare function createAdditionalTicketText(params: {
|
|
|
46
52
|
reservedTicket: factory.reservation.ITicket;
|
|
47
53
|
}): string | undefined;
|
|
48
54
|
export type IUnitPriceSpecification = factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.UnitPriceSpecification>;
|
|
49
|
-
export declare function createReservationFor(params: factory.
|
|
55
|
+
export declare function createReservationFor(params: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>): factory.assetTransaction.reserve.IReservationFor;
|
|
50
56
|
export declare function createIssuedThrough(params: {
|
|
51
|
-
reservationFor: factory.
|
|
57
|
+
reservationFor: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
|
|
52
58
|
}): {
|
|
53
59
|
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
54
60
|
};
|
|
@@ -61,7 +67,7 @@ export declare function createReservation(params: {
|
|
|
61
67
|
reserveDate: Date;
|
|
62
68
|
agent: factory.assetTransaction.reserve.IAgent;
|
|
63
69
|
reservationNumber: string;
|
|
64
|
-
reservationFor: factory.
|
|
70
|
+
reservationFor: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
|
|
65
71
|
reservedTicket: factory.reservation.ITicket;
|
|
66
72
|
additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
67
73
|
additionalTicketText?: string;
|
|
@@ -11,9 +11,13 @@ const price_1 = require("./factory/price");
|
|
|
11
11
|
function createStartParams(params) {
|
|
12
12
|
var _a;
|
|
13
13
|
const reservationNumber = params.reservationNumber;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const provider = {
|
|
15
|
+
id: params.provider.id,
|
|
16
|
+
typeOf: factory.organizationType.Corporation
|
|
17
|
+
};
|
|
18
|
+
const reservationPackage = Object.assign({ provider, reservationNumber: reservationNumber, reservationStatus: factory.reservationStatusType.ReservationPending,
|
|
19
|
+
// trueで固定(2023-07-19~)
|
|
20
|
+
disablePendingReservations: true, useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber, typeOf: factory.reservationType.ReservationPackage }, (typeof ((_a = params.object.broker) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { broker: params.object.broker } : undefined);
|
|
17
21
|
return {
|
|
18
22
|
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
19
23
|
typeOf: factory.assetTransactionType.Reserve,
|
|
@@ -327,7 +331,9 @@ function createAdditionalTicketText(params) {
|
|
|
327
331
|
return (_b = (_a = params.acceptedOffer.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.additionalTicketText;
|
|
328
332
|
}
|
|
329
333
|
exports.createAdditionalTicketText = createAdditionalTicketText;
|
|
330
|
-
function createReservationFor(
|
|
334
|
+
function createReservationFor(
|
|
335
|
+
// params: factory.event.screeningEvent.IEvent | factory.event.event.IEvent
|
|
336
|
+
params) {
|
|
331
337
|
var _a, _b;
|
|
332
338
|
if (params.typeOf === factory.eventType.ScreeningEvent) {
|
|
333
339
|
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 +349,9 @@ function createReservationFor(params) {
|
|
|
343
349
|
}
|
|
344
350
|
}
|
|
345
351
|
exports.createReservationFor = createReservationFor;
|
|
346
|
-
function optimizeReservationSuperEvent(
|
|
352
|
+
function optimizeReservationSuperEvent(
|
|
353
|
+
// params: factory.event.screeningEvent.IEvent
|
|
354
|
+
params) {
|
|
347
355
|
const superEvent = params.superEvent;
|
|
348
356
|
return Object.assign(Object.assign({ additionalProperty: (Array.isArray(superEvent.additionalProperty))
|
|
349
357
|
? superEvent.additionalProperty
|
|
@@ -409,36 +417,14 @@ function createReservation(params) {
|
|
|
409
417
|
}
|
|
410
418
|
// priceを最適化
|
|
411
419
|
const price4reservation = (0, price_1.createPrice)(params);
|
|
412
|
-
// const eventOffers = <factory.event.screeningEvent.IOffer | undefined>params.reservationFor.offers;
|
|
413
|
-
// // offersは必ず存在するはず
|
|
414
|
-
// if (eventOffers === undefined) {
|
|
415
|
-
// throw new factory.errors.NotFound('reservationFor.offers');
|
|
416
|
-
// }
|
|
417
|
-
// const serviceTypeOfIssuedThrough: factory.reservation.eventReservation.IServiceTypeOfIssuedThrough | undefined
|
|
418
|
-
// = (typeof eventOffers.itemOffered.serviceType?.codeValue === 'string')
|
|
419
|
-
// ? {
|
|
420
|
-
// codeValue: eventOffers.itemOffered.serviceType.codeValue,
|
|
421
|
-
// inCodeSet: {
|
|
422
|
-
// typeOf: 'CategoryCodeSet',
|
|
423
|
-
// identifier: factory.categoryCode.CategorySetIdentifier.ServiceType
|
|
424
|
-
// },
|
|
425
|
-
// typeOf: 'CategoryCode'
|
|
426
|
-
// }
|
|
427
|
-
// : undefined;
|
|
428
|
-
// const availableChannel: factory.reservation.IServiceChannel = eventOffers.itemOffered.availableChannel;
|
|
429
420
|
if (params.reservationFor.typeOf === factory.eventType.ScreeningEvent) {
|
|
430
|
-
// const issuedThrough: factory.reservation.eventReservation.IIssuedThrough = {
|
|
431
|
-
// typeOf: factory.product.ProductType.EventService,
|
|
432
|
-
// // 興行IDを追加(2022-09-08~)
|
|
433
|
-
// id: eventOffers.itemOffered.id,
|
|
434
|
-
// availableChannel,
|
|
435
|
-
// // issuedThrough.serviceTypeを連携
|
|
436
|
-
// ...(typeof serviceTypeOfIssuedThrough?.typeOf === 'string') ? { serviceType: serviceTypeOfIssuedThrough } : undefined
|
|
437
|
-
// };
|
|
438
421
|
return Object.assign(Object.assign(Object.assign({ project: params.project, typeOf: factory.reservationType.EventReservation, id: params.id,
|
|
439
422
|
// reservationPackage保管に移行(2023-06-06~)
|
|
440
423
|
// issuedThrough,
|
|
441
|
-
additionalProperty: params.additionalProperty, bookingTime: params.reserveDate, modifiedTime: params.reserveDate, numSeats: 1, price: price4reservation, priceCurrency: factory.priceCurrency.JPY, reservationNumber: params.reservationNumber,
|
|
424
|
+
additionalProperty: params.additionalProperty, bookingTime: params.reserveDate, modifiedTime: params.reserveDate, numSeats: 1, price: price4reservation, priceCurrency: factory.priceCurrency.JPY, reservationNumber: params.reservationNumber,
|
|
425
|
+
// statusは不要なので削除(2023-07-19~)
|
|
426
|
+
// reservationStatus: factory.reservationStatusType.ReservationPending,
|
|
427
|
+
reservedTicket: params.reservedTicket,
|
|
442
428
|
// 最適化(2022-12-19~)
|
|
443
429
|
underName: {
|
|
444
430
|
typeOf: params.agent.typeOf,
|
|
@@ -459,18 +445,13 @@ function createReservation(params) {
|
|
|
459
445
|
: undefined);
|
|
460
446
|
}
|
|
461
447
|
else {
|
|
462
|
-
// const issuedThrough: factory.reservation.busReservation.IIssuedThrough = {
|
|
463
|
-
// typeOf: factory.product.ProductType.Transportation,
|
|
464
|
-
// // 興行IDを追加(2022-09-08~)
|
|
465
|
-
// id: eventOffers.itemOffered.id,
|
|
466
|
-
// availableChannel,
|
|
467
|
-
// // issuedThrough.serviceTypeを連携
|
|
468
|
-
// ...(typeof serviceTypeOfIssuedThrough?.typeOf === 'string') ? { serviceType: serviceTypeOfIssuedThrough } : undefined
|
|
469
|
-
// };
|
|
470
448
|
return Object.assign(Object.assign(Object.assign({ project: params.project, typeOf: factory.reservationType.BusReservation, id: params.id,
|
|
471
449
|
// reservationPackage保管に移行(2023-06-06~)
|
|
472
450
|
// issuedThrough,
|
|
473
|
-
additionalProperty: params.additionalProperty, bookingTime: params.reserveDate, modifiedTime: params.reserveDate, numSeats: 1, price: price4reservation, priceCurrency: factory.priceCurrency.JPY, reservationNumber: params.reservationNumber,
|
|
451
|
+
additionalProperty: params.additionalProperty, bookingTime: params.reserveDate, modifiedTime: params.reserveDate, numSeats: 1, price: price4reservation, priceCurrency: factory.priceCurrency.JPY, reservationNumber: params.reservationNumber,
|
|
452
|
+
// statusは不要なので削除(2023-07-19~)
|
|
453
|
+
// reservationStatus: factory.reservationStatusType.ReservationPending,
|
|
454
|
+
reservedTicket: params.reservedTicket, underName: {
|
|
474
455
|
typeOf: params.agent.typeOf,
|
|
475
456
|
name: params.agent.name
|
|
476
457
|
}, checkedIn: false, attended: false }, (typeof params.additionalTicketText === 'string') ? { additionalTicketText: params.additionalTicketText } : undefined), (Array.isArray(params.subReservation))
|
|
@@ -96,7 +96,6 @@ type IStartParams = factory.assetTransaction.reserve.IStartParamsWithoutDetail &
|
|
|
96
96
|
* 取引開始
|
|
97
97
|
*/
|
|
98
98
|
export declare function start(params: IStartParams & {
|
|
99
|
-
disablePendingReservations: boolean;
|
|
100
99
|
useHoldStockByTransactionNumber: boolean;
|
|
101
100
|
stockHoldUntilDaysAfterEventEnd: number;
|
|
102
101
|
}): IStartOperation<{
|
|
@@ -55,7 +55,7 @@ function start(params) {
|
|
|
55
55
|
now,
|
|
56
56
|
store: { id: (_c = params.availableAtOrFrom) === null || _c === void 0 ? void 0 : _c.id }
|
|
57
57
|
});
|
|
58
|
-
const startParams = (0, factory_1.createStartParams)(Object.assign(Object.assign({}, params), { reservationNumber: reservationNumber }));
|
|
58
|
+
const startParams = (0, factory_1.createStartParams)(Object.assign(Object.assign({}, params), { provider: { id: event.organizer.id }, reservationNumber: reservationNumber }));
|
|
59
59
|
// 取引作成
|
|
60
60
|
let transaction;
|
|
61
61
|
try {
|
|
@@ -139,20 +139,6 @@ function addReservations(params) {
|
|
|
139
139
|
// 予約イベント最適化
|
|
140
140
|
const reservationFor = (0, factory_1.createReservationFor)(event);
|
|
141
141
|
const { issuedThrough } = (0, factory_1.createIssuedThrough)({ reservationFor: event });
|
|
142
|
-
// const minimizedObjectSubReservations: factory.assetTransaction.reserve.IMinimizedObjectSubReservation[] =
|
|
143
|
-
// objectSubReservations.map((r) => {
|
|
144
|
-
// return {
|
|
145
|
-
// id: r.id,
|
|
146
|
-
// typeOf: r.typeOf,
|
|
147
|
-
// reservedTicket: {
|
|
148
|
-
// ticketType: r.reservedTicket.ticketType,
|
|
149
|
-
// ...(typeof r.reservedTicket.ticketedSeat?.typeOf === 'string')
|
|
150
|
-
// ? { ticketedSeat: r.reservedTicket.ticketedSeat }
|
|
151
|
-
// : undefined
|
|
152
|
-
// },
|
|
153
|
-
// ...(Array.isArray(r.subReservation)) ? { subReservation: r.subReservation } : undefined
|
|
154
|
-
// };
|
|
155
|
-
// });
|
|
156
142
|
// 取引に予約追加
|
|
157
143
|
let lockedOfferRateLimitKeys = [];
|
|
158
144
|
try {
|
|
@@ -165,9 +151,7 @@ function addReservations(params) {
|
|
|
165
151
|
// issuedThroughを追加(2023-06-05~)
|
|
166
152
|
issuedThrough,
|
|
167
153
|
reservationFor,
|
|
168
|
-
// subReservationにreservationForを保管しない(2021-10-19~)
|
|
169
154
|
subReservation: objectSubReservations
|
|
170
|
-
// subReservation: minimizedObjectSubReservations
|
|
171
155
|
}
|
|
172
156
|
});
|
|
173
157
|
}
|
|
@@ -191,10 +175,11 @@ function addReservations(params) {
|
|
|
191
175
|
},
|
|
192
176
|
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
|
|
193
177
|
})(repos);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
178
|
+
// 完全廃止(2023-07-19~)
|
|
179
|
+
// if (transaction.object.disablePendingReservations !== true) {
|
|
180
|
+
// // 予約作成(insertManyで実装)
|
|
181
|
+
// await repos.reservation.createMany({ reservationFor, reservations: objectSubReservations });
|
|
182
|
+
// }
|
|
198
183
|
// ストックホルダー処理(stockHolderで残席数を集計しているので必要)
|
|
199
184
|
yield onReservationsCreated({ event })(repos);
|
|
200
185
|
return { transaction, objectSubReservations, issuedThrough };
|
|
@@ -546,7 +531,7 @@ function validateProgramMembershipUsed(params) {
|
|
|
546
531
|
function createPermitService(params) {
|
|
547
532
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
548
533
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
549
|
-
const product = yield repos.product.findById({ id: params.issuedThrough.id });
|
|
534
|
+
const product = yield repos.product.findById({ id: params.issuedThrough.id }, ['availableChannel'], []);
|
|
550
535
|
const permitServiceEndpoint = (_a = product.availableChannel) === null || _a === void 0 ? void 0 : _a.serviceUrl;
|
|
551
536
|
const permitServiceAuthorizeServerDomain = (_c = (_b = product.availableChannel) === null || _b === void 0 ? void 0 : _b.credentials) === null || _c === void 0 ? void 0 : _c.authorizeServerDomain;
|
|
552
537
|
const permitServiceClientId = (_e = (_d = product.availableChannel) === null || _d === void 0 ? void 0 : _d.credentials) === null || _e === void 0 ? void 0 : _e.clientId;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as factory from '../../factory';
|
|
2
|
+
import { MongoRepository as ActionRepo } from '../../repo/action';
|
|
3
|
+
import { MongoRepository as EventRepo } from '../../repo/event';
|
|
4
|
+
import { MongoRepository as TaskRepo } from '../../repo/task';
|
|
5
|
+
export declare function createEvent(params: factory.task.createEvent.IData): (repos: {
|
|
6
|
+
action: ActionRepo;
|
|
7
|
+
event: EventRepo;
|
|
8
|
+
task: TaskRepo;
|
|
9
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createEvent = void 0;
|
|
13
|
+
const factory = require("../../factory");
|
|
14
|
+
// tslint:disable-next-line:max-func-body-length
|
|
15
|
+
function createEvent(params) {
|
|
16
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
var _a;
|
|
18
|
+
const actionAttributes = params;
|
|
19
|
+
const action = yield repos.action.start(actionAttributes);
|
|
20
|
+
let eventIds = [];
|
|
21
|
+
let eventType;
|
|
22
|
+
try {
|
|
23
|
+
if (((_a = actionAttributes.instrument) === null || _a === void 0 ? void 0 : _a.createScreeningEventSeriesIfNotExistByWorkPerformed) === true) {
|
|
24
|
+
const bulkWriteResult = yield repos.event.createScreeningEventSeriesIfNotExistByWorkPerformed(actionAttributes.object.map((p) => {
|
|
25
|
+
if (p.typeOf !== factory.eventType.ScreeningEventSeries) {
|
|
26
|
+
throw new factory.errors.Argument('typeOf', `must be ${factory.eventType.ScreeningEventSeries}`);
|
|
27
|
+
}
|
|
28
|
+
return { attributes: p };
|
|
29
|
+
}));
|
|
30
|
+
let upsertedIds;
|
|
31
|
+
if (bulkWriteResult !== undefined) {
|
|
32
|
+
upsertedIds = bulkWriteResult.getUpsertedIds()
|
|
33
|
+
.map((doc) => doc._id.toString());
|
|
34
|
+
}
|
|
35
|
+
eventIds = (Array.isArray(upsertedIds)) ? upsertedIds : [];
|
|
36
|
+
eventType = factory.eventType.ScreeningEventSeries;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// no op
|
|
40
|
+
throw new factory.errors.NotImplemented('only createScreeningEventSeriesIfNotExistByWorkPerformed implemented');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
// actionにエラー結果を追加
|
|
45
|
+
try {
|
|
46
|
+
const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
|
|
47
|
+
yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
|
|
48
|
+
}
|
|
49
|
+
catch (__) {
|
|
50
|
+
// 失敗したら仕方ない
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
// アクション完了
|
|
55
|
+
yield repos.action.complete({
|
|
56
|
+
typeOf: action.typeOf,
|
|
57
|
+
id: action.id,
|
|
58
|
+
result: (Array.isArray(eventIds))
|
|
59
|
+
? eventIds.map((eventId) => {
|
|
60
|
+
return { id: eventId };
|
|
61
|
+
})
|
|
62
|
+
: undefined
|
|
63
|
+
});
|
|
64
|
+
if (Array.isArray(eventIds) && eventIds.length > 0) {
|
|
65
|
+
// 非同期に変更(2023-06-08~)
|
|
66
|
+
const onEventChangedTask = {
|
|
67
|
+
project: actionAttributes.project,
|
|
68
|
+
name: factory.taskName.OnEventChanged,
|
|
69
|
+
status: factory.taskStatus.Ready,
|
|
70
|
+
runsAt: new Date(),
|
|
71
|
+
remainingNumberOfTries: 3,
|
|
72
|
+
numberOfTried: 0,
|
|
73
|
+
executionResults: [],
|
|
74
|
+
data: {
|
|
75
|
+
id: eventIds,
|
|
76
|
+
project: { id: actionAttributes.project.id },
|
|
77
|
+
typeOf: eventType,
|
|
78
|
+
isNew: true,
|
|
79
|
+
useInform: true
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
yield repos.task.saveMany([onEventChangedTask], { emitImmediately: true });
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
exports.createEvent = createEvent;
|
|
@@ -6,6 +6,7 @@ import { MongoRepository as ProjectRepo } from '../repo/project';
|
|
|
6
6
|
import { MongoRepository as SellerRepo } from '../repo/seller';
|
|
7
7
|
import { MongoRepository as TaskRepo } from '../repo/task';
|
|
8
8
|
import * as factory from '../factory';
|
|
9
|
+
import { createEvent } from './event/createEvent';
|
|
9
10
|
/**
|
|
10
11
|
* Googleで作品画像を検索する
|
|
11
12
|
*/
|
|
@@ -71,3 +72,4 @@ export declare function updateEvent4ttts(params: {
|
|
|
71
72
|
project: ProjectRepo;
|
|
72
73
|
task: TaskRepo;
|
|
73
74
|
}) => Promise<void>;
|
|
75
|
+
export { createEvent };
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.updateEvent4ttts = exports.createScreeningEventIdFromCOA = exports.importFromCOA = void 0;
|
|
12
|
+
exports.createEvent = exports.updateEvent4ttts = exports.createScreeningEventIdFromCOA = exports.importFromCOA = void 0;
|
|
13
13
|
/**
|
|
14
14
|
* マスターデータ同期サービス
|
|
15
15
|
*/
|
|
@@ -21,6 +21,8 @@ const difference = require("lodash.difference");
|
|
|
21
21
|
const moment = require("moment-timezone");
|
|
22
22
|
const credentials_1 = require("../credentials");
|
|
23
23
|
const factory = require("../factory");
|
|
24
|
+
const createEvent_1 = require("./event/createEvent");
|
|
25
|
+
Object.defineProperty(exports, "createEvent", { enumerable: true, get: function () { return createEvent_1.createEvent; } });
|
|
24
26
|
const offer_1 = require("./offer");
|
|
25
27
|
const debug = createDebug('chevre-domain:service:event');
|
|
26
28
|
const coaAuthClient = new COA.auth.RefreshToken({
|
|
@@ -92,6 +94,7 @@ function importFromCOA(params) {
|
|
|
92
94
|
const sellersWithSameBranchCode = yield repos.seller.search({
|
|
93
95
|
limit: 1,
|
|
94
96
|
page: 1,
|
|
97
|
+
project: { id: { $eq: project.id } },
|
|
95
98
|
branchCode: { $eq: params.locationBranchCode }
|
|
96
99
|
}, ['_id'], []);
|
|
97
100
|
const seller = sellersWithSameBranchCode.shift();
|
|
@@ -119,6 +122,7 @@ function importFromCOA(params) {
|
|
|
119
122
|
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
120
123
|
}
|
|
121
124
|
const screeningRooms = yield repos.place.searchScreeningRooms({
|
|
125
|
+
project: { id: { $eq: project.id } },
|
|
122
126
|
containedInPlace: { branchCode: { $eq: movieTheater.branchCode } }
|
|
123
127
|
});
|
|
124
128
|
const targetImportFrom = moment(`${moment(params.importFrom)
|
|
@@ -133,7 +137,8 @@ function importFromCOA(params) {
|
|
|
133
137
|
locationBranchCode: params.locationBranchCode,
|
|
134
138
|
movieTheater,
|
|
135
139
|
project: project,
|
|
136
|
-
saveScreeningEventSeries: params.saveScreeningEventSeries
|
|
140
|
+
saveScreeningEventSeries: params.saveScreeningEventSeries,
|
|
141
|
+
seller: { id: seller.id }
|
|
137
142
|
})(repos);
|
|
138
143
|
savedScreeningEventSeriesCount = savedEventsCount;
|
|
139
144
|
try {
|
|
@@ -145,7 +150,8 @@ function importFromCOA(params) {
|
|
|
145
150
|
screeningEventSerieses: screeningEventSerieses,
|
|
146
151
|
project: project,
|
|
147
152
|
targetImportFrom: targetImportFrom.toDate(),
|
|
148
|
-
targetImportThrough: targetImportThrough.toDate()
|
|
153
|
+
targetImportThrough: targetImportThrough.toDate(),
|
|
154
|
+
seller: { id: seller.id }
|
|
149
155
|
})(repos);
|
|
150
156
|
savedScreeningEventsCount = screeningEvents.length;
|
|
151
157
|
// COAから削除されたイベントをキャンセル済ステータスへ変更
|
|
@@ -234,7 +240,8 @@ function saveScreeningEventSeries(params) {
|
|
|
234
240
|
eizouKubuns: eizouKubuns,
|
|
235
241
|
joueihousikiKubuns: joueihousikiKubuns,
|
|
236
242
|
jimakufukikaeKubuns: jimakufukikaeKubuns,
|
|
237
|
-
availablePaymentMethodTypes
|
|
243
|
+
availablePaymentMethodTypes,
|
|
244
|
+
seller: params.seller
|
|
238
245
|
});
|
|
239
246
|
});
|
|
240
247
|
let savedEventsCount = 0;
|
|
@@ -362,7 +369,8 @@ function createScreeningEvents(params) {
|
|
|
362
369
|
screenRoom: screenRoom,
|
|
363
370
|
superEvent: screeningEventSeries,
|
|
364
371
|
serviceKubuns: serviceKubuns,
|
|
365
|
-
acousticKubuns: acousticKubuns
|
|
372
|
+
acousticKubuns: acousticKubuns,
|
|
373
|
+
seller: params.seller
|
|
366
374
|
});
|
|
367
375
|
screeningEvents.push(screeningEvent);
|
|
368
376
|
});
|
|
@@ -373,16 +381,6 @@ function cancelDeletedEvents(params) {
|
|
|
373
381
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
374
382
|
// distinctでidのみ取得(2023-01-25~)
|
|
375
383
|
// COAから削除されたイベントをキャンセル済ステータスへ変更
|
|
376
|
-
// const ids = await repos.event.search<factory.eventType.ScreeningEvent>({
|
|
377
|
-
// project: { id: { $eq: params.project.id } },
|
|
378
|
-
// typeOf: factory.eventType.ScreeningEvent,
|
|
379
|
-
// superEvent: {
|
|
380
|
-
// locationBranchCodes: [params.locationBranchCode]
|
|
381
|
-
// },
|
|
382
|
-
// startFrom: params.targetImportFrom,
|
|
383
|
-
// startThrough: params.targetImportThrough
|
|
384
|
-
// })
|
|
385
|
-
// .then((events) => events.map((e) => e.id));
|
|
386
384
|
const ids = yield repos.event.searchIds({
|
|
387
385
|
project: { id: { $eq: params.project.id } },
|
|
388
386
|
typeOf: factory.eventType.ScreeningEvent,
|
|
@@ -397,7 +395,10 @@ function cancelDeletedEvents(params) {
|
|
|
397
395
|
debug(`cancelling ${cancelledIds.length} events...`);
|
|
398
396
|
for (const cancelledId of cancelledIds) {
|
|
399
397
|
try {
|
|
400
|
-
yield repos.event.cancel({
|
|
398
|
+
yield repos.event.cancel({
|
|
399
|
+
id: cancelledId,
|
|
400
|
+
project: { id: params.project.id }
|
|
401
|
+
});
|
|
401
402
|
}
|
|
402
403
|
catch (error) {
|
|
403
404
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
@@ -493,7 +494,8 @@ function createScreeningEventFromCOA(params) {
|
|
|
493
494
|
attendeeCount: 0,
|
|
494
495
|
maximumAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity,
|
|
495
496
|
remainingAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity,
|
|
496
|
-
additionalProperty
|
|
497
|
+
additionalProperty,
|
|
498
|
+
organizer: { id: params.seller.id }
|
|
497
499
|
};
|
|
498
500
|
}
|
|
499
501
|
function createScreeningEventAdditionalPropertyFromCOA(params) {
|
|
@@ -579,12 +581,8 @@ function createScreeningEventSeriesFromCOA(params) {
|
|
|
579
581
|
kanaName: params.movieTheater.kanaName,
|
|
580
582
|
typeOf: params.movieTheater.typeOf
|
|
581
583
|
},
|
|
582
|
-
//
|
|
583
|
-
|
|
584
|
-
// typeOf: factory.organizationType.Corporation,
|
|
585
|
-
// identifier: params.movieTheater.id,
|
|
586
|
-
// name: params.movieTheater.name
|
|
587
|
-
// },
|
|
584
|
+
// 必須化(2023-07-12~)
|
|
585
|
+
organizer: { id: params.seller.id },
|
|
588
586
|
videoFormat: params.eizouKubuns.filter((kubun) => kubun.kubunCode === params.filmFromCOA.kbnEizou)[0],
|
|
589
587
|
soundFormat: [],
|
|
590
588
|
workPerformed: {
|
|
@@ -674,7 +672,7 @@ function createMovieTheaterFromCOA(project, seller, theaterFromCOA, screensFromC
|
|
|
674
672
|
},
|
|
675
673
|
kanaName: theaterFromCOA.theaterNameKana,
|
|
676
674
|
containsPlace: screensFromCOA.map((screenFromCOA) => {
|
|
677
|
-
return createScreeningRoomFromCOA(project, screenFromCOA);
|
|
675
|
+
return createScreeningRoomFromCOA(project, seller, screenFromCOA);
|
|
678
676
|
}),
|
|
679
677
|
typeOf: factory.placeType.MovieTheater,
|
|
680
678
|
telephone: theaterFromCOA.theaterTelNum,
|
|
@@ -716,7 +714,7 @@ function createMovieTheaterFromCOA(project, seller, theaterFromCOA, screensFromC
|
|
|
716
714
|
*/
|
|
717
715
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
718
716
|
/* istanbul ignore next */
|
|
719
|
-
function createScreeningRoomFromCOA(project, screenFromCOA) {
|
|
717
|
+
function createScreeningRoomFromCOA(project, seller, screenFromCOA) {
|
|
720
718
|
const sections = [];
|
|
721
719
|
const sectionCodes = [];
|
|
722
720
|
screenFromCOA.listSeat.forEach((seat) => {
|
|
@@ -755,7 +753,9 @@ function createScreeningRoomFromCOA(project, screenFromCOA) {
|
|
|
755
753
|
en: screenFromCOA.screenNameEng
|
|
756
754
|
},
|
|
757
755
|
typeOf: factory.placeType.ScreeningRoom,
|
|
758
|
-
maximumAttendeeCapacity: sections[0].containsPlace.length
|
|
756
|
+
maximumAttendeeCapacity: sections[0].containsPlace.length,
|
|
757
|
+
// 必須化(2023-07-14~)
|
|
758
|
+
parentOrganization: { id: seller.id, typeOf: factory.organizationType.Corporation }
|
|
759
759
|
};
|
|
760
760
|
}
|
|
761
761
|
function updateEvent4ttts(params) {
|
|
@@ -322,7 +322,7 @@ function getIssuedThroughIdByAction(params) {
|
|
|
322
322
|
function createPermitServiceCredentials(params) {
|
|
323
323
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
324
324
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
325
|
-
const paymentCardService = yield repos.product.findById({ id: params.issuedThrough.id });
|
|
325
|
+
const paymentCardService = yield repos.product.findById({ id: params.issuedThrough.id }, ['availableChannel'], []);
|
|
326
326
|
const permitServiceEndpoint = (_a = paymentCardService.availableChannel) === null || _a === void 0 ? void 0 : _a.serviceUrl;
|
|
327
327
|
const permitServiceAuthorizeServerDomain = (_c = (_b = paymentCardService.availableChannel) === null || _b === void 0 ? void 0 : _b.credentials) === null || _c === void 0 ? void 0 : _c.authorizeServerDomain;
|
|
328
328
|
const permitServiceClientId = (_e = (_d = paymentCardService.availableChannel) === null || _d === void 0 ? void 0 : _d.credentials) === null || _e === void 0 ? void 0 : _e.clientId;
|
|
@@ -67,7 +67,8 @@ function authorize(params) {
|
|
|
67
67
|
unitPriceOffers,
|
|
68
68
|
validateEvent: params.validateEvent === true,
|
|
69
69
|
validateEventOfferPeriod: params.validateEventOfferPeriod === true,
|
|
70
|
-
|
|
70
|
+
// 完全廃止(2023-07-19~)
|
|
71
|
+
// disablePendingReservations: params.disablePendingReservations,
|
|
71
72
|
useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber,
|
|
72
73
|
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
|
|
73
74
|
})(repos);
|
|
@@ -165,7 +166,10 @@ function processStartReserve4chevre(params) {
|
|
|
165
166
|
// requestBody = startParams;
|
|
166
167
|
const startParamObject = yield validateObjectWithoutDetail(startParams)(repos);
|
|
167
168
|
// 予約取引開始
|
|
168
|
-
const startReserveTransactionResult = yield ReserveTransactionService.start(Object.assign(Object.assign({}, startParams), { object: startParamObject, preSearchedEvent: event, preSearchedTicketOffers: params.ticketOffers, preSearchedUnitPriceOffers: params.unitPriceOffers, availableAtOrFrom: { id: params.availableAtOrFrom.id }, validateEvent: params.validateEvent, validateEventOfferPeriod: params.validateEventOfferPeriod, validateAppliesToMovieTicket: true,
|
|
169
|
+
const startReserveTransactionResult = yield ReserveTransactionService.start(Object.assign(Object.assign({}, startParams), { object: startParamObject, preSearchedEvent: event, preSearchedTicketOffers: params.ticketOffers, preSearchedUnitPriceOffers: params.unitPriceOffers, availableAtOrFrom: { id: params.availableAtOrFrom.id }, validateEvent: params.validateEvent, validateEventOfferPeriod: params.validateEventOfferPeriod, validateAppliesToMovieTicket: true,
|
|
170
|
+
// 完全廃止(2023-07-19~)
|
|
171
|
+
// disablePendingReservations: params.disablePendingReservations,
|
|
172
|
+
useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber, stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd }))(repos);
|
|
169
173
|
responseBody = startReserveTransactionResult.transaction;
|
|
170
174
|
// 予約取引からオファー情報を生成する
|
|
171
175
|
acceptedOffers4result = (0, factory_1.responseBody2acceptedOffers4result)({
|
|
@@ -18,7 +18,7 @@ function searchTicketOffersByItemOffered(params) {
|
|
|
18
18
|
var _a, _b, _c, _d;
|
|
19
19
|
let catalogId;
|
|
20
20
|
if (typeof ((_a = params.itemOffered) === null || _a === void 0 ? void 0 : _a.id) === 'string') {
|
|
21
|
-
const eventService = yield repos.product.findById({ id: (_b = params.itemOffered) === null || _b === void 0 ? void 0 : _b.id });
|
|
21
|
+
const eventService = yield repos.product.findById({ id: (_b = params.itemOffered) === null || _b === void 0 ? void 0 : _b.id }, ['hasOfferCatalog'], []);
|
|
22
22
|
if (typeof ((_c = eventService.hasOfferCatalog) === null || _c === void 0 ? void 0 : _c.id) === 'string') {
|
|
23
23
|
catalogId = eventService.hasOfferCatalog.id;
|
|
24
24
|
}
|
|
@@ -53,7 +53,21 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
53
53
|
let videoFormatTypes = [];
|
|
54
54
|
if (event.typeOf === factory.eventType.ScreeningEvent) {
|
|
55
55
|
// 取得属性最適化(2023-01-25~)
|
|
56
|
-
const superEvent
|
|
56
|
+
// const superEvent: Pick<factory.event.IEvent<factory.eventType.ScreeningEventSeries>, 'soundFormat' | 'videoFormat'> =
|
|
57
|
+
// await repos.event.findById<factory.eventType.ScreeningEventSeries>(
|
|
58
|
+
// { id: event.superEvent.id },
|
|
59
|
+
// { soundFormat: 1, videoFormat: 1 }
|
|
60
|
+
// );
|
|
61
|
+
const superEvents = yield repos.event.search({
|
|
62
|
+
limit: 1,
|
|
63
|
+
page: 1,
|
|
64
|
+
id: { $eq: event.superEvent.id },
|
|
65
|
+
typeOf: factory.eventType.ScreeningEventSeries
|
|
66
|
+
}, { soundFormat: 1, videoFormat: 1 });
|
|
67
|
+
const superEvent = superEvents.shift();
|
|
68
|
+
if (superEvent === undefined) {
|
|
69
|
+
throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
|
|
70
|
+
}
|
|
57
71
|
soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
|
|
58
72
|
videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
59
73
|
}
|
|
@@ -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
|
/**
|
|
@@ -18,7 +18,7 @@ function searchProductOffers(params) {
|
|
|
18
18
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
var _a;
|
|
20
20
|
// プロダクト検索
|
|
21
|
-
const productWithOffers = yield repos.product.findById({ id: params.itemOffered.id });
|
|
21
|
+
const productWithOffers = yield repos.product.findById({ id: params.itemOffered.id }, ['hasOfferCatalog'], []);
|
|
22
22
|
const offerCatalogId = (_a = productWithOffers.hasOfferCatalog) === null || _a === void 0 ? void 0 : _a.id;
|
|
23
23
|
if (typeof offerCatalogId !== 'string') {
|
|
24
24
|
return [];
|
|
@@ -14,6 +14,7 @@ const order_1 = require("../../factory/order");
|
|
|
14
14
|
const factory_1 = require("../delivery/factory");
|
|
15
15
|
const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
|
|
16
16
|
const factory = require("../../factory");
|
|
17
|
+
// tslint:disable-next-line:max-func-body-length
|
|
17
18
|
function returnOrder(params) {
|
|
18
19
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
19
20
|
const orderNumber = params.object.orderNumber;
|
|
@@ -21,7 +22,12 @@ function returnOrder(params) {
|
|
|
21
22
|
? params.object.dateReturned
|
|
22
23
|
: new Date();
|
|
23
24
|
const returner = params.agent;
|
|
24
|
-
let order = yield repos.order.findByOrderNumber({
|
|
25
|
+
let order = yield repos.order.findByOrderNumber({
|
|
26
|
+
orderNumber,
|
|
27
|
+
project: { id: params.project.id },
|
|
28
|
+
inclusion: [],
|
|
29
|
+
exclusion: []
|
|
30
|
+
});
|
|
25
31
|
// プロジェクト条件検証
|
|
26
32
|
if (order.project.id !== params.project.id) {
|
|
27
33
|
throw new factory.errors.NotFound('Order');
|
|
@@ -59,6 +65,7 @@ function returnOrder(params) {
|
|
|
59
65
|
returnedOwnershipInfos = yield processReturnOrder(order, dateReturned)({ ownershipInfo: repos.ownershipInfo });
|
|
60
66
|
// 注文ステータス変更
|
|
61
67
|
order = yield repos.order.returnOrder({
|
|
68
|
+
project: { id: order.project.id },
|
|
62
69
|
orderNumber,
|
|
63
70
|
dateReturned,
|
|
64
71
|
returner
|