@chevre/domain 24.1.0-alpha.8 → 25.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/emailMessageBuilder.d.ts +1 -1
- package/lib/chevre/emailMessageBuilder.js +4 -12
- package/lib/chevre/factory/transaction/placeOrder.d.ts +2 -10
- package/lib/chevre/factory/transaction/placeOrder.js +1 -0
- package/lib/chevre/index.d.ts +1 -2
- package/lib/chevre/index.js +1 -3
- package/lib/chevre/repo/acceptedOffer.d.ts +25 -27
- package/lib/chevre/repo/acceptedOffer.js +102 -67
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +34 -0
- package/lib/chevre/repo/acceptedOfferInReserve.js +86 -0
- package/lib/chevre/repo/accountingReport.js +2 -30
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +1 -2
- package/lib/chevre/repo/assetTransaction/reserve.js +4 -50
- package/lib/chevre/repo/event.js +12 -8
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +9 -0
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +76 -0
- package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +1 -1
- package/lib/chevre/repo/factory/reservation/createMongoConditions.js +171 -363
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
- package/lib/chevre/repo/mongoose/schemas/order.js +134 -131
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -2
- package/lib/chevre/repo/mongoose/schemas/reservation.js +6 -57
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +84 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +2 -1
- package/lib/chevre/repo/order.d.ts +1 -82
- package/lib/chevre/repo/order.js +11 -372
- package/lib/chevre/repo/orderInTransaction.d.ts +58 -7
- package/lib/chevre/repo/orderInTransaction.js +58 -4
- package/lib/chevre/repo/place/hasPOS.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +20 -9
- package/lib/chevre/repo/reservation.js +16 -12
- package/lib/chevre/repo/role.d.ts +1 -15
- package/lib/chevre/repo/role.js +7 -14
- package/lib/chevre/repo/setting/integration.d.ts +27 -0
- package/lib/chevre/repo/setting/integration.js +102 -0
- package/lib/chevre/repo/transaction/placeOrder.d.ts +8 -3
- package/lib/chevre/repo/transaction/placeOrder.js +5 -1
- package/lib/chevre/repo/transaction.d.ts +6 -6
- package/lib/chevre/repo/transaction.js +0 -776
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +11 -0
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +6 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +1 -8
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +20 -32
- package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +1 -1
- package/lib/chevre/service/delivery/factory.d.ts +6 -1
- package/lib/chevre/service/delivery/factory.js +1 -1
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -3
- package/lib/chevre/service/delivery/reservation/factory.js +0 -17
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +2 -4
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +3 -3
- package/lib/chevre/service/notification/notifyByEmail.d.ts +3 -3
- package/lib/chevre/service/notification/notifyByEmail.js +7 -12
- package/lib/chevre/service/notification/sendEmailMessage.d.ts +2 -3
- package/lib/chevre/service/notification/sendEmailMessage.js +5 -4
- package/lib/chevre/service/offer/any.d.ts +7 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +17 -18
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize.js +55 -107
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -3
- package/lib/chevre/service/order/deleteOrder.d.ts +1 -1
- package/lib/chevre/service/order/deleteOrder.js +19 -46
- package/lib/chevre/service/order/{findPlaceOrderTransaction.d.ts → findConfirmedPlaceOrder.d.ts} +1 -1
- package/lib/chevre/service/order/{findPlaceOrderTransaction.js → findConfirmedPlaceOrder.js} +12 -7
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +11 -18
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +0 -1
- package/lib/chevre/service/order/onOrderUpdated.js +0 -1
- package/lib/chevre/service/order/payOrder.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +19 -7
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory.js +33 -22
- package/lib/chevre/service/order/placeOrder.d.ts +3 -2
- package/lib/chevre/service/order/placeOrder.js +0 -9
- package/lib/chevre/service/order/returnOrder.js +0 -1
- package/lib/chevre/service/order/sendOrder.js +1 -7
- package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/any/factory.js +7 -6
- package/lib/chevre/service/payment/any/person2username.js +0 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.js +4 -3
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +8 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +7 -7
- package/lib/chevre/service/reserve/factory.js +2 -1
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
- package/lib/chevre/service/reserve/findByCode.js +1 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +14 -6
- package/lib/chevre/service/reserve/findReservations.js +26 -36
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -10
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +0 -1
- package/lib/chevre/service/reserve/searchByOrder.js +7 -3
- package/lib/chevre/service/task/acceptCOAOffer.js +6 -3
- package/lib/chevre/service/task/authorizePayment.js +4 -2
- package/lib/chevre/service/task/cancelPendingReservation.js +4 -2
- package/lib/chevre/service/task/checkMovieTicket.js +4 -2
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +5 -3
- package/lib/chevre/service/task/createAccountingReport.js +0 -4
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +4 -2
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
- package/lib/chevre/service/task/importOffersFromCOA.js +4 -2
- package/lib/chevre/service/task/invalidatePaymentUrl.js +3 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +3 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/pay.js +4 -2
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.js +6 -7
- package/lib/chevre/service/task/payment/refundByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +1 -1
- package/lib/chevre/service/task/placeOrder.js +3 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
- package/lib/chevre/service/task/refund.js +4 -2
- package/lib/chevre/service/task/returnReserveTransaction.js +4 -2
- package/lib/chevre/service/task/sendEmailMessage.js +5 -3
- package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
- package/lib/chevre/service/task/voidPayment.js +4 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
- package/lib/chevre/service/task.d.ts +0 -7
- package/lib/chevre/service/transaction/deleteTransaction.js +13 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.js +7 -17
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +7 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +7 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +5 -4
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +5 -4
- package/lib/chevre/service/transaction/placeOrder/confirm.js +55 -58
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +11 -2
- package/lib/chevre/service/transaction/placeOrder/start/factory.js +12 -10
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +1 -2
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +5 -16
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +3 -4
- package/lib/chevre/service/transaction/placeOrder/start.js +2 -2
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
- package/lib/chevre/service/transaction/placeOrder.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -4
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service/transaction.js +3 -5
- package/lib/chevre/service/validation/validateOrder.js +4 -79
- package/lib/chevre/settings.d.ts +0 -55
- package/lib/chevre/settings.js +1 -29
- package/lib/chevre/taskSettings.d.ts +0 -22
- package/lib/chevre/taskSettings.js +1 -7
- package/package.json +2 -2
- package/lib/chevre/credentials/customSearch.d.ts +0 -13
- package/lib/chevre/credentials/customSearch.js +0 -16
- package/lib/chevre/credentials/lineNotify.d.ts +0 -17
- package/lib/chevre/credentials/lineNotify.js +0 -20
- package/lib/chevre/credentials/sendGrid.d.ts +0 -24
- package/lib/chevre/credentials/sendGrid.js +0 -18
- package/lib/chevre/credentials.d.ts +0 -20
- package/lib/chevre/credentials.js +0 -42
|
@@ -302,23 +302,24 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
302
302
|
* 注文データの予約を生成する
|
|
303
303
|
*/
|
|
304
304
|
function createReservation(params) {
|
|
305
|
-
// const { itemOffered, event, reservationFor } = params;
|
|
306
305
|
const { itemOffered } = params;
|
|
307
306
|
const event = params.reservationFor;
|
|
308
307
|
let reservationItem;
|
|
308
|
+
const ticketType = {
|
|
309
|
+
typeOf: itemOffered.reservedTicket.ticketType.typeOf,
|
|
310
|
+
id: itemOffered.reservedTicket.ticketType.id,
|
|
311
|
+
identifier: itemOffered.reservedTicket.ticketType.identifier,
|
|
312
|
+
name: itemOffered.reservedTicket.ticketType.name,
|
|
313
|
+
description: itemOffered.reservedTicket.ticketType.description,
|
|
314
|
+
...((Array.isArray(itemOffered.reservedTicket.ticketType.additionalProperty)) && { additionalProperty: itemOffered.reservedTicket.ticketType.additionalProperty })
|
|
315
|
+
};
|
|
309
316
|
const reservedTicket = {
|
|
310
317
|
typeOf: itemOffered.reservedTicket.typeOf,
|
|
311
|
-
ticketType
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
description: itemOffered.reservedTicket.ticketType.description,
|
|
317
|
-
additionalProperty: itemOffered.reservedTicket.ticketType.additionalProperty
|
|
318
|
-
},
|
|
319
|
-
...(typeof itemOffered.reservedTicket.identifier === 'string')
|
|
320
|
-
? { identifier: itemOffered.reservedTicket.identifier }
|
|
321
|
-
: undefined, // チケット識別子追加(2024-04-15~)
|
|
318
|
+
ticketType,
|
|
319
|
+
identifier: itemOffered.reservedTicket.identifier, // チケット識別子必須化(2026-06-08~)
|
|
320
|
+
// ...(typeof itemOffered.reservedTicket.identifier === 'string')
|
|
321
|
+
// ? { identifier: itemOffered.reservedTicket.identifier }
|
|
322
|
+
// : undefined, // チケット識別子追加(2024-04-15~)
|
|
322
323
|
...(itemOffered.reservedTicket.ticketedSeat !== undefined)
|
|
323
324
|
? { ticketedSeat: itemOffered.reservedTicket.ticketedSeat }
|
|
324
325
|
: undefined
|
|
@@ -367,19 +368,17 @@ function createReservation(params) {
|
|
|
367
368
|
if (params.issuedThrough.typeOf !== factory_1.factory.product.ProductType.EventService) {
|
|
368
369
|
throw new factory_1.factory.errors.Argument('issuedThrough', `issuedThrough.typeOf must be ${factory_1.factory.product.ProductType.EventService}`);
|
|
369
370
|
}
|
|
371
|
+
const { additionalProperty, additionalTicketText, programMembershipUsed } = itemOffered;
|
|
370
372
|
reservationItem = {
|
|
371
373
|
typeOf: itemOffered.typeOf,
|
|
372
|
-
additionalProperty: itemOffered.additionalProperty,
|
|
373
|
-
additionalTicketText: itemOffered.additionalTicketText,
|
|
374
374
|
id: itemOffered.id,
|
|
375
375
|
issuedThrough: params.issuedThrough,
|
|
376
376
|
reservationNumber: params.reservationNumber,
|
|
377
377
|
reservationFor,
|
|
378
378
|
reservedTicket,
|
|
379
|
-
|
|
380
|
-
...(typeof
|
|
381
|
-
|
|
382
|
-
: undefined
|
|
379
|
+
...((Array.isArray(additionalProperty)) && { additionalProperty }),
|
|
380
|
+
...((typeof additionalTicketText === 'string') && { additionalTicketText }),
|
|
381
|
+
...((typeof programMembershipUsed?.typeOf === 'string') && { programMembershipUsed }) // 使用メンバーシップがあれば追加
|
|
383
382
|
};
|
|
384
383
|
}
|
|
385
384
|
else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../../factory';
|
|
2
|
-
import { Settings } from '../../../../
|
|
2
|
+
import type { IntegrationSettingRepo as Settings } from '../../../../repo/setting/integration';
|
|
3
3
|
import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
|
|
4
4
|
import type { AuthorizationRepo } from '../../../../repo/authorization';
|
|
5
5
|
import type { EventRepo, IMinimizedIndividualEvent } from '../../../../repo/event';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
import { Settings } from '../../../
|
|
2
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
3
3
|
import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
|
|
4
4
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
5
5
|
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
6
6
|
import type { EventRepo } from '../../../repo/event';
|
|
7
7
|
import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
8
|
-
import { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
8
|
+
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
9
9
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
10
10
|
import type { MemberRepo } from '../../../repo/member';
|
|
11
11
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
@@ -12,11 +12,7 @@ const searchOffersByIds_1 = require("./searchOffersByIds");
|
|
|
12
12
|
* 興行オファー承認
|
|
13
13
|
*/
|
|
14
14
|
function authorize(params, options) {
|
|
15
|
-
return async (repos, settings
|
|
16
|
-
// credentials: {
|
|
17
|
-
// jwt: JWTCredentials;
|
|
18
|
-
// }
|
|
19
|
-
) => {
|
|
15
|
+
return async (repos, settings) => {
|
|
20
16
|
const { noOfferSpecified } = options;
|
|
21
17
|
const { transaction, event } = await validateCreateRequest(params)(repos);
|
|
22
18
|
const { acceptedOffers, ticketOffers, unitPriceOffers } = await validateAcceptedOffers({
|
|
@@ -51,20 +47,27 @@ function authorize(params, options) {
|
|
|
51
47
|
validateEventOfferPeriod: params.validateEventOfferPeriod === true,
|
|
52
48
|
orderNumber,
|
|
53
49
|
instrument: params.instrument,
|
|
54
|
-
// useHoldStockByTransactionNumber: params.useHoldStockByTransactionNumber, // discontinue(2024-07-02~)
|
|
55
|
-
// stockHoldUntilDaysAfterEventEnd,
|
|
56
50
|
...(typeof params.object.broker?.typeOf === 'string') ? { broker: params.object.broker } : undefined
|
|
57
51
|
}, options)(repos, settings);
|
|
58
52
|
acceptedOffers4result = processStartReserveResult.acceptedOffers4result;
|
|
59
|
-
// add orderInTransaction(2024-01-15~)
|
|
60
53
|
if (!noOfferSpecified) {
|
|
61
|
-
|
|
54
|
+
const minimizedAcceptedOffers = acceptedOffers4result.map((acceptOffer4result, offerIndex) => {
|
|
55
|
+
const { priceSpecification: _priceSpecification, itemOffered, name: _name, // 名称非保管に対応(2026-06-11~)
|
|
56
|
+
...acceptOfferNoPriceSpec } = acceptOffer4result;
|
|
57
|
+
const includeReservationFor = (offerIndex === 0); // ひとつめのオファーのみ含む(2026-06-04~)
|
|
58
|
+
return {
|
|
59
|
+
...acceptOfferNoPriceSpec,
|
|
60
|
+
// ...((!useAcceptedOfferNoName) && { name }), // 名称非保管に対応(2026-06-09~)
|
|
61
|
+
itemOffered: minimizeItemOffered(itemOffered, {
|
|
62
|
+
includeReservationFor
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
});
|
|
62
66
|
await (0, any_1.acceptOffer)({
|
|
63
67
|
orderNumber,
|
|
64
68
|
project: transaction.project,
|
|
65
|
-
acceptedOffers:
|
|
69
|
+
acceptedOffers: minimizedAcceptedOffers
|
|
66
70
|
})(repos);
|
|
67
|
-
// }
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
catch (error) {
|
|
@@ -81,6 +84,42 @@ function authorize(params, options) {
|
|
|
81
84
|
return { id: action.id, result };
|
|
82
85
|
};
|
|
83
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* 注文ドキュメントに保管するitemOfferedを最小化する
|
|
89
|
+
* 2026-05-25~
|
|
90
|
+
*/
|
|
91
|
+
function minimizeItemOffered(itemOffered, options) {
|
|
92
|
+
const { includeReservationFor } = options;
|
|
93
|
+
const { id, reservationNumber, typeOf, reservationFor } = itemOffered;
|
|
94
|
+
const minimizedReservation = {
|
|
95
|
+
id: reservationFor.id,
|
|
96
|
+
typeOf: reservationFor.typeOf,
|
|
97
|
+
location: {
|
|
98
|
+
branchCode: reservationFor.location.branchCode,
|
|
99
|
+
typeOf: reservationFor.location.typeOf
|
|
100
|
+
},
|
|
101
|
+
superEvent: {
|
|
102
|
+
id: reservationFor.superEvent.id,
|
|
103
|
+
typeOf: reservationFor.superEvent.typeOf,
|
|
104
|
+
location: {
|
|
105
|
+
branchCode: reservationFor.superEvent.location.branchCode,
|
|
106
|
+
typeOf: reservationFor.superEvent.location.typeOf
|
|
107
|
+
},
|
|
108
|
+
workPerformed: {
|
|
109
|
+
identifier: reservationFor.superEvent.workPerformed.identifier,
|
|
110
|
+
typeOf: reservationFor.superEvent.workPerformed.typeOf
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
startDate: reservationFor.startDate,
|
|
114
|
+
endDate: reservationFor.endDate
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
id,
|
|
118
|
+
reservationNumber,
|
|
119
|
+
typeOf,
|
|
120
|
+
...((includeReservationFor) && { reservationFor: minimizedReservation })
|
|
121
|
+
};
|
|
122
|
+
}
|
|
84
123
|
function validateCreateRequest(params) {
|
|
85
124
|
return async (repos) => {
|
|
86
125
|
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
@@ -190,51 +229,6 @@ function validateAcceptedOffers(params) {
|
|
|
190
229
|
})();
|
|
191
230
|
}))
|
|
192
231
|
: [];
|
|
193
|
-
// reserveTransaction.startへ処理を移行(2024-07-03~)
|
|
194
|
-
// オファーIDごとにオファー適用条件を確認
|
|
195
|
-
// offerIds.forEach((offerId) => {
|
|
196
|
-
// const acceptedOffersByOfferId = acceptedOffers.filter((o) => o.id === offerId);
|
|
197
|
-
// const numAcceptedOffersByOfferId = acceptedOffersByOfferId.length;
|
|
198
|
-
// let referenceQuantityValue = 1;
|
|
199
|
-
// // 単価仕様を取り出す
|
|
200
|
-
// const unitPriceSpec = acceptedOffersByOfferId[0].priceSpecification.priceComponent.find(
|
|
201
|
-
// (spec) => spec.typeOf === factory.priceSpecificationType.UnitPriceSpecification && (!Array.isArray(spec.appliesToAddOn))
|
|
202
|
-
// );
|
|
203
|
-
// // 単価仕様は必ず存在するはず
|
|
204
|
-
// if (unitPriceSpec?.typeOf !== factory.priceSpecificationType.UnitPriceSpecification) {
|
|
205
|
-
// throw new factory.errors.Internal(`unitPriceSpec of the offer '${offerId}' not found`);
|
|
206
|
-
// }
|
|
207
|
-
// const unitPriceSpecReferenceQuantityValue = unitPriceSpec.referenceQuantity?.value;
|
|
208
|
-
// if (typeof unitPriceSpecReferenceQuantityValue === 'number') {
|
|
209
|
-
// referenceQuantityValue = unitPriceSpecReferenceQuantityValue;
|
|
210
|
-
// }
|
|
211
|
-
// // アイテム数が適用単位要件を満たしていなければエラー
|
|
212
|
-
// if (numAcceptedOffersByOfferId % referenceQuantityValue !== 0) {
|
|
213
|
-
// throw new factory.errors.Argument(
|
|
214
|
-
// 'acceptedOffers',
|
|
215
|
-
// `Offer ${offerId} requires reference quantity value ${referenceQuantityValue}`
|
|
216
|
-
// );
|
|
217
|
-
// }
|
|
218
|
-
// // 適用数量要件を満たしていなければエラー
|
|
219
|
-
// const maxValue = unitPriceSpec.eligibleQuantity?.maxValue;
|
|
220
|
-
// if (typeof maxValue === 'number') {
|
|
221
|
-
// if (numAcceptedOffersByOfferId > maxValue) {
|
|
222
|
-
// throw new factory.errors.Argument(
|
|
223
|
-
// 'acceptedOffers',
|
|
224
|
-
// `Number of offer:${offerId} must be less than or equal to ${maxValue}`
|
|
225
|
-
// );
|
|
226
|
-
// }
|
|
227
|
-
// }
|
|
228
|
-
// const minValue = unitPriceSpec.eligibleQuantity?.minValue;
|
|
229
|
-
// if (typeof minValue === 'number') {
|
|
230
|
-
// if (numAcceptedOffersByOfferId < minValue) {
|
|
231
|
-
// throw new factory.errors.Argument(
|
|
232
|
-
// 'acceptedOffers',
|
|
233
|
-
// `Number of offer:${offerId} must be more than or equal to ${minValue}`
|
|
234
|
-
// );
|
|
235
|
-
// }
|
|
236
|
-
// }
|
|
237
|
-
// });
|
|
238
232
|
return { acceptedOffers, ticketOffers, unitPriceOffers };
|
|
239
233
|
};
|
|
240
234
|
}
|
|
@@ -246,27 +240,7 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
|
|
|
246
240
|
if (offer === undefined) {
|
|
247
241
|
throw new factory_1.factory.errors.NotFound('Ticket Offer', `Ticket Offer ${offerWithoutDetail.id} not found`);
|
|
248
242
|
}
|
|
249
|
-
// // ポイント特典入金先の指定があれば入金識別子を発行
|
|
250
|
-
// const pointAward = createPointAwardByOfferWithoutDetail({
|
|
251
|
-
// offerWithoutDetail,
|
|
252
|
-
// transaction: params.transaction
|
|
253
|
-
// });
|
|
254
243
|
const acceptedAppliesToMovieTicket = offerWithoutDetail.priceSpecification?.appliesToMovieTicket;
|
|
255
|
-
// 承認アクションオブジェクトのacceptedOfferにappliesToMovieTicketを連携する(2022-08-02~)
|
|
256
|
-
// const priceSpecification: IAcceptedOfferPriceSpecification = {
|
|
257
|
-
// // 必要な属性のみに最適化(2024-04-09~)
|
|
258
|
-
// // ...offer.priceSpecification,
|
|
259
|
-
// typeOf: offer.priceSpecification.typeOf,
|
|
260
|
-
// priceCurrency: offer.priceSpecification.priceCurrency,
|
|
261
|
-
// // valueAddedTaxIncluded: offer.priceSpecification.valueAddedTaxIncluded,
|
|
262
|
-
// priceComponent: offer.priceSpecification.priceComponent.map(({
|
|
263
|
-
// name, accounting, id, priceCurrency, valueAddedTaxIncluded, ...necessaryComponentFields
|
|
264
|
-
// }) => necessaryComponentFields),
|
|
265
|
-
// // appliesToMovieTicket.identifierを連携する
|
|
266
|
-
// ...(Array.isArray(acceptedAppliesToMovieTicket) || typeof acceptedAppliesToMovieTicket?.identifier === 'string')
|
|
267
|
-
// ? { appliesToMovieTicket: acceptedAppliesToMovieTicket }
|
|
268
|
-
// : undefined
|
|
269
|
-
// };
|
|
270
244
|
const priceSpecification = {
|
|
271
245
|
// appliesToMovieTicket.identifierを連携する
|
|
272
246
|
...(Array.isArray(acceptedAppliesToMovieTicket) || typeof acceptedAppliesToMovieTicket?.identifier === 'string')
|
|
@@ -292,7 +266,7 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
|
|
|
292
266
|
// itemOfferedServiceOutputを最適化(2024-04-08~)
|
|
293
267
|
let itemOfferedServiceOutput;
|
|
294
268
|
if (typeof serviceOutputByOfferWithoutDetail?.typeOf === 'string') {
|
|
295
|
-
const { typeOf,
|
|
269
|
+
const { typeOf, additionalTicketText, programMembershipUsed, reservedTicket, subReservation } = serviceOutputByOfferWithoutDetail;
|
|
296
270
|
let ticketedSeat;
|
|
297
271
|
if (typeof reservedTicket?.ticketedSeat?.typeOf === 'string') {
|
|
298
272
|
ticketedSeat = {
|
|
@@ -306,36 +280,19 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
|
|
|
306
280
|
};
|
|
307
281
|
}
|
|
308
282
|
switch (typeOf) {
|
|
309
|
-
// case factory.reservationType.BusReservation:
|
|
310
|
-
// const serviceOutputAsBusReservation: factory.assetTransaction.reserve.IBusReservatonAsItemOfferedServiceOutput = {
|
|
311
|
-
// typeOf,
|
|
312
|
-
// ...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
|
|
313
|
-
// ...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
|
|
314
|
-
// ...(programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined,
|
|
315
|
-
// ...(Array.isArray(subReservation)) ? { subReservation } : undefined,
|
|
316
|
-
// ...(reservedTicket !== undefined) ? {
|
|
317
|
-
// reservedTicket: {
|
|
318
|
-
// typeOf: 'Ticket',
|
|
319
|
-
// // チケット識別子指定拡張(2024-04-15~)
|
|
320
|
-
// ...(typeof reservedTicket.identifier === 'string') ? { identifier: reservedTicket.identifier } : undefined,
|
|
321
|
-
// ...(typeof ticketedSeat?.typeOf === 'string') ? { ticketedSeat } : undefined
|
|
322
|
-
// }
|
|
323
|
-
// } : undefined
|
|
324
|
-
// };
|
|
325
|
-
// itemOfferedServiceOutput = serviceOutputAsBusReservation;
|
|
326
|
-
// break;
|
|
327
283
|
case factory_1.factory.reservationType.EventReservation: {
|
|
328
284
|
const serviceOutputAsEventReservation = {
|
|
329
285
|
typeOf,
|
|
330
|
-
...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
|
|
286
|
+
// ...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined, // 追加特性指定を廃止(2026-06-08~)
|
|
331
287
|
...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
|
|
332
288
|
...(programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined,
|
|
333
289
|
...(Array.isArray(subReservation)) ? { subReservation } : undefined,
|
|
334
290
|
...(reservedTicket !== undefined) ? {
|
|
335
291
|
reservedTicket: {
|
|
336
292
|
typeOf: 'Ticket',
|
|
337
|
-
//
|
|
338
|
-
|
|
293
|
+
// チケット識別子のカスタム指定を廃止(2026-06-08~)
|
|
294
|
+
// // チケット識別子指定拡張(2024-04-15~)
|
|
295
|
+
// ...(typeof reservedTicket.identifier === 'string') ? { identifier: reservedTicket.identifier } : undefined,
|
|
339
296
|
...(typeof ticketedSeat?.typeOf === 'string') ? { ticketedSeat } : undefined
|
|
340
297
|
}
|
|
341
298
|
} : undefined
|
|
@@ -351,15 +308,9 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
|
|
|
351
308
|
return {
|
|
352
309
|
// オファーの中身を最適化する(必要最低限の情報のみに)
|
|
353
310
|
id: String(offer.id),
|
|
354
|
-
// identifier: offer.identifier,
|
|
355
311
|
priceSpecification,
|
|
356
|
-
// typeOf: offer.typeOf,
|
|
357
|
-
// priceCurrency: offer.priceCurrency,
|
|
358
312
|
itemOffered: {
|
|
359
|
-
// typeOf: factory.product.ProductType.EventService,
|
|
360
313
|
...(itemOfferedServiceOutput !== undefined) ? { serviceOutput: itemOfferedServiceOutput } : undefined,
|
|
361
|
-
// discontinue(2026-04-18~)
|
|
362
|
-
// ...(pointAward !== undefined) ? { pointAward } : undefined
|
|
363
314
|
},
|
|
364
315
|
addOn: acceptedAddOns,
|
|
365
316
|
// 追加属性をマージ
|
|
@@ -367,9 +318,6 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
|
|
|
367
318
|
...(Array.isArray(offerWithoutDetail.additionalProperty)) ? offerWithoutDetail.additionalProperty : [],
|
|
368
319
|
...(Array.isArray(offer.additionalProperty)) ? offer.additionalProperty : []
|
|
369
320
|
]
|
|
370
|
-
// ...(Array.isArray(offer.acceptedPaymentMethod)) // discontinue(2024-07-03~)
|
|
371
|
-
// ? { acceptedPaymentMethod: offer.acceptedPaymentMethod }
|
|
372
|
-
// : undefined
|
|
373
321
|
};
|
|
374
322
|
};
|
|
375
323
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../../factory';
|
|
2
|
-
import { Settings } from '../../../../
|
|
2
|
+
import type { IntegrationSettingRepo as Settings } from '../../../../repo/setting/integration';
|
|
3
3
|
import type { ActionRepo } from '../../../../repo/action';
|
|
4
4
|
import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
|
|
5
5
|
import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
|
-
import { Settings } from '../../../
|
|
3
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
4
4
|
import type { ActionRepo } from '../../../repo/action';
|
|
5
5
|
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
6
6
|
import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
|
-
import { Settings } from '../../../
|
|
3
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
4
4
|
import type { ActionRepo } from '../../../repo/action';
|
|
5
5
|
import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
|
|
6
6
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
@@ -21,9 +21,7 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
21
21
|
export declare function offers2resultPrice(offers: IAcceptedOffer4COA[]): {
|
|
22
22
|
price: number;
|
|
23
23
|
};
|
|
24
|
-
type IResultAcceptedOffer =
|
|
25
|
-
itemOffered: factory.order.ICOAEventReservation;
|
|
26
|
-
};
|
|
24
|
+
type IResultAcceptedOffer = factory.order.ICOAAcceptedOffer;
|
|
27
25
|
/**
|
|
28
26
|
* COA仮予約結果から注文アイテムを生成する
|
|
29
27
|
*/
|
|
@@ -13,7 +13,7 @@ import { factory } from '../../factory';
|
|
|
13
13
|
* 冪等性を確保すること
|
|
14
14
|
*/
|
|
15
15
|
declare function deleteOrder(params: {
|
|
16
|
-
object: Pick<factory.order.IOrder, '
|
|
16
|
+
object: Pick<factory.order.IOrder, 'orderNumber'>;
|
|
17
17
|
}): (repos: {
|
|
18
18
|
acceptedOffer: AcceptedOfferRepo;
|
|
19
19
|
accountingReport: AccountingReportRepo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteOrder = deleteOrder;
|
|
4
|
-
|
|
5
|
-
const
|
|
4
|
+
// import { createOwnershipInfosFromOrder } from '../delivery/factory';
|
|
5
|
+
const factory_1 = require("../../factory");
|
|
6
6
|
/**
|
|
7
7
|
* 注文に関わるリソースを削除する
|
|
8
8
|
* 冪等性を確保すること
|
|
@@ -20,24 +20,24 @@ function deleteOrder(params) {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
if (typeof order.id !== 'string') {
|
|
23
|
-
throw new
|
|
23
|
+
throw new factory_1.factory.errors.Internal(`order.id undefined. orderNumber: ${params.object.orderNumber}`);
|
|
24
24
|
}
|
|
25
25
|
// 注文アイテムの予約を削除
|
|
26
26
|
await deleteReservationsByOrder(order)(repos);
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
catch (error) {
|
|
32
|
-
|
|
33
|
-
}
|
|
27
|
+
// 所有権は所有期限でcleanされるので、注文削除時連動はひとまず廃止(2026-05-17~)
|
|
28
|
+
// // 所有権削除
|
|
29
|
+
// try {
|
|
30
|
+
// await deleteOwnershipInfosByOrder(order)(repos);
|
|
31
|
+
// } catch (error) {
|
|
32
|
+
// console.error('deleteOwnershipInfosByOrder throws', error);
|
|
33
|
+
// }
|
|
34
34
|
// 経理レポート削除
|
|
35
35
|
await repos.accountingReport.deleteByOrderNumber({ mainEntity: { orderNumber: order.orderNumber } });
|
|
36
36
|
// メモ削除(2024-02-15~)
|
|
37
37
|
await repos.note.deleteNotesByAbout({
|
|
38
38
|
about: {
|
|
39
39
|
id: order.id,
|
|
40
|
-
typeOf:
|
|
40
|
+
typeOf: factory_1.factory.order.OrderType.Order
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
// 注文削除
|
|
@@ -49,7 +49,7 @@ function deleteOrder(params) {
|
|
|
49
49
|
function deletePersonIfNecessary(order) {
|
|
50
50
|
return async (repos) => {
|
|
51
51
|
// 代理注文を除く
|
|
52
|
-
const isCustomerPerson = order.customer.typeOf ===
|
|
52
|
+
const isCustomerPerson = order.customer.typeOf === factory_1.factory.personType.Person
|
|
53
53
|
&& typeof order.broker?.typeOf !== 'string';
|
|
54
54
|
if (isCustomerPerson) {
|
|
55
55
|
const ordersByPerson = await repos.order.projectFields({
|
|
@@ -60,12 +60,12 @@ function deletePersonIfNecessary(order) {
|
|
|
60
60
|
if (ordersByPerson.length === 0) {
|
|
61
61
|
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['userPoolIdNew']);
|
|
62
62
|
if (typeof setting?.userPoolIdNew !== 'string') {
|
|
63
|
-
throw new
|
|
63
|
+
throw new factory_1.factory.errors.NotFound('setting.userPoolIdNew');
|
|
64
64
|
}
|
|
65
65
|
const deletePersonTask = {
|
|
66
|
-
project: { typeOf:
|
|
67
|
-
name:
|
|
68
|
-
status:
|
|
66
|
+
project: { typeOf: factory_1.factory.organizationType.Project, id: order.project.id },
|
|
67
|
+
name: factory_1.factory.taskName.DeletePerson,
|
|
68
|
+
status: factory_1.factory.taskStatus.Ready,
|
|
69
69
|
runsAt: new Date(),
|
|
70
70
|
remainingNumberOfTries: 10,
|
|
71
71
|
numberOfTried: 0,
|
|
@@ -74,8 +74,8 @@ function deletePersonIfNecessary(order) {
|
|
|
74
74
|
id: order.customer.id,
|
|
75
75
|
agent: {
|
|
76
76
|
id: order.project.id,
|
|
77
|
-
typeOf:
|
|
78
|
-
name:
|
|
77
|
+
typeOf: factory_1.factory.organizationType.Project,
|
|
78
|
+
name: factory_1.factory.organizationType.Project
|
|
79
79
|
},
|
|
80
80
|
physically: true,
|
|
81
81
|
userPoolId: setting.userPoolIdNew,
|
|
@@ -93,37 +93,10 @@ function deleteReservationsByOrder(order) {
|
|
|
93
93
|
const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
94
94
|
orderNumber: { $eq: order.orderNumber },
|
|
95
95
|
project: { id: { $eq: order.project.id } },
|
|
96
|
-
|
|
97
|
-
itemOffered: { typeOf: { $in: [factory_2.factory.reservationType.EventReservation] } }
|
|
98
|
-
}
|
|
99
|
-
});
|
|
96
|
+
}, { noName: true });
|
|
100
97
|
const reservationIds = acceptedOffers.map((o) => String(o.itemOffered.id));
|
|
101
98
|
if (reservationIds.length > 0) {
|
|
102
99
|
await repos.reservation.deleteByIds({ project: { id: order.project.id }, ids: reservationIds });
|
|
103
100
|
}
|
|
104
101
|
};
|
|
105
102
|
}
|
|
106
|
-
function deleteOwnershipInfosByOrder(order) {
|
|
107
|
-
return async (repos) => {
|
|
108
|
-
const now = new Date();
|
|
109
|
-
const ownershipInfos = (0, factory_1.createOwnershipInfosFromOrder)({
|
|
110
|
-
order: {
|
|
111
|
-
...order,
|
|
112
|
-
acceptedOffers: await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
113
|
-
orderNumber: { $eq: order.orderNumber },
|
|
114
|
-
project: { id: { $eq: order.project.id } }
|
|
115
|
-
})
|
|
116
|
-
},
|
|
117
|
-
offerIndexBase: 0
|
|
118
|
-
});
|
|
119
|
-
const ownershipIdentifiers = ownershipInfos.map((o) => String(o.identifier));
|
|
120
|
-
if (ownershipIdentifiers.length > 0) {
|
|
121
|
-
await repos.ownershipInfo.deleteExpiredByIdentifiers({
|
|
122
|
-
project: { id: order.project.id },
|
|
123
|
-
identifiers: ownershipIdentifiers,
|
|
124
|
-
// 所有期限切れのもの(ownedThroughの存在しないものは削除してはいけない)
|
|
125
|
-
ownedThrough: { $lte: now }
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
}
|
package/lib/chevre/service/order/{findPlaceOrderTransaction.d.ts → findConfirmedPlaceOrder.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
3
|
type ITransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'potentialActions' | 'project' | 'typeOf'>;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function findConfirmedPlaceOrder(params: {
|
|
5
5
|
project: {
|
|
6
6
|
id: string;
|
|
7
7
|
};
|
package/lib/chevre/service/order/{findPlaceOrderTransaction.js → findConfirmedPlaceOrder.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.findConfirmedPlaceOrder = findConfirmedPlaceOrder;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
function
|
|
5
|
+
function findConfirmedPlaceOrder(params) {
|
|
6
6
|
return async (repos) => {
|
|
7
7
|
const placeOrderTransactions = await repos.placeOrder.findPlaceOrderTransactions({
|
|
8
8
|
limit: 1,
|
|
@@ -10,12 +10,17 @@ function findPlaceOrderTransaction(params) {
|
|
|
10
10
|
project: { id: { $eq: params.project.id } },
|
|
11
11
|
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
12
12
|
statuses: [factory_1.factory.transactionStatusType.Confirmed],
|
|
13
|
-
result
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
13
|
+
// resultではなくobjectで参照するように変更(2026-06-16~)
|
|
14
|
+
object: {
|
|
15
|
+
confirmationNumber: { $eq: params.confirmationNumber },
|
|
16
|
+
orderNumber: { $eq: params.orderNumber },
|
|
18
17
|
},
|
|
18
|
+
// result: {
|
|
19
|
+
// order: {
|
|
20
|
+
// confirmationNumber: { $eq: params.confirmationNumber },
|
|
21
|
+
// orderNumbers: [params.orderNumber]
|
|
22
|
+
// }
|
|
23
|
+
// },
|
|
19
24
|
inclusion: ['potentialActions', 'project', 'typeOf']
|
|
20
25
|
});
|
|
21
26
|
const placeOrderTransaction = placeOrderTransactions.shift();
|
package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onPayTransactionCanceled = onPayTransactionCanceled;
|
|
4
|
-
const
|
|
4
|
+
const findConfirmedPlaceOrder_1 = require("../findConfirmedPlaceOrder");
|
|
5
5
|
const onOrderStatusChanged_1 = require("../onOrderStatusChanged");
|
|
6
6
|
const factory_1 = require("../../../factory");
|
|
7
7
|
function onPayTransactionCanceled(params) {
|
|
@@ -35,7 +35,7 @@ function cancelOrderIfExist(params) {
|
|
|
35
35
|
}, { inclusion: ['confirmationNumber', 'orderNumber'] });
|
|
36
36
|
const orderByPaymentMethodId = ordersByPaymentMethodId.shift();
|
|
37
37
|
if (orderByPaymentMethodId !== undefined) {
|
|
38
|
-
const placeOrderTransaction = await (0,
|
|
38
|
+
const placeOrderTransaction = await (0, findConfirmedPlaceOrder_1.findConfirmedPlaceOrder)({
|
|
39
39
|
project: { id: params.project.id },
|
|
40
40
|
confirmationNumber: orderByPaymentMethodId.confirmationNumber,
|
|
41
41
|
orderNumber: orderByPaymentMethodId.orderNumber
|
package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { SettingRepo } from '../../../repo/setting';
|
|
|
5
5
|
import type { TaskRepo } from '../../../repo/task';
|
|
6
6
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
7
7
|
import { factory } from '../../../factory';
|
|
8
|
-
import { Settings } from '../../../
|
|
8
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
9
9
|
interface IOnPayTransactionConfirmedRepos {
|
|
10
10
|
acceptedOffer: AcceptedOfferRepo;
|
|
11
11
|
assetTransaction: AssetTransactionRepo;
|
package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { SettingRepo } from '../../../repo/setting';
|
|
|
5
5
|
import type { TaskRepo } from '../../../repo/task';
|
|
6
6
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
7
7
|
import { factory } from '../../../factory';
|
|
8
|
-
import { Settings } from '../../../
|
|
8
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
9
9
|
interface IOnReserveTransactionConfirmedRepos {
|
|
10
10
|
acceptedOffer: AcceptedOfferRepo;
|
|
11
11
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -3,7 +3,7 @@ import type { OrderRepo } from '../../../repo/order';
|
|
|
3
3
|
import type { SettingRepo } from '../../../repo/setting';
|
|
4
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
5
5
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
6
|
-
import { Settings } from '../../../
|
|
6
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
7
7
|
interface IPaymentDue2ProcessingRepos {
|
|
8
8
|
acceptedOffer: AcceptedOfferRepo;
|
|
9
9
|
order: OrderRepo;
|