@chevre/domain 25.0.0-alpha.9 → 25.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/repo/message.d.ts +7 -15
- package/lib/chevre/repo/message.js +37 -74
- package/lib/chevre/repo/mongoose/schemas/message.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/order.js +2 -110
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +35 -9
- package/lib/chevre/repo/mongoose/schemas/setting.js +3 -2
- package/lib/chevre/repo/mongoose/schemas/transaction.js +51 -50
- package/lib/chevre/repo/order.d.ts +1 -7
- package/lib/chevre/repo/order.js +56 -26
- package/lib/chevre/repo/orderInTransaction.d.ts +41 -22
- package/lib/chevre/repo/orderInTransaction.js +108 -79
- package/lib/chevre/repo/passport.d.ts +5 -2
- package/lib/chevre/repo/setting/rateLimit.d.ts +18 -0
- package/lib/chevre/repo/setting/rateLimit.js +48 -0
- package/lib/chevre/repo/setting/waiter.d.ts +17 -0
- package/lib/chevre/repo/setting/waiter.js +39 -0
- package/lib/chevre/repo/setting.d.ts +12 -11
- package/lib/chevre/repo/setting.js +6 -18
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/transaction/placeOrder.d.ts +1 -6
- package/lib/chevre/repo/transaction/placeOrder.js +37 -26
- package/lib/chevre/repo/transaction.d.ts +1 -1
- package/lib/chevre/repo/transaction.js +2 -2
- package/lib/chevre/repository.d.ts +10 -0
- package/lib/chevre/repository.js +22 -0
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
- package/lib/chevre/service/offer/any.d.ts +1 -3
- package/lib/chevre/service/offer/any.js +7 -8
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +5 -8
- package/lib/chevre/service/offer/event/voidTransaction.js +29 -17
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +16 -12
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +0 -6
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +10 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +20 -17
- package/lib/chevre/service/order/deleteOrder.d.ts +6 -10
- package/lib/chevre/service/order/deleteOrder.js +7 -48
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +4 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -26
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -2
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory.js +6 -6
- package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.d.ts +1 -3
- package/lib/chevre/service/order/placeOrder/voidAcceptedOfferIfNecessary.js +3 -15
- package/lib/chevre/service/order/placeOrder.js +6 -6
- package/lib/chevre/service/order.d.ts +1 -2
- package/lib/chevre/service/order.js +1 -5
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.d.ts +2 -4
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +4 -6
- package/lib/chevre/service/payment/any/authorize.d.ts +2 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -4
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +5 -8
- package/lib/chevre/service/task/acceptCOAOffer.js +8 -10
- package/lib/chevre/service/task/authorizePayment.js +2 -6
- package/lib/chevre/service/task/deleteTransaction.js +2 -10
- package/lib/chevre/service/task/publishPaymentUrl.js +6 -9
- package/lib/chevre/service/taskHandler.js +0 -1
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +8 -16
- package/lib/chevre/service/transaction/deleteTransaction.js +46 -145
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.d.ts +7 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +3 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +3 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +2 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +29 -24
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -3
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +45 -54
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.d.ts +0 -4
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +2 -3
- package/lib/chevre/service/transaction/placeOrder/issueOrderNumberIfNotExist.d.ts +5 -0
- package/lib/chevre/service/transaction/placeOrder/issueOrderNumberIfNotExist.js +37 -23
- package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +20 -4
- package/lib/chevre/service/transaction/placeOrder/start/factory.js +20 -7
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +9 -4
- package/lib/chevre/service/transaction/placeOrder/start.js +18 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -4
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +19 -22
- package/lib/chevre/service/transaction/placeOrder.d.ts +1 -2
- package/lib/chevre/service/transaction/placeOrder.js +1 -3
- package/lib/chevre/service/transaction.d.ts +0 -4
- package/lib/chevre/service/transaction.js +1 -1
- package/lib/chevre/service.d.ts +0 -2
- package/lib/chevre/service.js +0 -2
- package/package.json +2 -2
- package/lib/chevre/factory/order.d.ts +0 -2
- package/lib/chevre/factory/order.js +0 -5
- package/lib/chevre/service/order/placeOrderWithoutTransaction.d.ts +0 -22
- package/lib/chevre/service/order/placeOrderWithoutTransaction.js +0 -51
- package/lib/chevre/service/task/deletePerson.d.ts +0 -6
- package/lib/chevre/service/task/deletePerson.js +0 -465
|
@@ -80,11 +80,11 @@ function authorize(params) {
|
|
|
80
80
|
await repos.action.giveUp({ typeOf: failedAction.typeOf, id: failedAction.id, error });
|
|
81
81
|
throw error;
|
|
82
82
|
}
|
|
83
|
-
const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.transaction.id });
|
|
84
|
-
if (typeof orderNumber !== 'string') {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
83
|
+
// const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.transaction.id });
|
|
84
|
+
// if (typeof orderNumber !== 'string') {
|
|
85
|
+
// // 事前に発行されているはず(acceptCOAOfferにて)
|
|
86
|
+
// throw new factory.errors.NotFound('transaction.object.orderNumber');
|
|
87
|
+
// }
|
|
88
88
|
let result;
|
|
89
89
|
// 承認アクションを開始
|
|
90
90
|
const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
|
|
@@ -103,7 +103,7 @@ function authorize(params) {
|
|
|
103
103
|
responseBody: params.result.responseBody,
|
|
104
104
|
acceptedOffer: acceptedOffers,
|
|
105
105
|
event: screeningEvent,
|
|
106
|
-
seller: transaction.seller,
|
|
106
|
+
// seller: transaction.seller,
|
|
107
107
|
bookingTime: (0, moment_1.default)(action.startDate)
|
|
108
108
|
.toDate(),
|
|
109
109
|
totalPrice: price
|
|
@@ -117,7 +117,6 @@ function authorize(params) {
|
|
|
117
117
|
// add orderInTransaction(2024-01-15~)
|
|
118
118
|
// if (params.options.useCreateOrderOnOfferAccepted) {
|
|
119
119
|
await (0, any_1.acceptOffer)({
|
|
120
|
-
orderNumber,
|
|
121
120
|
project: transaction.project,
|
|
122
121
|
placeOrderId: params.transaction.id,
|
|
123
122
|
acceptedOffers: acceptedOffers4result
|
|
@@ -22,11 +22,11 @@ function changeOffers(params) {
|
|
|
22
22
|
if (transaction.agent.id !== params.agent.id) {
|
|
23
23
|
throw new factory_2.factory.errors.Forbidden('Transaction not yours');
|
|
24
24
|
}
|
|
25
|
-
const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.transaction.id });
|
|
26
|
-
if (typeof orderNumber !== 'string') {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
25
|
+
// const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.transaction.id });
|
|
26
|
+
// if (typeof orderNumber !== 'string') {
|
|
27
|
+
// // 事前に発行されているはず
|
|
28
|
+
// throw new factory.errors.NotFound('transaction.object.orderNumber');
|
|
29
|
+
// }
|
|
30
30
|
// 取引内のアクションかどうか確認
|
|
31
31
|
const authorizeAction = await repos.action.findById({ typeOf: factory_2.factory.actionType.AuthorizeAction, id: params.id });
|
|
32
32
|
if (authorizeAction.purpose.typeOf !== transaction.typeOf || authorizeAction.purpose.id !== transaction.id) {
|
|
@@ -126,7 +126,7 @@ function changeOffers(params) {
|
|
|
126
126
|
responseBody: updTmpReserveSeatResult,
|
|
127
127
|
acceptedOffer: acceptedOffers,
|
|
128
128
|
event: screeningEvent,
|
|
129
|
-
seller: transaction.seller,
|
|
129
|
+
// seller: transaction.seller,
|
|
130
130
|
bookingTime: (0, moment_1.default)(authorizeAction.startDate)
|
|
131
131
|
.toDate(),
|
|
132
132
|
totalPrice: price
|
|
@@ -139,20 +139,23 @@ function changeOffers(params) {
|
|
|
139
139
|
// ActiveActionStatus->CompletedActionStatusで再実装(2024-01-15~)
|
|
140
140
|
await repos.action.reStart({ id: authorizeAction.id, typeOf: authorizeAction.typeOf });
|
|
141
141
|
try {
|
|
142
|
-
// まずvoidAcceptedOffer
|
|
143
|
-
// const orderNumberByTransaction = transaction.object.orderNumber;
|
|
144
|
-
const orderNumberByTransaction = orderNumber; // transaction.objectへのアクセス回避(2024-05-30~)
|
|
145
|
-
if (typeof orderNumberByTransaction === 'string') {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
142
|
+
// // まずvoidAcceptedOffer
|
|
143
|
+
// // const orderNumberByTransaction = transaction.object.orderNumber;
|
|
144
|
+
// const orderNumberByTransaction = orderNumber; // transaction.objectへのアクセス回避(2024-05-30~)
|
|
145
|
+
// if (typeof orderNumberByTransaction === 'string') {
|
|
146
|
+
// await voidAcceptedOffer({
|
|
147
|
+
// // authorizeActions: [authorizeAction],
|
|
148
|
+
// authorizeActionsWithInstrument: [authorizeAction],
|
|
149
|
+
// orderNumber: orderNumberByTransaction
|
|
150
|
+
// })(repos);
|
|
151
|
+
// }
|
|
152
|
+
await (0, any_1.voidAcceptedOffer)({
|
|
153
|
+
authorizeActionsWithInstrument: [authorizeAction],
|
|
154
|
+
placeOrderId: params.transaction.id
|
|
155
|
+
})(repos);
|
|
152
156
|
// add orderInTransaction(2024-01-15~)
|
|
153
157
|
// if (params.options.useCreateOrderOnOfferAccepted) {
|
|
154
158
|
await (0, any_1.acceptOffer)({
|
|
155
|
-
orderNumber,
|
|
156
159
|
project: transaction.project,
|
|
157
160
|
placeOrderId: params.transaction.id,
|
|
158
161
|
acceptedOffers: acceptedOffers4result
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
2
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
3
|
-
import type { EventRepo } from '../../repo/event';
|
|
4
3
|
import type { NoteRepo } from '../../repo/note';
|
|
5
4
|
import type { OrderRepo } from '../../repo/order';
|
|
6
|
-
import type { OwnershipInfoRepo } from '../../repo/ownershipInfo';
|
|
7
5
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
8
|
-
import type { SettingRepo } from '../../repo/setting';
|
|
9
|
-
import type { TaskRepo } from '../../repo/task';
|
|
10
|
-
import { factory } from '../../factory';
|
|
11
6
|
/**
|
|
12
7
|
* 注文に関わるリソースを削除する
|
|
13
8
|
* 冪等性を確保すること
|
|
14
9
|
*/
|
|
15
10
|
declare function deleteOrder(params: {
|
|
16
|
-
object:
|
|
11
|
+
object: {
|
|
12
|
+
/**
|
|
13
|
+
* 注文取引ID
|
|
14
|
+
*/
|
|
15
|
+
identifier: string;
|
|
16
|
+
};
|
|
17
17
|
}): (repos: {
|
|
18
18
|
acceptedOffer: AcceptedOfferRepo;
|
|
19
19
|
accountingReport: AccountingReportRepo;
|
|
20
|
-
event: EventRepo;
|
|
21
20
|
note: NoteRepo;
|
|
22
21
|
order: OrderRepo;
|
|
23
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
24
22
|
reservation: ReservationRepo;
|
|
25
|
-
setting: SettingRepo;
|
|
26
|
-
task: TaskRepo;
|
|
27
23
|
}) => Promise<void>;
|
|
28
24
|
export { deleteOrder };
|
|
@@ -9,23 +9,26 @@ const factory_1 = require("../../factory");
|
|
|
9
9
|
*/
|
|
10
10
|
function deleteOrder(params) {
|
|
11
11
|
return async (repos) => {
|
|
12
|
+
if (typeof params.object.identifier !== 'string' || params.object.identifier === '') {
|
|
13
|
+
throw new factory_1.factory.errors.ArgumentNull('object.identifier');
|
|
14
|
+
}
|
|
12
15
|
const orders = await repos.order.projectFields({
|
|
13
16
|
limit: 1,
|
|
14
17
|
page: 1,
|
|
15
|
-
orderNumbers: [params.object.orderNumber]
|
|
16
|
-
|
|
18
|
+
// orderNumbers: [params.object.orderNumber],
|
|
19
|
+
identifier: { $eq: params.object.identifier }
|
|
20
|
+
}, { inclusion: ['project', 'orderNumber'] });
|
|
17
21
|
const order = orders.shift();
|
|
18
22
|
if (order === undefined) {
|
|
19
23
|
// すでに削除済
|
|
20
24
|
return;
|
|
21
25
|
}
|
|
22
26
|
if (typeof order.id !== 'string') {
|
|
23
|
-
throw new factory_1.factory.errors.Internal(`order.id undefined. orderNumber: ${
|
|
27
|
+
throw new factory_1.factory.errors.Internal(`order.id undefined. orderNumber: ${order.orderNumber}`);
|
|
24
28
|
}
|
|
25
29
|
// 注文アイテムの予約を削除
|
|
26
30
|
await deleteReservationsByOrder(order)(repos);
|
|
27
31
|
// 所有権は所有期限でcleanされるので、注文削除時連動はひとまず廃止(2026-05-17~)
|
|
28
|
-
// // 所有権削除
|
|
29
32
|
// try {
|
|
30
33
|
// await deleteOwnershipInfosByOrder(order)(repos);
|
|
31
34
|
// } catch (error) {
|
|
@@ -42,50 +45,6 @@ function deleteOrder(params) {
|
|
|
42
45
|
});
|
|
43
46
|
// 注文削除
|
|
44
47
|
await repos.order.deleteByOrderNumber({ orderNumber: order.orderNumber });
|
|
45
|
-
// deletePerson(2024-12-25~)
|
|
46
|
-
await deletePersonIfNecessary(order)(repos);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function deletePersonIfNecessary(order) {
|
|
50
|
-
return async (repos) => {
|
|
51
|
-
// 代理注文を除く
|
|
52
|
-
const isCustomerPerson = order.customer.typeOf === factory_1.factory.personType.Person
|
|
53
|
-
&& typeof order.broker?.typeOf !== 'string';
|
|
54
|
-
if (isCustomerPerson) {
|
|
55
|
-
const ordersByPerson = await repos.order.projectFields({
|
|
56
|
-
limit: 1,
|
|
57
|
-
page: 1,
|
|
58
|
-
customer: { ids: [order.customer.id] }
|
|
59
|
-
}, { inclusion: ['orderNumber'] });
|
|
60
|
-
if (ordersByPerson.length === 0) {
|
|
61
|
-
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['userPoolIdNew']);
|
|
62
|
-
if (typeof setting?.userPoolIdNew !== 'string') {
|
|
63
|
-
throw new factory_1.factory.errors.NotFound('setting.userPoolIdNew');
|
|
64
|
-
}
|
|
65
|
-
const deletePersonTask = {
|
|
66
|
-
project: { typeOf: factory_1.factory.organizationType.Project, id: order.project.id },
|
|
67
|
-
name: factory_1.factory.taskName.DeletePerson,
|
|
68
|
-
status: factory_1.factory.taskStatus.Ready,
|
|
69
|
-
runsAt: new Date(),
|
|
70
|
-
remainingNumberOfTries: 10,
|
|
71
|
-
numberOfTried: 0,
|
|
72
|
-
executionResults: [],
|
|
73
|
-
data: {
|
|
74
|
-
id: order.customer.id,
|
|
75
|
-
agent: {
|
|
76
|
-
id: order.project.id,
|
|
77
|
-
typeOf: factory_1.factory.organizationType.Project,
|
|
78
|
-
name: factory_1.factory.organizationType.Project
|
|
79
|
-
},
|
|
80
|
-
physically: true,
|
|
81
|
-
userPoolId: setting.userPoolIdNew,
|
|
82
|
-
// migrate: false,
|
|
83
|
-
executeBackground: true
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
await repos.task.saveMany([deletePersonTask], { emitImmediately: true });
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
48
|
};
|
|
90
49
|
}
|
|
91
50
|
function deleteReservationsByOrder(order) {
|
|
@@ -7,5 +7,5 @@ import { factory } from '../../../../factory';
|
|
|
7
7
|
*/
|
|
8
8
|
declare function createOnOrderCancelledTasksByTransaction(params: {
|
|
9
9
|
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf'>;
|
|
10
|
-
}): (import("@chevre/factory/lib/chevre/task").ITaskAttributes | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/chevre/task/
|
|
10
|
+
}): (import("@chevre/factory/lib/chevre/task").ITaskAttributes | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/chevre/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/chevre/task/onEventChanged").IAttributes | import("@chevre/factory/lib/chevre/task/onResourceDeleted").IAttributes | import("@chevre/factory/lib/chevre/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/chevre/task/placeOrder").IAttributes | import("@chevre/factory/lib/chevre/task/returnOrder").IAttributes | import("@chevre/factory/lib/chevre/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/chevre/task/sendOrder").IAttributes | import("@chevre/factory/lib/chevre/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/chevre/task/useReservation").IAttributes | import("@chevre/factory/lib/chevre/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/voidReserveTransaction").IAttributes)[];
|
|
11
11
|
export { createOnOrderCancelledTasksByTransaction };
|
package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts
CHANGED
|
@@ -18,5 +18,5 @@ declare function createInformTasks(params: {
|
|
|
18
18
|
}, setting: Pick<ISetting, 'onOrderStatusChanged'> | null): factory.task.IAttributes<factory.taskName.TriggerWebhook>[];
|
|
19
19
|
declare function createNextSendOrderTasks(params: {
|
|
20
20
|
order: IInTransitOrder;
|
|
21
|
-
}): (import("@chevre/factory/lib/chevre/task").ITaskAttributes | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/chevre/task/
|
|
21
|
+
}): (import("@chevre/factory/lib/chevre/task").ITaskAttributes | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/chevre/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/chevre/task/onEventChanged").IAttributes | import("@chevre/factory/lib/chevre/task/onResourceDeleted").IAttributes | import("@chevre/factory/lib/chevre/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/chevre/task/placeOrder").IAttributes | import("@chevre/factory/lib/chevre/task/returnOrder").IAttributes | import("@chevre/factory/lib/chevre/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/chevre/task/sendOrder").IAttributes | import("@chevre/factory/lib/chevre/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/chevre/task/useReservation").IAttributes | import("@chevre/factory/lib/chevre/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/voidReserveTransaction").IAttributes)[];
|
|
22
22
|
export { createInformTasks, createNextSendOrderTasks, IInTransitOrder };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 注文決済時処理
|
|
3
|
+
*/
|
|
1
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
2
5
|
import { factory } from '../../../factory';
|
|
3
6
|
declare function onOrderPaymentDue(params: {
|
|
4
|
-
order: Pick<factory.order.IOrder, 'paymentMethods' | 'project' | 'orderNumber' | 'confirmationNumber' | 'orderDate' | '
|
|
7
|
+
order: Pick<factory.order.IOrder, 'paymentMethods' | 'project' | 'orderNumber' | 'confirmationNumber' | 'orderDate' | 'typeOf'> & {
|
|
5
8
|
orderStatus: factory.orderStatus.OrderPaymentDue;
|
|
6
9
|
};
|
|
7
10
|
}): (repos: {
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.onOrderPaymentDue = onOrderPaymentDue;
|
|
7
|
-
/**
|
|
8
|
-
* 注文決済時処理
|
|
9
|
-
*/
|
|
10
|
-
const debug_1 = __importDefault(require("debug"));
|
|
11
4
|
const factory_1 = require("../../../factory");
|
|
12
|
-
// import { createMaskedCustomer } from '../../../factory/order';
|
|
13
|
-
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
14
5
|
function onOrderPaymentDue(params) {
|
|
15
6
|
return async (repos) => {
|
|
16
|
-
debug('onOrderStatusChanged called.', params.order.orderNumber, params.order.orderStatus, params.order.orderDate);
|
|
17
7
|
let tasks;
|
|
18
|
-
// const maskedCustomer = createMaskedCustomer(params.order, { noProfile: true });
|
|
19
8
|
const simpleOrder = {
|
|
20
9
|
typeOf: params.order.typeOf,
|
|
21
|
-
// seller: {
|
|
22
|
-
// id: params.order.seller.id,
|
|
23
|
-
// typeOf: params.order.seller.typeOf,
|
|
24
|
-
// name: params.order.seller.name
|
|
25
|
-
// }, // 廃止(2024-03-06~)
|
|
26
|
-
// customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id }, // 廃止(2024-03-06~)
|
|
27
10
|
orderNumber: params.order.orderNumber,
|
|
28
|
-
// price: params.order.price,
|
|
29
|
-
// priceCurrency: params.order.priceCurrency,
|
|
30
11
|
orderDate: params.order.orderDate
|
|
31
12
|
};
|
|
32
13
|
switch (params.order.orderStatus) {
|
|
@@ -62,12 +43,7 @@ function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
|
62
43
|
object: { transactionNumber: { $eq: invoice.paymentMethodId } },
|
|
63
44
|
purpose: { orderNumber: { $eq: order.orderNumber } }
|
|
64
45
|
}
|
|
65
|
-
}, ['id']
|
|
66
|
-
// {
|
|
67
|
-
// data: 0, executionResults: 0, name: 0, numberOfTried: 0,
|
|
68
|
-
// remainingNumberOfTries: 0, runsAt: 0, status: 0
|
|
69
|
-
// }
|
|
70
|
-
);
|
|
46
|
+
}, ['id']);
|
|
71
47
|
if (existingTasks.length === 0) {
|
|
72
48
|
const data = {
|
|
73
49
|
project: order.project,
|
|
@@ -114,7 +90,6 @@ function createCreateAccountingReportTask(order) {
|
|
|
114
90
|
executionResults: [],
|
|
115
91
|
data: {
|
|
116
92
|
object: { mainEntity: { orderNumber: order.orderNumber } }
|
|
117
|
-
// project: { id: order.project.id }
|
|
118
93
|
}
|
|
119
94
|
};
|
|
120
95
|
return [task];
|
|
@@ -11,5 +11,5 @@ declare function createInformTasks(order: IReturnedOrder, returnOrderAction: IRe
|
|
|
11
11
|
declare function createOnOrderReturnedTasksByTransaction(params: {
|
|
12
12
|
order: Pick<factory.order.IOrder, 'project' | 'typeOf' | 'orderNumber' | 'customer' | 'price' | 'priceCurrency' | 'orderDate'>;
|
|
13
13
|
potentialActions?: factory.action.transfer.returnAction.order.IPotentialActions;
|
|
14
|
-
}): (import("@chevre/factory/lib/chevre/task").ITaskAttributes | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/chevre/task/
|
|
14
|
+
}): (import("@chevre/factory/lib/chevre/task").ITaskAttributes | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/chevre/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/chevre/task/onEventChanged").IAttributes | import("@chevre/factory/lib/chevre/task/onResourceDeleted").IAttributes | import("@chevre/factory/lib/chevre/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/chevre/task/placeOrder").IAttributes | import("@chevre/factory/lib/chevre/task/returnOrder").IAttributes | import("@chevre/factory/lib/chevre/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/chevre/task/sendOrder").IAttributes | import("@chevre/factory/lib/chevre/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/chevre/task/useReservation").IAttributes | import("@chevre/factory/lib/chevre/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/chevre/task/voidReserveTransaction").IAttributes)[];
|
|
15
15
|
export { createInformTasks, createOnOrderReturnedTasksByTransaction, IReturnAction };
|
|
@@ -89,8 +89,9 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
89
89
|
.map(({ instrument }) => String(instrument.transactionNumber));
|
|
90
90
|
try {
|
|
91
91
|
// すでにtypeOf: Orderに変更済の場合acceptedOffersは空になるが、そもそもorderedItemはその後上書きされないので、空のまま処理して問題なし
|
|
92
|
-
acceptedOffers = (await repos.orderInTransaction.
|
|
93
|
-
orderNumber,
|
|
92
|
+
acceptedOffers = (await repos.orderInTransaction.findAcceptedOffersWithPriceByIdentifier({
|
|
93
|
+
// orderNumber,
|
|
94
|
+
identifier: placeOrderTransactionWithResult.id,
|
|
94
95
|
project: { id: params.project.id }
|
|
95
96
|
}))
|
|
96
97
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
@@ -10,7 +10,7 @@ declare function createPaymentMethods(params: {
|
|
|
10
10
|
};
|
|
11
11
|
declare function createSeller(params: {
|
|
12
12
|
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'seller'>;
|
|
13
|
-
}): factory.order.ISeller
|
|
13
|
+
}): Pick<factory.order.ISeller, 'id' | 'name' | 'typeOf'>;
|
|
14
14
|
declare function createPlacingOrder(params: {
|
|
15
15
|
transaction: IPlaceOrderTransaction;
|
|
16
16
|
authorizePaymentActions: Pick<factory.action.authorize.paymentMethod.any.IAction, 'result'>[];
|
|
@@ -61,9 +61,9 @@ function createSeller(params) {
|
|
|
61
61
|
return {
|
|
62
62
|
id: seller.id,
|
|
63
63
|
name: (typeof seller.name === 'string') ? seller.name : String(seller.name?.ja),
|
|
64
|
-
typeOf: seller.typeOf
|
|
65
|
-
// 追加特性を追加(2023-08-08~)
|
|
66
|
-
additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : []
|
|
64
|
+
typeOf: seller.typeOf
|
|
65
|
+
// // 追加特性を追加(2023-08-08~)
|
|
66
|
+
// additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : []
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
function createPlacingOrder(params) {
|
|
@@ -79,7 +79,7 @@ function createPlacingOrder(params) {
|
|
|
79
79
|
throw new factory_1.factory.errors.Internal('object.orderNumber undefined');
|
|
80
80
|
}
|
|
81
81
|
if (orderDate === undefined) {
|
|
82
|
-
orderDateByTransaction = transaction.result?.order?.orderDate
|
|
82
|
+
// orderDateByTransaction = transaction.result?.order?.orderDate
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
85
|
orderDateByTransaction = orderDate;
|
|
@@ -91,7 +91,7 @@ function createPlacingOrder(params) {
|
|
|
91
91
|
// if (orderByTransaction === undefined) {
|
|
92
92
|
// throw new factory.errors.NotFound('transaction.result.order');
|
|
93
93
|
// }
|
|
94
|
-
const seller = createSeller({ transaction });
|
|
94
|
+
// const seller = createSeller({ transaction });
|
|
95
95
|
// discontinue(2026-06-11~)
|
|
96
96
|
// const name: string | undefined =
|
|
97
97
|
// (typeof transaction.object.name === 'string') ? transaction.object.name : undefined;
|
|
@@ -119,7 +119,7 @@ function createPlacingOrder(params) {
|
|
|
119
119
|
orderNumber,
|
|
120
120
|
typeOf: factory_1.factory.order.OrderType.Order, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
121
121
|
orderStatus: factory_1.factory.orderStatus.OrderPaymentDue, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
122
|
-
seller, //
|
|
122
|
+
// seller, // 取引開始時の注文ドキュメント作成へ移行(2026-06-25~)
|
|
123
123
|
paymentMethods, // 2024-06-17~
|
|
124
124
|
price, // 2024-06-17~
|
|
125
125
|
priceCurrency: factory_1.factory.priceCurrency.JPY, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
2
2
|
declare function voidAcceptedOfferIfNecessary(params: {
|
|
3
|
-
|
|
4
|
-
orderNumber: string;
|
|
5
|
-
};
|
|
3
|
+
placeOrderId: string;
|
|
6
4
|
serialNumbers: string[];
|
|
7
5
|
}): (repos: {
|
|
8
6
|
orderInTransaction: OrderInTransactionRepo;
|
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.voidAcceptedOfferIfNecessary = voidAcceptedOfferIfNecessary;
|
|
7
|
-
const debug_1 = __importDefault(require("debug"));
|
|
8
|
-
// import type { TransactionRepo } from '../../../repo/transaction';
|
|
9
|
-
// import { factory } from '../../../factory';
|
|
10
|
-
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
11
|
-
// type IPlaceOrderTransaction = Pick<
|
|
12
|
-
// factory.transaction.placeOrder.ITransaction,
|
|
13
|
-
// 'id' | 'project' | 'typeOf' | 'result' | 'object' | 'seller'
|
|
14
|
-
// >;
|
|
15
4
|
function voidAcceptedOfferIfNecessary(params) {
|
|
16
5
|
return async (repos) => {
|
|
17
6
|
if (Array.isArray(params.serialNumbers) && params.serialNumbers.length > 0) {
|
|
18
7
|
// 取引に保管された承認アクション以外のアクションについて、オファーを除外する
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
// const voidAcceptedOfferBySerialNumberResult =
|
|
9
|
+
await repos.orderInTransaction.voidAcceptedOfferByIdentifier({
|
|
10
|
+
identifier: params.placeOrderId,
|
|
22
11
|
acceptedOffers: { serialNumber: { $nin: params.serialNumbers } }
|
|
23
12
|
});
|
|
24
|
-
debug('voidAcceptedOfferBySerialNumber processed.', params.object.orderNumber, 'voidAcceptedOfferBySerialNumberResult:', voidAcceptedOfferBySerialNumberResult);
|
|
25
13
|
}
|
|
26
14
|
};
|
|
27
15
|
}
|
|
@@ -61,11 +61,11 @@ function placeOrder(params) {
|
|
|
61
61
|
try {
|
|
62
62
|
// 冗長なオファーを除外する(念のため)
|
|
63
63
|
await (0, voidAcceptedOfferIfNecessary_1.voidAcceptedOfferIfNecessary)({
|
|
64
|
-
object: { orderNumber: order.orderNumber },
|
|
65
|
-
|
|
64
|
+
// object: { orderNumber: order.orderNumber },
|
|
65
|
+
placeOrderId: placeOrderTransaction.id,
|
|
66
66
|
serialNumbers
|
|
67
67
|
})(repos);
|
|
68
|
-
await repos.orderInTransaction.
|
|
68
|
+
await repos.orderInTransaction.placeOrderByIdentifier({ identifier: placeOrderTransaction.id }, order);
|
|
69
69
|
}
|
|
70
70
|
catch (error) {
|
|
71
71
|
try {
|
|
@@ -89,10 +89,10 @@ function placeOrder(params) {
|
|
|
89
89
|
orderNumber: order.orderNumber,
|
|
90
90
|
confirmationNumber: order.confirmationNumber,
|
|
91
91
|
orderDate: order.orderDate,
|
|
92
|
-
seller: order.seller,
|
|
92
|
+
// seller: order.seller,
|
|
93
93
|
typeOf: order.typeOf,
|
|
94
|
-
price: order.price,
|
|
95
|
-
priceCurrency: order.priceCurrency,
|
|
94
|
+
// price: order.price,
|
|
95
|
+
// priceCurrency: order.priceCurrency,
|
|
96
96
|
orderStatus: order.orderStatus
|
|
97
97
|
}
|
|
98
98
|
})({
|
|
@@ -6,5 +6,4 @@ import { paymentDue2Processing } from './order/onAssetTransactionStatusChanged';
|
|
|
6
6
|
import { processOrder } from './order/onOrderStatusChanged';
|
|
7
7
|
import { onOrderUpdated } from './order/onOrderUpdated';
|
|
8
8
|
import { placeOrder } from './order/placeOrder';
|
|
9
|
-
|
|
10
|
-
export { confirmPayTransaction, onOrderUpdated, paymentDue2Processing, placeOrder, placeOrderWithoutTransaction, processOrder, };
|
|
9
|
+
export { confirmPayTransaction, onOrderUpdated, paymentDue2Processing, placeOrder, processOrder, };
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processOrder = exports.
|
|
3
|
+
exports.processOrder = exports.placeOrder = exports.paymentDue2Processing = exports.onOrderUpdated = exports.confirmPayTransaction = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* 注文サービス
|
|
6
6
|
*/
|
|
7
7
|
const confirmPayTransaction_1 = require("./order/confirmPayTransaction");
|
|
8
8
|
Object.defineProperty(exports, "confirmPayTransaction", { enumerable: true, get: function () { return confirmPayTransaction_1.confirmPayTransaction; } });
|
|
9
|
-
// import { deleteOrder } from './order/deleteOrder';
|
|
10
9
|
const onAssetTransactionStatusChanged_1 = require("./order/onAssetTransactionStatusChanged");
|
|
11
10
|
Object.defineProperty(exports, "paymentDue2Processing", { enumerable: true, get: function () { return onAssetTransactionStatusChanged_1.paymentDue2Processing; } });
|
|
12
11
|
const onOrderStatusChanged_1 = require("./order/onOrderStatusChanged");
|
|
13
12
|
Object.defineProperty(exports, "processOrder", { enumerable: true, get: function () { return onOrderStatusChanged_1.processOrder; } });
|
|
14
13
|
const onOrderUpdated_1 = require("./order/onOrderUpdated");
|
|
15
14
|
Object.defineProperty(exports, "onOrderUpdated", { enumerable: true, get: function () { return onOrderUpdated_1.onOrderUpdated; } });
|
|
16
|
-
// import { payOrder } from './order/payOrder';
|
|
17
15
|
const placeOrder_1 = require("./order/placeOrder");
|
|
18
16
|
Object.defineProperty(exports, "placeOrder", { enumerable: true, get: function () { return placeOrder_1.placeOrder; } });
|
|
19
|
-
const placeOrderWithoutTransaction_1 = require("./order/placeOrderWithoutTransaction");
|
|
20
|
-
Object.defineProperty(exports, "placeOrderWithoutTransaction", { enumerable: true, get: function () { return placeOrderWithoutTransaction_1.placeOrderWithoutTransaction; } });
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../../factory';
|
|
2
2
|
import type { ConfirmationNumberRepo } from '../../../../repo/confirmationNumber';
|
|
3
|
-
import type {
|
|
4
|
-
import type { ProjectRepo } from '../../../../repo/project';
|
|
3
|
+
import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
|
|
5
4
|
import type { PlaceOrderRepo } from '../../../../repo/transaction/placeOrder';
|
|
6
5
|
declare function fixOrderAsNeeded(params: {
|
|
7
6
|
project: {
|
|
@@ -9,10 +8,9 @@ declare function fixOrderAsNeeded(params: {
|
|
|
9
8
|
};
|
|
10
9
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
11
10
|
}): (repos: {
|
|
12
|
-
project: ProjectRepo;
|
|
13
11
|
placeOrder: PlaceOrderRepo;
|
|
14
12
|
confirmationNumber: ConfirmationNumberRepo;
|
|
15
|
-
|
|
13
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
16
14
|
}) => Promise<{
|
|
17
15
|
confirmationNumber: string;
|
|
18
16
|
orderNumber: string;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fixOrderAsNeeded = fixOrderAsNeeded;
|
|
4
4
|
const factory_1 = require("../../../../factory");
|
|
5
5
|
const publishConfirmationNumberIfNotExist_1 = require("../../../transaction/placeOrder/publishConfirmationNumberIfNotExist");
|
|
6
|
-
const issueOrderNumberIfNotExist_1 = require("../../../transaction/placeOrder/issueOrderNumberIfNotExist");
|
|
7
6
|
function fixOrderAsNeeded(params) {
|
|
8
7
|
return async (repos) => {
|
|
9
8
|
const orderDate = new Date();
|
|
@@ -17,12 +16,11 @@ function fixOrderAsNeeded(params) {
|
|
|
17
16
|
object: { orderDate }
|
|
18
17
|
})(repos);
|
|
19
18
|
// }
|
|
20
|
-
//
|
|
21
|
-
const orderNumber = await
|
|
19
|
+
// 注文ドキュメントを参照(2026-06-24~)
|
|
20
|
+
const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
21
|
+
identifier: params.purpose.id,
|
|
22
22
|
project: { id: params.project.id },
|
|
23
|
-
|
|
24
|
-
object: { orderDate }
|
|
25
|
-
})(repos);
|
|
23
|
+
}, { onlyPlaceOrder: true });
|
|
26
24
|
return { confirmationNumber, orderNumber };
|
|
27
25
|
};
|
|
28
26
|
}
|
|
@@ -14,6 +14,7 @@ import type { CredentialsRepo } from '../../../repo/credentials';
|
|
|
14
14
|
import type { EventRepo } from '../../../repo/event';
|
|
15
15
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
16
16
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
17
|
+
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
17
18
|
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
18
19
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
19
20
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
@@ -43,6 +44,7 @@ interface IAuthorizeRepos {
|
|
|
43
44
|
event: EventRepo;
|
|
44
45
|
eventSeries: EventSeriesRepo;
|
|
45
46
|
issuer: IssuerRepo;
|
|
47
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
46
48
|
orderNumber: OrderNumberRepo;
|
|
47
49
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
48
50
|
paymentService: PaymentServiceRepo;
|
|
@@ -7,10 +7,8 @@ import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
|
7
7
|
import type { EventRepo } from '../../../repo/event';
|
|
8
8
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
9
9
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
10
|
-
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
11
10
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
12
11
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
13
|
-
import type { ProjectRepo } from '../../../repo/project';
|
|
14
12
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
15
13
|
import type { TicketRepo } from '../../../repo/ticket';
|
|
16
14
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
@@ -24,11 +22,9 @@ interface IPublishPaymentUrlRepos {
|
|
|
24
22
|
event: EventRepo;
|
|
25
23
|
eventSeries: EventSeriesRepo;
|
|
26
24
|
issuer: IssuerRepo;
|
|
27
|
-
orderNumber: OrderNumberRepo;
|
|
28
25
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
29
26
|
paymentService: PaymentServiceRepo;
|
|
30
27
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
31
|
-
project: ProjectRepo;
|
|
32
28
|
ticket: TicketRepo;
|
|
33
29
|
placeOrder: PlaceOrderRepo;
|
|
34
30
|
transactionNumber: TransactionNumberRepo;
|
|
@@ -35,9 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.publishPaymentUrl = publishPaymentUrl;
|
|
37
37
|
const factory_1 = require("../../../factory");
|
|
38
|
-
// import type { TransactionProcessRepo } from '../../repo/transactionProcess';
|
|
39
38
|
const PayTransactionService = __importStar(require("../../assetTransaction/pay"));
|
|
40
|
-
const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
|
|
41
39
|
const fixTransactionNumberOnPublishPaymentUrl_1 = require("./publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl");
|
|
42
40
|
const factory_2 = require("./factory");
|
|
43
41
|
/**
|
|
@@ -54,12 +52,11 @@ function publishPaymentUrl(params) {
|
|
|
54
52
|
if (project.id !== transaction.project.id) {
|
|
55
53
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
|
|
56
54
|
}
|
|
57
|
-
//
|
|
58
|
-
await
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})(repos);
|
|
55
|
+
// // 注文ドキュメントを参照(2026-06-24~)
|
|
56
|
+
// const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
57
|
+
// identifier: transaction.id,
|
|
58
|
+
// project: { id: transaction.project.id },
|
|
59
|
+
// });
|
|
63
60
|
// 取引番号生成
|
|
64
61
|
const { transactionNumber, ticketToken } = await (0, fixTransactionNumberOnPublishPaymentUrl_1.fixTransactionNumberOnPublishPaymentUrl)({
|
|
65
62
|
object: params.object,
|