@chevre/domain 25.2.0-alpha.27 → 25.2.0-alpha.29
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/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/orderInTransaction.d.ts +2 -0
- package/lib/chevre/repo/orderInTransaction.js +19 -16
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +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 -0
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder.d.ts +2 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -0
- package/lib/chevre/service/task/placeOrder.js +2 -2
- package/lib/chevre/service/task/publishPaymentUrl.js +5 -1
- package/package.json +2 -2
|
@@ -43,7 +43,7 @@ export declare class MessageRepo {
|
|
|
43
43
|
/**
|
|
44
44
|
* 検索
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
findMessages(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<(IEmailMessage & {
|
|
47
47
|
id: string;
|
|
48
48
|
})[]>;
|
|
49
49
|
/**
|
|
@@ -53,7 +53,7 @@ class MessageRepo {
|
|
|
53
53
|
/**
|
|
54
54
|
* 検索
|
|
55
55
|
*/
|
|
56
|
-
async
|
|
56
|
+
async findMessages(params, inclusion) {
|
|
57
57
|
const conditions = MessageRepo.CREATE_MONGO_CONDITIONS(params);
|
|
58
58
|
let positiveProjectionFields;
|
|
59
59
|
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
@@ -155,6 +155,8 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
|
155
155
|
savePaymentMethodId(params: {
|
|
156
156
|
id: string;
|
|
157
157
|
paymentMethod: factory.transaction.placeOrder.IPaymentMethodByPaymentUrl;
|
|
158
|
+
}, options: {
|
|
159
|
+
savePaymentMethodIdInTransaction: boolean;
|
|
158
160
|
}): Promise<void>;
|
|
159
161
|
/**
|
|
160
162
|
* 進行中取引に保管された採用済決済方法を検索する
|
|
@@ -281,26 +281,29 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
281
281
|
* 特定の進行中取引の決済方法IDを保管する
|
|
282
282
|
* transactionsへの保管としてひとまず定義(2026-07-11~)
|
|
283
283
|
*/
|
|
284
|
-
async savePaymentMethodId(params) {
|
|
284
|
+
async savePaymentMethodId(params, options) {
|
|
285
|
+
const { savePaymentMethodIdInTransaction } = options;
|
|
285
286
|
const { paymentMethodId } = params.paymentMethod;
|
|
286
287
|
if (typeof paymentMethodId !== 'string' || paymentMethodId === '') {
|
|
287
288
|
throw new factory_1.factory.errors.ArgumentNull('paymentMethod.paymentMethodId');
|
|
288
289
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
290
|
+
if (savePaymentMethodIdInTransaction) {
|
|
291
|
+
await this.transactionModel.findOneAndUpdate({
|
|
292
|
+
_id: { $eq: params.id },
|
|
293
|
+
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
294
|
+
}, {
|
|
295
|
+
$set: { 'object.paymentMethods': { paymentMethodId } }
|
|
296
|
+
}, {
|
|
297
|
+
projection: { _id: 1 }
|
|
298
|
+
})
|
|
299
|
+
.lean()
|
|
300
|
+
.exec()
|
|
301
|
+
.then((doc) => {
|
|
302
|
+
if (doc === null) {
|
|
303
|
+
throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
304
307
|
// 注文ドキュメントにも保管する(2026-07-12~)
|
|
305
308
|
await this.orderModel.findOneAndUpdate({
|
|
306
309
|
identifier: { $eq: params.id },
|
package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../../repo/acceptedOffer';
|
|
2
2
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
3
|
+
import type { MessageRepo } from '../../../repo/message';
|
|
3
4
|
import type { OrderRepo } from '../../../repo/order';
|
|
4
5
|
import type { SettingRepo } from '../../../repo/setting';
|
|
5
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
@@ -9,6 +10,7 @@ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/i
|
|
|
9
10
|
interface IOnPayTransactionConfirmedRepos {
|
|
10
11
|
acceptedOffer: AcceptedOfferRepo;
|
|
11
12
|
assetTransaction: AssetTransactionRepo;
|
|
13
|
+
message: MessageRepo;
|
|
12
14
|
order: OrderRepo;
|
|
13
15
|
setting: SettingRepo;
|
|
14
16
|
task: TaskRepo;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../../repo/acceptedOffer';
|
|
2
|
+
import type { MessageRepo } from '../../../repo/message';
|
|
2
3
|
import type { OrderRepo } from '../../../repo/order';
|
|
3
4
|
import type { SettingRepo } from '../../../repo/setting';
|
|
4
5
|
import type { TaskRepo } from '../../../repo/task';
|
|
@@ -6,6 +7,7 @@ import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
|
6
7
|
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
7
8
|
interface IPaymentDue2ProcessingRepos {
|
|
8
9
|
acceptedOffer: AcceptedOfferRepo;
|
|
10
|
+
message: MessageRepo;
|
|
9
11
|
order: OrderRepo;
|
|
10
12
|
setting: SettingRepo;
|
|
11
13
|
task: TaskRepo;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
2
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
3
|
+
import type { MessageRepo } from '../../repo/message';
|
|
3
4
|
import type { OrderRepo } from '../../repo/order';
|
|
4
5
|
import type { SettingRepo } from '../../repo/setting';
|
|
5
6
|
import type { TaskRepo } from '../../repo/task';
|
|
@@ -11,6 +12,7 @@ import type { IntegrationSettingRepo as Settings } from '../../repo/setting/inte
|
|
|
11
12
|
interface IOnAssetTransactionStatusChangedRepos {
|
|
12
13
|
acceptedOffer: AcceptedOfferRepo;
|
|
13
14
|
assetTransaction: AssetTransactionRepo;
|
|
15
|
+
message: MessageRepo;
|
|
14
16
|
order: OrderRepo;
|
|
15
17
|
setting: SettingRepo;
|
|
16
18
|
task: TaskRepo;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import type { MessageRepo } from '../../../../repo/message';
|
|
1
2
|
import type { TaskRepo } from '../../../../repo/task';
|
|
2
3
|
import { factory } from '../../../../factory';
|
|
3
4
|
declare function createSendEmailMessageTaskIfNotExist(params: {
|
|
4
|
-
sendEmailMessage?:
|
|
5
|
+
sendEmailMessage?: {
|
|
6
|
+
object: factory.action.transfer.send.message.email.IOptimizedObject;
|
|
7
|
+
}[];
|
|
5
8
|
order: Pick<factory.order.IOrder, 'customer' | 'orderDate' | 'orderNumber' | 'price' | 'priceCurrency' | 'project' | 'typeOf'>;
|
|
6
9
|
}): (repos: {
|
|
10
|
+
message: MessageRepo;
|
|
7
11
|
task: TaskRepo;
|
|
8
12
|
}) => Promise<void>;
|
|
9
13
|
export { createSendEmailMessageTaskIfNotExist };
|
|
@@ -1,45 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.createSendEmailMessageTaskIfNotExist = createSendEmailMessageTaskIfNotExist;
|
|
7
|
+
const debug_1 = __importDefault(require("debug"));
|
|
4
8
|
const util_1 = require("util");
|
|
5
9
|
const factory_1 = require("../../../../factory");
|
|
10
|
+
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
6
11
|
function createSendEmailMessageTaskIfNotExist(params) {
|
|
7
12
|
return async (repos) => {
|
|
8
13
|
const sendEmailMessageActions = params.sendEmailMessage;
|
|
9
14
|
const now = new Date();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
15
|
+
// 取引のpotentialActions参照を廃止して、messageリポジトリを参照して存在すればタスクを作成(2026-07-16~)
|
|
16
|
+
const message4order = (await repos.message.findMessages({
|
|
17
|
+
limit: 1,
|
|
18
|
+
page: 1,
|
|
19
|
+
about: { identifier: { $eq: factory_1.factory.creativeWork.message.email.AboutIdentifier.OnOrderSent } },
|
|
20
|
+
mainEntity: { orderNumber: { $eq: params.order.orderNumber } }
|
|
21
|
+
}, ['identifier'])).shift();
|
|
22
|
+
debug('createSendEmailMessageTaskIfNotExist: message4order:', JSON.stringify(message4order));
|
|
23
|
+
if (typeof message4order?.identifier === 'string') {
|
|
24
|
+
// 取引のpotentialActionsが存在する間は、メッセージ識別子が想定通りか確認する
|
|
25
|
+
const messageIdentifierByTransaction = sendEmailMessageActions?.at(0)?.object.identifier;
|
|
26
|
+
if (typeof messageIdentifierByTransaction === 'string') {
|
|
27
|
+
debug('createSendEmailMessageTaskIfNotExist: identifier matched?', message4order.identifier, messageIdentifierByTransaction);
|
|
28
|
+
if (message4order.identifier !== messageIdentifierByTransaction) {
|
|
29
|
+
throw new factory_1.factory.errors.Internal(`message identifier not matched. ${message4order.identifier} ${messageIdentifierByTransaction}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s:%s:%s', params.order.project.id, factory_1.factory.taskName.SendEmailMessage, params.order.typeOf, params.order.orderNumber, factory_1.factory.orderStatus.OrderProcessing, 0 // 複数メッセージに対応していた時期の名残(2026-07-16~)
|
|
33
|
+
);
|
|
34
|
+
const simpleOrder = {
|
|
35
|
+
typeOf: params.order.typeOf,
|
|
36
|
+
orderNumber: params.order.orderNumber,
|
|
37
|
+
orderDate: params.order.orderDate
|
|
38
|
+
};
|
|
39
|
+
const actionAttributes = {
|
|
40
|
+
project: params.order.project,
|
|
41
|
+
typeOf: factory_1.factory.actionType.SendAction,
|
|
42
|
+
object: {
|
|
43
|
+
identifier: message4order.identifier,
|
|
44
|
+
typeOf: factory_1.factory.creativeWorkType.EmailMessage
|
|
45
|
+
},
|
|
46
|
+
agent: params.order.project,
|
|
47
|
+
recipient: { typeOf: params.order.customer.typeOf, id: params.order.customer.id },
|
|
48
|
+
purpose: simpleOrder
|
|
49
|
+
};
|
|
50
|
+
const sendEmailMessageTask = {
|
|
51
|
+
alternateName: taskIdentifier,
|
|
52
|
+
identifier: taskIdentifier,
|
|
53
|
+
project: params.order.project,
|
|
54
|
+
name: factory_1.factory.taskName.SendEmailMessage,
|
|
55
|
+
status: factory_1.factory.taskStatus.Ready,
|
|
56
|
+
runsAt: now, // なるはやで実行
|
|
57
|
+
remainingNumberOfTries: 10,
|
|
58
|
+
numberOfTried: 0,
|
|
59
|
+
executionResults: [],
|
|
60
|
+
data: { actionAttributes }
|
|
61
|
+
};
|
|
62
|
+
await repos.task.createIfNotExistByAlternateName(sendEmailMessageTask, { emitImmediately: true });
|
|
43
63
|
}
|
|
64
|
+
// if (Array.isArray(sendEmailMessageActions)) {
|
|
65
|
+
// await Promise.all(sendEmailMessageActions.map(async (sendEmailMessageAction, index) => {
|
|
66
|
+
// const taskIdentifier: string = format(
|
|
67
|
+
// '%s:%s:%s:%s:%s:%s',
|
|
68
|
+
// params.order.project.id,
|
|
69
|
+
// factory.taskName.SendEmailMessage,
|
|
70
|
+
// params.order.typeOf,
|
|
71
|
+
// params.order.orderNumber,
|
|
72
|
+
// factory.orderStatus.OrderProcessing,
|
|
73
|
+
// index
|
|
74
|
+
// );
|
|
75
|
+
// const simpleOrder: factory.order.ISimpleOrder = {
|
|
76
|
+
// typeOf: params.order.typeOf,
|
|
77
|
+
// orderNumber: params.order.orderNumber,
|
|
78
|
+
// orderDate: params.order.orderDate
|
|
79
|
+
// };
|
|
80
|
+
// const actionAttributes: factory.task.sendEmailMessage.IData['actionAttributes'] = {
|
|
81
|
+
// project: params.order.project,
|
|
82
|
+
// typeOf: factory.actionType.SendAction,
|
|
83
|
+
// object: sendEmailMessageAction.object,
|
|
84
|
+
// agent: params.order.project,
|
|
85
|
+
// recipient: { typeOf: params.order.customer.typeOf, id: params.order.customer.id },
|
|
86
|
+
// purpose: simpleOrder
|
|
87
|
+
// };
|
|
88
|
+
// const sendEmailMessageTask: factory.task.IAttributes<factory.taskName.SendEmailMessage> & {
|
|
89
|
+
// alternateName: string;
|
|
90
|
+
// identifier: string;
|
|
91
|
+
// } = {
|
|
92
|
+
// alternateName: taskIdentifier,
|
|
93
|
+
// identifier: taskIdentifier,
|
|
94
|
+
// project: params.order.project,
|
|
95
|
+
// name: factory.taskName.SendEmailMessage,
|
|
96
|
+
// status: factory.taskStatus.Ready,
|
|
97
|
+
// runsAt: now, // なるはやで実行
|
|
98
|
+
// remainingNumberOfTries: 10,
|
|
99
|
+
// numberOfTried: 0,
|
|
100
|
+
// executionResults: [],
|
|
101
|
+
// data: { actionAttributes }
|
|
102
|
+
// };
|
|
103
|
+
// await repos.task.createIfNotExistByAlternateName(sendEmailMessageTask, { emitImmediately: true });
|
|
104
|
+
// }));
|
|
105
|
+
// }
|
|
44
106
|
};
|
|
45
107
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MessageRepo } from '../../../repo/message';
|
|
1
2
|
import type { SettingRepo } from '../../../repo/setting';
|
|
2
3
|
import type { TaskRepo } from '../../../repo/task';
|
|
3
4
|
import { factory } from '../../../factory';
|
|
@@ -13,6 +14,7 @@ declare function onOrderProcessing(params: {
|
|
|
13
14
|
};
|
|
14
15
|
placeOrderTransaction?: IPlaceOrderTransaction;
|
|
15
16
|
}): (repos: {
|
|
17
|
+
message: MessageRepo;
|
|
16
18
|
setting: SettingRepo;
|
|
17
19
|
task: TaskRepo;
|
|
18
20
|
}, settings: Settings) => Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
|
+
import type { MessageRepo } from '../../repo/message';
|
|
2
3
|
import type { OrderRepo } from '../../repo/order';
|
|
3
4
|
import type { SettingRepo } from '../../repo/setting';
|
|
4
5
|
import type { TaskRepo } from '../../repo/task';
|
|
@@ -10,6 +11,7 @@ import type { IntegrationSettingRepo as Settings } from '../../repo/setting/inte
|
|
|
10
11
|
*/
|
|
11
12
|
declare function payOrder(params: factory.task.IData<factory.taskName.OnOrderPaymentCompleted>): (repos: {
|
|
12
13
|
acceptedOffer: AcceptedOfferRepo;
|
|
14
|
+
message: MessageRepo;
|
|
13
15
|
order: OrderRepo;
|
|
14
16
|
setting: SettingRepo;
|
|
15
17
|
task: TaskRepo;
|
|
@@ -3,6 +3,7 @@ import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
|
3
3
|
import type { ActionRepo } from '../../repo/action';
|
|
4
4
|
import type { AuthorizeOfferActionRepo } from '../../repo/action/authorizeOffer';
|
|
5
5
|
import type { AuthorizePaymentMethodActionRepo } from '../../repo/action/authorizePaymentMethod';
|
|
6
|
+
import type { MessageRepo } from '../../repo/message';
|
|
6
7
|
import type { OrderRepo } from '../../repo/order';
|
|
7
8
|
import type { OrderInTransactionRepo } from '../../repo/orderInTransaction';
|
|
8
9
|
import type { SettingRepo } from '../../repo/setting';
|
|
@@ -17,6 +18,7 @@ interface IPlaceOrderRepos {
|
|
|
17
18
|
action: ActionRepo;
|
|
18
19
|
authorizeOfferAction: AuthorizeOfferActionRepo;
|
|
19
20
|
authorizePaymentMethodAction: AuthorizePaymentMethodActionRepo;
|
|
21
|
+
message: MessageRepo;
|
|
20
22
|
order: OrderRepo;
|
|
21
23
|
orderInTransaction: OrderInTransactionRepo;
|
|
22
24
|
setting: SettingRepo;
|
|
@@ -60,5 +60,7 @@ declare function publishPaymentUrl(params: {
|
|
|
60
60
|
*/
|
|
61
61
|
identifier?: string;
|
|
62
62
|
instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[];
|
|
63
|
+
}, options: {
|
|
64
|
+
savePaymentMethodIdInTransaction: boolean;
|
|
63
65
|
}): IPublishPaymentUrlOperation<Pick<PayTransactionService.IPublishPaymentUrlResult, 'paymentMethodId' | 'paymentUrl'>>;
|
|
64
66
|
export { IPublishPaymentUrlRepos, publishPaymentUrl };
|
|
@@ -41,7 +41,7 @@ const factory_2 = require("./factory");
|
|
|
41
41
|
/**
|
|
42
42
|
* 外部決済ロケーションを発行する
|
|
43
43
|
*/
|
|
44
|
-
function publishPaymentUrl(params) {
|
|
44
|
+
function publishPaymentUrl(params, options) {
|
|
45
45
|
return async (repos, settings) => {
|
|
46
46
|
const { paymentServiceType, purpose, project } = params;
|
|
47
47
|
if (purpose.typeOf !== factory_1.factory.transactionType.PlaceOrder) {
|
|
@@ -107,7 +107,7 @@ function publishPaymentUrl(params) {
|
|
|
107
107
|
await repos.orderInTransaction.savePaymentMethodId({
|
|
108
108
|
id: transaction.id,
|
|
109
109
|
paymentMethod: { paymentMethodId: result.paymentMethodId }
|
|
110
|
-
});
|
|
110
|
+
}, options);
|
|
111
111
|
return {
|
|
112
112
|
paymentMethodId: result.paymentMethodId,
|
|
113
113
|
paymentUrl: result.paymentUrl
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
5
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
6
|
+
const message_1 = require("../../repo/message");
|
|
6
7
|
const order_1 = require("../../repo/order");
|
|
7
8
|
const setting_1 = require("../../repo/setting");
|
|
8
9
|
const integration_1 = require("../../repo/setting/integration");
|
|
9
10
|
const task_1 = require("../../repo/task");
|
|
10
|
-
// import { TransactionRepo } from '../../repo/transaction';
|
|
11
11
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
12
12
|
const onAssetTransactionStatusChanged_1 = require("../order/onAssetTransactionStatusChanged");
|
|
13
13
|
/**
|
|
@@ -19,10 +19,10 @@ function call(data) {
|
|
|
19
19
|
await (0, onAssetTransactionStatusChanged_1.onAssetTransactionStatusChanged)(data)({
|
|
20
20
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
21
21
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
22
|
+
message: new message_1.MessageRepo(connection),
|
|
22
23
|
order: new order_1.OrderRepo(connection),
|
|
23
24
|
setting: new setting_1.SettingRepo(connection),
|
|
24
25
|
task: new task_1.TaskRepo(connection),
|
|
25
|
-
// transaction: new TransactionRepo(connection),
|
|
26
26
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
27
27
|
}, settings);
|
|
28
28
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
|
+
const message_1 = require("../../repo/message");
|
|
5
6
|
const order_1 = require("../../repo/order");
|
|
6
7
|
const setting_1 = require("../../repo/setting");
|
|
7
8
|
const integration_1 = require("../../repo/setting/integration");
|
|
@@ -16,6 +17,7 @@ function call(data) {
|
|
|
16
17
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
17
18
|
await (0, payOrder_1.payOrder)(data)({
|
|
18
19
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
20
|
+
message: new message_1.MessageRepo(connection),
|
|
19
21
|
order: new order_1.OrderRepo(connection),
|
|
20
22
|
setting: new setting_1.SettingRepo(connection),
|
|
21
23
|
task: new task_1.TaskRepo(connection),
|
|
@@ -6,12 +6,12 @@ const accountingReport_1 = require("../../repo/accountingReport");
|
|
|
6
6
|
const action_1 = require("../../repo/action");
|
|
7
7
|
const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
|
|
8
8
|
const authorizePaymentMethod_1 = require("../../repo/action/authorizePaymentMethod");
|
|
9
|
+
const message_1 = require("../../repo/message");
|
|
9
10
|
const order_1 = require("../../repo/order");
|
|
10
11
|
const orderInTransaction_1 = require("../../repo/orderInTransaction");
|
|
11
12
|
const setting_1 = require("../../repo/setting");
|
|
12
13
|
const integration_1 = require("../../repo/setting/integration");
|
|
13
14
|
const task_1 = require("../../repo/task");
|
|
14
|
-
// import { TransactionRepo } from '../../repo/transaction';
|
|
15
15
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
16
16
|
const placeOrder_2 = require("../order/placeOrder");
|
|
17
17
|
/**
|
|
@@ -29,11 +29,11 @@ function call(data) {
|
|
|
29
29
|
action: new action_1.ActionRepo(connection),
|
|
30
30
|
authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
|
|
31
31
|
authorizePaymentMethodAction: new authorizePaymentMethod_1.AuthorizePaymentMethodActionRepo(connection),
|
|
32
|
+
message: new message_1.MessageRepo(connection),
|
|
32
33
|
order: new order_1.OrderRepo(connection),
|
|
33
34
|
orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
|
|
34
35
|
setting: new setting_1.SettingRepo(connection),
|
|
35
36
|
task: new task_1.TaskRepo(connection),
|
|
36
|
-
// transaction: new TransactionRepo(connection),
|
|
37
37
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
38
38
|
}, settings);
|
|
39
39
|
};
|
|
@@ -36,10 +36,14 @@ function call(params) {
|
|
|
36
36
|
const actionRepo = new acceptPay_1.AcceptPayActionRepo(connection);
|
|
37
37
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
38
38
|
try {
|
|
39
|
+
const { savePaymentMethodIdInTransaction, project: _project, ...publishPaymentUrlParams } = params.data;
|
|
39
40
|
await (0, any_1.publishPaymentUrl)({
|
|
40
|
-
...
|
|
41
|
+
...publishPaymentUrlParams,
|
|
42
|
+
project: { id: params.project.id },
|
|
41
43
|
instrument: (Array.isArray(params.data.instrument)) ? params.data.instrument : [],
|
|
42
44
|
sameAs: { id: params.id }
|
|
45
|
+
}, {
|
|
46
|
+
savePaymentMethodIdInTransaction: savePaymentMethodIdInTransaction === true
|
|
43
47
|
})({
|
|
44
48
|
acceptPayAction: actionRepo,
|
|
45
49
|
authorizeInvoiceAction: new authorizeInvoice_1.AuthorizeInvoiceActionRepo(connection),
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "9.5.0-alpha.
|
|
14
|
+
"@chevre/factory": "9.5.0-alpha.11",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"postversion": "git push origin --tags",
|
|
93
93
|
"prepublishOnly": "npm run clean && npm run build"
|
|
94
94
|
},
|
|
95
|
-
"version": "25.2.0-alpha.
|
|
95
|
+
"version": "25.2.0-alpha.29"
|
|
96
96
|
}
|