@chevre/domain 24.0.0-alpha.2 → 24.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/repo/action/acceptCOAOffer.d.ts +23 -0
- package/lib/chevre/repo/action/acceptCOAOffer.js +64 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +8 -0
- package/lib/chevre/repo/action/acceptPay.js +13 -0
- package/lib/chevre/repo/action/actionProcess.d.ts +115 -0
- package/lib/chevre/repo/action/actionProcess.js +293 -0
- package/lib/chevre/repo/action/authorizeOffer.d.ts +21 -0
- package/lib/chevre/repo/action/authorizeOffer.js +85 -0
- package/lib/chevre/repo/action/checkMovieTicket.d.ts +111 -0
- package/lib/chevre/repo/action/checkMovieTicket.js +200 -0
- package/lib/chevre/repo/action/checkThing.d.ts +8 -0
- package/lib/chevre/repo/action/checkThing.js +13 -0
- package/lib/chevre/repo/action.d.ts +9 -249
- package/lib/chevre/repo/action.js +308 -708
- package/lib/chevre/repo/aggregateAction.d.ts +102 -0
- package/lib/chevre/repo/aggregateAction.js +379 -0
- package/lib/chevre/repo/mongoose/schemas/transaction.js +31 -0
- package/lib/chevre/repo/orderInTransaction.d.ts +8 -0
- package/lib/chevre/repo/orderInTransaction.js +16 -2
- package/lib/chevre/repo/orderNumber.d.ts +3 -2
- package/lib/chevre/repo/orderNumber.js +23 -28
- package/lib/chevre/repo/transaction/moneyTransfer.d.ts +61 -0
- package/lib/chevre/repo/transaction/moneyTransfer.js +379 -0
- package/lib/chevre/repo/transaction/placeOrder.d.ts +140 -0
- package/lib/chevre/repo/transaction/placeOrder.js +528 -0
- package/lib/chevre/repo/transaction/returnOrder.d.ts +45 -0
- package/lib/chevre/repo/transaction/returnOrder.js +341 -0
- package/lib/chevre/repo/transaction.d.ts +1 -125
- package/lib/chevre/repo/transaction.js +726 -632
- package/lib/chevre/repository.d.ts +49 -0
- package/lib/chevre/repository.js +107 -2
- package/lib/chevre/service/aggregation/system.d.ts +10 -10
- package/lib/chevre/service/aggregation/system.js +9 -9
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +5 -4
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +5 -2
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +3 -3
- package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +51 -3
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +58 -21
- package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.d.ts +10 -0
- package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.js +88 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +55 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.js +56 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +3 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.js +1 -11
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/pay/start.js +8 -132
- package/lib/chevre/service/notification/triggerWebhook.d.ts +7 -6
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize.js +3 -3
- package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +2 -2
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +0 -2
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -0
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -2
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +3 -3
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +16 -5
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +7 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +6 -4
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +3 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +21 -13
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +19 -10
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +2 -2
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +6 -3
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.d.ts +2 -2
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +4 -1
- package/lib/chevre/service/offer/product.d.ts +3 -3
- package/lib/chevre/service/offer/product.js +4 -4
- package/lib/chevre/service/order/confirmPayTransaction.d.ts +0 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +1 -0
- package/lib/chevre/service/order/findPlaceOrderTransaction.d.ts +2 -2
- package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.d.ts +16 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +97 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.d.ts +21 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +86 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +22 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +112 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +22 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.js +74 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +25 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +111 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.d.ts +16 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.js +74 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +8 -30
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +37 -348
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.d.ts +6 -7
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.d.ts +6 -5
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +7 -6
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/payOrder.d.ts +2 -2
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -2
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -1
- package/lib/chevre/service/order/placeOrder.d.ts +13 -12
- package/lib/chevre/service/order/returnOrder.d.ts +2 -2
- package/lib/chevre/service/order/returnOrder.js +1 -1
- package/lib/chevre/service/order/sendOrder.d.ts +6 -6
- package/lib/chevre/service/order/sendOrder.js +10 -8
- package/lib/chevre/service/order.d.ts +3 -6
- package/lib/chevre/service/order.js +3 -9
- package/lib/chevre/service/payment/any/{fixOrderAsNeeded.d.ts → authorize/fixOrderAsNeeded.d.ts} +6 -6
- package/lib/chevre/service/payment/any/{fixOrderAsNeeded.js → authorize/fixOrderAsNeeded.js} +5 -8
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +3 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +1 -1
- package/lib/chevre/service/payment/any/authorize.d.ts +92 -0
- package/lib/chevre/service/payment/any/authorize.js +225 -0
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +43 -0
- package/lib/chevre/service/payment/any/findAcceptAction.js +94 -0
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +41 -0
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +83 -0
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +45 -0
- package/lib/chevre/service/payment/any/findCheckAction.js +89 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +28 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +185 -0
- package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +7 -3
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +3 -0
- package/lib/chevre/service/payment/any/processVoidPayTransaction.d.ts +29 -0
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +125 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.d.ts +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +66 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +133 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +31 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +38 -0
- package/lib/chevre/service/payment/any.d.ts +8 -305
- package/lib/chevre/service/payment/any.js +17 -857
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +2 -0
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +3 -3
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +3 -3
- package/lib/chevre/service/payment/movieTicket/validation.d.ts +11 -10
- package/lib/chevre/service/payment/movieTicket/validation.js +19 -15
- package/lib/chevre/service/report/telemetry.d.ts +4 -0
- package/lib/chevre/service/report/telemetry.js +7 -12
- package/lib/chevre/service/task/acceptCOAOffer.js +11 -6
- package/lib/chevre/service/task/authorizePayment.js +6 -2
- package/lib/chevre/service/task/checkMovieTicket.js +3 -3
- package/lib/chevre/service/task/checkResource.js +2 -2
- package/lib/chevre/service/task/confirmPayTransaction.js +2 -2
- package/lib/chevre/service/task/deleteTransaction.js +7 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -2
- package/lib/chevre/service/task/payment/payByTask.d.ts +14 -12
- package/lib/chevre/service/task/placeOrder.js +6 -4
- package/lib/chevre/service/task/publishPaymentUrl.js +8 -4
- package/lib/chevre/service/task/returnOrder.js +4 -4
- package/lib/chevre/service/task/returnPayTransaction.js +4 -3
- package/lib/chevre/service/task/sendOrder.js +4 -4
- package/lib/chevre/service/task/voidMoneyTransferTransaction.js +6 -3
- package/lib/chevre/service/task/voidPayTransaction.js +4 -2
- package/lib/chevre/service/task/voidRegisterServiceTransaction.js +3 -3
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -3
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +6 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +56 -14
- package/lib/chevre/service/transaction/moneyTransfer.d.ts +5 -5
- package/lib/chevre/service/transaction/moneyTransfer.js +5 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +10 -9
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.d.ts +7 -6
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/{publishOrderNumberIfNotExist.d.ts → issueOrderNumberIfNotExist.d.ts} +4 -4
- package/lib/chevre/service/transaction/placeOrder/{publishOrderNumberIfNotExist.js → issueOrderNumberIfNotExist.js} +21 -13
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +3 -3
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +3 -3
- package/lib/chevre/service/transaction/placeOrder/start.js +2 -2
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +23 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +126 -0
- package/lib/chevre/service/transaction/placeOrder.d.ts +2 -1
- package/lib/chevre/service/transaction/placeOrder.js +3 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder.d.ts +16 -14
- package/lib/chevre/service/transaction/returnOrder.js +4 -4
- package/lib/chevre/service/transaction.d.ts +9 -21
- package/lib/chevre/service/transaction.js +5 -111
- package/package.json +4 -8
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
2
|
import type { ActionRepo } from '../../../repo/action';
|
|
3
|
+
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
3
4
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
4
5
|
import type { EventRepo } from '../../../repo/event';
|
|
5
6
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -38,6 +39,7 @@ declare function authorize(params: factory.assetTransaction.pay.IStartParamsWith
|
|
|
38
39
|
};
|
|
39
40
|
}): (repos: {
|
|
40
41
|
action: ActionRepo;
|
|
42
|
+
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
41
43
|
accountingReport: AccountingReportRepo;
|
|
42
44
|
credentials: CredentialsRepo;
|
|
43
45
|
event: EventRepo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
2
2
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
3
3
|
import type { EventRepo } from '../../../repo/event';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -8,7 +8,7 @@ import * as factory from '../../../factory';
|
|
|
8
8
|
import { Settings } from '../../../settings';
|
|
9
9
|
import { ICheckResult } from './processPurchaseNumberAuth';
|
|
10
10
|
interface ICheckOperationRepos {
|
|
11
|
-
|
|
11
|
+
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
12
12
|
credentials: CredentialsRepo;
|
|
13
13
|
event: EventRepo;
|
|
14
14
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
@@ -22,4 +22,4 @@ type ICheckOperation<T> = (repos: ICheckOperationRepos, settings: Settings) => P
|
|
|
22
22
|
declare function checkMovieTicket(params: factory.action.check.paymentMethod.movieTicket.IAttributes): ICheckOperation<{
|
|
23
23
|
result: ICheckResult;
|
|
24
24
|
}>;
|
|
25
|
-
export { checkMovieTicket };
|
|
25
|
+
export { ICheckOperationRepos, checkMovieTicket };
|
|
@@ -65,7 +65,7 @@ function checkMovieTicket(params) {
|
|
|
65
65
|
? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } // タスク関連付け(2024-05-21~)
|
|
66
66
|
: undefined
|
|
67
67
|
};
|
|
68
|
-
const action = await repos.
|
|
68
|
+
const action = await repos.checkMovieTicketAction.start(actionAttributes);
|
|
69
69
|
let processPurchaseNumberAuthResult;
|
|
70
70
|
let recipe;
|
|
71
71
|
try {
|
|
@@ -99,7 +99,7 @@ function checkMovieTicket(params) {
|
|
|
99
99
|
// アクション保管用のエラーと両方保管(2024-05-22~)
|
|
100
100
|
const errors = [(0, errorHandler_1.handleMvtkReserveError)(error), error];
|
|
101
101
|
try {
|
|
102
|
-
await repos.
|
|
102
|
+
await repos.checkMovieTicketAction.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error: errors });
|
|
103
103
|
}
|
|
104
104
|
catch (__) {
|
|
105
105
|
// 失敗したら仕方ない
|
|
@@ -107,7 +107,7 @@ function checkMovieTicket(params) {
|
|
|
107
107
|
throw errors[0];
|
|
108
108
|
}
|
|
109
109
|
const result = {};
|
|
110
|
-
await repos.
|
|
110
|
+
await repos.checkMovieTicketAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result, recipe });
|
|
111
111
|
return { result: processPurchaseNumberAuthResult };
|
|
112
112
|
};
|
|
113
113
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
2
2
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
3
3
|
import type { EventRepo } from '../../../repo/event';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -7,6 +7,15 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
|
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
8
|
import * as factory from '../../../factory';
|
|
9
9
|
import { Settings } from '../../../settings';
|
|
10
|
+
export interface IValidateMovieTicketRepos {
|
|
11
|
+
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
12
|
+
credentials: CredentialsRepo;
|
|
13
|
+
event: EventRepo;
|
|
14
|
+
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
15
|
+
paymentService: PaymentServiceRepo;
|
|
16
|
+
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
17
|
+
task: TaskRepo;
|
|
18
|
+
}
|
|
10
19
|
export declare function validateMovieTicket(params: factory.assetTransaction.pay.IStartParamsWithoutDetail, paymentServiceId: string, checkedAction: {
|
|
11
20
|
id: string;
|
|
12
21
|
}, purpose: {
|
|
@@ -14,14 +23,6 @@ export declare function validateMovieTicket(params: factory.assetTransaction.pay
|
|
|
14
23
|
* placeOrder ID
|
|
15
24
|
*/
|
|
16
25
|
id?: string;
|
|
17
|
-
}): (repos: {
|
|
18
|
-
action: ActionRepo;
|
|
19
|
-
credentials: CredentialsRepo;
|
|
20
|
-
event: EventRepo;
|
|
21
|
-
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
22
|
-
paymentService: PaymentServiceRepo;
|
|
23
|
-
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
24
|
-
task: TaskRepo;
|
|
25
|
-
}, settings: Settings) => Promise<{
|
|
26
|
+
}): (repos: IValidateMovieTicketRepos, settings: Settings) => Promise<{
|
|
26
27
|
accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
|
|
27
28
|
}>;
|
|
@@ -139,24 +139,26 @@ function checkByIdentifierIfNotYet(params) {
|
|
|
139
139
|
}
|
|
140
140
|
const specifiedCheckedActionId = params.checkedAction?.id;
|
|
141
141
|
if (typeof specifiedCheckedActionId === 'string' && specifiedCheckedActionId !== '') {
|
|
142
|
-
alreadyCheckedAction = (await repos.
|
|
143
|
-
limit: 1,
|
|
144
|
-
page: 1,
|
|
145
|
-
id: { $in: [specifiedCheckedActionId] },
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions({
|
|
143
|
+
// limit: 1,
|
|
144
|
+
// page: 1,
|
|
145
|
+
// id: { $in: [specifiedCheckedActionId] },
|
|
146
|
+
id: specifiedCheckedActionId,
|
|
147
|
+
// actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
148
|
+
// ...(typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined
|
|
149
|
+
...(typeof placeOrderId === 'string') ? { purpose: { id: placeOrderId } } : undefined
|
|
150
|
+
})).shift();
|
|
149
151
|
if (alreadyCheckedAction === undefined) {
|
|
150
152
|
throw new factory.errors.NotFound(factory.actionType.CheckAction);
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
else {
|
|
154
|
-
alreadyCheckedAction = (await repos.
|
|
155
|
-
limit: 1,
|
|
156
|
-
page: 1,
|
|
156
|
+
alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions({
|
|
157
|
+
// limit: 1,
|
|
158
|
+
// page: 1,
|
|
157
159
|
sort: { startDate: factory.sortType.Descending },
|
|
158
|
-
typeOf: { $eq: factory.actionType.CheckAction },
|
|
159
|
-
actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
160
|
+
// typeOf: { $eq: factory.actionType.CheckAction },
|
|
161
|
+
// actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
160
162
|
object: {
|
|
161
163
|
typeOf: { $eq: factory.service.paymentService.PaymentServiceType.MovieTicket },
|
|
162
164
|
id: { $eq: params.paymentServiceId }, // 指定の決済サービスにおいて
|
|
@@ -167,11 +169,13 @@ function checkByIdentifierIfNotYet(params) {
|
|
|
167
169
|
}
|
|
168
170
|
}
|
|
169
171
|
},
|
|
170
|
-
...(typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined
|
|
171
|
-
|
|
172
|
+
// ...(typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined
|
|
173
|
+
...(typeof placeOrderId === 'string') ? { purpose: { id: placeOrderId } } : undefined
|
|
174
|
+
})).shift();
|
|
172
175
|
}
|
|
176
|
+
debug('checkByIdentifierIfNotYet: alreadyCheckedAction:', JSON.stringify(alreadyCheckedAction), 'params:', JSON.stringify(params));
|
|
173
177
|
if (alreadyCheckedAction !== undefined) {
|
|
174
|
-
const recipe = await repos.
|
|
178
|
+
const recipe = await repos.checkMovieTicketAction.findRecipeByAction({
|
|
175
179
|
project: { id: params.screeningEvent.project.id },
|
|
176
180
|
recipeFor: { id: alreadyCheckedAction.id }
|
|
177
181
|
});
|
|
@@ -6,6 +6,7 @@ import type { ActionRepo } from '../../repo/action';
|
|
|
6
6
|
import type { TaskRepo } from '../../repo/task';
|
|
7
7
|
import type { TelemetryRepo } from '../../repo/telemetry';
|
|
8
8
|
import type { TransactionRepo } from '../../repo/transaction';
|
|
9
|
+
import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
9
10
|
import * as factory from '../../factory';
|
|
10
11
|
export type TelemetryOperation<T> = (repos: {
|
|
11
12
|
telemetry: TelemetryRepo;
|
|
@@ -15,6 +16,7 @@ export type TaskOperation<T> = (repos: {
|
|
|
15
16
|
}) => Promise<T>;
|
|
16
17
|
export type TransactionOperation<T> = (repos: {
|
|
17
18
|
transaction: TransactionRepo;
|
|
19
|
+
placeOrder: PlaceOrderRepo;
|
|
18
20
|
}) => Promise<T>;
|
|
19
21
|
export type TaskAndTransactionOperation<T> = (repos: {
|
|
20
22
|
task: TaskRepo;
|
|
@@ -27,12 +29,14 @@ export type TaskAndTransactionAndActionOperation<T> = (repos: {
|
|
|
27
29
|
}) => Promise<T>;
|
|
28
30
|
export type TransactionAndActionOperation<T> = (repos: {
|
|
29
31
|
transaction: TransactionRepo;
|
|
32
|
+
placeOrder: PlaceOrderRepo;
|
|
30
33
|
action: ActionRepo;
|
|
31
34
|
}) => Promise<T>;
|
|
32
35
|
export type TaskAndTelemetryAndTransactionOperation<T> = (repos: {
|
|
33
36
|
task: TaskRepo;
|
|
34
37
|
telemetry: TelemetryRepo;
|
|
35
38
|
transaction: TransactionRepo;
|
|
39
|
+
placeOrder: PlaceOrderRepo;
|
|
36
40
|
action: ActionRepo;
|
|
37
41
|
}) => Promise<T>;
|
|
38
42
|
export interface IGlobalFlowTaskResultByName {
|
|
@@ -100,10 +100,7 @@ function createFlow(target) {
|
|
|
100
100
|
.add(-TELEMETRY_UNIT_OF_MEASUREMENT_IN_SECONDS, 'seconds');
|
|
101
101
|
let telemetry;
|
|
102
102
|
if (target.sellerId !== undefined) {
|
|
103
|
-
const flowData = await createSellerFlow(measuredFrom.toDate(), measuredThrough.toDate(), target.sellerId)(
|
|
104
|
-
transaction: repos.transaction,
|
|
105
|
-
action: repos.action
|
|
106
|
-
});
|
|
103
|
+
const flowData = await createSellerFlow(measuredFrom.toDate(), measuredThrough.toDate(), target.sellerId)(repos);
|
|
107
104
|
debug('flowData created.');
|
|
108
105
|
telemetry = {
|
|
109
106
|
purpose: { typeOf: TelemetryPurposeType.Flow },
|
|
@@ -146,9 +143,7 @@ function createStock(target) {
|
|
|
146
143
|
const startDate = new Date();
|
|
147
144
|
let telemetry;
|
|
148
145
|
if (target.sellerId !== undefined) {
|
|
149
|
-
const stockData = await createSellerStock(target.measuredAt, target.sellerId)(
|
|
150
|
-
transaction: repos.transaction
|
|
151
|
-
});
|
|
146
|
+
const stockData = await createSellerStock(target.measuredAt, target.sellerId)(repos);
|
|
152
147
|
debug('stockData created.');
|
|
153
148
|
telemetry = {
|
|
154
149
|
purpose: { typeOf: TelemetryPurposeType.Stock },
|
|
@@ -224,7 +219,7 @@ function createSellerFlow(measuredFrom, measuredThrough, sellerId) {
|
|
|
224
219
|
function createSellerFlowTransactionResult(measuredFrom, measuredThrough, sellerId) {
|
|
225
220
|
return async (repos) => {
|
|
226
221
|
// 計測期間内に開始された取引数を算出する
|
|
227
|
-
const { count } = await repos.
|
|
222
|
+
const { count } = await repos.placeOrder.countPlaceOrder({
|
|
228
223
|
typeOf: factory.transactionType.PlaceOrder,
|
|
229
224
|
seller: { ids: [sellerId] },
|
|
230
225
|
startFrom: measuredFrom,
|
|
@@ -232,7 +227,7 @@ function createSellerFlowTransactionResult(measuredFrom, measuredThrough, seller
|
|
|
232
227
|
});
|
|
233
228
|
const numberOfTransactionsStarted = count;
|
|
234
229
|
// 計測期間内に開始され、かつ、すでに終了している取引を検索
|
|
235
|
-
const startedAndEndedTransactions = await repos.
|
|
230
|
+
const startedAndEndedTransactions = await repos.placeOrder.findPlaceOrderTransactions({
|
|
236
231
|
typeOf: factory.transactionType.PlaceOrder,
|
|
237
232
|
seller: { ids: [sellerId] },
|
|
238
233
|
startFrom: measuredFrom,
|
|
@@ -242,7 +237,7 @@ function createSellerFlowTransactionResult(measuredFrom, measuredThrough, seller
|
|
|
242
237
|
});
|
|
243
238
|
const numberOfStartedAndConfirmed = startedAndEndedTransactions.filter((transaction) => transaction.status === factory.transactionStatusType.Confirmed).length;
|
|
244
239
|
const numberOfStartedAndExpired = startedAndEndedTransactions.filter((transaction) => transaction.status === factory.transactionStatusType.Expired).length;
|
|
245
|
-
const endedTransactions = await repos.
|
|
240
|
+
const endedTransactions = await repos.placeOrder.findPlaceOrderTransactions({
|
|
246
241
|
typeOf: factory.transactionType.PlaceOrder,
|
|
247
242
|
seller: { ids: [sellerId] },
|
|
248
243
|
endFrom: measuredFrom,
|
|
@@ -323,7 +318,7 @@ function createSellerFlowTransactionResult(measuredFrom, measuredThrough, seller
|
|
|
323
318
|
function createSellerStock(measuredAt, sellerId) {
|
|
324
319
|
return async (repos) => {
|
|
325
320
|
// {measuredAt}以前に開始し、{measuredAt}以後に成立あるいは期限切れした取引
|
|
326
|
-
const { count } = await repos.
|
|
321
|
+
const { count } = await repos.placeOrder.countPlaceOrder({
|
|
327
322
|
typeOf: factory.transactionType.PlaceOrder,
|
|
328
323
|
seller: { ids: [sellerId] },
|
|
329
324
|
startThrough: measuredAt,
|
|
@@ -331,7 +326,7 @@ function createSellerStock(measuredAt, sellerId) {
|
|
|
331
326
|
});
|
|
332
327
|
const numTransactionsUnderway1 = count;
|
|
333
328
|
// {measuredAt}以前に開始し、いまだに進行中の取引
|
|
334
|
-
const count2Result = await repos.
|
|
329
|
+
const count2Result = await repos.placeOrder.countPlaceOrder({
|
|
335
330
|
typeOf: factory.transactionType.PlaceOrder,
|
|
336
331
|
seller: { ids: [sellerId] },
|
|
337
332
|
startThrough: measuredAt,
|
|
@@ -26,14 +26,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.call = call;
|
|
27
27
|
const COA = __importStar(require("@motionpicture/coa-service"));
|
|
28
28
|
const factory = __importStar(require("../../factory"));
|
|
29
|
-
|
|
29
|
+
// import { ActionRepo } from '../../repo/action';
|
|
30
|
+
const acceptCOAOffer_1 = require("../../repo/action/acceptCOAOffer");
|
|
31
|
+
const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
|
|
30
32
|
const credentials_1 = require("../../repo/credentials");
|
|
31
33
|
const event_1 = require("../../repo/event");
|
|
32
34
|
const orderNumber_1 = require("../../repo/orderNumber");
|
|
33
35
|
const project_1 = require("../../repo/project");
|
|
34
36
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
// import { TransactionRepo } from '../../repo/transaction';
|
|
38
|
+
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
37
39
|
const acceptOffer_1 = require("../offer/eventServiceByCOA/acceptOffer");
|
|
38
40
|
let coaAuthClient;
|
|
39
41
|
/**
|
|
@@ -76,7 +78,7 @@ function call(params) {
|
|
|
76
78
|
...(credentialsRepo !== undefined) ? { credentialsRepo } : undefined
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
|
-
const actionRepo = new
|
|
81
|
+
const actionRepo = new acceptCOAOffer_1.AcceptCOAOfferActionRepo(connection);
|
|
80
82
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
81
83
|
try {
|
|
82
84
|
const reserveService = new COA.service.Reserve({
|
|
@@ -103,10 +105,12 @@ function call(params) {
|
|
|
103
105
|
isMember
|
|
104
106
|
})({
|
|
105
107
|
action: actionRepo,
|
|
108
|
+
authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
|
|
106
109
|
event: new event_1.EventRepo(connection),
|
|
107
110
|
orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
|
|
108
111
|
project: new project_1.ProjectRepo(connection),
|
|
109
|
-
|
|
112
|
+
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
113
|
+
// transaction: new TransactionRepo(connection),
|
|
110
114
|
reserveService,
|
|
111
115
|
masterService
|
|
112
116
|
});
|
|
@@ -124,7 +128,8 @@ function call(params) {
|
|
|
124
128
|
event: new event_1.EventRepo(connection),
|
|
125
129
|
orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
|
|
126
130
|
project: new project_1.ProjectRepo(connection),
|
|
127
|
-
|
|
131
|
+
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
132
|
+
// transaction: new TransactionRepo(connection),
|
|
128
133
|
reserveService,
|
|
129
134
|
masterService
|
|
130
135
|
});
|
|
@@ -28,6 +28,7 @@ const factory = __importStar(require("../../factory"));
|
|
|
28
28
|
const acceptedPaymentMethod_1 = require("../../repo/acceptedPaymentMethod");
|
|
29
29
|
const accountingReport_1 = require("../../repo/accountingReport");
|
|
30
30
|
const action_1 = require("../../repo/action");
|
|
31
|
+
const checkMovieTicket_1 = require("../../repo/action/checkMovieTicket");
|
|
31
32
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
32
33
|
const authorization_1 = require("../../repo/authorization");
|
|
33
34
|
const confirmationNumber_1 = require("../../repo/confirmationNumber");
|
|
@@ -43,7 +44,8 @@ const project_1 = require("../../repo/project");
|
|
|
43
44
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
44
45
|
const task_1 = require("../../repo/task");
|
|
45
46
|
const ticket_1 = require("../../repo/ticket");
|
|
46
|
-
|
|
47
|
+
// import { TransactionRepo } from '../../repo/transaction';
|
|
48
|
+
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
47
49
|
const transactionNumber_1 = require("../../repo/transactionNumber");
|
|
48
50
|
// import { TransactionProcessRepo } from '../../repo/transactionProcess';
|
|
49
51
|
const any_1 = require("../payment/any");
|
|
@@ -75,6 +77,7 @@ function call(params) {
|
|
|
75
77
|
acceptedPaymentMethod: new acceptedPaymentMethod_1.AcceptedPaymentMethodRepo(connection),
|
|
76
78
|
accountingReport: new accountingReport_1.AccountingReportRepo(connection),
|
|
77
79
|
action: actionRepo,
|
|
80
|
+
checkMovieTicketAction: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
|
|
78
81
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
79
82
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
80
83
|
confirmationNumber: new confirmationNumber_1.ConfirmationNumberRepo({ connection }),
|
|
@@ -93,7 +96,8 @@ function call(params) {
|
|
|
93
96
|
project: new project_1.ProjectRepo(connection),
|
|
94
97
|
task: new task_1.TaskRepo(connection),
|
|
95
98
|
ticket: new ticket_1.TicketRepo(connection),
|
|
96
|
-
|
|
99
|
+
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
100
|
+
// transaction: new TransactionRepo(connection),
|
|
97
101
|
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ connection })
|
|
98
102
|
// transactionProcess: transactionProcessRepo
|
|
99
103
|
}, settings);
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.call = call;
|
|
27
27
|
const factory = __importStar(require("../../factory"));
|
|
28
|
-
const
|
|
28
|
+
const checkMovieTicket_1 = require("../../repo/action/checkMovieTicket");
|
|
29
29
|
const credentials_1 = require("../../repo/credentials");
|
|
30
30
|
const event_1 = require("../../repo/event");
|
|
31
31
|
const paymentService_1 = require("../../repo/paymentService");
|
|
@@ -45,7 +45,7 @@ function call(params) {
|
|
|
45
45
|
if (!options.executeById) {
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
const actionRepo = new
|
|
48
|
+
const actionRepo = new checkMovieTicket_1.CheckMovieTicketActionRepo(connection);
|
|
49
49
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
50
50
|
const paymentServiceId = params.data.object[0]?.id;
|
|
51
51
|
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
@@ -56,7 +56,7 @@ function call(params) {
|
|
|
56
56
|
...params.data,
|
|
57
57
|
sameAs: { id: params.id, typeOf: 'Task' }
|
|
58
58
|
})({
|
|
59
|
-
|
|
59
|
+
checkMovieTicketAction: actionRepo,
|
|
60
60
|
credentials: new credentials_1.CredentialsRepo(redisClient, {
|
|
61
61
|
scope: `${factory.service.paymentService.PaymentServiceType.MovieTicket}:${paymentServiceId}`,
|
|
62
62
|
expireInSeconds: (useCredentialsRepo) ? credentialsExpireInSeconds : 0
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.call = call;
|
|
27
27
|
const factory = __importStar(require("../../factory"));
|
|
28
28
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
29
|
-
const
|
|
29
|
+
const checkThing_1 = require("../../repo/action/checkThing");
|
|
30
30
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
31
31
|
const event_1 = require("../../repo/event");
|
|
32
32
|
const order_1 = require("../../repo/order");
|
|
@@ -43,7 +43,7 @@ function call(params) {
|
|
|
43
43
|
if (redisClient === undefined) {
|
|
44
44
|
throw new factory.errors.Argument('settings', 'redisClient required');
|
|
45
45
|
}
|
|
46
|
-
const actionRepo = new
|
|
46
|
+
const actionRepo = new checkThing_1.CheckThingActionRepo(connection);
|
|
47
47
|
const { data } = params;
|
|
48
48
|
const actionAttributes = {
|
|
49
49
|
agent: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
@@ -9,7 +9,7 @@ const event_1 = require("../../repo/event");
|
|
|
9
9
|
const order_1 = require("../../repo/order");
|
|
10
10
|
const project_1 = require("../../repo/project");
|
|
11
11
|
const task_1 = require("../../repo/task");
|
|
12
|
-
|
|
12
|
+
// import { TransactionRepo } from '../../repo/transaction';
|
|
13
13
|
const confirmPayTransaction_1 = require("../order/confirmPayTransaction");
|
|
14
14
|
/**
|
|
15
15
|
* タスク実行関数
|
|
@@ -29,7 +29,7 @@ function call(params) {
|
|
|
29
29
|
event: new event_1.EventRepo(connection),
|
|
30
30
|
project: new project_1.ProjectRepo(connection),
|
|
31
31
|
task: new task_1.TaskRepo(connection),
|
|
32
|
-
transaction: new
|
|
32
|
+
// transaction: new TransactionRepo(connection)
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
}
|
|
@@ -37,6 +37,9 @@ const reservation_1 = require("../../repo/reservation");
|
|
|
37
37
|
const setting_1 = require("../../repo/setting");
|
|
38
38
|
const task_1 = require("../../repo/task");
|
|
39
39
|
const transaction_1 = require("../../repo/transaction");
|
|
40
|
+
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
41
|
+
const returnOrder_1 = require("../../repo/transaction/returnOrder");
|
|
42
|
+
const moneyTransfer_1 = require("../../repo/transaction/moneyTransfer");
|
|
40
43
|
const TransactionService = __importStar(require("../transaction"));
|
|
41
44
|
/**
|
|
42
45
|
* タスク実行関数
|
|
@@ -56,7 +59,10 @@ function call(data) {
|
|
|
56
59
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
57
60
|
setting: new setting_1.SettingRepo(connection),
|
|
58
61
|
task: new task_1.TaskRepo(connection),
|
|
59
|
-
transaction: new transaction_1.TransactionRepo(connection)
|
|
62
|
+
transaction: new transaction_1.TransactionRepo(connection),
|
|
63
|
+
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
64
|
+
returnOrder: new returnOrder_1.ReturnOrderRepo(connection),
|
|
65
|
+
moneyTransfer: new moneyTransfer_1.MoneyTransferRepo(connection),
|
|
60
66
|
});
|
|
61
67
|
};
|
|
62
68
|
}
|
|
@@ -6,7 +6,8 @@ const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
|
6
6
|
const order_1 = require("../../repo/order");
|
|
7
7
|
const setting_1 = require("../../repo/setting");
|
|
8
8
|
const task_1 = require("../../repo/task");
|
|
9
|
-
|
|
9
|
+
// import { TransactionRepo } from '../../repo/transaction';
|
|
10
|
+
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
10
11
|
const onAssetTransactionStatusChanged_1 = require("../order/onAssetTransactionStatusChanged");
|
|
11
12
|
/**
|
|
12
13
|
* タスク実行関数
|
|
@@ -19,7 +20,8 @@ function call(data) {
|
|
|
19
20
|
order: new order_1.OrderRepo(connection),
|
|
20
21
|
setting: new setting_1.SettingRepo(connection),
|
|
21
22
|
task: new task_1.TaskRepo(connection),
|
|
22
|
-
transaction: new
|
|
23
|
+
// transaction: new TransactionRepo(connection),
|
|
24
|
+
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
23
25
|
}, settings);
|
|
24
26
|
};
|
|
25
27
|
}
|
|
@@ -5,7 +5,7 @@ const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
|
5
5
|
const order_1 = require("../../repo/order");
|
|
6
6
|
const setting_1 = require("../../repo/setting");
|
|
7
7
|
const task_1 = require("../../repo/task");
|
|
8
|
-
const
|
|
8
|
+
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
9
9
|
const payOrder_1 = require("../order/payOrder");
|
|
10
10
|
/**
|
|
11
11
|
* タスク実行関数
|
|
@@ -17,7 +17,7 @@ function call(data) {
|
|
|
17
17
|
order: new order_1.OrderRepo(connection),
|
|
18
18
|
setting: new setting_1.SettingRepo(connection),
|
|
19
19
|
task: new task_1.TaskRepo(connection),
|
|
20
|
-
|
|
20
|
+
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
21
21
|
}, settings);
|
|
22
22
|
};
|
|
23
23
|
}
|
|
@@ -13,6 +13,12 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
|
|
|
13
13
|
import type { TaskRepo } from '../../../repo/task';
|
|
14
14
|
import * as factory from '../../../factory';
|
|
15
15
|
import { Settings } from '../../../settings';
|
|
16
|
+
interface IPayTask2payActionAttributesRepos {
|
|
17
|
+
action: ActionRepo;
|
|
18
|
+
acceptedOffer: AcceptedOfferRepo;
|
|
19
|
+
assetTransaction: AssetTransactionRepo;
|
|
20
|
+
order: OrderRepo;
|
|
21
|
+
}
|
|
16
22
|
declare function payTask2payActionAttributes(params: factory.task.pay.IData & {
|
|
17
23
|
sameAs?: {
|
|
18
24
|
/**
|
|
@@ -21,16 +27,8 @@ declare function payTask2payActionAttributes(params: factory.task.pay.IData & {
|
|
|
21
27
|
id: string;
|
|
22
28
|
typeOf: 'Task';
|
|
23
29
|
};
|
|
24
|
-
}): (repos:
|
|
25
|
-
|
|
26
|
-
acceptedOffer: AcceptedOfferRepo;
|
|
27
|
-
assetTransaction: AssetTransactionRepo;
|
|
28
|
-
order: OrderRepo;
|
|
29
|
-
}) => Promise<factory.action.trade.pay.IAttributes>;
|
|
30
|
-
/**
|
|
31
|
-
* 決済確定
|
|
32
|
-
*/
|
|
33
|
-
declare function payByTask(payActionAttributes: factory.action.trade.pay.IAttributes): (repos: {
|
|
30
|
+
}): (repos: IPayTask2payActionAttributesRepos) => Promise<factory.action.trade.pay.IAttributes>;
|
|
31
|
+
interface IPayByTaskRepos {
|
|
34
32
|
acceptedOffer: AcceptedOfferRepo;
|
|
35
33
|
action: ActionRepo;
|
|
36
34
|
accountingReport: AccountingReportRepo;
|
|
@@ -44,5 +42,9 @@ declare function payByTask(payActionAttributes: factory.action.trade.pay.IAttrib
|
|
|
44
42
|
product: ProductRepo;
|
|
45
43
|
project: ProjectRepo;
|
|
46
44
|
task: TaskRepo;
|
|
47
|
-
}
|
|
48
|
-
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 決済確定
|
|
48
|
+
*/
|
|
49
|
+
declare function payByTask(payActionAttributes: factory.action.trade.pay.IAttributes): (repos: IPayByTaskRepos, settings: Settings) => Promise<void>;
|
|
50
|
+
export { IPayTask2payActionAttributesRepos, IPayByTaskRepos, payByTask, payTask2payActionAttributes };
|
|
@@ -8,14 +8,15 @@ const order_1 = require("../../repo/order");
|
|
|
8
8
|
const orderInTransaction_1 = require("../../repo/orderInTransaction");
|
|
9
9
|
const setting_1 = require("../../repo/setting");
|
|
10
10
|
const task_1 = require("../../repo/task");
|
|
11
|
-
|
|
12
|
-
const placeOrder_1 = require("
|
|
11
|
+
// import { TransactionRepo } from '../../repo/transaction';
|
|
12
|
+
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
13
|
+
const placeOrder_2 = require("../order/placeOrder");
|
|
13
14
|
/**
|
|
14
15
|
* タスク実行関数
|
|
15
16
|
*/
|
|
16
17
|
function call(data) {
|
|
17
18
|
return async ({ connection, settings }) => {
|
|
18
|
-
await (0,
|
|
19
|
+
await (0, placeOrder_2.placeOrder)({
|
|
19
20
|
...data,
|
|
20
21
|
useOnOrderStatusChanged: true
|
|
21
22
|
})({
|
|
@@ -26,7 +27,8 @@ function call(data) {
|
|
|
26
27
|
orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
|
|
27
28
|
setting: new setting_1.SettingRepo(connection),
|
|
28
29
|
task: new task_1.TaskRepo(connection),
|
|
29
|
-
transaction: new
|
|
30
|
+
// transaction: new TransactionRepo(connection),
|
|
31
|
+
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
30
32
|
}, settings);
|
|
31
33
|
};
|
|
32
34
|
}
|
|
@@ -27,6 +27,7 @@ exports.call = call;
|
|
|
27
27
|
const factory = __importStar(require("../../factory"));
|
|
28
28
|
const acceptedPaymentMethod_1 = require("../../repo/acceptedPaymentMethod");
|
|
29
29
|
const action_1 = require("../../repo/action");
|
|
30
|
+
const acceptPay_1 = require("../../repo/action/acceptPay");
|
|
30
31
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
31
32
|
const authorization_1 = require("../../repo/authorization");
|
|
32
33
|
const event_1 = require("../../repo/event");
|
|
@@ -37,7 +38,8 @@ const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
|
37
38
|
const project_1 = require("../../repo/project");
|
|
38
39
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
39
40
|
const ticket_1 = require("../../repo/ticket");
|
|
40
|
-
|
|
41
|
+
// import { TransactionRepo } from '../../repo/transaction';
|
|
42
|
+
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
41
43
|
const transactionNumber_1 = require("../../repo/transactionNumber");
|
|
42
44
|
// import { TransactionProcessRepo } from '../../repo/transactionProcess';
|
|
43
45
|
const any_1 = require("../payment/any");
|
|
@@ -53,7 +55,7 @@ function call(params) {
|
|
|
53
55
|
if (!options.executeById) {
|
|
54
56
|
return;
|
|
55
57
|
}
|
|
56
|
-
const actionRepo = new
|
|
58
|
+
const actionRepo = new acceptPay_1.AcceptPayActionRepo(connection);
|
|
57
59
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
58
60
|
try {
|
|
59
61
|
await (0, any_1.publishPaymentUrl)({
|
|
@@ -62,7 +64,8 @@ function call(params) {
|
|
|
62
64
|
sameAs: { id: params.id }
|
|
63
65
|
})({
|
|
64
66
|
acceptedPaymentMethod: new acceptedPaymentMethod_1.AcceptedPaymentMethodRepo(connection),
|
|
65
|
-
action:
|
|
67
|
+
action: new action_1.ActionRepo(connection),
|
|
68
|
+
acceptPayAction: actionRepo,
|
|
66
69
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
67
70
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
68
71
|
event: new event_1.EventRepo(connection),
|
|
@@ -73,7 +76,8 @@ function call(params) {
|
|
|
73
76
|
paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
|
|
74
77
|
project: new project_1.ProjectRepo(connection),
|
|
75
78
|
ticket: new ticket_1.TicketRepo(connection),
|
|
76
|
-
|
|
79
|
+
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
80
|
+
// transaction: new TransactionRepo(connection),
|
|
77
81
|
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ connection })
|
|
78
82
|
}, settings);
|
|
79
83
|
}
|
|
@@ -7,14 +7,14 @@ const order_1 = require("../../repo/order");
|
|
|
7
7
|
const ownershipInfo_1 = require("../../repo/ownershipInfo");
|
|
8
8
|
const setting_1 = require("../../repo/setting");
|
|
9
9
|
const task_1 = require("../../repo/task");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const returnOrder_1 = require("../../repo/transaction/returnOrder");
|
|
11
|
+
const returnOrder_2 = require("../order/returnOrder");
|
|
12
12
|
/**
|
|
13
13
|
* タスク実行関数
|
|
14
14
|
*/
|
|
15
15
|
function call(data) {
|
|
16
16
|
return async ({ connection }) => {
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, returnOrder_2.returnOrder)({
|
|
18
18
|
...data,
|
|
19
19
|
useOnOrderStatusChanged: true
|
|
20
20
|
})({
|
|
@@ -24,7 +24,7 @@ function call(data) {
|
|
|
24
24
|
ownershipInfo: new ownershipInfo_1.OwnershipInfoRepo(connection),
|
|
25
25
|
setting: new setting_1.SettingRepo(connection),
|
|
26
26
|
task: new task_1.TaskRepo(connection),
|
|
27
|
-
|
|
27
|
+
returnOrder: new returnOrder_1.ReturnOrderRepo(connection)
|
|
28
28
|
}
|
|
29
29
|
// settings
|
|
30
30
|
);
|