@chevre/domain 23.2.0-alpha.8 → 23.2.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/example/src/chevre/acceptedPaymentMethodOffer/adminAcceptedPaymentMethodOffers.ts +27 -19
- package/example/src/chevre/actions/checkAcceptPayActions.ts +2 -2
- package/example/src/chevre/actions/checkAuthorizePaymentActions.ts +2 -2
- package/example/src/chevre/activateOptionalAggregationSettings.ts +1 -1
- package/example/src/chevre/adminIdentities.ts +1 -1
- package/example/src/chevre/aggreateOwnershipInfosByOrder.ts +1 -1
- package/example/src/chevre/aggregateEventPublicFields.ts +2 -2
- package/example/src/chevre/aggregateOfferCatalogItemList.ts +1 -1
- package/example/src/chevre/aggregateScreeningEventMaxVersion.ts +1 -1
- package/example/src/chevre/aggregation/aggregateOffersOnEvent.ts +1 -1
- package/example/src/chevre/aggregation/aggregateOrderOfCustomer.ts +2 -2
- package/example/src/chevre/aggregation/aggregateOrderOfCustomerGlobally.ts +2 -2
- package/example/src/chevre/aggregation/aggregateOrderOfSeatByRoyalCustomers.ts +2 -2
- package/example/src/chevre/aggregation/aggregateOrderOnSystem.ts +2 -2
- package/example/src/chevre/aggregation/aggregateReservationByProject.ts +2 -2
- package/example/src/chevre/aggregation/aggregateSystem.ts +1 -1
- package/example/src/chevre/aggregation/aggregateTasks.ts +2 -2
- package/example/src/chevre/aggregation/createAggregateEventTasks.ts +2 -2
- package/example/src/chevre/aggregation/searchAggregateReservations.ts +1 -1
- package/example/src/chevre/assetTransaction/checkPayTransactionsTicketToken.ts +2 -2
- package/example/src/chevre/assetTransaction/processReserve.ts +2 -2
- package/example/src/chevre/attendIfNotAttended.ts +1 -1
- package/example/src/chevre/authorizeEventServiceOffer.ts +1 -1
- package/example/src/chevre/categoryCode/checkUniqueness.ts +1 -1
- package/example/src/chevre/changeOrderStatus.ts +1 -1
- package/example/src/chevre/checkCustomerAttributesLength.ts +2 -2
- package/example/src/chevre/checkEventDuration.ts +2 -2
- package/example/src/chevre/checkPaymentServiceUniqueness.ts +1 -1
- package/example/src/chevre/checkProjectMembers.ts +1 -1
- package/example/src/chevre/checkReserveTransactionSizes.ts +2 -2
- package/example/src/chevre/cleanActions.ts +2 -2
- package/example/src/chevre/cleanReservations.ts +2 -2
- package/example/src/chevre/cleanTransactions.ts +2 -2
- package/example/src/chevre/confirmationNumber/testRandomness.ts +49 -0
- package/example/src/chevre/countPotentiallyExportTasks.ts +2 -2
- package/example/src/chevre/countTransactions.ts +1 -1
- package/example/src/chevre/createProject.ts +1 -1
- package/example/src/chevre/createTaskIfNotExistByAlternateName.ts +1 -1
- package/example/src/chevre/db/stats.ts +1 -1
- package/example/src/chevre/deleteDiscontinuedPeople.ts +2 -2
- package/example/src/chevre/deleteDiscontinuedPeopleByFetch.ts +1 -1
- package/example/src/chevre/deleteOwnershipInfosByOwnedThrough.ts +2 -2
- package/example/src/chevre/deleteStartDatePassedCertainPeriod.ts +2 -2
- package/example/src/chevre/deleteTasksByName.ts +2 -2
- package/example/src/chevre/emailMessage/createEmailMessageText.ts +63 -0
- package/example/src/chevre/event/checkEventAdditionalPropertyUniqueness.ts +2 -2
- package/example/src/chevre/event/importEventSeriesFromCOAByTitle.ts +1 -1
- package/example/src/chevre/event/importEventsFromCOAByTitle.ts +4 -4
- package/example/src/chevre/event/migrateEventAdditionalProperty2identifier.ts +2 -2
- package/example/src/chevre/event/migrateEventMaximumPhysicalAttendeeCapacity.ts +1 -1
- package/example/src/chevre/event/unsetSuperEventVideoFormat.ts +30 -0
- package/example/src/chevre/event/updateSellerMakesOffersByIdentifier.ts +2 -2
- package/example/src/chevre/eventSeries/unsetVideoFormat.ts +31 -0
- package/example/src/chevre/eventSeries/upsertScreeningEventSeriesByVersion.ts +106 -0
- package/example/src/chevre/findAnyEventById.ts +1 -1
- package/example/src/chevre/findAuthorizePaymentAction.ts +1 -1
- package/example/src/chevre/findAvailableChannelMovieTicket.ts +1 -1
- package/example/src/chevre/findCheckAction.ts +1 -1
- package/example/src/chevre/findCustomerByOrderNumber.ts +1 -1
- package/example/src/chevre/findItemListElementByCatalogId.ts +1 -1
- package/example/src/chevre/findItemListElementById.ts +1 -1
- package/example/src/chevre/findJWTSetting.ts +1 -1
- package/example/src/chevre/findOneAvailableHours.ts +2 -2
- package/example/src/chevre/findReservationByCode.ts +1 -1
- package/example/src/chevre/findSchedule.ts +1 -1
- package/example/src/chevre/giveUpStartDatePassedCertainPeriod.ts +2 -2
- package/example/src/chevre/identity/getCommonClients.ts +1 -1
- package/example/src/chevre/identity/migrateClients2oauth.ts +1 -1
- package/example/src/chevre/importCategoryCodesFromCOA.ts +1 -1
- package/example/src/chevre/importEventsFromCOA.ts +2 -2
- package/example/src/chevre/investigateEvents.ts +1 -1
- package/example/src/chevre/investigateTransaction.ts +2 -2
- package/example/src/chevre/isPaymentAcceptedBySeller.ts +1 -1
- package/example/src/chevre/issuer/adminMemberProgramTiers.ts +1 -1
- package/example/src/chevre/issuer/migrateIssuerUrls.ts +1 -1
- package/example/src/chevre/issuer/renameIssuerIdentifier.ts +1 -1
- package/example/src/chevre/maintenance/checkTransactionStatuses.ts +1 -1
- package/example/src/chevre/makeExpiredManyTasks.ts +1 -1
- package/example/src/chevre/makeTransactionExpired.ts +2 -2
- package/example/src/chevre/member/migrateMemberIdentifier.ts +2 -2
- package/example/src/chevre/migrateAuthorizeEventServiceOfferChevre.ts +1 -1
- package/example/src/chevre/migrateCancelReservationObject.ts +1 -1
- package/example/src/chevre/migrateCustomerAdditionalProperties.ts +2 -2
- package/example/src/chevre/migrateEventSellerMakesOfferAvailableAt.ts +2 -2
- package/example/src/chevre/migrateIdentities.ts +1 -1
- package/example/src/chevre/migrateProjectSettings.ts +1 -1
- package/example/src/chevre/migrateRoomAdditionalProperties.ts +2 -2
- package/example/src/chevre/migrateRoomSectionAdditionalProperties.ts +2 -2
- package/example/src/chevre/note/findNotes.ts +1 -1
- package/example/src/chevre/note/upsertNotesByIdentifier.ts +1 -1
- package/example/src/chevre/notifyAbortedTasksByEmail.ts +2 -2
- package/example/src/chevre/notifyByEmail.ts +1 -1
- package/example/src/chevre/offerCatalog/updateManyOfferCatalogsByIds.ts +1 -1
- package/example/src/chevre/{upsertOfferCatalogItemsByIdentifier.ts → offerCatalog/upsertOfferCatalogItemsByIdentifier.ts} +7 -4
- package/example/src/chevre/{upsertOfferCatalogsByIdentifier.ts → offerCatalog/upsertOfferCatalogsByIdentifier.ts} +9 -4
- package/example/src/chevre/offers/checkIncludedInCatalogCount.ts +1 -1
- package/example/src/chevre/offers/projectItemListElement.ts +1 -1
- package/example/src/chevre/offers/searchAvaialbleAppliesToMovieTicketByOfferCatalogId.ts +1 -1
- package/example/src/chevre/offers/searchByOfferCatalogIdWithSortIndex.ts +1 -1
- package/example/src/chevre/offers/searchOfferCatalogItemAvailability.ts +1 -1
- package/example/src/chevre/{upsertOffersByIdentifier.ts → offers/upsertOffersByIdentifier.ts} +6 -4
- package/example/src/chevre/optimizeActions.ts +2 -2
- package/example/src/chevre/orderNumber/testRandomness.ts +54 -0
- package/example/src/chevre/orders/searchOrders.ts +1 -1
- package/example/src/chevre/orders/searchWithUnwoundAcceptedOffers.ts +1 -1
- package/example/src/chevre/pendingReservation/findEventSeatOffersBySection.ts +1 -1
- package/example/src/chevre/person/checkUserPoolClients.ts +1 -1
- package/example/src/chevre/person/cleanUpCognitoUsers.ts +2 -2
- package/example/src/chevre/person/cleanUpCognitoUsersByFetch.ts +2 -2
- package/example/src/chevre/person/cleanUpCreditCard.ts +1 -1
- package/example/src/chevre/place/adminEntranceGates.ts +69 -0
- package/example/src/chevre/place/adminHasPOS.ts +1 -1
- package/example/src/chevre/place/aggregateSeatingTypes.ts +1 -1
- package/example/src/chevre/place/checkEntranceGatesCount.ts +82 -0
- package/example/src/chevre/place/checkSectionCount.ts +1 -1
- package/example/src/chevre/place/findRooms.ts +24 -0
- package/example/src/chevre/place/findSections.ts +28 -0
- package/example/src/chevre/place/findSectionsByRoom.ts +1 -1
- package/example/src/chevre/place/migrateSectionIdentifier.ts +2 -2
- package/example/src/chevre/place/seatsJson2csv.ts +63 -0
- package/example/src/chevre/place/upsertMovieTheatersByBranchCode.ts +41 -0
- package/example/src/chevre/place/upsertRoomsByBranchCode.ts +40 -0
- package/example/src/chevre/place/upsertSeatSectionsByBranchCode.ts +56 -0
- package/example/src/chevre/processAction.ts +1 -1
- package/example/src/chevre/processOrder.ts +2 -2
- package/example/src/chevre/product/findHasOfferCatalog.ts +1 -1
- package/example/src/chevre/productOffer/publishMemberTierToken.ts +1 -1
- package/example/src/chevre/project/unsetProjectSettings.ts +1 -1
- package/example/src/chevre/projectEventFieldsById.ts +1 -1
- package/example/src/chevre/projectFields.ts +1 -1
- package/example/src/chevre/projectFieldsById.ts +1 -1
- package/example/src/chevre/projectOwnershipInfoFieldsById.ts +1 -1
- package/example/src/chevre/pushIncludedInDataCatalog.ts +1 -1
- package/example/src/chevre/reExportAction.ts +2 -2
- package/example/src/chevre/reIndex.ts +2 -2
- package/example/src/chevre/recreateRefundTasks.ts +2 -2
- package/example/src/chevre/roles/{addAdminSeatReadPermissionIfNotExists.ts → addAdminAcceptedPaymentMethodReadPermissionIfNotExists.ts} +2 -2
- package/example/src/chevre/roles/{addAdminSeatWritePermissionIfNotExists.ts → addAdminAcceptedPaymentMethodWritePermissionIfNotExists.ts} +2 -2
- package/example/src/chevre/roles/addAdminEventSeriesReadPermissionIfNotExists.ts +1 -1
- package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +1 -1
- package/example/src/chevre/roles/addAdminNotePermissionIfNotExists.ts +1 -1
- package/example/src/chevre/roles/addAdminPaymentServiceReadPermissionIfNotExists.ts +1 -1
- package/example/src/chevre/roles/addAdminProductHasOfferCatalogReadPermissionIfNotExists.ts +1 -1
- package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminSellerEventOfferIfNotExists.ts +1 -1
- package/example/src/chevre/roles/addProjectCreatorRole.ts +1 -1
- package/example/src/chevre/roles/assignGlobalRoles.ts +1 -1
- package/example/src/chevre/roles/findPermissions.ts +2 -2
- package/example/src/chevre/roles/findRoleNames.ts +2 -2
- package/example/src/chevre/roles/removeConsolePermissionIfExists.ts +1 -1
- package/example/src/chevre/roles/removePermissionFromAPIRoles.ts +1 -1
- package/example/src/chevre/roles/removePermissionIfExists.ts +1 -1
- package/example/src/chevre/saveOfferCatalogItem.ts +1 -1
- package/example/src/chevre/saveWebSite.ts +1 -1
- package/example/src/chevre/searchAcceptedOfferIds.ts +1 -1
- package/example/src/chevre/searchActionsByPurpose.ts +1 -1
- package/example/src/chevre/searchAggregateOffers.ts +1 -1
- package/example/src/chevre/searchAggregations.ts +1 -1
- package/example/src/chevre/searchAuthorizations.ts +1 -1
- package/example/src/chevre/searchCheckMovieTicketResultYkknInfo.ts +1 -1
- package/example/src/chevre/searchEventHasOfferCatalog.ts +1 -1
- package/example/src/chevre/searchIdsByReservationNumber.ts +1 -1
- package/example/src/chevre/searchOfferCatalogItemListElement.ts +1 -1
- package/example/src/chevre/searchOffers.ts +1 -1
- package/example/src/chevre/searchProducts.ts +1 -1
- package/example/src/chevre/searchProjects.ts +1 -1
- package/example/src/chevre/searchReservationsByOrder.ts +1 -1
- package/example/src/chevre/searchSellersByAggregate.ts +1 -1
- package/example/src/chevre/searchSlicedAcceptedOffersByOrderNumber.ts +1 -1
- package/example/src/chevre/seller/adminMakesOffer.ts +1 -1
- package/example/src/chevre/sendEmailMessage.ts +1 -1
- package/example/src/chevre/settings/addOrderNumberSetting.ts +44 -0
- package/example/src/chevre/settings/addTransactionNumberSetting.ts +40 -0
- package/example/src/chevre/stockHolder/findSeatsBySection.ts +1 -1
- package/example/src/chevre/stockHolder/getSize.ts +2 -2
- package/example/src/chevre/stockHolder/projectPendingReservation.ts +1 -1
- package/example/src/chevre/stockHolder/searchSeats.ts +1 -1
- package/example/src/chevre/task/countPotentiallyRunning.ts +1 -1
- package/example/src/chevre/task/countTasks.ts +1 -1
- package/example/src/chevre/task/deleteRunsAtPassedCertainPeriod.ts +2 -2
- package/example/src/chevre/task/deleteUnexpectedTasks.ts +1 -1
- package/example/src/chevre/task/emitRunning.ts +2 -2
- package/example/src/chevre/transaction/processPlaceOrder.ts +1 -1
- package/example/src/chevre/transaction/processReturnOrder.ts +1 -1
- package/example/src/chevre/transaction/startExportTasks.ts +1 -1
- package/example/src/chevre/transactionNumber/publishByTimestamp.ts +23 -0
- package/example/src/chevre/transactionNumber/testRandomness.ts +42 -0
- package/example/src/chevre/unsetUnnecessaryFields.ts +10 -6
- package/example/src/chevre/updateEventPartiallyById.ts +1 -1
- package/example/src/chevre/updateProjectAggregateReservation.ts +1 -1
- package/example/src/chevre/validateCheckMovieTicketActions.ts +2 -2
- package/example/src/duration.ts +1 -1
- package/example/src/moment.ts +1 -1
- package/example/src/mongoConnectionList.ts +1 -1
- package/example/src/objectId.ts +1 -1
- package/lib/chevre/credentials/customSearch.js +2 -0
- package/lib/chevre/credentials/lineNotify.js +4 -0
- package/lib/chevre/credentials/sendGrid.js +2 -0
- package/lib/chevre/credentials.js +37 -29
- package/lib/chevre/emailMessageBuilder.js +250 -251
- package/lib/chevre/errorHandler.js +60 -58
- package/lib/chevre/eventEmitter/assetTransaction.js +0 -1
- package/lib/chevre/eventEmitter/task.js +0 -1
- package/lib/chevre/eventEmitter/transaction.js +0 -1
- package/lib/chevre/eventEmitter.js +24 -1
- package/lib/chevre/factory/accountTransactionIdentifier.js +24 -1
- package/lib/chevre/factory/availableProductTypes.js +24 -1
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/factory/event.js +93 -37
- package/lib/chevre/factory/taskIdentifier.js +25 -2
- package/lib/chevre/factory/transactionNumber.d.ts +19 -0
- package/lib/chevre/factory/transactionNumber.js +80 -0
- package/lib/chevre/index.js +43 -35
- package/lib/chevre/repo/acceptedOffer.js +200 -197
- package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -8
- package/lib/chevre/repo/acceptedPaymentMethod.js +163 -108
- package/lib/chevre/repo/account.js +217 -238
- package/lib/chevre/repo/accountTitle.js +32 -21
- package/lib/chevre/repo/accountTransaction.js +213 -194
- package/lib/chevre/repo/accountingReport.js +111 -107
- package/lib/chevre/repo/action.js +875 -883
- package/lib/chevre/repo/additionalProperty.js +87 -92
- package/lib/chevre/repo/advanceBookingRequirement.js +92 -91
- package/lib/chevre/repo/aggregateOffer.d.ts +6 -1
- package/lib/chevre/repo/aggregateOffer.js +419 -423
- package/lib/chevre/repo/aggregateOrder.js +73 -155
- package/lib/chevre/repo/aggregateReservation.d.ts +0 -1
- package/lib/chevre/repo/aggregateReservation.js +99 -91
- package/lib/chevre/repo/aggregation.js +65 -63
- package/lib/chevre/repo/assetTransaction.js +719 -730
- package/lib/chevre/repo/authorization.js +143 -136
- package/lib/chevre/repo/categoryCode.js +137 -147
- package/lib/chevre/repo/comment.js +96 -82
- package/lib/chevre/repo/concurrentLock.js +40 -29
- package/lib/chevre/repo/confirmationNumber.d.ts +1 -0
- package/lib/chevre/repo/confirmationNumber.js +48 -54
- package/lib/chevre/repo/creativeWork.js +175 -180
- package/lib/chevre/repo/credentials.js +39 -51
- package/lib/chevre/repo/customer.js +87 -88
- package/lib/chevre/repo/customerType.js +52 -62
- package/lib/chevre/repo/emailMessage.js +74 -80
- package/lib/chevre/repo/event.d.ts +3 -18
- package/lib/chevre/repo/event.js +734 -744
- package/lib/chevre/repo/eventOffer.d.ts +8 -0
- package/lib/chevre/repo/eventOffer.js +149 -118
- package/lib/chevre/repo/eventSellerMakesOffer.js +87 -76
- package/lib/chevre/repo/eventSeries.d.ts +17 -30
- package/lib/chevre/repo/eventSeries.js +391 -347
- package/lib/chevre/repo/identity.js +117 -107
- package/lib/chevre/repo/identityProvider.js +95 -96
- package/lib/chevre/repo/issuer.js +125 -135
- package/lib/chevre/repo/member.js +261 -259
- package/lib/chevre/repo/memberProgram.js +180 -177
- package/lib/chevre/repo/merchantReturnPolicy.js +84 -94
- package/lib/chevre/repo/message.js +145 -135
- package/lib/chevre/repo/mongoose/onIndexCreated.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/acceptedPaymentMethod.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/account.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountTitle.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/advanceBookingRequirement.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregateOrder.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +1 -2
- package/lib/chevre/repo/mongoose/schemas/aggregation.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/categoryCode.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/civicStructure.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/customer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/customerType.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/eventOffer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +45 -7
- package/lib/chevre/repo/mongoose/schemas/identity.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/identityProvider.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/issuer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/member/global.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/member.js +25 -2
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/movieTicketTypes.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/note.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +3 -9
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +29 -3
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/paymentService.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/paymentServiceChannel.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -2
- package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/potentialAction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/product.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/productModel.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/productOffer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/reserveInterface.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/role.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/schedule.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/seller.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/sellerReturnPolicy.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/service/availableHour.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +40 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +4 -1
- package/lib/chevre/repo/mongoose/schemas/task.js +1 -2
- package/lib/chevre/repo/mongoose/schemas/ticket.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.js +25 -2
- package/lib/chevre/repo/mongoose/schemas/transactionNumber.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/trip.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/webSite.js +1 -1
- package/lib/chevre/repo/movieTicketType.js +90 -94
- package/lib/chevre/repo/note.js +166 -147
- package/lib/chevre/repo/noteAboutOrder.js +135 -113
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +353 -314
- package/lib/chevre/repo/offerCatalog.d.ts +14 -1
- package/lib/chevre/repo/offerCatalog.js +313 -300
- package/lib/chevre/repo/offerCatalogItem.d.ts +10 -1
- package/lib/chevre/repo/offerCatalogItem.js +302 -292
- package/lib/chevre/repo/offerItemCondition.js +83 -85
- package/lib/chevre/repo/order.js +582 -607
- package/lib/chevre/repo/orderInTransaction.js +136 -136
- package/lib/chevre/repo/orderNumber.d.ts +6 -0
- package/lib/chevre/repo/orderNumber.js +142 -58
- package/lib/chevre/repo/ownershipInfo.js +236 -241
- package/lib/chevre/repo/passport.js +123 -106
- package/lib/chevre/repo/paymentMethod/creditCard.js +175 -170
- package/lib/chevre/repo/paymentService.js +202 -200
- package/lib/chevre/repo/paymentServiceChannel.js +99 -100
- package/lib/chevre/repo/paymentServiceProvider.js +209 -201
- package/lib/chevre/repo/pendingReservation.js +300 -307
- package/lib/chevre/repo/permit.js +70 -42
- package/lib/chevre/repo/person.js +240 -256
- package/lib/chevre/repo/place/busStop.js +99 -106
- package/lib/chevre/repo/place/entranceGate.d.ts +57 -0
- package/lib/chevre/repo/place/entranceGate.js +190 -0
- package/lib/chevre/repo/place/hasPOS.js +131 -120
- package/lib/chevre/repo/place/movieTheater.d.ts +40 -3
- package/lib/chevre/repo/place/movieTheater.js +220 -161
- package/lib/chevre/repo/place/screeningRoom.d.ts +49 -41
- package/lib/chevre/repo/place/screeningRoom.js +469 -345
- package/lib/chevre/repo/place/seat.d.ts +47 -45
- package/lib/chevre/repo/place/seat.js +596 -386
- package/lib/chevre/repo/place/section.d.ts +34 -3
- package/lib/chevre/repo/place/section.js +510 -292
- package/lib/chevre/repo/potentialAction.js +90 -87
- package/lib/chevre/repo/priceSpecification.js +125 -146
- package/lib/chevre/repo/product.js +226 -239
- package/lib/chevre/repo/productHasOfferCatalog.js +62 -50
- package/lib/chevre/repo/productModel.js +117 -127
- package/lib/chevre/repo/productOffer.js +142 -118
- package/lib/chevre/repo/project.js +146 -141
- package/lib/chevre/repo/projectMakesOffer.js +119 -108
- package/lib/chevre/repo/rateLimit/offer.js +71 -59
- package/lib/chevre/repo/reservation.js +392 -398
- package/lib/chevre/repo/reserveInterface.js +31 -42
- package/lib/chevre/repo/role.js +116 -112
- package/lib/chevre/repo/schedule.js +25 -36
- package/lib/chevre/repo/seller.js +137 -147
- package/lib/chevre/repo/sellerMakesOffer.js +118 -110
- package/lib/chevre/repo/sellerPaymentAccepted.js +115 -109
- package/lib/chevre/repo/sellerReturnPolicy.js +97 -97
- package/lib/chevre/repo/service/availableHour.js +27 -38
- package/lib/chevre/repo/serviceOutput.js +77 -67
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +3 -1
- package/lib/chevre/repo/serviceOutputIdentifier.js +80 -51
- package/lib/chevre/repo/setting/jwt.js +63 -50
- package/lib/chevre/repo/setting.d.ts +1 -1
- package/lib/chevre/repo/setting.js +48 -48
- package/lib/chevre/repo/stockHolder.js +202 -199
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/task.js +636 -619
- package/lib/chevre/repo/telemetry.js +1 -0
- package/lib/chevre/repo/ticket.js +75 -65
- package/lib/chevre/repo/transaction.js +781 -816
- package/lib/chevre/repo/transactionNumber.d.ts +5 -0
- package/lib/chevre/repo/transactionNumber.js +100 -51
- package/lib/chevre/repo/transactionNumberCounter.js +91 -79
- package/lib/chevre/repo/transactionProcess.js +65 -50
- package/lib/chevre/repo/trip.js +167 -164
- package/lib/chevre/repo/webSite.js +114 -107
- package/lib/chevre/repository.d.ts +8 -0
- package/lib/chevre/repository.js +486 -639
- package/lib/chevre/service/account.js +32 -21
- package/lib/chevre/service/accountTransaction/deposit.js +39 -17
- package/lib/chevre/service/accountTransaction/factory.js +24 -1
- package/lib/chevre/service/accountTransaction/transfer.js +41 -22
- package/lib/chevre/service/accountTransaction/withdraw.js +39 -17
- package/lib/chevre/service/accountTransaction.js +30 -19
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +95 -66
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +84 -61
- package/lib/chevre/service/aggregation/event/findEventOffers.js +30 -17
- package/lib/chevre/service/aggregation/event/importFromCOA.js +11 -18
- package/lib/chevre/service/aggregation/project.js +48 -31
- package/lib/chevre/service/aggregation/system.js +256 -147
- package/lib/chevre/service/aggregation.js +26 -3
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +55 -18
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +40 -24
- package/lib/chevre/service/assetTransaction/cancelReservation/startAndConfirm.js +40 -15
- package/lib/chevre/service/assetTransaction/cancelReservation.js +30 -18
- package/lib/chevre/service/assetTransaction/cancelReservationCOA/factory.js +35 -5
- package/lib/chevre/service/assetTransaction/cancelReservationCOA.js +4 -13
- package/lib/chevre/service/assetTransaction/fixInformAction.d.ts +3 -0
- package/lib/chevre/service/assetTransaction/fixInformAction.js +32 -16
- package/lib/chevre/service/assetTransaction/moneyTransfer/potentialActions.js +36 -25
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +131 -94
- package/lib/chevre/service/assetTransaction/pay/cancel.d.ts +12 -0
- package/lib/chevre/service/assetTransaction/pay/cancel.js +39 -0
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +23 -0
- package/lib/chevre/service/assetTransaction/pay/check.js +50 -0
- package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +24 -0
- package/lib/chevre/service/assetTransaction/pay/confirm.js +92 -0
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.d.ts +18 -0
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +127 -0
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +48 -0
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +186 -0
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +20 -0
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.js +72 -0
- package/lib/chevre/service/assetTransaction/pay/{account → start/account}/validation.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/pay/{account → start/account}/validation.js +29 -16
- package/lib/chevre/service/assetTransaction/pay/{factory.d.ts → start/factory.d.ts} +1 -1
- package/lib/chevre/service/assetTransaction/pay/{factory.js → start/factory.js} +88 -38
- package/lib/chevre/service/assetTransaction/pay/{validateAcceptedPaymentMethodIfNeeded.d.ts → start/preStart/validateAcceptedPaymentMethodIfNeeded.d.ts} +4 -4
- package/lib/chevre/service/assetTransaction/pay/{validateAcceptedPaymentMethodIfNeeded.js → start/preStart/validateAcceptedPaymentMethodIfNeeded.js} +35 -24
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.d.ts +8 -0
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +67 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.d.ts +13 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.js +62 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +29 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.js +54 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +42 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.js +45 -0
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +60 -0
- package/lib/chevre/service/assetTransaction/pay/start.js +162 -0
- package/lib/chevre/service/assetTransaction/pay.d.ts +8 -170
- package/lib/chevre/service/assetTransaction/pay.js +16 -623
- package/lib/chevre/service/assetTransaction/refund/factory.js +60 -17
- package/lib/chevre/service/assetTransaction/refund/potentialActions.js +35 -21
- package/lib/chevre/service/assetTransaction/refund.js +63 -43
- package/lib/chevre/service/assetTransaction/registerService/factory.js +96 -33
- package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +80 -47
- package/lib/chevre/service/assetTransaction/registerService.js +70 -58
- package/lib/chevre/service/assetTransaction/reserve/cancel.js +28 -14
- package/lib/chevre/service/assetTransaction/reserve/confirm/factory.js +15 -4
- package/lib/chevre/service/assetTransaction/reserve/confirm.js +44 -26
- package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +26 -13
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +138 -96
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createPointAward.js +41 -13
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +142 -80
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +93 -23
- package/lib/chevre/service/assetTransaction/reserve/start/factory/price.js +53 -21
- package/lib/chevre/service/assetTransaction/reserve/start.js +131 -122
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.js +33 -17
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.js +72 -59
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.js +71 -59
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/verifyTicketTokenAsNeeded.js +30 -19
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +45 -31
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +47 -24
- package/lib/chevre/service/assetTransaction/reserveCOA/factory.js +36 -5
- package/lib/chevre/service/assetTransaction/reserveCOA.js +4 -13
- package/lib/chevre/service/assetTransaction.js +46 -27
- package/lib/chevre/service/delivery/factory.js +33 -8
- package/lib/chevre/service/delivery/product/factory.js +48 -13
- package/lib/chevre/service/delivery/reservation/factory.js +44 -7
- package/lib/chevre/service/delivery.js +78 -56
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
- package/lib/chevre/service/event/processUpdateMovieTheater.js +56 -36
- package/lib/chevre/service/event/saveScreeningEventSeries.js +98 -58
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -2
- package/lib/chevre/service/event/saveScreeningEvents.js +65 -50
- package/lib/chevre/service/event.js +70 -40
- package/lib/chevre/service/iam.js +8 -17
- package/lib/chevre/service/moneyTransfer.js +158 -116
- package/lib/chevre/service/notification/factory.js +42 -15
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +39 -17
- package/lib/chevre/service/notification/notifyByEmail.js +31 -20
- package/lib/chevre/service/notification/sendEmailMessage.js +47 -27
- package/lib/chevre/service/notification/triggerWebhook.js +82 -57
- package/lib/chevre/service/offer/any.js +34 -17
- package/lib/chevre/service/offer/event/authorize/defaultOffer.js +24 -1
- package/lib/chevre/service/offer/event/authorize/factory.js +173 -63
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +31 -19
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +67 -28
- package/lib/chevre/service/offer/event/authorize.js +137 -71
- package/lib/chevre/service/offer/event/checkAvailability.js +33 -17
- package/lib/chevre/service/offer/event/importFromCOA/factory.js +34 -5
- package/lib/chevre/service/offer/event/importFromCOA.js +36 -19
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +66 -41
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +53 -42
- package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +38 -23
- package/lib/chevre/service/offer/event/searchOfferCatalogItemAvailability.js +36 -26
- package/lib/chevre/service/offer/event/searchOfferCatalogItems.js +38 -23
- package/lib/chevre/service/offer/event/searchOffersByIds.js +56 -42
- package/lib/chevre/service/offer/event/searchPriceSpecs4event.js +28 -14
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +27 -13
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +6 -15
- package/lib/chevre/service/offer/event/voidTransaction.js +58 -41
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +37 -20
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +76 -43
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.js +29 -2
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +57 -37
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +81 -30
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +90 -62
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +44 -29
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +31 -18
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +70 -45
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +45 -25
- package/lib/chevre/service/offer/factory.js +42 -9
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +60 -39
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +39 -22
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +34 -20
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +38 -25
- package/lib/chevre/service/offer/onEventChanged.js +106 -72
- package/lib/chevre/service/offer/product/factory.js +83 -35
- package/lib/chevre/service/offer/product/searchProductOffers.js +53 -24
- package/lib/chevre/service/offer/product.js +130 -83
- package/lib/chevre/service/offer.d.ts +5 -0
- package/lib/chevre/service/offer.js +111 -57
- package/lib/chevre/service/order/confirmPayTransaction.js +52 -28
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +81 -42
- package/lib/chevre/service/order/deleteOrder.js +51 -36
- package/lib/chevre/service/order/findPlaceOrderTransaction.js +26 -12
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +92 -72
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.js +25 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +31 -14
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +35 -7
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +33 -16
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +46 -10
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +33 -16
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +51 -28
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +41 -21
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +29 -15
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +49 -16
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +52 -35
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +36 -20
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +34 -10
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +51 -30
- package/lib/chevre/service/order/onOrderUpdated/factory.js +27 -6
- package/lib/chevre/service/order/onOrderUpdated.js +36 -15
- package/lib/chevre/service/order/payOrder.js +26 -12
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +32 -20
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +55 -16
- package/lib/chevre/service/order/placeOrder/factory.js +63 -24
- package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.js +7 -13
- package/lib/chevre/service/order/placeOrder.js +35 -23
- package/lib/chevre/service/order/placeOrderWithoutTransaction.js +33 -18
- package/lib/chevre/service/order/returnOrder.js +55 -32
- package/lib/chevre/service/order/sendOrder.js +65 -39
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.js +42 -25
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +52 -41
- package/lib/chevre/service/payment/any/factory.js +137 -55
- package/lib/chevre/service/payment/any/fixOrderAsNeeded.js +27 -13
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +36 -18
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.js +61 -38
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.js +45 -25
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +39 -16
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +38 -21
- package/lib/chevre/service/payment/any/person2username.js +55 -45
- package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.js +31 -18
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +28 -17
- package/lib/chevre/service/payment/any.js +206 -144
- package/lib/chevre/service/payment/creditCard/authorize/handleAuthorizeError.js +31 -5
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +68 -26
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +29 -15
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3dsResult2recipe.js +29 -2
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCardResult2recipe.js +34 -3
- package/lib/chevre/service/payment/creditCard/authorize.js +49 -25
- package/lib/chevre/service/payment/creditCard/factory.js +46 -5
- package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.js +31 -18
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +55 -37
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +64 -52
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +57 -46
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +39 -27
- package/lib/chevre/service/payment/faceToFace.js +37 -23
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +68 -26
- package/lib/chevre/service/payment/factory.js +74 -25
- package/lib/chevre/service/payment/movieTicket/authorize.js +58 -30
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +45 -25
- package/lib/chevre/service/payment/movieTicket/factory.js +64 -15
- package/lib/chevre/service/payment/movieTicket/getCredentials.js +28 -15
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +53 -41
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +37 -21
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +90 -64
- package/lib/chevre/service/payment/movieTicket/validation.js +69 -39
- package/lib/chevre/service/payment/movieTicket/voidTransaction.js +31 -18
- package/lib/chevre/service/payment/paymentCard.js +117 -108
- package/lib/chevre/service/permit.js +60 -36
- package/lib/chevre/service/product.js +50 -29
- package/lib/chevre/service/project.js +22 -31
- package/lib/chevre/service/report/ownershipInfo.js +9 -7
- package/lib/chevre/service/report/telemetry.js +86 -79
- package/lib/chevre/service/report.js +25 -2
- package/lib/chevre/service/reserve/cancelReservation.js +122 -97
- package/lib/chevre/service/reserve/checkInReservation.js +52 -31
- package/lib/chevre/service/reserve/confirmReservation.js +61 -41
- package/lib/chevre/service/reserve/factory.js +66 -21
- package/lib/chevre/service/reserve/findByCode.js +36 -18
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +41 -24
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +40 -25
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +61 -30
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +68 -37
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +67 -37
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +40 -23
- package/lib/chevre/service/reserve/searchByOrder.js +33 -20
- package/lib/chevre/service/reserve/useReservation.js +75 -36
- package/lib/chevre/service/reserve/verifyToken4reservation.js +30 -14
- package/lib/chevre/service/reserveCOA/cancelReservation.js +30 -17
- package/lib/chevre/service/reserveCOA/factory.js +29 -2
- package/lib/chevre/service/task/acceptCOAOffer.js +44 -26
- package/lib/chevre/service/task/aggregateOffers.js +26 -12
- package/lib/chevre/service/task/aggregateOnSystem.js +4 -14
- package/lib/chevre/service/task/aggregateScreeningEvent.js +27 -13
- package/lib/chevre/service/task/authorizePayment.js +32 -15
- package/lib/chevre/service/task/cancelMoneyTransfer.js +3 -12
- package/lib/chevre/service/task/cancelPendingReservation.js +34 -21
- package/lib/chevre/service/task/cancelReservation.js +26 -12
- package/lib/chevre/service/task/checkMovieTicket.js +39 -19
- package/lib/chevre/service/task/checkResource.js +30 -16
- package/lib/chevre/service/task/confirmMoneyTransfer.js +3 -12
- package/lib/chevre/service/task/confirmPayTransaction.js +6 -12
- package/lib/chevre/service/task/confirmRegisterService.js +3 -12
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +51 -32
- package/lib/chevre/service/task/confirmReserveTransaction.js +72 -46
- package/lib/chevre/service/task/createAccountingReport.js +37 -20
- package/lib/chevre/service/task/deletePerson.js +77 -63
- package/lib/chevre/service/task/deleteTransaction.js +26 -12
- package/lib/chevre/service/task/givePointAward.js +27 -13
- package/lib/chevre/service/task/handleNotification.js +4 -14
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +31 -18
- package/lib/chevre/service/task/importEventsFromCOA.js +31 -18
- package/lib/chevre/service/task/importOffersFromCOA.js +33 -20
- package/lib/chevre/service/task/invalidatePaymentUrl.js +6 -12
- package/lib/chevre/service/task/moneyTransfer.js +27 -13
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -12
- package/lib/chevre/service/task/onAuthorizationCreated.js +34 -19
- package/lib/chevre/service/task/onEventChanged.js +3 -12
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +3 -12
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +13 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +67 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +13 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +70 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +15 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +72 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +17 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +89 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +19 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +74 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +20 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +65 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +27 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +113 -0
- package/lib/chevre/service/task/onResourceDeleted.d.ts +6 -0
- package/lib/chevre/service/task/onResourceDeleted.js +181 -0
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +32 -21
- package/lib/chevre/service/task/onResourceUpdated/onCategoryCodeUpdated.js +3 -12
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +34 -23
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +36 -25
- package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +32 -15
- package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +44 -27
- package/lib/chevre/service/task/onResourceUpdated.js +285 -144
- package/lib/chevre/service/task/pay.js +31 -16
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.js +28 -15
- package/lib/chevre/service/task/payment/payByTask.js +81 -44
- package/lib/chevre/service/task/payment/refundByTask.js +34 -21
- package/lib/chevre/service/task/payment/voidPaymentByTask.js +33 -19
- package/lib/chevre/service/task/placeOrder.js +6 -12
- package/lib/chevre/service/task/publishPaymentUrl.js +32 -14
- package/lib/chevre/service/task/refund.js +31 -16
- package/lib/chevre/service/task/registerService.js +3 -12
- package/lib/chevre/service/task/reserve.js +3 -12
- package/lib/chevre/service/task/returnMoneyTransfer.js +26 -12
- package/lib/chevre/service/task/returnOrder.js +6 -12
- package/lib/chevre/service/task/returnPayTransaction.js +83 -52
- package/lib/chevre/service/task/returnPointAward.js +27 -13
- package/lib/chevre/service/task/returnReserveTransaction.js +60 -35
- package/lib/chevre/service/task/sendEmailMessage.js +6 -13
- package/lib/chevre/service/task/sendOrder.js +35 -15
- package/lib/chevre/service/task/syncResourcesFromCOA.js +74 -52
- package/lib/chevre/service/task/triggerWebhook.js +6 -12
- package/lib/chevre/service/task/useReservation.js +11 -14
- package/lib/chevre/service/task/voidMoneyTransferTransaction.js +3 -12
- package/lib/chevre/service/task/voidPayTransaction.js +7 -12
- package/lib/chevre/service/task/voidPayment.js +26 -12
- package/lib/chevre/service/task/voidRegisterServiceTransaction.js +3 -12
- package/lib/chevre/service/task/voidReserveTransaction.js +34 -17
- package/lib/chevre/service/task.js +43 -27
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +37 -22
- package/lib/chevre/service/taskHandler/onOperationFailed.js +43 -17
- package/lib/chevre/service/taskHandler.js +50 -26
- package/lib/chevre/service/transaction/deleteTransaction.js +127 -88
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +45 -13
- package/lib/chevre/service/transaction/moneyTransfer/factory.js +37 -5
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +35 -24
- package/lib/chevre/service/transaction/moneyTransfer.js +151 -104
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.js +24 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +73 -52
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +14 -25
- package/lib/chevre/service/transaction/placeOrder/confirm/publishCode.js +27 -14
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.js +32 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.js +32 -9
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.js +26 -4
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +59 -50
- package/lib/chevre/service/transaction/placeOrder/confirm.js +108 -66
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +61 -19
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +34 -17
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +29 -15
- package/lib/chevre/service/transaction/placeOrder/publishOrderNumberIfNotExist.js +30 -16
- package/lib/chevre/service/transaction/placeOrder/start/factory.js +51 -8
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +77 -61
- package/lib/chevre/service/transaction/placeOrder/start.js +37 -18
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +43 -11
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +200 -191
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +98 -89
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +64 -49
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +75 -56
- package/lib/chevre/service/transaction/returnOrder/preStart/findApplicableReturnPolicy.js +142 -120
- package/lib/chevre/service/transaction/returnOrder/preStart/getReturnPolicyByProject.js +83 -80
- package/lib/chevre/service/transaction/returnOrder/preStart.js +70 -49
- package/lib/chevre/service/transaction/returnOrder.js +60 -39
- package/lib/chevre/service/transaction.js +101 -49
- package/lib/chevre/service/validation/validateEvent.js +3 -12
- package/lib/chevre/service/validation/validateOrder.js +41 -26
- package/lib/chevre/service.js +113 -136
- package/lib/chevre/settings/aggregation.js +4 -0
- package/lib/chevre/settings.js +7 -1
- package/lib/index.js +24 -2
- package/package.json +18 -19
- package/example/src/chevre/addEventBySchedule.ts +0 -46
- package/example/src/chevre/event/upsertManyScreeningEventByIdentifier.ts +0 -191
- package/example/src/chevre/eventSeries/migrateEventSeriesOffers.ts +0 -75
- package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +0 -93
- package/example/src/chevre/offers/createSampleOffers.ts +0 -154
- package/example/src/chevre/settings/addSettings.ts +0 -46
- package/example/src/chevre/upsertScreeningEventSeriesByVersion.ts +0 -102
- package/example/src/idaas/auth0/adminApplications.ts +0 -183
- package/example/src/idaas/auth0/getToken.ts +0 -55
- package/example/src/idaas/auth0/getTokenByPrivateKeyJWT.ts +0 -84
- package/lib/chevre/service/eventOld.d.ts +0 -60
- package/lib/chevre/service/eventOld.js +0 -864
- package/lib/chevre/service/task/createEvent/createEvent.d.ts +0 -25
- package/lib/chevre/service/task/createEvent/createEvent.js +0 -45
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +0 -22
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +0 -188
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.d.ts +0 -15
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +0 -116
- package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +0 -25
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +0 -107
- package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +0 -13
- package/lib/chevre/service/task/createEvent/createEventSeries.js +0 -118
- package/lib/chevre/service/task/createEvent.d.ts +0 -6
- package/lib/chevre/service/task/createEvent.js +0 -46
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +0 -45
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +0 -447
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
10
24
|
};
|
|
11
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
26
|
exports.person2username = exports.onPaymentStatusChanged = void 0;
|
|
@@ -18,10 +32,10 @@ exports.invalidatePaymentUrl = invalidatePaymentUrl;
|
|
|
18
32
|
exports.voidPayTransaction = voidPayTransaction;
|
|
19
33
|
exports.processVoidPayTransaction = processVoidPayTransaction;
|
|
20
34
|
exports.publishPaymentUrl = publishPaymentUrl;
|
|
21
|
-
const util = require("util");
|
|
22
|
-
const factory = require("../../factory");
|
|
35
|
+
const util = __importStar(require("util"));
|
|
36
|
+
const factory = __importStar(require("../../factory"));
|
|
23
37
|
// import type { TransactionProcessRepo } from '../../repo/transactionProcess';
|
|
24
|
-
const PayTransactionService = require("../assetTransaction/pay");
|
|
38
|
+
const PayTransactionService = __importStar(require("../assetTransaction/pay"));
|
|
25
39
|
const publishOrderNumberIfNotExist_1 = require("../transaction/placeOrder/publishOrderNumberIfNotExist");
|
|
26
40
|
const fixTransactionNumber_1 = require("./any/authorize/fixTransactionNumber");
|
|
27
41
|
const fixTransactionNumberOnPublishPaymentUrl_1 = require("./any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl");
|
|
@@ -36,9 +50,9 @@ Object.defineProperty(exports, "person2username", { enumerable: true, get: funct
|
|
|
36
50
|
* タスクから決済承認を取り消す
|
|
37
51
|
*/
|
|
38
52
|
function voidPayTransaction(params) {
|
|
39
|
-
return (repos
|
|
53
|
+
return async (repos
|
|
40
54
|
// settings: Settings
|
|
41
|
-
) =>
|
|
55
|
+
) => {
|
|
42
56
|
// 決済承認アクション確認不要(2024-03-12~)
|
|
43
57
|
// 決済承認アクションを検索
|
|
44
58
|
// let authorizeActions = <factory.action.authorize.paymentMethod.any.IAction[]>
|
|
@@ -59,21 +73,19 @@ function voidPayTransaction(params) {
|
|
|
59
73
|
// if (authorizeActionsWithChevre.length > 0) {
|
|
60
74
|
// await processVoidPayTransaction(params)(repos);
|
|
61
75
|
// }
|
|
62
|
-
|
|
76
|
+
await processVoidPayTransaction(params)(repos);
|
|
63
77
|
// 決済URL無効化もここで処理
|
|
64
|
-
|
|
65
|
-
}
|
|
78
|
+
await invalidatePaymentUrl(params)(repos);
|
|
79
|
+
};
|
|
66
80
|
}
|
|
67
81
|
function invalidatePaymentUrl(params) {
|
|
68
|
-
|
|
69
|
-
return (repos
|
|
82
|
+
return async (repos
|
|
70
83
|
// settings: Settings
|
|
71
|
-
) =>
|
|
72
|
-
var _a, _b, _c, _d;
|
|
84
|
+
) => {
|
|
73
85
|
if (params.purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
74
86
|
throw new factory.errors.Argument('purpose.typeOf', `must be ${factory.transactionType.PlaceOrder}`);
|
|
75
87
|
}
|
|
76
|
-
const transaction =
|
|
88
|
+
const transaction = await repos.transaction.projectFieldsById({
|
|
77
89
|
typeOf: params.purpose.typeOf,
|
|
78
90
|
id: params.purpose.id
|
|
79
91
|
}, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
|
|
@@ -85,7 +97,7 @@ function invalidatePaymentUrl(params) {
|
|
|
85
97
|
// }
|
|
86
98
|
// }
|
|
87
99
|
// support multiple accept actions(2025-02-25~)
|
|
88
|
-
let acceptPayActions =
|
|
100
|
+
let acceptPayActions = await repos.action.search({
|
|
89
101
|
project: { id: { $eq: transaction.project.id } },
|
|
90
102
|
typeOf: { $eq: factory.actionType.AcceptAction },
|
|
91
103
|
// actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] }, // all statuses(2025-02-26~)
|
|
@@ -100,9 +112,9 @@ function invalidatePaymentUrl(params) {
|
|
|
100
112
|
throw new factory.errors.NotImplemented(`${transaction.status} not implemented`);
|
|
101
113
|
case factory.transactionStatusType.Confirmed:
|
|
102
114
|
// support OrderCanceled(2025-02-25~)
|
|
103
|
-
const orderCancelled =
|
|
115
|
+
const orderCancelled = params.purpose.result?.order?.orderStatus === factory.orderStatus.OrderCancelled;
|
|
104
116
|
if (!orderCancelled) {
|
|
105
|
-
const paymentMethodIdByPaymentUrl =
|
|
117
|
+
const paymentMethodIdByPaymentUrl = transaction.object.paymentMethods?.paymentMethodId;
|
|
106
118
|
if (typeof paymentMethodIdByPaymentUrl === 'string') {
|
|
107
119
|
acceptPayActions = acceptPayActions.filter(({ object }) => object.transactionNumber !== paymentMethodIdByPaymentUrl);
|
|
108
120
|
}
|
|
@@ -126,7 +138,7 @@ function invalidatePaymentUrl(params) {
|
|
|
126
138
|
typeOf: transaction.seller.typeOf,
|
|
127
139
|
name: (typeof transaction.seller.name === 'string')
|
|
128
140
|
? transaction.seller.name
|
|
129
|
-
: String(
|
|
141
|
+
: String(transaction.seller.name?.ja),
|
|
130
142
|
id: transaction.seller.id
|
|
131
143
|
},
|
|
132
144
|
recipient: {
|
|
@@ -162,7 +174,7 @@ function invalidatePaymentUrl(params) {
|
|
|
162
174
|
}
|
|
163
175
|
}
|
|
164
176
|
if (invalidatePaymentUrlTasks.length > 0) {
|
|
165
|
-
|
|
177
|
+
await repos.task.saveMany(invalidatePaymentUrlTasks, { emitImmediately: true });
|
|
166
178
|
}
|
|
167
179
|
// const paymentMethodIdByPaymentUrl = transaction.object.paymentMethods?.paymentMethodId;
|
|
168
180
|
// if (typeof paymentMethodIdByPaymentUrl === 'string' && paymentMethodIdByPaymentUrl.length > 0) {
|
|
@@ -219,29 +231,31 @@ function invalidatePaymentUrl(params) {
|
|
|
219
231
|
// }
|
|
220
232
|
// }
|
|
221
233
|
// }
|
|
222
|
-
}
|
|
234
|
+
};
|
|
223
235
|
}
|
|
224
236
|
/**
|
|
225
237
|
* 決済承認中止
|
|
226
238
|
* apiもしくはタスクから決済承認を取り消す
|
|
227
239
|
*/
|
|
228
240
|
function processVoidPayTransaction(params) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
241
|
+
return async (repos) => {
|
|
242
|
+
const cancelAction = {
|
|
243
|
+
startTime: new Date(),
|
|
244
|
+
agent: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
245
|
+
...(typeof params.sameAs?.id === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined
|
|
246
|
+
};
|
|
233
247
|
let transaction;
|
|
234
248
|
// アクションID指定の場合、進行中取引検証(2023-02-24~)
|
|
235
249
|
if (typeof params.id === 'string') {
|
|
236
|
-
transaction =
|
|
250
|
+
transaction = await repos.transaction.projectFieldsInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status']);
|
|
237
251
|
}
|
|
238
252
|
else {
|
|
239
|
-
transaction =
|
|
253
|
+
transaction = await repos.transaction.projectFieldsById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'result']);
|
|
240
254
|
}
|
|
241
255
|
// 承認アクションを取得
|
|
242
256
|
let authorizeActions;
|
|
243
257
|
if (typeof params.id === 'string') {
|
|
244
|
-
const authorizeAction =
|
|
258
|
+
const authorizeAction = await repos.action.findById({ typeOf: factory.actionType.AuthorizeAction, id: params.id });
|
|
245
259
|
// 取引内のアクションかどうか確認
|
|
246
260
|
if (authorizeAction.purpose.typeOf !== transaction.typeOf || authorizeAction.purpose.id !== transaction.id) {
|
|
247
261
|
throw new factory.errors.Argument('Transaction', 'Action not found in the transaction');
|
|
@@ -249,21 +263,21 @@ function processVoidPayTransaction(params) {
|
|
|
249
263
|
authorizeActions = [authorizeAction];
|
|
250
264
|
}
|
|
251
265
|
else {
|
|
252
|
-
authorizeActions =
|
|
266
|
+
authorizeActions = await repos.action.searchByPurpose({
|
|
253
267
|
typeOf: factory.actionType.AuthorizeAction,
|
|
254
268
|
purpose: { typeOf: transaction.typeOf, id: transaction.id },
|
|
255
269
|
object: { typeOf: { $eq: factory.action.authorize.paymentMethod.any.ResultType.Payment } }
|
|
256
|
-
})
|
|
270
|
+
});
|
|
257
271
|
switch (transaction.status) {
|
|
258
272
|
case factory.transactionStatusType.InProgress:
|
|
259
273
|
throw new factory.errors.NotImplemented(`${transaction.status} not implemented`);
|
|
260
274
|
case factory.transactionStatusType.Confirmed:
|
|
261
275
|
// OrderCancelledを考慮(2023-08-30~)
|
|
262
|
-
const orderCancelled =
|
|
276
|
+
const orderCancelled = params.purpose.result?.order?.orderStatus === factory.orderStatus.OrderCancelled;
|
|
263
277
|
if (!orderCancelled) {
|
|
264
278
|
// 取り消すべきアクションに絞る
|
|
265
279
|
authorizeActions = authorizeActions.filter(({ actionStatus }) => actionStatus !== factory.actionStatusType.CompletedActionStatus);
|
|
266
|
-
const actionIdsFromTransactionResult =
|
|
280
|
+
const actionIdsFromTransactionResult = transaction.result?.authorizeActions?.map(({ id }) => id);
|
|
267
281
|
if (!Array.isArray(actionIdsFromTransactionResult)) {
|
|
268
282
|
throw new factory.errors.Argument('Transaction', `${transaction.id} must have result.authorizeActions`);
|
|
269
283
|
}
|
|
@@ -287,11 +301,11 @@ function processVoidPayTransaction(params) {
|
|
|
287
301
|
for (const action of authorizeActions) {
|
|
288
302
|
// 失敗するケースがあっても、残りが少なくとも処理されるようにエラーハンドリング
|
|
289
303
|
try {
|
|
290
|
-
|
|
304
|
+
await repos.action.cancelWithVoid({ typeOf: action.typeOf, id: action.id, cancelAction });
|
|
291
305
|
// 取引が存在すれば中止
|
|
292
306
|
const transactionNumber = action.object.paymentMethodId;
|
|
293
307
|
if (typeof transactionNumber === 'string' && transactionNumber.length > 0) {
|
|
294
|
-
const payTransaction = (
|
|
308
|
+
const payTransaction = (await repos.assetTransaction.search({
|
|
295
309
|
limit: 1,
|
|
296
310
|
page: 1,
|
|
297
311
|
project: { id: { $eq: action.project.id } },
|
|
@@ -302,7 +316,7 @@ function processVoidPayTransaction(params) {
|
|
|
302
316
|
// ステータス検証(Expiredから実行される可能性がある)
|
|
303
317
|
if (payTransaction.status !== factory.transactionStatusType.Canceled
|
|
304
318
|
&& payTransaction.status !== factory.transactionStatusType.Expired) {
|
|
305
|
-
|
|
319
|
+
await PayTransactionService.cancel({ transactionNumber })(repos);
|
|
306
320
|
}
|
|
307
321
|
}
|
|
308
322
|
}
|
|
@@ -314,33 +328,30 @@ function processVoidPayTransaction(params) {
|
|
|
314
328
|
if (errors.length > 0) {
|
|
315
329
|
throw errors[0];
|
|
316
330
|
}
|
|
317
|
-
}
|
|
331
|
+
};
|
|
318
332
|
}
|
|
319
333
|
/**
|
|
320
334
|
* 外部決済ロケーションを発行する
|
|
321
335
|
*/
|
|
322
|
-
// tslint:disable-next-line:max-func-body-length
|
|
323
336
|
function publishPaymentUrl(params) {
|
|
324
|
-
|
|
325
|
-
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
326
|
-
var _a, _b;
|
|
337
|
+
return async (repos, settings) => {
|
|
327
338
|
const { paymentServiceType, purpose, project } = params;
|
|
328
339
|
if (purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
329
340
|
throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
330
341
|
}
|
|
331
342
|
try {
|
|
332
|
-
const transaction =
|
|
343
|
+
const transaction = await repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['expires', 'seller', 'project']);
|
|
333
344
|
if (project.id !== transaction.project.id) {
|
|
334
345
|
throw new factory.errors.NotFound(factory.transactionType.PlaceOrder);
|
|
335
346
|
}
|
|
336
347
|
// publishOrderNumber(2025-03-11~)
|
|
337
|
-
|
|
348
|
+
await (0, publishOrderNumberIfNotExist_1.publishOrderNumberIfNotExist)({
|
|
338
349
|
project: { id: transaction.project.id },
|
|
339
350
|
id: transaction.id,
|
|
340
351
|
object: { orderDate: new Date() }
|
|
341
352
|
})(repos);
|
|
342
353
|
// 取引番号生成
|
|
343
|
-
const { transactionNumber, ticketToken } =
|
|
354
|
+
const { transactionNumber, ticketToken } = await (0, fixTransactionNumberOnPublishPaymentUrl_1.fixTransactionNumberOnPublishPaymentUrl)({
|
|
344
355
|
object: params.object,
|
|
345
356
|
transaction,
|
|
346
357
|
paymentServiceType
|
|
@@ -361,14 +372,28 @@ function publishPaymentUrl(params) {
|
|
|
361
372
|
// }
|
|
362
373
|
let result;
|
|
363
374
|
// URL発行
|
|
364
|
-
const authorizeObject =
|
|
375
|
+
const authorizeObject = {
|
|
376
|
+
...params.object,
|
|
377
|
+
accountId: '',
|
|
378
|
+
paymentMethodId: transactionNumber,
|
|
379
|
+
typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment,
|
|
365
380
|
// support referencesOrder(2025-11-24~)
|
|
366
|
-
referencesOrder: (
|
|
381
|
+
referencesOrder: (params.object.referencesOrder?.typeOf === factory.order.OrderType.Order)
|
|
367
382
|
? params.object.referencesOrder
|
|
368
|
-
: { typeOf: factory.order.OrderType.Order }
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
|
|
383
|
+
: { typeOf: factory.order.OrderType.Order }
|
|
384
|
+
};
|
|
385
|
+
const startParams = (0, factory_1.creatPublishPaymentUrlParams)({
|
|
386
|
+
object: authorizeObject,
|
|
387
|
+
paymentServiceType,
|
|
388
|
+
transaction: transaction,
|
|
389
|
+
transactionNumber: transactionNumber,
|
|
390
|
+
location: params.location,
|
|
391
|
+
instrument: params.instrument,
|
|
392
|
+
...(typeof params.identifier === 'string') ? { identifier: params.identifier } : undefined,
|
|
393
|
+
...(typeof ticketToken === 'string') ? { ticketToken } : undefined
|
|
394
|
+
});
|
|
395
|
+
const taskId = params.sameAs?.id;
|
|
396
|
+
result = await PayTransactionService.publishPaymentUrl(startParams, {
|
|
372
397
|
purposeAsTransaction: { id: transaction.id },
|
|
373
398
|
executor: (typeof taskId === 'string') ? { id: taskId } : {} // タスク関連付け(2024-05-22~)
|
|
374
399
|
})(repos, settings);
|
|
@@ -387,7 +412,7 @@ function publishPaymentUrl(params) {
|
|
|
387
412
|
// execTranResult: result.execTranResult, // migrate to recipe(2024-06-05~)
|
|
388
413
|
// paymentMethod: startParams.object.paymentMethod // 拡張(2024-01-04~) // migrate to acceptAction(2024-06-05~)
|
|
389
414
|
};
|
|
390
|
-
|
|
415
|
+
await repos.transaction.findByIdAndUpdateInProgress({
|
|
391
416
|
id: transaction.id,
|
|
392
417
|
update: { $set: { 'object.paymentMethods': paymentMethodByPaymentUrl } }
|
|
393
418
|
});
|
|
@@ -405,7 +430,7 @@ function publishPaymentUrl(params) {
|
|
|
405
430
|
throw error;
|
|
406
431
|
}
|
|
407
432
|
}
|
|
408
|
-
}
|
|
433
|
+
};
|
|
409
434
|
}
|
|
410
435
|
/**
|
|
411
436
|
* 承認アクションオブジェクトから冗長な属性を排除する
|
|
@@ -418,24 +443,22 @@ function minimizeObjectIncludingPaymentMethodDetails(authorizeObjectIncludingPay
|
|
|
418
443
|
* 決済承認
|
|
419
444
|
*/
|
|
420
445
|
function authorize(params) {
|
|
421
|
-
|
|
422
|
-
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
423
|
-
var _a, _b, _c;
|
|
446
|
+
return async (repos, settings) => {
|
|
424
447
|
const { paymentServiceType, purpose, project } = params;
|
|
425
448
|
if (purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
426
449
|
throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
427
450
|
}
|
|
428
|
-
const transaction =
|
|
451
|
+
const transaction = await repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
|
|
429
452
|
if (project.id !== transaction.project.id) {
|
|
430
453
|
throw new factory.errors.NotFound(factory.transactionType.PlaceOrder);
|
|
431
454
|
}
|
|
432
|
-
const { confirmationNumber, orderNumber } =
|
|
455
|
+
const { confirmationNumber, orderNumber } = await (0, fixOrderAsNeeded_1.fixOrderAsNeeded)({
|
|
433
456
|
project: { id: transaction.project.id },
|
|
434
457
|
purpose
|
|
435
458
|
// paymentServiceType
|
|
436
459
|
})(repos);
|
|
437
460
|
// 取引番号生成
|
|
438
|
-
const fixTransactionNumberResult =
|
|
461
|
+
const fixTransactionNumberResult = await (0, fixTransactionNumber_1.fixTransactionNumber)({
|
|
439
462
|
object: params.object,
|
|
440
463
|
transaction,
|
|
441
464
|
paymentServiceType
|
|
@@ -498,34 +521,50 @@ function authorize(params) {
|
|
|
498
521
|
// transactionNumber = publishTransactionNumberResult.transactionNumber;
|
|
499
522
|
// }
|
|
500
523
|
const movieTickets = (Array.isArray(params.object.movieTickets)) ? params.object.movieTickets.map(factory_1.createMovieTicket) : undefined;
|
|
501
|
-
const { accountId } =
|
|
524
|
+
const { accountId } = await fixAccountIdIfPossible({
|
|
502
525
|
object: params.object, project: { id: transaction.project.id }
|
|
503
526
|
})();
|
|
504
|
-
const authorizeObjectIncludingPaymentMethodDetails =
|
|
527
|
+
const authorizeObjectIncludingPaymentMethodDetails = {
|
|
528
|
+
...params.object,
|
|
529
|
+
accountId,
|
|
530
|
+
paymentMethodId: transactionNumber,
|
|
531
|
+
typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment,
|
|
505
532
|
// support referencesOrder(2025-11-24~)
|
|
506
|
-
referencesOrder: (
|
|
533
|
+
referencesOrder: (params.object.referencesOrder?.typeOf === factory.order.OrderType.Order)
|
|
507
534
|
? params.object.referencesOrder
|
|
508
|
-
: { typeOf: factory.order.OrderType.Order }
|
|
535
|
+
: { typeOf: factory.order.OrderType.Order },
|
|
536
|
+
...(creditCard !== undefined) ? { creditCard } : undefined,
|
|
537
|
+
...(Array.isArray(movieTickets)) ? { movieTickets } : undefined
|
|
538
|
+
};
|
|
509
539
|
const { authorizeObject } = minimizeObjectIncludingPaymentMethodDetails(authorizeObjectIncludingPaymentMethodDetails);
|
|
510
540
|
// 承認アクションを開始する
|
|
511
|
-
const taskId =
|
|
541
|
+
const taskId = params.sameAs?.id;
|
|
512
542
|
const uniqueActionIdentifier = util.format(`%s:%s:%s`, factory.actionType.AuthorizeAction, factory.action.authorize.paymentMethod.any.ResultType.Payment, authorizeObject.paymentMethodId);
|
|
513
|
-
const actionAttributes =
|
|
543
|
+
const actionAttributes = {
|
|
544
|
+
project: transaction.project,
|
|
545
|
+
typeOf: factory.actionType.AuthorizeAction,
|
|
546
|
+
object: authorizeObject,
|
|
547
|
+
agent: {
|
|
514
548
|
typeOf: transaction.agent.typeOf,
|
|
515
549
|
id: transaction.agent.id
|
|
516
|
-
},
|
|
550
|
+
},
|
|
551
|
+
instrument: {
|
|
517
552
|
typeOf: factory.assetTransactionType.Pay, // 資産取引化(2024-03-11~)
|
|
518
553
|
identifier: factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre,
|
|
519
554
|
transactionNumber
|
|
520
|
-
},
|
|
555
|
+
},
|
|
556
|
+
recipient: {
|
|
521
557
|
typeOf: transaction.seller.typeOf,
|
|
522
558
|
id: transaction.seller.id,
|
|
523
559
|
name: (typeof transaction.seller.name === 'string')
|
|
524
560
|
? transaction.seller.name
|
|
525
|
-
: String(
|
|
526
|
-
},
|
|
527
|
-
|
|
528
|
-
|
|
561
|
+
: String(transaction.seller.name?.ja)
|
|
562
|
+
},
|
|
563
|
+
purpose: { typeOf: transaction.typeOf, id: transaction.id },
|
|
564
|
+
identifier: uniqueActionIdentifier, // add unique identifier(2025-02-25~)
|
|
565
|
+
...(typeof taskId === 'string') ? { sameAs: { id: taskId, typeOf: 'Task' } } : undefined // タスク関連付け(2024-04-22~)
|
|
566
|
+
};
|
|
567
|
+
const action = await repos.action.start(actionAttributes);
|
|
529
568
|
let payTransaction;
|
|
530
569
|
try {
|
|
531
570
|
const startParams = (0, factory_1.creatPayTransactionStartParams)({
|
|
@@ -542,13 +581,17 @@ function authorize(params) {
|
|
|
542
581
|
ticketToken,
|
|
543
582
|
instrument: params.instrument
|
|
544
583
|
});
|
|
545
|
-
payTransaction =
|
|
584
|
+
payTransaction = await PayTransactionService.start(startParams, {
|
|
546
585
|
// useCheckByIdentifierIfNotYet: params.options.useCheckByIdentifierIfNotYet,
|
|
547
|
-
executor: (typeof taskId === 'string') ? { id: taskId } : {},
|
|
586
|
+
executor: (typeof taskId === 'string') ? { id: taskId } : {}, // タスク関連付け(2024-05-18~)
|
|
587
|
+
purpose: { id: transaction.id },
|
|
588
|
+
checkedAction: params.options.checkedAction,
|
|
589
|
+
...(pendingPaymentAgencyTransaction !== undefined) ? { pendingPaymentAgencyTransaction } : undefined
|
|
590
|
+
})(repos, settings);
|
|
548
591
|
}
|
|
549
592
|
catch (error) {
|
|
550
593
|
try {
|
|
551
|
-
|
|
594
|
+
await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
552
595
|
}
|
|
553
596
|
catch (__) {
|
|
554
597
|
// no op
|
|
@@ -563,7 +606,7 @@ function authorize(params) {
|
|
|
563
606
|
// }
|
|
564
607
|
const rawError = Array.isArray(error) ? error[1] : undefined;
|
|
565
608
|
if (rawError !== undefined && rawError.name !== 'AbortError') {
|
|
566
|
-
|
|
609
|
+
await processVoidPayTransaction({
|
|
567
610
|
project: actionAttributes.project,
|
|
568
611
|
id: action.id,
|
|
569
612
|
purpose: actionAttributes.purpose
|
|
@@ -583,15 +626,15 @@ function authorize(params) {
|
|
|
583
626
|
object: authorizeObjectIncludingPaymentMethodDetails,
|
|
584
627
|
invoiceByTicketToken
|
|
585
628
|
});
|
|
586
|
-
|
|
629
|
+
await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
|
|
587
630
|
return { id: action.id };
|
|
588
|
-
}
|
|
631
|
+
};
|
|
589
632
|
}
|
|
590
633
|
/**
|
|
591
634
|
* 承認しようとしているobjectからaccountIdを決定する
|
|
592
635
|
*/
|
|
593
636
|
function fixAccountIdIfPossible(params) {
|
|
594
|
-
return (
|
|
637
|
+
return async (
|
|
595
638
|
// repos: {
|
|
596
639
|
// action: ActionRepo;
|
|
597
640
|
// authorization: AuthorizationRepo;
|
|
@@ -600,11 +643,10 @@ function fixAccountIdIfPossible(params) {
|
|
|
600
643
|
// credentials: {
|
|
601
644
|
// jwt: JWTCredentials;
|
|
602
645
|
// }
|
|
603
|
-
) =>
|
|
604
|
-
var _a, _b;
|
|
646
|
+
) => {
|
|
605
647
|
let accountId = '';
|
|
606
|
-
const fromLocation =
|
|
607
|
-
const movieTickets =
|
|
648
|
+
const fromLocation = params.object?.fromLocation;
|
|
649
|
+
const movieTickets = params.object?.movieTickets;
|
|
608
650
|
// discontinue token as fromLocation(ticketTokenへ移行するべき)(2024-12-18~)
|
|
609
651
|
if (typeof fromLocation === 'string') {
|
|
610
652
|
throw new factory.errors.NotImplemented('object.fromLocation as string not implemented');
|
|
@@ -631,13 +673,12 @@ function fixAccountIdIfPossible(params) {
|
|
|
631
673
|
accountId = movieTickets[0].identifier; // 決済カードidentifierは1つのみ許可の前提
|
|
632
674
|
}
|
|
633
675
|
return { accountId };
|
|
634
|
-
}
|
|
676
|
+
};
|
|
635
677
|
}
|
|
636
678
|
function findAuthorizeAction(params) {
|
|
637
|
-
return (repos) =>
|
|
638
|
-
var _a, _b;
|
|
679
|
+
return async (repos) => {
|
|
639
680
|
// タスク検索
|
|
640
|
-
const task = (
|
|
681
|
+
const task = (await repos.task.projectFields({
|
|
641
682
|
limit: 1,
|
|
642
683
|
page: 1,
|
|
643
684
|
id: { $eq: params.sameAs.id },
|
|
@@ -647,47 +688,53 @@ function findAuthorizeAction(params) {
|
|
|
647
688
|
if (task === undefined) {
|
|
648
689
|
throw new factory.errors.NotFound(factory.taskName.AuthorizePayment);
|
|
649
690
|
}
|
|
650
|
-
const errorByTask =
|
|
691
|
+
const errorByTask = task.executionResults.shift()?.error;
|
|
651
692
|
let defaultActionError;
|
|
652
693
|
if (typeof errorByTask === 'string') {
|
|
653
694
|
defaultActionError = { message: errorByTask };
|
|
654
695
|
}
|
|
655
|
-
else if (typeof
|
|
696
|
+
else if (typeof errorByTask?.message === 'string') {
|
|
656
697
|
defaultActionError = { message: errorByTask.message, name: errorByTask.name };
|
|
657
698
|
}
|
|
658
|
-
let action =
|
|
699
|
+
let action = {
|
|
700
|
+
actionStatus: factory.actionStatusType.PotentialActionStatus,
|
|
701
|
+
...(defaultActionError !== undefined) ? { error: defaultActionError } : undefined
|
|
702
|
+
};
|
|
659
703
|
switch (task.status) {
|
|
660
704
|
case factory.taskStatus.Ready:
|
|
661
705
|
break;
|
|
662
706
|
default:
|
|
663
707
|
// タスクがReadyでなければアクション検索
|
|
664
|
-
const authorizeAction = (
|
|
708
|
+
const authorizeAction = (await repos.action.searchBySameAs({
|
|
665
709
|
sameAs: { id: { $eq: task.id } },
|
|
666
710
|
typeOf: { $eq: factory.actionType.AuthorizeAction }
|
|
667
711
|
// purpose: { id: { $eq: String(params.purpose.id) } }
|
|
668
712
|
})).shift();
|
|
669
713
|
if (authorizeAction !== undefined) {
|
|
670
714
|
// purpose検証
|
|
671
|
-
if (
|
|
715
|
+
if (authorizeAction.purpose?.id !== params.purpose.id) {
|
|
672
716
|
throw new factory.errors.NotFound('Action');
|
|
673
717
|
}
|
|
674
|
-
action =
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
718
|
+
action = {
|
|
719
|
+
id: authorizeAction.id,
|
|
720
|
+
actionStatus: authorizeAction.actionStatus,
|
|
721
|
+
...(authorizeAction.error !== undefined)
|
|
722
|
+
? {
|
|
723
|
+
error: (Array.isArray(authorizeAction.error))
|
|
724
|
+
? authorizeAction.error[0]
|
|
725
|
+
: authorizeAction.error
|
|
726
|
+
}
|
|
727
|
+
: undefined
|
|
728
|
+
};
|
|
681
729
|
}
|
|
682
730
|
}
|
|
683
731
|
return action;
|
|
684
|
-
}
|
|
732
|
+
};
|
|
685
733
|
}
|
|
686
734
|
function findCheckAction(params) {
|
|
687
|
-
return (repos) =>
|
|
688
|
-
var _a, _b;
|
|
735
|
+
return async (repos) => {
|
|
689
736
|
// タスク検索
|
|
690
|
-
const task = (
|
|
737
|
+
const task = (await repos.task.projectFields({
|
|
691
738
|
limit: 1,
|
|
692
739
|
page: 1,
|
|
693
740
|
id: { $eq: params.sameAs.id },
|
|
@@ -697,52 +744,59 @@ function findCheckAction(params) {
|
|
|
697
744
|
if (task === undefined) {
|
|
698
745
|
throw new factory.errors.NotFound(factory.taskName.CheckMovieTicket);
|
|
699
746
|
}
|
|
700
|
-
const errorByTask =
|
|
747
|
+
const errorByTask = task.executionResults.shift()?.error;
|
|
701
748
|
let defaultActionError;
|
|
702
749
|
if (typeof errorByTask === 'string') {
|
|
703
750
|
defaultActionError = { message: errorByTask };
|
|
704
751
|
}
|
|
705
|
-
else if (typeof
|
|
752
|
+
else if (typeof errorByTask?.message === 'string') {
|
|
706
753
|
defaultActionError = { message: errorByTask.message, name: errorByTask.name };
|
|
707
754
|
}
|
|
708
|
-
let action =
|
|
755
|
+
let action = {
|
|
756
|
+
actionStatus: factory.actionStatusType.PotentialActionStatus,
|
|
757
|
+
...(defaultActionError !== undefined) ? { error: defaultActionError } : undefined
|
|
758
|
+
};
|
|
709
759
|
switch (task.status) {
|
|
710
760
|
case factory.taskStatus.Ready:
|
|
711
761
|
break;
|
|
712
762
|
default:
|
|
713
763
|
// タスクがReadyでなければアクション検索
|
|
714
|
-
const authorizeAction = (
|
|
764
|
+
const authorizeAction = (await repos.action.searchBySameAs({
|
|
715
765
|
sameAs: { id: { $eq: task.id } },
|
|
716
766
|
typeOf: { $eq: factory.actionType.CheckAction }
|
|
717
767
|
// purpose: { id: { $eq: String(params.purpose.id) } }
|
|
718
768
|
})).shift();
|
|
719
769
|
if (authorizeAction !== undefined) {
|
|
720
770
|
// purpose検証
|
|
721
|
-
if (
|
|
771
|
+
if (authorizeAction.purpose?.id !== params.purpose.id) {
|
|
722
772
|
throw new factory.errors.NotFound('Action');
|
|
723
773
|
}
|
|
724
774
|
// result from recipe(2024-06-10~)
|
|
725
|
-
const purchaseNumberAuthResult =
|
|
775
|
+
const purchaseNumberAuthResult = await repos.action.findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe({
|
|
726
776
|
project: { id: params.project.id },
|
|
727
777
|
recipeFor: { id: authorizeAction.id }
|
|
728
778
|
});
|
|
729
|
-
action =
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
779
|
+
action = {
|
|
780
|
+
id: authorizeAction.id,
|
|
781
|
+
actionStatus: authorizeAction.actionStatus,
|
|
782
|
+
...(authorizeAction.error !== undefined)
|
|
783
|
+
? {
|
|
784
|
+
error: (Array.isArray(authorizeAction.error))
|
|
785
|
+
? authorizeAction.error[0]
|
|
786
|
+
: authorizeAction.error
|
|
787
|
+
}
|
|
788
|
+
: undefined,
|
|
789
|
+
...(purchaseNumberAuthResult !== undefined) ? { result: { purchaseNumberAuthResult } } : undefined
|
|
790
|
+
};
|
|
736
791
|
}
|
|
737
792
|
}
|
|
738
793
|
return action;
|
|
739
|
-
}
|
|
794
|
+
};
|
|
740
795
|
}
|
|
741
796
|
function findAcceptAction(params) {
|
|
742
|
-
return (repos) =>
|
|
743
|
-
var _a, _b;
|
|
797
|
+
return async (repos) => {
|
|
744
798
|
// タスク検索
|
|
745
|
-
const task = (
|
|
799
|
+
const task = (await repos.task.projectFields({
|
|
746
800
|
limit: 1,
|
|
747
801
|
page: 1,
|
|
748
802
|
id: { $eq: params.sameAs.id },
|
|
@@ -752,49 +806,57 @@ function findAcceptAction(params) {
|
|
|
752
806
|
if (task === undefined) {
|
|
753
807
|
throw new factory.errors.NotFound(factory.taskName.PublishPaymentUrl);
|
|
754
808
|
}
|
|
755
|
-
const errorByTask =
|
|
809
|
+
const errorByTask = task.executionResults.shift()?.error;
|
|
756
810
|
let defaultActionError;
|
|
757
811
|
if (typeof errorByTask === 'string') {
|
|
758
812
|
defaultActionError = { message: errorByTask };
|
|
759
813
|
}
|
|
760
|
-
else if (typeof
|
|
814
|
+
else if (typeof errorByTask?.message === 'string') {
|
|
761
815
|
defaultActionError = { message: errorByTask.message, name: errorByTask.name };
|
|
762
816
|
}
|
|
763
|
-
let action =
|
|
817
|
+
let action = {
|
|
818
|
+
actionStatus: factory.actionStatusType.PotentialActionStatus,
|
|
819
|
+
...(defaultActionError !== undefined) ? { error: defaultActionError } : undefined
|
|
820
|
+
};
|
|
764
821
|
switch (task.status) {
|
|
765
822
|
case factory.taskStatus.Ready:
|
|
766
823
|
break;
|
|
767
824
|
default:
|
|
768
825
|
// タスクがReadyでなければアクション検索
|
|
769
|
-
const acceptAction = (
|
|
826
|
+
const acceptAction = (await repos.action.searchBySameAs({
|
|
770
827
|
sameAs: { id: { $eq: task.id } },
|
|
771
828
|
typeOf: { $eq: factory.actionType.AcceptAction }
|
|
772
829
|
// purpose: { id: { $eq: String(params.purpose.id) } }
|
|
773
830
|
})).shift();
|
|
774
831
|
if (acceptAction !== undefined) {
|
|
775
832
|
// purpose検証
|
|
776
|
-
if (
|
|
833
|
+
if (acceptAction.purpose?.id !== params.purpose.id) {
|
|
777
834
|
throw new factory.errors.NotFound('Action');
|
|
778
835
|
}
|
|
779
|
-
const acceptActionWithResult =
|
|
780
|
-
action =
|
|
836
|
+
const acceptActionWithResult = await repos.action.findById({ id: acceptAction.id, typeOf: factory.actionType.AcceptAction }, ['result', 'object'], []);
|
|
837
|
+
action = {
|
|
838
|
+
id: acceptAction.id,
|
|
839
|
+
actionStatus: acceptAction.actionStatus,
|
|
781
840
|
// add object.transactionNumber(2025-08-26~)
|
|
782
|
-
object: { transactionNumber: acceptActionWithResult.object.transactionNumber }
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
: undefined), ((acceptActionWithResult === null || acceptActionWithResult === void 0 ? void 0 : acceptActionWithResult.result) !== undefined)
|
|
789
|
-
? {
|
|
790
|
-
result: {
|
|
791
|
-
paymentMethodId: acceptActionWithResult.result.paymentMethodId,
|
|
792
|
-
paymentUrl: acceptActionWithResult.result.paymentUrl
|
|
841
|
+
object: { transactionNumber: acceptActionWithResult.object.transactionNumber },
|
|
842
|
+
...(acceptAction.error !== undefined)
|
|
843
|
+
? {
|
|
844
|
+
error: (Array.isArray(acceptAction.error))
|
|
845
|
+
? acceptAction.error[0]
|
|
846
|
+
: acceptAction.error
|
|
793
847
|
}
|
|
794
|
-
|
|
795
|
-
|
|
848
|
+
: undefined,
|
|
849
|
+
...(acceptActionWithResult?.result !== undefined)
|
|
850
|
+
? {
|
|
851
|
+
result: {
|
|
852
|
+
paymentMethodId: acceptActionWithResult.result.paymentMethodId,
|
|
853
|
+
paymentUrl: acceptActionWithResult.result.paymentUrl
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
: undefined
|
|
857
|
+
};
|
|
796
858
|
}
|
|
797
859
|
}
|
|
798
860
|
return action;
|
|
799
|
-
}
|
|
861
|
+
};
|
|
800
862
|
}
|