@chevre/domain 25.2.0-alpha.5 → 25.2.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/eventEmitter/task.d.ts +2 -1
- package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
- package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
- package/lib/chevre/repo/action/acceptPay.js +47 -19
- package/lib/chevre/repo/action/actionProcess.js +57 -57
- package/lib/chevre/repo/action.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
- package/lib/chevre/repo/aggregateOffer.js +16 -125
- package/lib/chevre/repo/asyncAction.d.ts +64 -0
- package/lib/chevre/repo/asyncAction.js +178 -0
- package/lib/chevre/repo/concurrentLock.d.ts +3 -1
- package/lib/chevre/repo/creativeWork.d.ts +2 -3
- package/lib/chevre/repo/credentials.d.ts +2 -1
- package/lib/chevre/repo/customerType.d.ts +2 -3
- package/lib/chevre/repo/event.d.ts +10 -11
- package/lib/chevre/repo/eventOffer.d.ts +4 -5
- package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
- package/lib/chevre/repo/eventSeries.d.ts +4 -5
- package/lib/chevre/repo/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
- package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +11 -0
- package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
- package/lib/chevre/repo/note.d.ts +3 -4
- package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
- package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
- package/lib/chevre/repo/offerCatalog.d.ts +2 -3
- package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
- package/lib/chevre/repo/order.d.ts +2 -0
- package/lib/chevre/repo/order.js +14 -14
- package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
- package/lib/chevre/repo/orderInTransaction.js +181 -3
- package/lib/chevre/repo/passport.d.ts +2 -1
- package/lib/chevre/repo/person.d.ts +0 -15
- package/lib/chevre/repo/person.js +122 -108
- package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
- package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
- package/lib/chevre/repo/place/seat.d.ts +4 -5
- package/lib/chevre/repo/place/section.d.ts +3 -4
- package/lib/chevre/repo/priceSpecification.d.ts +4 -4
- package/lib/chevre/repo/product.d.ts +3 -4
- package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
- package/lib/chevre/repo/rateLimit/offer.js +0 -12
- package/lib/chevre/repo/reservation.d.ts +2 -3
- package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
- package/lib/chevre/repo/stockHolder.d.ts +1 -1
- package/lib/chevre/repo/stockHolder.js +0 -146
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
- package/lib/chevre/repo/transaction/placeOrder.js +43 -83
- package/lib/chevre/repo/transaction.d.ts +2 -2
- package/lib/chevre/repo/transactionNumberCounter.js +0 -34
- package/lib/chevre/repo/transactionProcess.d.ts +2 -1
- package/lib/chevre/repo/transactionProcess.js +0 -13
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +12 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/asyncAction.d.ts +16 -0
- package/lib/chevre/service/asyncAction.js +36 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
- package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
- package/lib/chevre/service/asyncActionHandler.js +89 -0
- package/lib/chevre/service/notification/factory.d.ts +2 -4
- package/lib/chevre/service/notification/factory.js +26 -24
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +11 -5
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +11 -3
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
- package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +22 -9
- package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +4 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
- package/lib/chevre/service/order/placeOrder/factory.js +3 -21
- package/lib/chevre/service/order/placeOrder.d.ts +4 -5
- package/lib/chevre/service/order/placeOrder.js +20 -31
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
- package/lib/chevre/service/payment/any/authorize.js +13 -37
- package/lib/chevre/service/payment/any/factory.d.ts +7 -7
- package/lib/chevre/service/payment/any/factory.js +19 -22
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +3 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
- package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
- package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
- package/lib/chevre/service/reserve/searchByOrder.js +2 -6
- package/lib/chevre/service/reserve.d.ts +2 -2
- package/lib/chevre/service/reserve.js +3 -3
- package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
- package/lib/chevre/service/task/aggregateOffers.js +2 -1
- package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
- package/lib/chevre/service/task/authorizePayment.js +3 -1
- package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
- package/lib/chevre/service/task/cancelReservation.js +2 -1
- package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +2 -7
- package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
- package/lib/chevre/service/task/deleteTransaction.js +2 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
- package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
- package/lib/chevre/service/task/onEventChanged.js +2 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +2 -1
- package/lib/chevre/service/task/placeOrder.d.ts +2 -2
- package/lib/chevre/service/task/placeOrder.js +6 -3
- package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
- package/lib/chevre/service/task/refund.d.ts +2 -2
- package/lib/chevre/service/task/refund.js +4 -10
- package/lib/chevre/service/task/reserve.d.ts +2 -2
- package/lib/chevre/service/task/reserve.js +2 -1
- package/lib/chevre/service/task/returnOrder.d.ts +2 -2
- package/lib/chevre/service/task/returnOrder.js +2 -1
- package/lib/chevre/service/task/sendOrder.d.ts +2 -2
- package/lib/chevre/service/task/sendOrder.js +2 -1
- package/lib/chevre/service/task/voidPayTransaction.js +3 -7
- package/lib/chevre/service/task/voidPayment.d.ts +2 -2
- package/lib/chevre/service/task/voidPayment.js +2 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
- package/lib/chevre/service/taskHandler.d.ts +2 -2
- package/lib/chevre/service/taskHandler.js +36 -37
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +35 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +15 -11
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +53 -32
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +33 -78
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service.d.ts +4 -0
- package/lib/chevre/service.js +12 -1
- package/lib/chevre/taskSettings.d.ts +1 -3
- package/package.json +8 -11
- package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
- package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
- package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
- package/lib/chevre/service/reserve/findReservations.js +0 -61
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StockHolderRepo = void 0;
|
|
4
|
-
// import type { RedisClientType } from 'redis';
|
|
5
4
|
const factory_1 = require("../factory");
|
|
6
5
|
const pendingReservation_1 = require("./pendingReservation");
|
|
7
6
|
const SEARCH_OFFERS_MAX_LENGTH = 100;
|
|
@@ -9,36 +8,11 @@ const SEARCH_OFFERS_MAX_LENGTH = 100;
|
|
|
9
8
|
* 保留予約リポジトリ
|
|
10
9
|
*/
|
|
11
10
|
class StockHolderRepo {
|
|
12
|
-
// public static KEY_PREFIX_NEW: string = 'stockHolder';
|
|
13
|
-
// private readonly redisClient: RedisClientType | undefined;
|
|
14
11
|
pendingReservationRepo;
|
|
15
12
|
constructor(params) {
|
|
16
13
|
const { connection } = params;
|
|
17
|
-
// this.redisClient = redisClient;
|
|
18
14
|
this.pendingReservationRepo = new pendingReservation_1.PendingReservationRepo(connection);
|
|
19
15
|
}
|
|
20
|
-
// private static offer2field(params: IOffer, hasTicketedSeat: boolean) {
|
|
21
|
-
// if (hasTicketedSeat) {
|
|
22
|
-
// return `${params.seatSection}:${params.seatNumber}`;
|
|
23
|
-
// } else {
|
|
24
|
-
// // 予約IDをfieldにする場合
|
|
25
|
-
// const serviceOutputId = params.itemOffered?.serviceOutput?.id;
|
|
26
|
-
// if (typeof serviceOutputId === 'string') {
|
|
27
|
-
// return serviceOutputId;
|
|
28
|
-
// } else {
|
|
29
|
-
// throw new factory.errors.Internal('offer2field requires itemOffered.serviceOutput.id');
|
|
30
|
-
// }
|
|
31
|
-
// }
|
|
32
|
-
// }
|
|
33
|
-
// private static createKey(params: {
|
|
34
|
-
// eventId: string;
|
|
35
|
-
// startDate: Date;
|
|
36
|
-
// }): string {
|
|
37
|
-
// if (!(params.startDate instanceof Date)) {
|
|
38
|
-
// throw new factory.errors.Argument('startDate', 'must be Date');
|
|
39
|
-
// }
|
|
40
|
-
// return `${StockHolderRepo.KEY_PREFIX_NEW}:${params.eventId}`;
|
|
41
|
-
// }
|
|
42
16
|
/**
|
|
43
17
|
* 座席をロックする(maxキャパシティチェック有)
|
|
44
18
|
*/
|
|
@@ -54,16 +28,6 @@ class StockHolderRepo {
|
|
|
54
28
|
}
|
|
55
29
|
else {
|
|
56
30
|
throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
|
|
57
|
-
// if (this.redisClient === undefined) {
|
|
58
|
-
// throw new factory.errors.Internal('redisClient required');
|
|
59
|
-
// }
|
|
60
|
-
// const key = StockHolderRepo.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
|
|
61
|
-
// await this.redisClient.watch(key);
|
|
62
|
-
// const hashCount = await this.redisClient.hLen(key);
|
|
63
|
-
// if (hashCount + lockKey.offers.length > maximum) {
|
|
64
|
-
// throw new factory.errors.Argument('Event', 'maximumAttendeeCapacity exceeded');
|
|
65
|
-
// }
|
|
66
|
-
// await this.lock(lockKey);
|
|
67
31
|
}
|
|
68
32
|
}
|
|
69
33
|
/**
|
|
@@ -79,59 +43,11 @@ class StockHolderRepo {
|
|
|
79
43
|
startDate: lockKey.startDate,
|
|
80
44
|
hasTicketedSeat: lockKey.hasTicketedSeat
|
|
81
45
|
});
|
|
82
|
-
// const key = StockHolderRepo.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
|
|
83
|
-
// await this.checkIfConflicted({ key, eventId: lockKey.eventId, useMongoose });
|
|
84
46
|
if (useMongoose) {
|
|
85
47
|
return this.pendingReservationRepo.lock(lockKey);
|
|
86
48
|
}
|
|
87
49
|
else {
|
|
88
50
|
throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
|
|
89
|
-
// if (this.redisClient === undefined) {
|
|
90
|
-
// throw new factory.errors.Internal('redisClient required');
|
|
91
|
-
// }
|
|
92
|
-
// const value = lockKey.holder;
|
|
93
|
-
// const multi = this.redisClient.multi();
|
|
94
|
-
// const fields = lockKey.offers.map((offer) => StockHolderRepo.offer2field(offer, lockKey.hasTicketedSeat));
|
|
95
|
-
// // check uniqueness(2025-04-20~)
|
|
96
|
-
// const uniqueFields = [...new Set(fields)];
|
|
97
|
-
// if (uniqueFields.length !== fields.length) {
|
|
98
|
-
// throw new factory.errors.Argument('offers', 'offers must be unique');
|
|
99
|
-
// }
|
|
100
|
-
// fields.forEach((field) => {
|
|
101
|
-
// multi.hSetNX(key, field, value);
|
|
102
|
-
// });
|
|
103
|
-
// const results = await multi.expireAt(
|
|
104
|
-
// key,
|
|
105
|
-
// moment(lockKey.expires)
|
|
106
|
-
// .unix()
|
|
107
|
-
// )
|
|
108
|
-
// .exec();
|
|
109
|
-
// const lockedFields: string[] = [];
|
|
110
|
-
// if (Array.isArray(results)) {
|
|
111
|
-
// results.slice(0, fields.length)
|
|
112
|
-
// .forEach((r, index) => {
|
|
113
|
-
// if (r === 1 || (<any>r) === true) {
|
|
114
|
-
// lockedFields.push(fields[index]);
|
|
115
|
-
// }
|
|
116
|
-
// });
|
|
117
|
-
// }
|
|
118
|
-
// const lockedAll = lockedFields.length === fields.length;
|
|
119
|
-
// // expireAtReplyの検証も追加する(2023-04-19~)
|
|
120
|
-
// const expiredAll = results.slice(fields.length)
|
|
121
|
-
// .every((r) => (r === 1 || (<any>r) === true));
|
|
122
|
-
// if (!lockedAll || !expiredAll) {
|
|
123
|
-
// if (lockedFields.length > 0) {
|
|
124
|
-
// // 全て仮押さえできなければ仮押さえできたものは解除
|
|
125
|
-
// await this.redisClient.multi()
|
|
126
|
-
// .hDel(key, lockedFields)
|
|
127
|
-
// .exec();
|
|
128
|
-
// }
|
|
129
|
-
// if (!lockedAll) {
|
|
130
|
-
// throw new factory.errors.AlreadyInUse(factory.reservationType.EventReservation, ['ticketedSeat'], 'Already hold');
|
|
131
|
-
// } else {
|
|
132
|
-
// throw new factory.errors.Internal('timeout cannot be set unexpectedly');
|
|
133
|
-
// }
|
|
134
|
-
// }
|
|
135
51
|
}
|
|
136
52
|
}
|
|
137
53
|
/**
|
|
@@ -144,20 +60,11 @@ class StockHolderRepo {
|
|
|
144
60
|
startDate: params.startDate,
|
|
145
61
|
hasTicketedSeat: params.hasTicketedSeat
|
|
146
62
|
});
|
|
147
|
-
// const key = StockHolderRepo.createKey({ eventId: params.eventId, startDate: params.startDate });
|
|
148
|
-
// await this.checkIfConflicted({ key, eventId: params.eventId, useMongoose });
|
|
149
63
|
if (useMongoose) {
|
|
150
64
|
return this.pendingReservationRepo.unlock(params);
|
|
151
65
|
}
|
|
152
66
|
else {
|
|
153
67
|
throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
|
|
154
|
-
// if (this.redisClient === undefined) {
|
|
155
|
-
// throw new factory.errors.Internal('redisClient required');
|
|
156
|
-
// }
|
|
157
|
-
// const field = StockHolderRepo.offer2field(params.offer, params.hasTicketedSeat);
|
|
158
|
-
// await this.redisClient.multi()
|
|
159
|
-
// .hDel(key, field)
|
|
160
|
-
// .exec();
|
|
161
68
|
}
|
|
162
69
|
}
|
|
163
70
|
/**
|
|
@@ -174,16 +81,6 @@ class StockHolderRepo {
|
|
|
174
81
|
}
|
|
175
82
|
else {
|
|
176
83
|
throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
|
|
177
|
-
// if (this.redisClient === undefined) {
|
|
178
|
-
// throw new factory.errors.Internal('redisClient required');
|
|
179
|
-
// }
|
|
180
|
-
// const key = StockHolderRepo.createKey({ eventId: params.event.id, startDate: params.event.startDate });
|
|
181
|
-
// const reply = await this.redisClient.hLen(key);
|
|
182
|
-
// let fieldCount: number = 0;
|
|
183
|
-
// if (typeof reply === 'number') {
|
|
184
|
-
// fieldCount = Number(reply);
|
|
185
|
-
// }
|
|
186
|
-
// return fieldCount;
|
|
187
84
|
}
|
|
188
85
|
}
|
|
189
86
|
/**
|
|
@@ -200,12 +97,6 @@ class StockHolderRepo {
|
|
|
200
97
|
}
|
|
201
98
|
else {
|
|
202
99
|
throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
|
|
203
|
-
// if (this.redisClient === undefined) {
|
|
204
|
-
// throw new factory.errors.Internal('redisClient required');
|
|
205
|
-
// }
|
|
206
|
-
// const key = StockHolderRepo.createKey({ eventId: params.eventId, startDate: params.startDate });
|
|
207
|
-
// const field = StockHolderRepo.offer2field(params.offer, params.hasTicketedSeat);
|
|
208
|
-
// return this.redisClient.hGet(key, field);
|
|
209
100
|
}
|
|
210
101
|
}
|
|
211
102
|
async searchHolders(params) {
|
|
@@ -223,32 +114,8 @@ class StockHolderRepo {
|
|
|
223
114
|
}
|
|
224
115
|
else {
|
|
225
116
|
throw new factory_1.factory.errors.NotImplemented('useRedis discontinued.');
|
|
226
|
-
// if (this.redisClient === undefined) {
|
|
227
|
-
// throw new factory.errors.Internal('redisClient required');
|
|
228
|
-
// }
|
|
229
|
-
// const key = StockHolderRepo.createKey({ eventId: params.eventId, startDate: params.startDate });
|
|
230
|
-
// const fields = params.offers.map((o) => {
|
|
231
|
-
// return StockHolderRepo.offer2field(o, params.hasTicketedSeat);
|
|
232
|
-
// });
|
|
233
|
-
// // Array reply: list of values associated with the given fields, in the same order as they are requested.
|
|
234
|
-
// const result = await this.redisClient.hmGet(key, fields);
|
|
235
|
-
// if (!Array.isArray(result)) {
|
|
236
|
-
// throw new factory.errors.Internal(`searchAvailability got non-array: ${typeof result}`);
|
|
237
|
-
// }
|
|
238
|
-
// // そのまま返却(2023-04-17~)
|
|
239
|
-
// return result;
|
|
240
117
|
}
|
|
241
118
|
}
|
|
242
|
-
// public async checkIfConflicted(params: {
|
|
243
|
-
// eventId: string;
|
|
244
|
-
// startDate: Date;
|
|
245
|
-
// }): Promise<void> {
|
|
246
|
-
// const redisKeyExists = await this.redisKeyExists(params);
|
|
247
|
-
// const mongoDocExists = await this.pendingReservationRepo.docExists(params);
|
|
248
|
-
// if (redisKeyExists && mongoDocExists) {
|
|
249
|
-
// throw new factory.errors.Internal(`repository conflicted. eventId:${params.eventId}`);
|
|
250
|
-
// }
|
|
251
|
-
// }
|
|
252
119
|
/**
|
|
253
120
|
* 新リポジトリを使用するかどうか
|
|
254
121
|
*/
|
|
@@ -258,19 +125,6 @@ class StockHolderRepo {
|
|
|
258
125
|
}
|
|
259
126
|
// always use mongo(2025-08-17~)
|
|
260
127
|
return true;
|
|
261
|
-
// let useMongoose = false;
|
|
262
|
-
// const redisKeyExists = await this.redisKeyExists(params);
|
|
263
|
-
// if (redisKeyExists) {
|
|
264
|
-
// useMongoose = false;
|
|
265
|
-
// } else {
|
|
266
|
-
// // redis keyが存在しなければmongo利用
|
|
267
|
-
// useMongoose = true;
|
|
268
|
-
// }
|
|
269
|
-
// // check confliction for test
|
|
270
|
-
// if (USE_STOCK_HOLDER_CHECK_CONFLICT) {
|
|
271
|
-
// await this.checkIfConflicted(params);
|
|
272
|
-
// }
|
|
273
|
-
// return useMongoose;
|
|
274
128
|
}
|
|
275
129
|
}
|
|
276
130
|
exports.StockHolderRepo = StockHolderRepo;
|
|
@@ -37,21 +37,6 @@ export declare class PlaceOrderRepo {
|
|
|
37
37
|
}): Promise<(Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, IKeyOfProjection> & {
|
|
38
38
|
id: string;
|
|
39
39
|
})[]>;
|
|
40
|
-
/**
|
|
41
|
-
* 進行中取引に保管された採用済決済方法を検索する
|
|
42
|
-
*/
|
|
43
|
-
findInProgressPaymentMethodId(params: {
|
|
44
|
-
id: string;
|
|
45
|
-
}): Promise<factory.transaction.placeOrder.IPaymentMethodByPaymentUrl | undefined>;
|
|
46
|
-
/**
|
|
47
|
-
* 取引の確認番号を検索する
|
|
48
|
-
*/
|
|
49
|
-
findInProgressConfirmationNumberById(params: {
|
|
50
|
-
id: string;
|
|
51
|
-
status: {
|
|
52
|
-
$in: factory.transactionStatusType[];
|
|
53
|
-
};
|
|
54
|
-
}): Promise<string | undefined>;
|
|
55
40
|
/**
|
|
56
41
|
* 取引期限変更
|
|
57
42
|
*/
|
|
@@ -60,28 +45,6 @@ export declare class PlaceOrderRepo {
|
|
|
60
45
|
id: string;
|
|
61
46
|
expires: Date;
|
|
62
47
|
}): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* 取引オブジェクトを更新
|
|
65
|
-
* 注文名称など
|
|
66
|
-
*/
|
|
67
|
-
updateObject(params: {
|
|
68
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
69
|
-
id: string;
|
|
70
|
-
object?: {
|
|
71
|
-
name?: string;
|
|
72
|
-
};
|
|
73
|
-
}): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* 特定の進行中取引を更新する(汎用)
|
|
76
|
-
*/
|
|
77
|
-
findByIdAndUpdateInProgress(params: {
|
|
78
|
-
id: string;
|
|
79
|
-
update: {
|
|
80
|
-
$set?: {
|
|
81
|
-
'object.paymentMethods'?: factory.transaction.placeOrder.IPaymentMethodByPaymentUrl;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
}): Promise<void>;
|
|
85
48
|
/**
|
|
86
49
|
* 進行中取引のobjectに注文番号を保管する
|
|
87
50
|
*/
|
|
@@ -91,13 +54,6 @@ export declare class PlaceOrderRepo {
|
|
|
91
54
|
}): Promise<{
|
|
92
55
|
modifiedCount: number;
|
|
93
56
|
}>;
|
|
94
|
-
saveConfirmationNumberIfNotExist(params: {
|
|
95
|
-
id: string;
|
|
96
|
-
status: {
|
|
97
|
-
$in: factory.transactionStatusType[];
|
|
98
|
-
};
|
|
99
|
-
confirmationNumber: string;
|
|
100
|
-
}): Promise<void>;
|
|
101
57
|
/**
|
|
102
58
|
* 進行中の注文取引を取得する
|
|
103
59
|
*/
|
|
@@ -125,9 +81,10 @@ export declare class PlaceOrderRepo {
|
|
|
125
81
|
object: {
|
|
126
82
|
orderDate: Date;
|
|
127
83
|
orderNumber: string;
|
|
84
|
+
confirmationNumber: string;
|
|
128
85
|
};
|
|
129
86
|
result: factory.transaction.IResult<factory.transactionType.PlaceOrder>;
|
|
130
|
-
potentialActions
|
|
87
|
+
potentialActions?: factory.transaction.IPotentialActions<factory.transactionType.PlaceOrder>;
|
|
131
88
|
}): Promise<void>;
|
|
132
89
|
/**
|
|
133
90
|
* 取引を中止する
|
|
@@ -186,22 +186,6 @@ class PlaceOrderRepo {
|
|
|
186
186
|
.lean()
|
|
187
187
|
.exec();
|
|
188
188
|
}
|
|
189
|
-
/**
|
|
190
|
-
* 進行中取引に保管された採用済決済方法を検索する
|
|
191
|
-
*/
|
|
192
|
-
async findInProgressPaymentMethodId(params) {
|
|
193
|
-
const doc = await this.transactionModel.findOne({
|
|
194
|
-
_id: { $eq: params.id },
|
|
195
|
-
typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder },
|
|
196
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
197
|
-
}, { 'object.paymentMethods': 1 })
|
|
198
|
-
.lean() // 2024-08-26~
|
|
199
|
-
.exec();
|
|
200
|
-
if (doc === null) {
|
|
201
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${factory_1.factory.transactionType.PlaceOrder} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
202
|
-
}
|
|
203
|
-
return doc.object.paymentMethods;
|
|
204
|
-
}
|
|
205
189
|
// /**
|
|
206
190
|
// * 取引の注文番号を検索する
|
|
207
191
|
// */
|
|
@@ -226,22 +210,31 @@ class PlaceOrderRepo {
|
|
|
226
210
|
// }
|
|
227
211
|
// return doc.object.orderNumber;
|
|
228
212
|
// }
|
|
229
|
-
/**
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
async findInProgressConfirmationNumberById(params
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
213
|
+
// /**
|
|
214
|
+
// * 取引の確認番号を検索する
|
|
215
|
+
// */
|
|
216
|
+
// public async findInProgressConfirmationNumberById(params: {
|
|
217
|
+
// id: string;
|
|
218
|
+
// status: { $in: factory.transactionStatusType[] };
|
|
219
|
+
// }): Promise<string | undefined> {
|
|
220
|
+
// const doc = await this.transactionModel.findOne(
|
|
221
|
+
// {
|
|
222
|
+
// _id: { $eq: params.id },
|
|
223
|
+
// typeOf: { $eq: factory.transactionType.PlaceOrder },
|
|
224
|
+
// status: { $in: params.status.$in }
|
|
225
|
+
// },
|
|
226
|
+
// { 'object.confirmationNumber': 1 }
|
|
227
|
+
// )
|
|
228
|
+
// .lean<{ object: Pick<factory.transaction.placeOrder.IObject, 'confirmationNumber'> }>() // 2024-08-26~
|
|
229
|
+
// .exec();
|
|
230
|
+
// if (doc === null) {
|
|
231
|
+
// throw new factory.errors.NotFound(
|
|
232
|
+
// this.transactionModel.modelName,
|
|
233
|
+
// `${factory.transactionType.PlaceOrder} ${params.status.$in.join(' or ')} not found`
|
|
234
|
+
// );
|
|
235
|
+
// }
|
|
236
|
+
// return doc.object.confirmationNumber;
|
|
237
|
+
// }
|
|
245
238
|
/**
|
|
246
239
|
* 取引期限変更
|
|
247
240
|
*/
|
|
@@ -263,47 +256,6 @@ class PlaceOrderRepo {
|
|
|
263
256
|
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${params.typeOf} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
264
257
|
}
|
|
265
258
|
}
|
|
266
|
-
/**
|
|
267
|
-
* 取引オブジェクトを更新
|
|
268
|
-
* 注文名称など
|
|
269
|
-
*/
|
|
270
|
-
async updateObject(params) {
|
|
271
|
-
const doc = await this.transactionModel.findOneAndUpdate({
|
|
272
|
-
_id: { $eq: params.id },
|
|
273
|
-
typeOf: { $eq: params.typeOf },
|
|
274
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
275
|
-
}, {
|
|
276
|
-
$set: {
|
|
277
|
-
...(typeof params.object?.name === 'string') ? { 'object.name': params.object.name } : undefined
|
|
278
|
-
}
|
|
279
|
-
}, {
|
|
280
|
-
projection: { _id: 1 }
|
|
281
|
-
})
|
|
282
|
-
.lean()
|
|
283
|
-
.exec();
|
|
284
|
-
if (doc === null) {
|
|
285
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${params.typeOf} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* 特定の進行中取引を更新する(汎用)
|
|
290
|
-
*/
|
|
291
|
-
async findByIdAndUpdateInProgress(params) {
|
|
292
|
-
await this.transactionModel.findOneAndUpdate({
|
|
293
|
-
_id: { $eq: params.id },
|
|
294
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
295
|
-
}, params.update, {
|
|
296
|
-
// new: true,
|
|
297
|
-
projection: { _id: 1 }
|
|
298
|
-
})
|
|
299
|
-
.lean()
|
|
300
|
-
.exec()
|
|
301
|
-
.then((doc) => {
|
|
302
|
-
if (doc === null) {
|
|
303
|
-
throw new factory_1.factory.errors.ArgumentNull(this.transactionModel.modelName);
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
259
|
/**
|
|
308
260
|
* 進行中取引のobjectに注文番号を保管する
|
|
309
261
|
*/
|
|
@@ -316,15 +268,22 @@ class PlaceOrderRepo {
|
|
|
316
268
|
.exec();
|
|
317
269
|
return { modifiedCount: result.modifiedCount };
|
|
318
270
|
}
|
|
319
|
-
async saveConfirmationNumberIfNotExist(params
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
271
|
+
// public async saveConfirmationNumberIfNotExist(params: {
|
|
272
|
+
// id: string;
|
|
273
|
+
// status: { $in: factory.transactionStatusType[] };
|
|
274
|
+
// confirmationNumber: string;
|
|
275
|
+
// }): Promise<void> {
|
|
276
|
+
// await this.transactionModel.updateOne(
|
|
277
|
+
// {
|
|
278
|
+
// _id: { $eq: params.id },
|
|
279
|
+
// // status: { $eq: factory.transactionStatusType.InProgress },
|
|
280
|
+
// status: { $in: params.status.$in },
|
|
281
|
+
// 'object.confirmationNumber': { $exists: false }
|
|
282
|
+
// },
|
|
283
|
+
// { $set: { 'object.confirmationNumber': params.confirmationNumber } }
|
|
284
|
+
// )
|
|
285
|
+
// .exec();
|
|
286
|
+
// }
|
|
328
287
|
/**
|
|
329
288
|
* 進行中の注文取引を取得する
|
|
330
289
|
*/
|
|
@@ -441,8 +400,9 @@ class PlaceOrderRepo {
|
|
|
441
400
|
endDate,
|
|
442
401
|
'object.orderDate': params.object.orderDate, // add(2026-06-15~)
|
|
443
402
|
'object.orderNumber': params.object.orderNumber, // add(2026-06-27~)
|
|
403
|
+
'object.confirmationNumber': params.object.confirmationNumber, // add(2026-07-08~)
|
|
444
404
|
result: params.result, // resultを更新
|
|
445
|
-
potentialActions: params.potentialActions //
|
|
405
|
+
...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
446
406
|
}, {
|
|
447
407
|
new: true,
|
|
448
408
|
projection: { _id: 1 }
|
|
@@ -144,7 +144,7 @@ export declare class TransactionRepo {
|
|
|
144
144
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
145
145
|
status: factory.transactionStatusType;
|
|
146
146
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
147
|
-
potentialActions?:
|
|
147
|
+
potentialActions?: undefined;
|
|
148
148
|
} & {
|
|
149
149
|
_id: import("mongoose").Types.ObjectId;
|
|
150
150
|
} & {
|
|
@@ -182,7 +182,7 @@ export declare class TransactionRepo {
|
|
|
182
182
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
183
183
|
status: factory.transactionStatusType;
|
|
184
184
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
185
|
-
potentialActions?:
|
|
185
|
+
potentialActions?: undefined;
|
|
186
186
|
} & {
|
|
187
187
|
_id: import("mongoose").Types.ObjectId;
|
|
188
188
|
} & {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransactionNumberCounterRepo = void 0;
|
|
4
|
-
// import { RedisClientType } from 'redis';
|
|
5
4
|
const errorHandler_1 = require("../errorHandler");
|
|
6
5
|
const factory_1 = require("../factory");
|
|
7
6
|
const transactionNumber_1 = require("./mongoose/schemas/transactionNumber");
|
|
@@ -10,44 +9,11 @@ const MAX_RETRY_INCREMENT = 1;
|
|
|
10
9
|
* 取引番号カウンターリポジトリ
|
|
11
10
|
*/
|
|
12
11
|
class TransactionNumberCounterRepo {
|
|
13
|
-
// private readonly redisClient: RedisClientType;
|
|
14
12
|
transactionNumberModel;
|
|
15
13
|
constructor(params) {
|
|
16
14
|
const { connection } = params;
|
|
17
|
-
// this.redisClient = redisClient;
|
|
18
15
|
this.transactionNumberModel = connection.model(transactionNumber_1.modelName, (0, transactionNumber_1.createSchema)());
|
|
19
16
|
}
|
|
20
|
-
// public async incrementByRedis(params: {
|
|
21
|
-
// identifier: string;
|
|
22
|
-
// includedInDataCatalog: {
|
|
23
|
-
// identifier: DataCatalogIdentifier;
|
|
24
|
-
// };
|
|
25
|
-
// expires: Date;
|
|
26
|
-
// }): Promise<number> {
|
|
27
|
-
// // const now = moment();
|
|
28
|
-
// const { expires } = params;
|
|
29
|
-
// const key = `${params.includedInDataCatalog.identifier}:${params.identifier}`;
|
|
30
|
-
// // const TTL = moment(expires)
|
|
31
|
-
// // .diff(now, 'seconds');
|
|
32
|
-
// const [incrReply, expireAtReply] = await this.redisClient.multi()
|
|
33
|
-
// .incr(key)
|
|
34
|
-
// // .expire(key, TTL)
|
|
35
|
-
// .expireAt(key, expires)
|
|
36
|
-
// .exec();
|
|
37
|
-
// // tslint:disable-next-line:no-single-line-block-comment
|
|
38
|
-
// /* istanbul ignore else: please write tests */
|
|
39
|
-
// if (typeof incrReply !== 'number') {
|
|
40
|
-
// // 基本的にありえないフロー
|
|
41
|
-
// throw new factory.errors.Internal('transaction number not incremented unexpectedly');
|
|
42
|
-
// }
|
|
43
|
-
// // expireAtReplyの検証も追加する(2023-04-19~)
|
|
44
|
-
// const expiredSet = expireAtReply === 1 || <any>expireAtReply === true;
|
|
45
|
-
// if (!expiredSet) {
|
|
46
|
-
// // 基本的にありえないフロー
|
|
47
|
-
// throw new factory.errors.Internal('transaction number expiration not set unexpectedly');
|
|
48
|
-
// }
|
|
49
|
-
// return incrReply;
|
|
50
|
-
// }
|
|
51
17
|
async incrementByMongo(params) {
|
|
52
18
|
const now = new Date();
|
|
53
19
|
const dataFeedExpires = params.expires;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { createClient } from 'redis';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
3
|
interface IProcessKey {
|
|
4
4
|
typeOf: factory.transactionType;
|
|
@@ -13,6 +13,7 @@ interface IProcessKey {
|
|
|
13
13
|
interface IOptions {
|
|
14
14
|
lockExpiresInSeconds: number;
|
|
15
15
|
}
|
|
16
|
+
type RedisClientType = ReturnType<typeof createClient>;
|
|
16
17
|
/**
|
|
17
18
|
* 取引プロセスリポジトリ
|
|
18
19
|
*/
|
|
@@ -16,10 +16,8 @@ const DEFAULT_LOCK_EXPIRES = 120;
|
|
|
16
16
|
class TransactionProcessRepo {
|
|
17
17
|
concurrentLockRepo;
|
|
18
18
|
options;
|
|
19
|
-
// private readonly redisClient: RedisClientType;
|
|
20
19
|
constructor(redisClient, options) {
|
|
21
20
|
this.concurrentLockRepo = new concurrentLock_1.ConcurrentLockRepo({ redisClient });
|
|
22
|
-
// this.redisClient = redisClient;
|
|
23
21
|
this.options = options;
|
|
24
22
|
}
|
|
25
23
|
static CREATE_REDIS_KEY(params) {
|
|
@@ -44,16 +42,6 @@ class TransactionProcessRepo {
|
|
|
44
42
|
catch (_error) {
|
|
45
43
|
throw new factory_1.factory.errors.AlreadyInUse(params.typeOf, [], 'Another transaction process in progress');
|
|
46
44
|
}
|
|
47
|
-
// const results = await this.redisClient.multi()
|
|
48
|
-
// .setNX(key, '1')
|
|
49
|
-
// .expire(key, ttl)
|
|
50
|
-
// .exec();
|
|
51
|
-
// debug('locked,', params.id, results);
|
|
52
|
-
// if (Array.isArray(results) && (results[0] === 1 || (<any>results)[0] === true)) {
|
|
53
|
-
// return;
|
|
54
|
-
// } else {
|
|
55
|
-
// throw new factory.errors.AlreadyInUse(params.typeOf, [], 'Another transaction process in progress');
|
|
56
|
-
// }
|
|
57
45
|
}
|
|
58
46
|
async unlock(params) {
|
|
59
47
|
const key = TransactionProcessRepo.CREATE_REDIS_KEY(params);
|
|
@@ -62,7 +50,6 @@ class TransactionProcessRepo {
|
|
|
62
50
|
about: { identifier: key, typeOf: 'Thing' },
|
|
63
51
|
audience: { identifier: '1', typeOf: 'Audience' }
|
|
64
52
|
});
|
|
65
|
-
// await this.redisClient.del([key]);
|
|
66
53
|
}
|
|
67
54
|
}
|
|
68
55
|
exports.TransactionProcessRepo = TransactionProcessRepo;
|
|
@@ -15,6 +15,7 @@ import type { CheckMovieTicketActionRepo } from './repo/action/checkMovieTicket'
|
|
|
15
15
|
import type { CheckThingActionRepo } from './repo/action/checkThing';
|
|
16
16
|
import type { PayActionRepo } from './repo/action/pay';
|
|
17
17
|
import type { RefundActionRepo } from './repo/action/refund';
|
|
18
|
+
import type { AsyncActionRepo } from './repo/asyncAction';
|
|
18
19
|
import type { AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
19
20
|
import type { AggregateActionRepo } from './repo/aggregateAction';
|
|
20
21
|
import type { AggregateOfferRepo } from './repo/aggregateOffer';
|
|
@@ -470,6 +471,10 @@ export type Task = TaskRepo;
|
|
|
470
471
|
export declare namespace Task {
|
|
471
472
|
function createInstance(...params: ConstructorParameters<typeof TaskRepo>): Promise<TaskRepo>;
|
|
472
473
|
}
|
|
474
|
+
export type AsyncAction = AsyncActionRepo;
|
|
475
|
+
export declare namespace AsyncAction {
|
|
476
|
+
function createInstance(...params: ConstructorParameters<typeof AsyncActionRepo>): Promise<AsyncActionRepo>;
|
|
477
|
+
}
|
|
473
478
|
export type Ticket = TicketRepo;
|
|
474
479
|
export declare namespace Ticket {
|
|
475
480
|
function createInstance(...params: ConstructorParameters<typeof TicketRepo>): Promise<TicketRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.place = exports.Person = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Authorization = exports.CategoryCode = exports.assetTransaction = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AggregateAction = exports.AdditionalProperty = exports.action = exports.Action = exports.AccountTitle = exports.AccountingReport = exports.AcceptedOffer = void 0;
|
|
4
|
-
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = void 0;
|
|
4
|
+
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -989,6 +989,17 @@ var Task;
|
|
|
989
989
|
}
|
|
990
990
|
Task.createInstance = createInstance;
|
|
991
991
|
})(Task || (exports.Task = Task = {}));
|
|
992
|
+
var AsyncAction;
|
|
993
|
+
(function (AsyncAction) {
|
|
994
|
+
let repo;
|
|
995
|
+
async function createInstance(...params) {
|
|
996
|
+
if (repo === undefined) {
|
|
997
|
+
repo = (await import('./repo/asyncAction.js')).AsyncActionRepo;
|
|
998
|
+
}
|
|
999
|
+
return new repo(...params);
|
|
1000
|
+
}
|
|
1001
|
+
AsyncAction.createInstance = createInstance;
|
|
1002
|
+
})(AsyncAction || (exports.AsyncAction = AsyncAction = {}));
|
|
992
1003
|
var Ticket;
|
|
993
1004
|
(function (Ticket) {
|
|
994
1005
|
let repo;
|
|
@@ -167,7 +167,7 @@ function publishPaymentUrl(params, options) {
|
|
|
167
167
|
}
|
|
168
168
|
const actionResult = {
|
|
169
169
|
paymentMethodId: result.paymentMethodId,
|
|
170
|
-
paymentUrl: result.paymentUrl
|
|
170
|
+
// paymentUrl: result.paymentUrl // result.paymentUrlは廃止(2026-07-14~)
|
|
171
171
|
};
|
|
172
172
|
await repos.acceptPayAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
|
|
173
173
|
return result;
|
|
@@ -20,7 +20,7 @@ export declare function createStartParams(params: factory.assetTransaction.pay.I
|
|
|
20
20
|
*/
|
|
21
21
|
id: string;
|
|
22
22
|
}[];
|
|
23
|
-
instrument: factory.action.trade.pay.
|
|
23
|
+
instrument: factory.action.trade.pay.IPayTransactionInstrument[];
|
|
24
24
|
}, options: {
|
|
25
25
|
checkedAction: {
|
|
26
26
|
id: string;
|