@chevre/domain 21.37.0 → 22.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example/src/chevre/aggregation/aggregateSystem.ts +24 -12
- package/example/src/chevre/findReservationByCode.ts +1 -1
- package/example/src/chevre/findValidAuthorization.ts +1 -1
- package/example/src/chevre/transaction/processPlaceOrder.ts +11 -5
- package/lib/chevre/repo/acceptedOffer.d.ts +1 -1
- package/lib/chevre/repo/acceptedOffer.js +4 -4
- package/lib/chevre/repo/account.d.ts +1 -1
- package/lib/chevre/repo/account.js +5 -5
- package/lib/chevre/repo/accountTitle.d.ts +1 -1
- package/lib/chevre/repo/accountTitle.js +3 -3
- package/lib/chevre/repo/accountTransaction.d.ts +1 -1
- package/lib/chevre/repo/accountTransaction.js +4 -4
- package/lib/chevre/repo/accountingReport.d.ts +1 -1
- package/lib/chevre/repo/accountingReport.js +4 -4
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/repo/action.js +4 -4
- package/lib/chevre/repo/additionalProperty.d.ts +1 -1
- package/lib/chevre/repo/additionalProperty.js +4 -4
- package/lib/chevre/repo/aggregateOffer.d.ts +1 -1
- package/lib/chevre/repo/aggregateOffer.js +6 -6
- package/lib/chevre/repo/aggregateReservation.d.ts +1 -1
- package/lib/chevre/repo/aggregateReservation.js +4 -4
- package/lib/chevre/repo/aggregation.d.ts +1 -0
- package/lib/chevre/repo/aggregation.js +1 -0
- package/lib/chevre/repo/assetTransaction.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction.js +5 -5
- package/lib/chevre/repo/categoryCode.d.ts +1 -1
- package/lib/chevre/repo/categoryCode.js +6 -6
- package/lib/chevre/repo/comment.d.ts +1 -1
- package/lib/chevre/repo/comment.js +4 -4
- package/lib/chevre/repo/creativeWork.d.ts +1 -1
- package/lib/chevre/repo/creativeWork.js +4 -4
- package/lib/chevre/repo/customer.d.ts +1 -1
- package/lib/chevre/repo/customer.js +4 -4
- package/lib/chevre/repo/customerType.d.ts +1 -1
- package/lib/chevre/repo/customerType.js +4 -4
- package/lib/chevre/repo/emailMessage.d.ts +1 -1
- package/lib/chevre/repo/emailMessage.js +4 -4
- package/lib/chevre/repo/event.d.ts +1 -1
- package/lib/chevre/repo/event.js +5 -5
- package/lib/chevre/repo/member.d.ts +1 -1
- package/lib/chevre/repo/member.js +4 -4
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -1
- package/lib/chevre/repo/merchantReturnPolicy.js +4 -4
- package/lib/chevre/repo/note.d.ts +1 -1
- package/lib/chevre/repo/note.js +4 -4
- package/lib/chevre/repo/offer.d.ts +1 -1
- package/lib/chevre/repo/offer.js +7 -7
- package/lib/chevre/repo/offerCatalog.d.ts +1 -1
- package/lib/chevre/repo/offerCatalog.js +4 -4
- package/lib/chevre/repo/offerCatalogItem.d.ts +1 -1
- package/lib/chevre/repo/offerCatalogItem.js +5 -5
- package/lib/chevre/repo/offerItemCondition.d.ts +1 -1
- package/lib/chevre/repo/offerItemCondition.js +4 -4
- package/lib/chevre/repo/order.d.ts +26 -1
- package/lib/chevre/repo/order.js +72 -5
- package/lib/chevre/repo/orderInTransaction.d.ts +1 -1
- package/lib/chevre/repo/orderInTransaction.js +3 -3
- package/lib/chevre/repo/orderNumber.d.ts +1 -1
- package/lib/chevre/repo/orderNumber.js +6 -6
- package/lib/chevre/repo/ownershipInfo.d.ts +1 -1
- package/lib/chevre/repo/ownershipInfo.js +4 -4
- package/lib/chevre/repo/passport.d.ts +7 -0
- package/lib/chevre/repo/passport.js +4 -1
- package/lib/chevre/repo/paymentMethod/creditCard.d.ts +1 -1
- package/lib/chevre/repo/paymentMethod/creditCard.js +3 -3
- package/lib/chevre/repo/paymentService.d.ts +1 -1
- package/lib/chevre/repo/paymentService.js +4 -4
- package/lib/chevre/repo/paymentServiceProvider.d.ts +1 -1
- package/lib/chevre/repo/paymentServiceProvider.js +3 -3
- package/lib/chevre/repo/permit.d.ts +1 -1
- package/lib/chevre/repo/permit.js +3 -3
- package/lib/chevre/repo/person.d.ts +1 -1
- package/lib/chevre/repo/person.js +10 -10
- package/lib/chevre/repo/place/busStop.d.ts +1 -1
- package/lib/chevre/repo/place/busStop.js +4 -4
- package/lib/chevre/repo/place/hasPOS.d.ts +1 -1
- package/lib/chevre/repo/place/hasPOS.js +3 -3
- package/lib/chevre/repo/place/movieTheater.d.ts +1 -1
- package/lib/chevre/repo/place/movieTheater.js +4 -4
- package/lib/chevre/repo/place/screeningRoom.d.ts +1 -1
- package/lib/chevre/repo/place/screeningRoom.js +3 -3
- package/lib/chevre/repo/place/seat.d.ts +1 -1
- package/lib/chevre/repo/place/seat.js +4 -4
- package/lib/chevre/repo/place/section.d.ts +1 -1
- package/lib/chevre/repo/place/section.js +3 -3
- package/lib/chevre/repo/priceSpecification.d.ts +1 -1
- package/lib/chevre/repo/priceSpecification.js +5 -5
- package/lib/chevre/repo/product.d.ts +1 -1
- package/lib/chevre/repo/product.js +4 -4
- package/lib/chevre/repo/productModel.d.ts +1 -1
- package/lib/chevre/repo/productModel.js +4 -4
- package/lib/chevre/repo/productOffer.d.ts +1 -1
- package/lib/chevre/repo/productOffer.js +3 -3
- package/lib/chevre/repo/project.d.ts +2 -1
- package/lib/chevre/repo/project.js +5 -4
- package/lib/chevre/repo/projectMakesOffer.d.ts +1 -1
- package/lib/chevre/repo/projectMakesOffer.js +3 -3
- package/lib/chevre/repo/rateLimit/offer.d.ts +1 -1
- package/lib/chevre/repo/rateLimit/offer.js +9 -8
- package/lib/chevre/repo/reservation.d.ts +1 -1
- package/lib/chevre/repo/reservation.js +5 -5
- package/lib/chevre/repo/role.d.ts +1 -1
- package/lib/chevre/repo/role.js +4 -4
- package/lib/chevre/repo/seller.d.ts +4 -2
- package/lib/chevre/repo/seller.js +19 -17
- package/lib/chevre/repo/sellerPaymentAccepted.d.ts +1 -1
- package/lib/chevre/repo/sellerPaymentAccepted.js +3 -3
- package/lib/chevre/repo/serviceOutput.d.ts +1 -1
- package/lib/chevre/repo/serviceOutput.js +4 -4
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +1 -1
- package/lib/chevre/repo/serviceOutputIdentifier.js +6 -6
- package/lib/chevre/repo/stockHolder.d.ts +1 -1
- package/lib/chevre/repo/stockHolder.js +21 -21
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/task.js +5 -5
- package/lib/chevre/repo/telemetry.d.ts +1 -1
- package/lib/chevre/repo/telemetry.js +3 -3
- package/lib/chevre/repo/transaction.d.ts +1 -10
- package/lib/chevre/repo/transaction.js +29 -42
- package/lib/chevre/repo/transactionNumber.d.ts +1 -1
- package/lib/chevre/repo/transactionNumber.js +6 -6
- package/lib/chevre/repo/transactionProcess.d.ts +1 -1
- package/lib/chevre/repo/transactionProcess.js +5 -5
- package/lib/chevre/repo/trip.d.ts +1 -1
- package/lib/chevre/repo/trip.js +4 -4
- package/lib/chevre/repository.d.ts +64 -64
- package/lib/chevre/repository.js +65 -65
- package/lib/chevre/service/account.d.ts +2 -2
- package/lib/chevre/service/accountTransaction/deposit.d.ts +2 -2
- package/lib/chevre/service/accountTransaction/transfer.d.ts +2 -2
- package/lib/chevre/service/accountTransaction/withdraw.d.ts +2 -2
- package/lib/chevre/service/accountTransaction.d.ts +1 -1
- package/lib/chevre/service/aggregation/event/aggregateOffers.d.ts +10 -10
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +9 -9
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.d.ts +7 -7
- package/lib/chevre/service/aggregation/event/findEventOffers.d.ts +3 -3
- package/lib/chevre/service/aggregation/event/importFromCOA.d.ts +1 -1
- package/lib/chevre/service/aggregation/project.d.ts +3 -3
- package/lib/chevre/service/aggregation/system.d.ts +22 -7
- package/lib/chevre/service/aggregation/system.js +35 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +4 -4
- package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +4 -4
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/account/validation.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/pay.d.ts +16 -16
- package/lib/chevre/service/assetTransaction/refund.d.ts +5 -5
- package/lib/chevre/service/assetTransaction/registerService.d.ts +8 -8
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +6 -6
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +5 -5
- package/lib/chevre/service/assetTransaction/reserve/exportTasksById.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.d.ts +5 -5
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +14 -14
- package/lib/chevre/service/assetTransaction.d.ts +2 -2
- package/lib/chevre/service/code.d.ts +2 -2
- package/lib/chevre/service/delivery.d.ts +7 -7
- package/lib/chevre/service/event/createEvent.d.ts +4 -4
- package/lib/chevre/service/event.d.ts +9 -9
- package/lib/chevre/service/iam.d.ts +2 -2
- package/lib/chevre/service/moneyTransfer.d.ts +5 -5
- package/lib/chevre/service/notification.d.ts +2 -2
- package/lib/chevre/service/offer/any.d.ts +4 -4
- package/lib/chevre/service/offer/any.js +2 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +16 -16
- package/lib/chevre/service/offer/event/authorize.d.ts +20 -20
- package/lib/chevre/service/offer/event/importFromCOA.d.ts +3 -3
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +7 -7
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +8 -8
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +8 -8
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +8 -8
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +8 -8
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +8 -8
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.d.ts +5 -5
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.d.ts +3 -3
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.d.ts +3 -3
- package/lib/chevre/service/offer/onEventChanged.d.ts +3 -3
- package/lib/chevre/service/offer/product/searchProductOffers.d.ts +3 -3
- package/lib/chevre/service/offer/product.d.ts +15 -15
- package/lib/chevre/service/offer/product.js +2 -2
- package/lib/chevre/service/offer.d.ts +4 -4
- package/lib/chevre/service/order/confirmPayTransaction.d.ts +9 -9
- package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
- package/lib/chevre/service/order/deleteOrder.d.ts +7 -7
- package/lib/chevre/service/order/findPlaceOrderTransaction.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +5 -5
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.d.ts +2 -2
- package/lib/chevre/service/order/onOrderUpdated.d.ts +1 -1
- package/lib/chevre/service/order/payOrder.d.ts +4 -4
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +3 -3
- package/lib/chevre/service/order/placeOrder/factory.d.ts +10 -1
- package/lib/chevre/service/order/placeOrder/factory.js +58 -5
- package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.js +1 -1
- package/lib/chevre/service/order/placeOrder.d.ts +7 -7
- package/lib/chevre/service/order/placeOrderWithoutTransaction.d.ts +4 -4
- package/lib/chevre/service/order/returnOrder.d.ts +6 -6
- package/lib/chevre/service/order/sendOrder.d.ts +6 -6
- package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +2 -2
- package/lib/chevre/service/payment/any/onPaid.d.ts +3 -3
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.d.ts +1 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.d.ts +1 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.d.ts +2 -2
- package/lib/chevre/service/payment/any/onRefund.d.ts +3 -3
- package/lib/chevre/service/payment/any/person2username.js +1 -1
- package/lib/chevre/service/payment/any.d.ts +18 -18
- package/lib/chevre/service/payment/any.js +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +5 -5
- package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.d.ts +3 -3
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +7 -7
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +7 -7
- package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +5 -5
- package/lib/chevre/service/payment/faceToFace.d.ts +4 -4
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +8 -8
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +6 -6
- package/lib/chevre/service/payment/movieTicket/getCredentials.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +8 -8
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +2 -2
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +4 -4
- package/lib/chevre/service/payment/movieTicket/validation.d.ts +7 -7
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +4 -4
- package/lib/chevre/service/payment/paymentCard.d.ts +6 -6
- package/lib/chevre/service/payment.d.ts +16 -16
- package/lib/chevre/service/permit.d.ts +2 -2
- package/lib/chevre/service/product.d.ts +3 -3
- package/lib/chevre/service/project.d.ts +17 -17
- package/lib/chevre/service/report/telemetry.d.ts +4 -4
- package/lib/chevre/service/reserve/cancelReservation.d.ts +6 -6
- package/lib/chevre/service/reserve/checkInReservation.d.ts +5 -5
- package/lib/chevre/service/reserve/confirmReservation.d.ts +5 -5
- package/lib/chevre/service/reserve/findByCode.d.ts +3 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +1 -1
- package/lib/chevre/service/reserve/searchByOrder.d.ts +3 -3
- package/lib/chevre/service/reserve/useReservation.d.ts +5 -5
- package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +2 -2
- package/lib/chevre/service/task/acceptCOAOffer.js +6 -6
- package/lib/chevre/service/task/aggregateOffers.js +10 -10
- package/lib/chevre/service/task/aggregateScreeningEvent.js +9 -9
- package/lib/chevre/service/task/aggregateUseActionsOnEvent.js +7 -7
- package/lib/chevre/service/task/authorizePayment.js +14 -14
- package/lib/chevre/service/task/cancelMoneyTransfer.js +2 -2
- package/lib/chevre/service/task/cancelPendingReservation.js +6 -6
- package/lib/chevre/service/task/cancelReservation.js +6 -6
- package/lib/chevre/service/task/checkMovieTicket.js +6 -6
- package/lib/chevre/service/task/checkResource.js +4 -4
- package/lib/chevre/service/task/confirmMoneyTransfer.js +3 -3
- package/lib/chevre/service/task/confirmPayTransaction.js +9 -9
- package/lib/chevre/service/task/confirmRegisterService.js +3 -3
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +3 -3
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +3 -3
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -6
- package/lib/chevre/service/task/confirmReserveTransaction.js +6 -6
- package/lib/chevre/service/task/createAccountingReport.js +4 -4
- package/lib/chevre/service/task/createEvent.js +4 -4
- package/lib/chevre/service/task/deleteTransaction.js +11 -11
- package/lib/chevre/service/task/givePointAward.js +5 -5
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +7 -7
- package/lib/chevre/service/task/importOffersFromCOA.js +3 -3
- package/lib/chevre/service/task/moneyTransfer.js +3 -3
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +5 -5
- package/lib/chevre/service/task/onAuthorizationCreated.js +10 -10
- package/lib/chevre/service/task/onEventChanged.js +3 -3
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -4
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onCategoryCodeUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +3 -3
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.d.ts +4 -4
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +18 -18
- package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.d.ts +3 -3
- package/lib/chevre/service/task/onResourceUpdated.js +19 -19
- package/lib/chevre/service/task/pay.js +12 -12
- package/lib/chevre/service/task/placeOrder.js +7 -7
- package/lib/chevre/service/task/publishPaymentUrl.js +8 -8
- package/lib/chevre/service/task/refund.js +10 -10
- package/lib/chevre/service/task/registerService.js +3 -3
- package/lib/chevre/service/task/reserve.js +4 -4
- package/lib/chevre/service/task/returnMoneyTransfer.js +5 -5
- package/lib/chevre/service/task/returnOrder.js +6 -6
- package/lib/chevre/service/task/returnPayTransaction.js +8 -8
- package/lib/chevre/service/task/returnPointAward.js +5 -5
- package/lib/chevre/service/task/returnReserveTransaction.js +5 -5
- package/lib/chevre/service/task/sendEmailMessage.js +2 -2
- package/lib/chevre/service/task/sendOrder.js +6 -6
- package/lib/chevre/service/task/triggerWebhook.js +1 -1
- package/lib/chevre/service/task/useReservation.js +5 -5
- package/lib/chevre/service/task/voidMoneyTransferTransaction.js +3 -3
- package/lib/chevre/service/task/voidPayTransaction.js +8 -8
- package/lib/chevre/service/task/voidPayment.js +8 -8
- package/lib/chevre/service/task/voidRegisterServiceTransaction.js +3 -3
- package/lib/chevre/service/task/voidReserveTransaction.js +9 -9
- package/lib/chevre/service/task.d.ts +1 -1
- package/lib/chevre/service/task.js +3 -3
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +11 -11
- package/lib/chevre/service/transaction/moneyTransfer.d.ts +10 -10
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.d.ts +11 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.js +32 -0
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/potentialActions/sendEmailMessage.d.ts +1 -1
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/potentialActions/sendEmailMessage.js +2 -2
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/publishCode.d.ts +2 -2
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/publishCode.js +1 -1
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/validation/validateMovieTicket.js +2 -2
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/validation.d.ts +2 -2
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/validation.js +2 -2
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/confirm.d.ts +8 -8
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/confirm.js +18 -25
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.d.ts +17 -0
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +39 -0
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/publishConfirmationNumberIfNotExist.d.ts +1 -1
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/publishOrderNumberIfNotExist.d.ts +3 -3
- package/lib/chevre/service/transaction/{placeOrderInProgress/validation → placeOrder/start}/validateStartRequest.d.ts +3 -3
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/start.d.ts +4 -4
- package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/start.js +4 -2
- package/lib/chevre/service/transaction/placeOrder.d.ts +6 -14
- package/lib/chevre/service/transaction/placeOrder.js +11 -37
- package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +9 -9
- package/lib/chevre/service/transaction/returnOrder.d.ts +12 -12
- package/lib/chevre/service/transaction.d.ts +5 -11
- package/lib/chevre/service/transaction.js +14 -7
- package/lib/chevre/service/validation/validateOrder.d.ts +3 -3
- package/lib/chevre/service/validation/validateOrder.js +1 -1
- package/package.json +5 -5
- package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +0 -24
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +0 -120
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +0 -9
- package/lib/chevre/service/transaction/placeOrderInProgress.js +0 -16
- /package/lib/chevre/repo/{code.d.ts → authorization.d.ts} +0 -0
- /package/lib/chevre/repo/{code.js → authorization.js} +0 -0
- /package/lib/chevre/service/{transaction/placeOrderInProgress/result → order/placeOrder/factory}/orderedItem.d.ts +0 -0
- /package/lib/chevre/service/{transaction/placeOrderInProgress/result → order/placeOrder/factory}/orderedItem.js +0 -0
- /package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder/confirm}/potentialActions.js +0 -0
- /package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/publishConfirmationNumberIfNotExist.js +0 -0
- /package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/publishOrderNumberIfNotExist.js +0 -0
- /package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/start/factory.d.ts +0 -0
- /package/lib/chevre/service/transaction/{placeOrderInProgress → placeOrder}/start/factory.js +0 -0
- /package/lib/chevre/service/transaction/{placeOrderInProgress/validation → placeOrder/start}/validateStartRequest.js +0 -0
|
@@ -15,13 +15,14 @@ const moment = require("moment");
|
|
|
15
15
|
const errorHandler_1 = require("../../../errorHandler");
|
|
16
16
|
const factory = require("../../../factory");
|
|
17
17
|
const availableProductTypes_1 = require("../../../factory/availableProductTypes");
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const factory_1 = require("../../order/placeOrder/factory");
|
|
19
|
+
const orderedItem_1 = require("../../order/placeOrder/factory/orderedItem");
|
|
20
|
+
const result_1 = require("./confirm/factory/result");
|
|
21
|
+
const potentialActions_1 = require("./confirm/potentialActions");
|
|
22
|
+
const publishCode_1 = require("./confirm/publishCode");
|
|
23
|
+
const validation_1 = require("./confirm/validation");
|
|
20
24
|
const publishConfirmationNumberIfNotExist_1 = require("./publishConfirmationNumberIfNotExist");
|
|
21
25
|
const publishOrderNumberIfNotExist_1 = require("./publishOrderNumberIfNotExist");
|
|
22
|
-
const result_1 = require("./result");
|
|
23
|
-
const orderedItem_1 = require("./result/orderedItem");
|
|
24
|
-
const validation_1 = require("./validation");
|
|
25
26
|
const debug = createDebug('chevre-domain:service:transaction');
|
|
26
27
|
function processTransactionNotInProgress(transaction) {
|
|
27
28
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -108,7 +109,7 @@ function confirm(params) {
|
|
|
108
109
|
// retrieve customer from orderInTransaction(2024-06-24~)
|
|
109
110
|
// let customer: factory.order.ICustomer = createCustomer({ transaction });
|
|
110
111
|
const customer = yield repos.orderInTransaction.findCustomerByOrderNumber({ orderNumber: { $eq: orderNumber } });
|
|
111
|
-
const seller = (0,
|
|
112
|
+
const seller = (0, factory_1.createSeller)({ transaction });
|
|
112
113
|
const { paymentMethods, result, eventId, reservationIds } = createResult(Object.assign(Object.assign(Object.assign({}, params), { orderNumber, transaction,
|
|
113
114
|
authorizePaymentActions, authorizeEventServiceOfferActions, authorizeMoneyTansferActions, authorizeProductOfferActions,
|
|
114
115
|
acceptedOffers, payTransactions, customer }), (typeof code === 'string') ? { code } : undefined));
|
|
@@ -276,27 +277,23 @@ function createResult(params) {
|
|
|
276
277
|
});
|
|
277
278
|
// 取引の確定条件が全て整っているかどうか確認
|
|
278
279
|
(0, validation_1.validateTransaction)(transaction, params.authorizePaymentActions, params.authorizeEventServiceOfferActions, params.authorizeMoneyTansferActions, params.authorizeProductOfferActions, eventReservationAcceptedOffers, params.payTransactions, params.customer);
|
|
279
|
-
const { paymentMethods, price } = (0,
|
|
280
|
+
const { paymentMethods, price } = (0, factory_1.createPaymentMethods)({ authorizePaymentActions: params.authorizePaymentActions });
|
|
280
281
|
const orderedItem = (0, orderedItem_1.acceptedOffers2orderedItem)({
|
|
281
282
|
eventReservationAcceptedOffers,
|
|
282
283
|
productAcceptedOffers,
|
|
283
284
|
moneyTransferAcceptedOffers
|
|
284
285
|
});
|
|
285
286
|
// 注文作成
|
|
286
|
-
const
|
|
287
|
+
const orderAsResult = (0, result_1.createOrderAsResult)({
|
|
287
288
|
orderNumber: params.orderNumber,
|
|
288
|
-
transaction,
|
|
289
289
|
orderDate: params.result.order.orderDate,
|
|
290
290
|
orderStatus: factory.orderStatus.OrderPaymentDue,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
// eventReservationAcceptedOffers,
|
|
295
|
-
// productAcceptedOffers,
|
|
296
|
-
// moneyTransferAcceptedOffers
|
|
291
|
+
// orderedItem,
|
|
292
|
+
// paymentMethods,
|
|
293
|
+
price
|
|
297
294
|
});
|
|
298
295
|
(0, validation_1.validateEventOffers)({
|
|
299
|
-
order:
|
|
296
|
+
order: orderAsResult,
|
|
300
297
|
paymentMethods,
|
|
301
298
|
authorizeEventServiceOfferActions: params.authorizeEventServiceOfferActions
|
|
302
299
|
});
|
|
@@ -313,22 +310,19 @@ function createResult(params) {
|
|
|
313
310
|
(0, validation_1.validatePaymentMethods)({ order: { paymentMethods } });
|
|
314
311
|
// 確認番号を発行
|
|
315
312
|
const { confirmationNumber, identifier, url } = createConfirmationNumber({
|
|
316
|
-
order:
|
|
313
|
+
order: orderAsResult,
|
|
317
314
|
transaction: transaction,
|
|
318
315
|
result: params.result
|
|
319
316
|
});
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
317
|
+
orderAsResult.confirmationNumber = confirmationNumber;
|
|
318
|
+
orderAsResult.identifier = identifier;
|
|
319
|
+
orderAsResult.url = url;
|
|
323
320
|
const authorizeActions = [
|
|
324
321
|
...params.authorizePaymentActions.map(({ id }) => ({ id })),
|
|
325
322
|
...params.authorizeEventServiceOfferActions.map(({ id }) => ({ id })),
|
|
326
323
|
...params.authorizeProductOfferActions.map(({ id }) => ({ id })),
|
|
327
324
|
...params.authorizeMoneyTansferActions.map(({ id }) => ({ id }))
|
|
328
325
|
];
|
|
329
|
-
// params.authorizeActions.map(({ id }) => ({ id }));
|
|
330
|
-
// const { acceptedOffers, ...orderWithoutAcceptedOffers } = order;
|
|
331
|
-
// const orderAsResult: factory.transaction.placeOrder.IOrderAsResult = order;
|
|
332
326
|
let eventId;
|
|
333
327
|
let reservationIds;
|
|
334
328
|
if (params.options.expectsReservationIds) {
|
|
@@ -337,8 +331,7 @@ function createResult(params) {
|
|
|
337
331
|
eventId = reservationIdsResult.eventId;
|
|
338
332
|
reservationIds = reservationIdsResult.reservationIds;
|
|
339
333
|
}
|
|
340
|
-
return Object.assign(Object.assign({ paymentMethods, result: Object.assign({ order,
|
|
341
|
-
authorizeActions, numAcceptedOffers: params.acceptedOffers.length }, (typeof params.code === 'string') ? { code: params.code } : undefined) }, (typeof eventId === 'string') ? { eventId } : undefined), (Array.isArray(reservationIds)) ? { reservationIds } : undefined);
|
|
334
|
+
return Object.assign(Object.assign({ paymentMethods, result: Object.assign({ order: orderAsResult, authorizeActions, numAcceptedOffers: params.acceptedOffers.length }, (typeof params.code === 'string') ? { code: params.code } : undefined) }, (typeof eventId === 'string') ? { eventId } : undefined), (Array.isArray(reservationIds)) ? { reservationIds } : undefined);
|
|
342
335
|
}
|
|
343
336
|
function searchAuthorizeActions(params) {
|
|
344
337
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TaskRepo } from '../../../repo/task';
|
|
2
|
+
import type { TransactionRepo } from '../../../repo/transaction';
|
|
3
|
+
type ITaskAndTransactionOperation<T> = (repos: {
|
|
4
|
+
task: TaskRepo;
|
|
5
|
+
transaction: TransactionRepo;
|
|
6
|
+
}) => Promise<T>;
|
|
7
|
+
/**
|
|
8
|
+
* 取引のタスクを出力します
|
|
9
|
+
*/
|
|
10
|
+
export declare function exportTasksById(params: {
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* タスク実行日時バッファ
|
|
14
|
+
*/
|
|
15
|
+
runsTasksAfterInSeconds?: number;
|
|
16
|
+
}): ITaskAndTransactionOperation<void>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
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.exportTasksById = void 0;
|
|
13
|
+
const moment = require("moment");
|
|
14
|
+
const factory = require("../../../factory");
|
|
15
|
+
const factory_1 = require("./exportTasks/factory");
|
|
16
|
+
/**
|
|
17
|
+
* 取引のタスクを出力します
|
|
18
|
+
*/
|
|
19
|
+
function exportTasksById(params) {
|
|
20
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const transaction = yield repos.transaction.findById({
|
|
22
|
+
typeOf: factory.transactionType.PlaceOrder,
|
|
23
|
+
id: params.id
|
|
24
|
+
}, ['endDate', 'object', 'project', 'seller', 'startDate', 'status', 'typeOf']);
|
|
25
|
+
// タスク実行日時バッファの指定があれば調整
|
|
26
|
+
let taskRunsAt = new Date();
|
|
27
|
+
if (typeof params.runsTasksAfterInSeconds === 'number') {
|
|
28
|
+
taskRunsAt = moment(taskRunsAt)
|
|
29
|
+
.add(params.runsTasksAfterInSeconds, 'seconds')
|
|
30
|
+
.toDate();
|
|
31
|
+
}
|
|
32
|
+
const taskAttributes = (0, factory_1.createTasks)({
|
|
33
|
+
transaction,
|
|
34
|
+
runsAt: taskRunsAt
|
|
35
|
+
});
|
|
36
|
+
yield repos.task.saveMany(taskAttributes, { emitImmediately: true });
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.exportTasksById = exportTasksById;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConfirmationNumberRepo } from '../../../repo/confirmationNumber';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TransactionRepo } from '../../../repo/transaction';
|
|
3
3
|
import * as factory from '../../../factory';
|
|
4
4
|
/**
|
|
5
5
|
* 未発行であれば、注文の確認番号を発行して取引に保管する
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
2
|
+
import type { ProjectRepo } from '../../../repo/project';
|
|
3
|
+
import type { TransactionRepo } from '../../../repo/transaction';
|
|
4
4
|
/**
|
|
5
5
|
* 未発行であれば、注文番号を発行して取引に保管する
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { MemberRepo } from '../../../../repo/member';
|
|
2
|
+
import type { ProjectMakesOfferRepo } from '../../../../repo/projectMakesOffer';
|
|
3
|
+
import type { SellerRepo } from '../../../../repo/seller';
|
|
4
4
|
import * as factory from '../../../../factory';
|
|
5
5
|
type ISeller = Pick<factory.seller.ISeller, 'id' | 'name' | 'project' | 'typeOf' | 'makesOffer' | 'additionalProperty'>;
|
|
6
6
|
declare function validateStartRequest(params: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MemberRepo } from '../../../repo/member';
|
|
2
2
|
import type { PassportRepo } from '../../../repo/passport';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { IStartedTransaction,
|
|
3
|
+
import type { ProjectMakesOfferRepo } from '../../../repo/projectMakesOffer';
|
|
4
|
+
import type { SellerRepo } from '../../../repo/seller';
|
|
5
|
+
import type { IStartedTransaction, TransactionRepo } from '../../../repo/transaction';
|
|
6
6
|
import { placeOrder as PlaceOrderFactory } from '../../../factory/transaction';
|
|
7
7
|
interface IStartOperationRepos {
|
|
8
8
|
member: MemberRepo;
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.start = void 0;
|
|
13
13
|
const factory = require("../../../factory");
|
|
14
14
|
const factory_1 = require("./start/factory");
|
|
15
|
-
const validateStartRequest_1 = require("./
|
|
15
|
+
const validateStartRequest_1 = require("./start/validateStartRequest");
|
|
16
16
|
/**
|
|
17
17
|
* 取引開始
|
|
18
18
|
*/
|
|
@@ -39,11 +39,13 @@ function start(params, options) {
|
|
|
39
39
|
limit: 1, page: 1,
|
|
40
40
|
typeOf: factory.transactionType.PlaceOrder,
|
|
41
41
|
project: { id: { $eq: startParams.project.id } },
|
|
42
|
+
status: { $in: [factory.transactionStatusType.InProgress] },
|
|
42
43
|
agent: { identifiers: [{ name: factory_1.AGENT_IDENTIFIER_NAME_PASSPORT, value: passport.identifier }] },
|
|
43
44
|
inclusion: ['expires', 'startDate', 'status']
|
|
44
45
|
})).shift();
|
|
45
46
|
if (alreadyStartedTransaction !== undefined) {
|
|
46
|
-
|
|
47
|
+
const { id, startDate, expires, status } = alreadyStartedTransaction;
|
|
48
|
+
transaction = { id, startDate, expires, status };
|
|
47
49
|
}
|
|
48
50
|
else {
|
|
49
51
|
throw error;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import type { MongoRepository as TaskRepo } from '../../repo/task';
|
|
2
|
-
import type { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
3
|
-
export type ITaskAndTransactionOperation<T> = (repos: {
|
|
4
|
-
task: TaskRepo;
|
|
5
|
-
transaction: TransactionRepo;
|
|
6
|
-
}) => Promise<T>;
|
|
7
1
|
/**
|
|
8
|
-
*
|
|
2
|
+
* 注文取引サービス
|
|
9
3
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
runsTasksAfterInSeconds?: number;
|
|
16
|
-
}): ITaskAndTransactionOperation<void>;
|
|
4
|
+
import { POINT_AWARD_IDENTIFIER_NAME } from '../../factory/order';
|
|
5
|
+
import { confirm } from './placeOrder/confirm';
|
|
6
|
+
import { exportTasksById } from './placeOrder/exportTasksById';
|
|
7
|
+
import { start } from './placeOrder/start';
|
|
8
|
+
export { confirm, POINT_AWARD_IDENTIFIER_NAME, start, exportTasksById };
|
|
@@ -1,42 +1,16 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.exportTasksById = void 0;
|
|
3
|
+
exports.exportTasksById = exports.start = exports.POINT_AWARD_IDENTIFIER_NAME = exports.confirm = void 0;
|
|
13
4
|
/**
|
|
14
5
|
* 注文取引サービス
|
|
15
6
|
*/
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
id: params.id
|
|
27
|
-
}, ['endDate', 'object', 'project', 'seller', 'startDate', 'status', 'typeOf']);
|
|
28
|
-
// タスク実行日時バッファの指定があれば調整
|
|
29
|
-
let taskRunsAt = new Date();
|
|
30
|
-
if (typeof params.runsTasksAfterInSeconds === 'number') {
|
|
31
|
-
taskRunsAt = moment(taskRunsAt)
|
|
32
|
-
.add(params.runsTasksAfterInSeconds, 'seconds')
|
|
33
|
-
.toDate();
|
|
34
|
-
}
|
|
35
|
-
const taskAttributes = (0, factory_1.createTasks)({
|
|
36
|
-
transaction,
|
|
37
|
-
runsAt: taskRunsAt
|
|
38
|
-
});
|
|
39
|
-
yield repos.task.saveMany(taskAttributes, { emitImmediately: true });
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
exports.exportTasksById = exportTasksById;
|
|
7
|
+
const order_1 = require("../../factory/order");
|
|
8
|
+
Object.defineProperty(exports, "POINT_AWARD_IDENTIFIER_NAME", { enumerable: true, get: function () { return order_1.POINT_AWARD_IDENTIFIER_NAME; } });
|
|
9
|
+
const confirm_1 = require("./placeOrder/confirm");
|
|
10
|
+
Object.defineProperty(exports, "confirm", { enumerable: true, get: function () { return confirm_1.confirm; } });
|
|
11
|
+
const exportTasksById_1 = require("./placeOrder/exportTasksById");
|
|
12
|
+
Object.defineProperty(exports, "exportTasksById", { enumerable: true, get: function () { return exportTasksById_1.exportTasksById; } });
|
|
13
|
+
// import { publishConfirmationNumberIfNotExist } from './placeOrder/publishConfirmationNumberIfNotExist';
|
|
14
|
+
// import { publishOrderNumberIfNotExist } from './placeOrder/publishOrderNumberIfNotExist';
|
|
15
|
+
const start_1 = require("./placeOrder/start");
|
|
16
|
+
Object.defineProperty(exports, "start", { enumerable: true, get: function () { return start_1.start; } });
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
2
|
+
import type { AcceptedOfferRepo } from '../../../repo/acceptedOffer';
|
|
3
|
+
import type { EventRepo } from '../../../repo/event';
|
|
4
|
+
import type { MerchantReturnPolicyRepo } from '../../../repo/merchantReturnPolicy';
|
|
5
|
+
import type { OfferRepo } from '../../../repo/offer';
|
|
6
|
+
import type { OfferItemConditionRepo } from '../../../repo/offerItemCondition';
|
|
7
|
+
import type { OrderRepo } from '../../../repo/order';
|
|
8
|
+
import type { ProjectRepo } from '../../../repo/project';
|
|
9
|
+
import type { ReservationRepo } from '../../../repo/reservation';
|
|
10
|
+
import type { SellerRepo } from '../../../repo/seller';
|
|
11
11
|
interface IPreStartOperationRepos {
|
|
12
12
|
acceptedOffer: AcceptedOfferRepo;
|
|
13
13
|
event: EventRepo;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
2
|
+
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
3
|
+
import type { EmailMessageRepo } from '../../repo/emailMessage';
|
|
4
|
+
import type { EventRepo } from '../../repo/event';
|
|
5
|
+
import type { MerchantReturnPolicyRepo } from '../../repo/merchantReturnPolicy';
|
|
6
6
|
import type { MessageRepo } from '../../repo/message';
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import type { IStartedTransaction,
|
|
7
|
+
import type { OfferRepo } from '../../repo/offer';
|
|
8
|
+
import type { OfferItemConditionRepo } from '../../repo/offerItemCondition';
|
|
9
|
+
import type { OrderRepo } from '../../repo/order';
|
|
10
|
+
import type { ProjectRepo } from '../../repo/project';
|
|
11
|
+
import type { ReservationRepo } from '../../repo/reservation';
|
|
12
|
+
import type { SellerRepo } from '../../repo/seller';
|
|
13
|
+
import type { TaskRepo } from '../../repo/task';
|
|
14
|
+
import type { IStartedTransaction, TransactionRepo } from '../../repo/transaction';
|
|
15
15
|
import { preStart } from './returnOrder/preStart';
|
|
16
16
|
interface IStartOperationRepos {
|
|
17
17
|
acceptedOffer: AcceptedOfferRepo;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import * as factory from '../factory';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
2
|
+
import type { OrderInTransactionRepo } from '../repo/orderInTransaction';
|
|
3
|
+
import type { OrderNumberRepo } from '../repo/orderNumber';
|
|
4
|
+
import type { ProjectRepo } from '../repo/project';
|
|
5
|
+
import type { TaskRepo } from '../repo/task';
|
|
6
|
+
import type { TransactionRepo } from '../repo/transaction';
|
|
7
7
|
import { deleteTransaction } from './transaction/deleteTransaction';
|
|
8
8
|
import * as MoneyTransferTransactionService from './transaction/moneyTransfer';
|
|
9
9
|
import * as PlaceOrderTransactionService from './transaction/placeOrder';
|
|
10
|
-
import * as PlaceOrderInProgressTransactionService from './transaction/placeOrderInProgress';
|
|
11
10
|
import * as ReturnOrderTransactionService from './transaction/returnOrder';
|
|
12
11
|
export type ITransactionOperation<T> = (repos: {
|
|
13
12
|
transaction: TransactionRepo;
|
|
14
13
|
}) => Promise<T>;
|
|
15
14
|
export import moneyTransfer = MoneyTransferTransactionService;
|
|
16
15
|
export import placeOrder = PlaceOrderTransactionService;
|
|
17
|
-
export import placeOrderInProgress = PlaceOrderInProgressTransactionService;
|
|
18
16
|
export import returnOrder = ReturnOrderTransactionService;
|
|
19
17
|
export { deleteTransaction };
|
|
20
18
|
/**
|
|
@@ -43,10 +41,6 @@ export type IExportTasksOperation<T> = (repos: {
|
|
|
43
41
|
* ひとつの取引のタスクをエクスポートする
|
|
44
42
|
*/
|
|
45
43
|
export declare function exportTasks<T extends factory.transactionType>(params: {
|
|
46
|
-
project?: {
|
|
47
|
-
id: string;
|
|
48
|
-
typeOf: factory.organizationType.Project;
|
|
49
|
-
};
|
|
50
44
|
/**
|
|
51
45
|
* タスク実行日時バッファ
|
|
52
46
|
*/
|
|
@@ -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.exportTasks = exports.updateAgent = exports.deleteTransaction = exports.returnOrder = exports.
|
|
12
|
+
exports.exportTasks = exports.updateAgent = exports.deleteTransaction = exports.returnOrder = exports.placeOrder = exports.moneyTransfer = void 0;
|
|
13
13
|
/**
|
|
14
14
|
* 取引サービス
|
|
15
15
|
*/
|
|
@@ -19,12 +19,11 @@ const deleteTransaction_1 = require("./transaction/deleteTransaction");
|
|
|
19
19
|
Object.defineProperty(exports, "deleteTransaction", { enumerable: true, get: function () { return deleteTransaction_1.deleteTransaction; } });
|
|
20
20
|
const MoneyTransferTransactionService = require("./transaction/moneyTransfer");
|
|
21
21
|
const PlaceOrderTransactionService = require("./transaction/placeOrder");
|
|
22
|
-
const
|
|
22
|
+
const publishOrderNumberIfNotExist_1 = require("./transaction/placeOrder/publishOrderNumberIfNotExist");
|
|
23
23
|
const ReturnOrderTransactionService = require("./transaction/returnOrder");
|
|
24
24
|
const settings_1 = require("../settings");
|
|
25
25
|
exports.moneyTransfer = MoneyTransferTransactionService;
|
|
26
26
|
exports.placeOrder = PlaceOrderTransactionService;
|
|
27
|
-
exports.placeOrderInProgress = PlaceOrderInProgressTransactionService;
|
|
28
27
|
exports.returnOrder = ReturnOrderTransactionService;
|
|
29
28
|
function fixCustomer(params) {
|
|
30
29
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -56,7 +55,15 @@ function fixCustomer(params) {
|
|
|
56
55
|
if (typeof ((_a = trasactionObject.customer) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') {
|
|
57
56
|
customer = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ typeOf: trasactionObject.customer.typeOf, id: trasactionObject.customer.id }, (Array.isArray(trasactionObject.customer.identifier))
|
|
58
57
|
? { identifier: trasactionObject.customer.identifier }
|
|
59
|
-
:
|
|
58
|
+
: /* istanbul ignore next */ undefined), (Array.isArray(params.agent.additionalProperty))
|
|
59
|
+
? { additionalProperty: params.agent.additionalProperty }
|
|
60
|
+
: /* istanbul ignore next */ undefined), (typeof params.agent.age === 'string') ? { age: params.agent.age }
|
|
61
|
+
: /* istanbul ignore next */ undefined), (typeof params.agent.address === 'string') ? { address: params.agent.address }
|
|
62
|
+
: /* istanbul ignore next */ undefined), (typeof params.agent.email === 'string') ? { email: params.agent.email }
|
|
63
|
+
: /* istanbul ignore next */ undefined), (typeof params.agent.familyName === 'string') ? { familyName: params.agent.familyName }
|
|
64
|
+
: /* istanbul ignore next */ undefined), (typeof params.agent.gender === 'string') ? { gender: params.agent.gender }
|
|
65
|
+
: /* istanbul ignore next */ undefined), (typeof params.agent.givenName === 'string') ? { givenName: params.agent.givenName }
|
|
66
|
+
: /* istanbul ignore next */ undefined), (typeof params.agent.name === 'string') ? { name: params.agent.name } : /* istanbul ignore next */ undefined), (typeof formattedTelephone === 'string') ? { telephone: formattedTelephone } : /* istanbul ignore next */ undefined), (typeof params.agent.url === 'string') ? { url: params.agent.url } : /* istanbul ignore next */ undefined);
|
|
60
67
|
}
|
|
61
68
|
}
|
|
62
69
|
return { customer, transaction };
|
|
@@ -80,7 +87,7 @@ function updateAgent(params) {
|
|
|
80
87
|
// });
|
|
81
88
|
// also save in orderInTransaction(2024-06-20~)
|
|
82
89
|
if (customer !== undefined) {
|
|
83
|
-
const orderNumber = yield
|
|
90
|
+
const orderNumber = yield (0, publishOrderNumberIfNotExist_1.publishOrderNumberIfNotExist)({
|
|
84
91
|
project: { id: transaction.project.id },
|
|
85
92
|
id: params.id,
|
|
86
93
|
object: { orderDate: new Date() }
|
|
@@ -108,13 +115,13 @@ exports.updateAgent = updateAgent;
|
|
|
108
115
|
function exportTasks(params) {
|
|
109
116
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
110
117
|
var _a;
|
|
111
|
-
const transaction = yield repos.transaction.startExportTasks(Object.assign(Object.assign(
|
|
118
|
+
const transaction = yield repos.transaction.startExportTasks(Object.assign(Object.assign({ status: params.status, tasksExportAction: {
|
|
112
119
|
agent: {
|
|
113
120
|
name: (typeof ((_a = params.tasksExportAction) === null || _a === void 0 ? void 0 : _a.agent.name) === 'string')
|
|
114
121
|
? params.tasksExportAction.agent.name
|
|
115
122
|
: settings_1.DEFAULT_TASKS_EXPORT_AGENT_NAME
|
|
116
123
|
}
|
|
117
|
-
} }, (params.typeOf !== undefined) ? { typeOf: params.typeOf } : undefined), (
|
|
124
|
+
} }, (params.typeOf !== undefined) ? { typeOf: params.typeOf } : undefined), (typeof params.id === 'string') ? { id: params.id } : undefined));
|
|
118
125
|
if (transaction === null) {
|
|
119
126
|
return;
|
|
120
127
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
|
+
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
3
|
+
import type { OrderRepo } from '../../repo/order';
|
|
4
4
|
export declare function validateOrder(params: {
|
|
5
5
|
orderNumber: string;
|
|
6
6
|
project: {
|
|
@@ -15,7 +15,7 @@ const moment = require("moment");
|
|
|
15
15
|
const factory = require("../../factory");
|
|
16
16
|
const factory_1 = require("../offer/event/authorize/factory");
|
|
17
17
|
const factory_2 = require("../offer/product/factory");
|
|
18
|
-
const validateMovieTicket_1 = require("../transaction/
|
|
18
|
+
const validateMovieTicket_1 = require("../transaction/placeOrder/confirm/validation/validateMovieTicket");
|
|
19
19
|
// const debug = createDebug('chevre-domain:service:validation');
|
|
20
20
|
function validateOrder(params) {
|
|
21
21
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.
|
|
13
|
+
"@chevre/factory": "4.378.0-alpha.0",
|
|
14
14
|
"@cinerino/sdk": "8.2.0",
|
|
15
15
|
"@motionpicture/coa-service": "9.4.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.3.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/json2csv": "^4.5.1",
|
|
39
39
|
"@types/jsonwebtoken": "9.0.1",
|
|
40
40
|
"@types/lodash.difference": "^4.5.6",
|
|
41
|
-
"@types/mocha": "
|
|
41
|
+
"@types/mocha": "10.0.7",
|
|
42
42
|
"@types/moment-timezone": "^0.5.30",
|
|
43
43
|
"@types/node": "18.19.2",
|
|
44
44
|
"@types/power-assert": "^1.5.3",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"csvtojson": "^2.0.10",
|
|
52
52
|
"googleapis": "^85.0.0",
|
|
53
53
|
"json2csv": "4.5.4",
|
|
54
|
-
"mocha": "
|
|
54
|
+
"mocha": "10.6.0",
|
|
55
55
|
"mongoose": "7.0.5",
|
|
56
56
|
"nock": "13.4.0",
|
|
57
|
-
"nyc": "
|
|
57
|
+
"nyc": "17.0.0",
|
|
58
58
|
"power-assert": "^1.6.1",
|
|
59
59
|
"redis": "4.6.5",
|
|
60
60
|
"rimraf": "^2.7.1",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"postversion": "git push origin --tags",
|
|
111
111
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
112
112
|
},
|
|
113
|
-
"version": "
|
|
113
|
+
"version": "22.0.0-alpha.1"
|
|
114
114
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as factory from '../../../factory';
|
|
2
|
-
/**
|
|
3
|
-
* 注文を生成する
|
|
4
|
-
*/
|
|
5
|
-
declare function createOrder(params: {
|
|
6
|
-
orderNumber: string;
|
|
7
|
-
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'object' | 'seller' | 'project'>;
|
|
8
|
-
orderDate: Date;
|
|
9
|
-
orderStatus: factory.orderStatus;
|
|
10
|
-
isGift: boolean;
|
|
11
|
-
orderedItem: factory.order.IOrderedItem[];
|
|
12
|
-
paymentMethods: factory.order.IReferencedInvoice[];
|
|
13
|
-
price: number;
|
|
14
|
-
}): factory.transaction.placeOrder.IOrderAsResult;
|
|
15
|
-
declare function createSeller(params: {
|
|
16
|
-
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'seller'>;
|
|
17
|
-
}): factory.order.ISeller;
|
|
18
|
-
declare function createPaymentMethods(params: {
|
|
19
|
-
authorizePaymentActions: Pick<factory.action.authorize.paymentMethod.any.IAction, 'result'>[];
|
|
20
|
-
}): {
|
|
21
|
-
paymentMethods: factory.order.IReferencedInvoice[];
|
|
22
|
-
price: number;
|
|
23
|
-
};
|
|
24
|
-
export { createOrder, createSeller, createPaymentMethods };
|