@chevre/domain 25.0.0-alpha.8 → 25.0.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.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +11 -110
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +7 -15
- package/lib/chevre/repo/mongoose/schemas/setting.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.js +51 -50
- package/lib/chevre/repo/order.d.ts +3 -7
- package/lib/chevre/repo/order.js +56 -26
- package/lib/chevre/repo/orderInTransaction.d.ts +45 -22
- package/lib/chevre/repo/orderInTransaction.js +108 -77
- package/lib/chevre/repo/orderNumber.d.ts +4 -0
- package/lib/chevre/repo/orderNumber.js +32 -60
- package/lib/chevre/repo/passport.d.ts +5 -2
- 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 +5 -0
- package/lib/chevre/repository.js +11 -0
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
- package/lib/chevre/service/offer/any.d.ts +2 -3
- package/lib/chevre/service/offer/any.js +8 -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 +6 -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 +7 -7
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +21 -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 +20 -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
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.authorize = authorize;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
|
|
6
5
|
const any_1 = require("../any");
|
|
7
6
|
const defaultOffer_1 = require("./authorize/defaultOffer");
|
|
8
7
|
const factory_2 = require("./authorize/factory");
|
|
@@ -25,11 +24,11 @@ function authorize(params, options) {
|
|
|
25
24
|
})(repos);
|
|
26
25
|
let acceptedOffers4result;
|
|
27
26
|
const now = new Date();
|
|
28
|
-
|
|
27
|
+
// 注文ドキュメントを参照(2026-06-24~)
|
|
28
|
+
const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
29
|
+
identifier: transaction.id,
|
|
29
30
|
project: { id: params.project.id },
|
|
30
|
-
|
|
31
|
-
object: { orderDate: now }
|
|
32
|
-
})(repos);
|
|
31
|
+
}, { onlyPlaceOrder: true });
|
|
33
32
|
// まず取引番号発行
|
|
34
33
|
const { transactionNumber } = await repos.transactionNumber.publishByTimestamp({ startDate: now });
|
|
35
34
|
const actionAttributes = (0, factory_2.createAuthorizeSeatReservationActionAttributes)({
|
|
@@ -64,10 +63,9 @@ function authorize(params, options) {
|
|
|
64
63
|
};
|
|
65
64
|
});
|
|
66
65
|
await (0, any_1.acceptOffer)({
|
|
67
|
-
orderNumber,
|
|
68
66
|
project: transaction.project,
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
placeOrderId: transaction.id,
|
|
68
|
+
acceptedOffers: minimizedAcceptedOffers
|
|
71
69
|
})(repos);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
@@ -48,23 +48,35 @@ function voidTransaction(params) {
|
|
|
48
48
|
default:
|
|
49
49
|
// no op
|
|
50
50
|
}
|
|
51
|
-
// add orderInTransaction(2024-01-15~)
|
|
52
|
-
// USE_CREATE_ORDER_ON_OFFER_ACCEPTEDの場合、orderNumber発行済のはず
|
|
53
|
-
const orderNumberByTransaction = transaction.object.orderNumber;
|
|
54
|
-
if (typeof orderNumberByTransaction === 'string') {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
// // add orderInTransaction(2024-01-15~)
|
|
52
|
+
// // USE_CREATE_ORDER_ON_OFFER_ACCEPTEDの場合、orderNumber発行済のはず
|
|
53
|
+
// const orderNumberByTransaction = transaction.object.orderNumber;
|
|
54
|
+
// if (typeof orderNumberByTransaction === 'string') {
|
|
55
|
+
// switch (transaction.status) {
|
|
56
|
+
// case factory.transactionStatusType.Confirmed:
|
|
57
|
+
// // 確定取引の場合、不要なオファーのみ除外
|
|
58
|
+
// await voidAcceptedOffer({
|
|
59
|
+
// // authorizeActions,
|
|
60
|
+
// authorizeActionsWithInstrument: authorizeActions,
|
|
61
|
+
// orderNumber: orderNumberByTransaction
|
|
62
|
+
// })(repos);
|
|
63
|
+
// break;
|
|
64
|
+
// default:
|
|
65
|
+
// // orderInTransaction自体を削除
|
|
66
|
+
// await repos.orderInTransaction.deleteByOrderNumber({ orderNumber: orderNumberByTransaction });
|
|
67
|
+
// }
|
|
68
|
+
// }
|
|
69
|
+
switch (transaction.status) {
|
|
70
|
+
case factory_1.factory.transactionStatusType.Confirmed:
|
|
71
|
+
// 確定取引の場合、不要なオファーのみ除外
|
|
72
|
+
await (0, any_1.voidAcceptedOffer)({
|
|
73
|
+
authorizeActionsWithInstrument: authorizeActions,
|
|
74
|
+
placeOrderId: params.purpose.id
|
|
75
|
+
})(repos);
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
// orderInTransaction自体を削除
|
|
79
|
+
await repos.orderInTransaction.deleteByIdentifier({ identifier: params.purpose.id });
|
|
68
80
|
}
|
|
69
81
|
await Promise.all(authorizeActions.map(async (action) => {
|
|
70
82
|
await repos.authorizeOfferAction.cancelWithVoid({ typeOf: action.typeOf, id: action.id, cancelAction });
|
|
@@ -26,7 +26,7 @@ function voidTransactionByActionId(params) {
|
|
|
26
26
|
// if (transaction.agent.id !== params.agent.id) {
|
|
27
27
|
// throw new factory.errors.Forbidden('Transaction not yours');
|
|
28
28
|
// }
|
|
29
|
-
const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.purpose.id });
|
|
29
|
+
// const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.purpose.id });
|
|
30
30
|
const action = await repos.authorizeOfferAction.findById({ typeOf: factory_1.factory.actionType.AuthorizeAction, id: params.id });
|
|
31
31
|
if (action.purpose.typeOf !== transaction.typeOf || action.purpose.id !== transaction.id) {
|
|
32
32
|
throw new factory_1.factory.errors.Argument('Transaction', 'Action not found in the transaction');
|
|
@@ -34,17 +34,21 @@ function voidTransactionByActionId(params) {
|
|
|
34
34
|
// MongoDBでcompleteステータスであるにも関わらず、Chevreでは削除されている、というのが最悪の状況
|
|
35
35
|
// それだけは回避するためにMongoDBを先に変更
|
|
36
36
|
await repos.authorizeOfferAction.cancelWithVoid({ typeOf: factory_1.factory.actionType.AuthorizeAction, id: params.id, cancelAction });
|
|
37
|
-
// add orderInTransaction(2024-01-15~)
|
|
38
|
-
// USE_CREATE_ORDER_ON_OFFER_ACCEPTEDの場合、orderNumber発行済のはず
|
|
39
|
-
// const orderNumberByTransaction = transaction.object.orderNumber;
|
|
40
|
-
const orderNumberByTransaction = orderNumber; // transaction.objectへのアクセス回避(2024-05-30~)
|
|
41
|
-
if (typeof orderNumberByTransaction === 'string') {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
37
|
+
// // add orderInTransaction(2024-01-15~)
|
|
38
|
+
// // USE_CREATE_ORDER_ON_OFFER_ACCEPTEDの場合、orderNumber発行済のはず
|
|
39
|
+
// // const orderNumberByTransaction = transaction.object.orderNumber;
|
|
40
|
+
// const orderNumberByTransaction = orderNumber; // transaction.objectへのアクセス回避(2024-05-30~)
|
|
41
|
+
// if (typeof orderNumberByTransaction === 'string') {
|
|
42
|
+
// await voidAcceptedOffer({
|
|
43
|
+
// // authorizeActions: [action],
|
|
44
|
+
// authorizeActionsWithInstrument: [action],
|
|
45
|
+
// orderNumber: orderNumberByTransaction
|
|
46
|
+
// })(repos);
|
|
47
|
+
// }
|
|
48
|
+
await (0, any_1.voidAcceptedOffer)({
|
|
49
|
+
authorizeActionsWithInstrument: [action],
|
|
50
|
+
placeOrderId: params.purpose.id
|
|
51
|
+
})(repos);
|
|
48
52
|
switch (action.instrument.typeOf) {
|
|
49
53
|
case factory_1.factory.assetTransactionType.COAReserveTransaction: {
|
|
50
54
|
const { reserveService } = repos;
|
|
@@ -2,15 +2,11 @@ import type { COA } from '@motionpicture/coa-service';
|
|
|
2
2
|
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
3
3
|
import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
|
|
4
4
|
import type { EventRepo } from '../../../repo/event';
|
|
5
|
-
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
6
|
-
import type { ProjectRepo } from '../../../repo/project';
|
|
7
5
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
8
6
|
import { factory } from '../../../factory';
|
|
9
7
|
interface IAcceptRepos {
|
|
10
8
|
action: AcceptCOAOfferActionRepo;
|
|
11
9
|
event: EventRepo;
|
|
12
|
-
orderNumber: OrderNumberRepo;
|
|
13
|
-
project: ProjectRepo;
|
|
14
10
|
placeOrder: PlaceOrderRepo;
|
|
15
11
|
reserveService: COA.service.Reserve;
|
|
16
12
|
masterService: COA.service.Master;
|
|
@@ -19,8 +15,6 @@ interface IReAcceptRepos {
|
|
|
19
15
|
action: AcceptCOAOfferActionRepo;
|
|
20
16
|
authorizeOfferAction: AuthorizeOfferActionRepo;
|
|
21
17
|
event: EventRepo;
|
|
22
|
-
orderNumber: OrderNumberRepo;
|
|
23
|
-
project: ProjectRepo;
|
|
24
18
|
placeOrder: PlaceOrderRepo;
|
|
25
19
|
reserveService: COA.service.Reserve;
|
|
26
20
|
masterService: COA.service.Master;
|
|
@@ -4,7 +4,6 @@ exports.acceptOffer = acceptOffer;
|
|
|
4
4
|
exports.reAcceptOffer = reAcceptOffer;
|
|
5
5
|
const errorHandler_1 = require("../../../errorHandler");
|
|
6
6
|
const factory_1 = require("../../../factory");
|
|
7
|
-
const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
|
|
8
7
|
const authorize_1 = require("./acceptOffer/authorize");
|
|
9
8
|
const factory_2 = require("./acceptOffer/factory");
|
|
10
9
|
function findCOAInfo(params) {
|
|
@@ -39,12 +38,11 @@ function acceptOffer(params) {
|
|
|
39
38
|
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
40
39
|
id: params.purpose.id
|
|
41
40
|
}, ['project', 'agent', 'typeOf']);
|
|
42
|
-
//
|
|
43
|
-
await
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})(repos);
|
|
41
|
+
// // 注文ドキュメントを参照(2026-06-24~)
|
|
42
|
+
// const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
43
|
+
// identifier: transaction.id,
|
|
44
|
+
// project: { id: transaction.project.id },
|
|
45
|
+
// });
|
|
48
46
|
const coaInfo = await findCOAInfo({ id: params.object.event.id, project: { id: transaction.project.id } })(repos);
|
|
49
47
|
const updTmpReserveSeatArgs = (0, factory_2.createUpdTmpReserveSeatArgs)({ object: params.object, coaInfo });
|
|
50
48
|
let updTmpReserveSeatResult;
|
|
@@ -125,11 +123,11 @@ function reAcceptOffer(params) {
|
|
|
125
123
|
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
126
124
|
id: params.purpose.id
|
|
127
125
|
}, ['project', 'agent', 'typeOf']);
|
|
128
|
-
const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: transaction.id });
|
|
129
|
-
if (typeof orderNumber !== 'string') {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
126
|
+
// const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: transaction.id });
|
|
127
|
+
// if (typeof orderNumber !== 'string') {
|
|
128
|
+
// // 事前に発行されているはず
|
|
129
|
+
// throw new factory.errors.NotFound('transaction.object.orderNumber');
|
|
130
|
+
// }
|
|
133
131
|
const coaInfo = await findCOAInfo({ id: params.object.event.id, project: { id: transaction.project.id } })(repos);
|
|
134
132
|
// 承認アクション存在検証
|
|
135
133
|
await repos.authorizeOfferAction.findById({ id: params.potentialActions.id, typeOf: factory_1.factory.actionType.AuthorizeAction }, ['id'], []);
|
|
@@ -32,7 +32,7 @@ export declare function responseBody2acceptedOffers4result(params: {
|
|
|
32
32
|
responseBody: IResponseBody;
|
|
33
33
|
acceptedOffer: IAcceptedOffer4COA[];
|
|
34
34
|
event: Pick<IMinimizedIndividualEvent, 'coaInfo' | 'doorTime' | 'endDate' | 'id' | 'location' | 'startDate' | 'superEvent' | 'typeOf' | 'identifier' | 'name'>;
|
|
35
|
-
seller
|
|
35
|
+
seller?: never;
|
|
36
36
|
bookingTime: Date;
|
|
37
37
|
totalPrice: number;
|
|
38
38
|
}): IResultAcceptedOffer[];
|
|
@@ -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,8 +117,8 @@ 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,
|
|
121
|
+
placeOrderId: params.transaction.id,
|
|
122
122
|
acceptedOffers: acceptedOffers4result
|
|
123
123
|
})(repos);
|
|
124
124
|
// }
|
|
@@ -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,21 +139,25 @@ 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,
|
|
160
|
+
placeOrderId: params.transaction.id,
|
|
157
161
|
acceptedOffers: acceptedOffers4result
|
|
158
162
|
})(repos);
|
|
159
163
|
// }
|
|
@@ -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;
|