@chevre/domain 24.0.0-alpha.32 → 24.0.0-alpha.34
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/factory/transaction.d.ts +0 -3
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/action/authorizeOffer.d.ts +16 -1
- package/lib/chevre/repo/action/authorizeOffer.js +21 -2
- package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +12 -0
- package/lib/chevre/repo/action/authorizePaymentMethod.js +14 -0
- package/lib/chevre/repo/action/authorizeTicketedObject.d.ts +8 -0
- package/lib/chevre/repo/action/authorizeTicketedObject.js +11 -0
- package/lib/chevre/repo/action.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +1 -2
- package/lib/chevre/repo/passport.d.ts +1 -1
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/transaction.d.ts +1 -39
- package/lib/chevre/repository.d.ts +5 -10
- package/lib/chevre/repository.js +11 -22
- package/lib/chevre/service/delivery/factory.js +4 -4
- package/lib/chevre/service/offer/any.d.ts +1 -1
- package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +16 -14
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +3 -3
- package/lib/chevre/service/offer.d.ts +1 -2
- package/lib/chevre/service/offer.js +1 -3
- 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/onOrderProcessing/processOrder.js +54 -36
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +78 -64
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +5 -2
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +40 -25
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +0 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +3 -8
- package/lib/chevre/service/order/placeOrder/factory.js +5 -5
- package/lib/chevre/service/order/placeOrder.d.ts +4 -0
- package/lib/chevre/service/order/placeOrder.js +6 -1
- package/lib/chevre/service/task/deletePerson.js +0 -1
- package/lib/chevre/service/task/deleteTransaction.js +0 -2
- package/lib/chevre/service/task/placeOrder.js +4 -0
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +0 -2
- package/lib/chevre/service/transaction/deleteTransaction.js +2 -47
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.js +2 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +3 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +12 -17
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -15
- package/lib/chevre/service/transaction.d.ts +0 -4
- package/lib/chevre/service/transaction.js +1 -11
- package/lib/chevre/service/validation/validateOrder.js +2 -2
- package/package.json +3 -3
- package/lib/chevre/repo/action/authorizeMoneyTransferOffer.d.ts +0 -40
- package/lib/chevre/repo/action/authorizeMoneyTransferOffer.js +0 -61
- package/lib/chevre/repo/transaction/moneyTransfer.d.ts +0 -61
- package/lib/chevre/repo/transaction/moneyTransfer.js +0 -379
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +0 -38
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +0 -250
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.d.ts +0 -16
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +0 -96
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.d.ts +0 -9
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +0 -91
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.d.ts +0 -10
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +0 -81
- package/lib/chevre/service/offer/moneyTransfer.d.ts +0 -5
- package/lib/chevre/service/offer/moneyTransfer.js +0 -11
- package/lib/chevre/service/task/confirmMoneyTransfer.d.ts +0 -6
- package/lib/chevre/service/task/confirmMoneyTransfer.js +0 -19
- package/lib/chevre/service/task/returnMoneyTransfer.d.ts +0 -6
- package/lib/chevre/service/task/returnMoneyTransfer.js +0 -55
- package/lib/chevre/service/task/voidMoneyTransferTransaction.d.ts +0 -6
- package/lib/chevre/service/task/voidMoneyTransferTransaction.js +0 -27
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.d.ts +0 -9
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +0 -138
- package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +0 -2
- package/lib/chevre/service/transaction/moneyTransfer/factory.js +0 -55
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +0 -9
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +0 -65
- package/lib/chevre/service/transaction/moneyTransfer.d.ts +0 -72
- package/lib/chevre/service/transaction/moneyTransfer.js +0 -649
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IAuthorizeEventServiceOffer,
|
|
2
|
-
declare function validatePrice(authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[], authorizeProductOfferActions: Pick<IAuthorizeProductOffer, 'id' | 'result'>[]
|
|
1
|
+
import { IAuthorizeEventServiceOffer, IAuthorizePaymentAction, IAuthorizeProductOffer } from './factory';
|
|
2
|
+
declare function validatePrice(authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[], authorizeProductOfferActions: Pick<IAuthorizeProductOffer, 'id' | 'result'>[]): void;
|
|
3
3
|
export { validatePrice };
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.validatePrice = validatePrice;
|
|
27
27
|
const factory = __importStar(require("../../../../../factory"));
|
|
28
|
-
function validatePrice(authorizePaymentActions, authorizeEventServiceOfferActions, authorizeProductOfferActions
|
|
28
|
+
function validatePrice(authorizePaymentActions, authorizeEventServiceOfferActions, authorizeProductOfferActions) {
|
|
29
29
|
let priceByAgent = 0;
|
|
30
30
|
let priceBySeller = 0;
|
|
31
31
|
// 決済承認を確認
|
|
@@ -42,8 +42,7 @@ function validatePrice(authorizePaymentActions, authorizeEventServiceOfferAction
|
|
|
42
42
|
// 販売者が提供するアイテムの発生金額
|
|
43
43
|
[
|
|
44
44
|
...authorizeEventServiceOfferActions,
|
|
45
|
-
...authorizeProductOfferActions
|
|
46
|
-
...authorizeMoneyTansferActions
|
|
45
|
+
...authorizeProductOfferActions
|
|
47
46
|
].forEach(({ id, result }) => {
|
|
48
47
|
const priceByAction = result?.price;
|
|
49
48
|
if (typeof priceByAction === 'number' && priceByAction >= 0) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as factory from '../../../../factory';
|
|
2
2
|
import { placeOrder as PlaceOrderFactory } from '../../../../factory/transaction';
|
|
3
|
-
import { IAcceptPayAction, IAuthorizeEventServiceOffer,
|
|
4
|
-
export { IAcceptPayAction, IAuthorizeEventServiceOffer,
|
|
3
|
+
import { IAcceptPayAction, IAuthorizeEventServiceOffer, IAuthorizePaymentAction, IAuthorizeProductOffer, IPayTransaction } from './validation/factory';
|
|
4
|
+
export { IAcceptPayAction, IAuthorizeEventServiceOffer, IAuthorizePaymentAction, IAuthorizeProductOffer, IPayTransaction };
|
|
5
5
|
/**
|
|
6
6
|
* 取引が確定可能な状態かどうかをチェックする
|
|
7
7
|
*/
|
|
8
|
-
export declare function validateTransaction(transaction: Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'object'>, acceptPayActions: IAcceptPayAction[], authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[],
|
|
8
|
+
export declare function validateTransaction(transaction: Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'object'>, acceptPayActions: IAcceptPayAction[], authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[], authorizeProductOfferActions: Pick<IAuthorizeProductOffer, 'id' | 'result'>[], eventReservationAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IReservation>[], payTransactions: IPayTransaction[], customer: factory.order.ICustomer): void;
|
|
9
9
|
export type IOrderURLGenerator = (order: factory.order.IOrder) => string;
|
|
10
10
|
/**
|
|
11
11
|
* 注文オファー数検証
|
|
@@ -44,10 +44,10 @@ const debug = (0, debug_1.default)('chevre-domain:service:transaction');
|
|
|
44
44
|
/**
|
|
45
45
|
* 取引が確定可能な状態かどうかをチェックする
|
|
46
46
|
*/
|
|
47
|
-
function validateTransaction(transaction, acceptPayActions, authorizePaymentActions, authorizeEventServiceOfferActions,
|
|
47
|
+
function validateTransaction(transaction, acceptPayActions, authorizePaymentActions, authorizeEventServiceOfferActions, authorizeProductOfferActions, eventReservationAcceptedOffers, payTransactions, customer) {
|
|
48
48
|
// validateProfile(transaction);
|
|
49
49
|
validateProfile({ customer });
|
|
50
|
-
(0, validatePrice_1.validatePrice)(authorizePaymentActions, authorizeEventServiceOfferActions, authorizeProductOfferActions
|
|
50
|
+
(0, validatePrice_1.validatePrice)(authorizePaymentActions, authorizeEventServiceOfferActions, authorizeProductOfferActions);
|
|
51
51
|
// 請求のreferencesOrder検証(2025-11-23~)
|
|
52
52
|
(0, validateInvoiceReferencesOrder_1.validateInvoiceReferencesOrder)(authorizePaymentActions, eventReservationAcceptedOffers);
|
|
53
53
|
// 利用可能な通貨単位に対して取引検証
|
|
@@ -118,7 +118,7 @@ function confirm(params, options) {
|
|
|
118
118
|
}
|
|
119
119
|
const {
|
|
120
120
|
// acceptedOffersFromAuthorizeAction, // discontinue(2024-06-17~)
|
|
121
|
-
authorizePaymentActions, authorizeEventServiceOfferActions,
|
|
121
|
+
authorizePaymentActions, authorizeEventServiceOfferActions, authorizeProductOfferActions, serialNumbers } = dissolveAuthorizeActions(completedAuthorizeActions);
|
|
122
122
|
// orderInTransactionから検索する(2024-03-04~)
|
|
123
123
|
const acceptedOffers = (await repos.orderInTransaction.findAcceptedOffersByOrderNumber({ orderNumber: { $eq: orderNumber } }))
|
|
124
124
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
@@ -141,7 +141,7 @@ function confirm(params, options) {
|
|
|
141
141
|
...params,
|
|
142
142
|
orderNumber, transaction,
|
|
143
143
|
acceptPayActions,
|
|
144
|
-
authorizePaymentActions, authorizeEventServiceOfferActions,
|
|
144
|
+
authorizePaymentActions, authorizeEventServiceOfferActions, authorizeProductOfferActions,
|
|
145
145
|
acceptedOffers, payTransactions, customer,
|
|
146
146
|
...(typeof code === 'string') ? { code } : undefined
|
|
147
147
|
}, options);
|
|
@@ -240,7 +240,6 @@ function dissolveAuthorizeActions(completedAuthorizeActions) {
|
|
|
240
240
|
// const acceptedOffersFromAuthorizeAction: IOrderAcceptedOffer[] = []; // discontinue(2024-06-17~)
|
|
241
241
|
const authorizePaymentActions = [];
|
|
242
242
|
const authorizeEventServiceOfferActions = [];
|
|
243
|
-
const authorizeMoneyTansferActions = [];
|
|
244
243
|
const authorizeProductOfferActions = [];
|
|
245
244
|
const serialNumbers = [];
|
|
246
245
|
completedAuthorizeActions.forEach((a) => {
|
|
@@ -261,11 +260,12 @@ function dissolveAuthorizeActions(completedAuthorizeActions) {
|
|
|
261
260
|
throw new factory.errors.NotFound('instrument.transactionNumber', `action.instrument.transactionNumber not found. [${a.id}]`);
|
|
262
261
|
}
|
|
263
262
|
serialNumber = assetTransactionNumber;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
&& a.object.itemOffered?.typeOf === factory.actionType.MoneyTransfer
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
// } else if (
|
|
264
|
+
// a.object.typeOf === factory.offerType.Offer
|
|
265
|
+
// && a.object.itemOffered?.typeOf === factory.actionType.MoneyTransfer
|
|
266
|
+
// ) {
|
|
267
|
+
// authorizeMoneyTansferActions.push(<IAuthorizeMoneyTransferOffer>a);
|
|
268
|
+
// serialNumber = (<IAuthorizeMoneyTransferOffer>a).instrument.transactionNumber;
|
|
269
269
|
}
|
|
270
270
|
else if (a.object.typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment) {
|
|
271
271
|
authorizePaymentActions.push(a);
|
|
@@ -280,7 +280,6 @@ function dissolveAuthorizeActions(completedAuthorizeActions) {
|
|
|
280
280
|
authorizePaymentActions,
|
|
281
281
|
authorizeEventServiceOfferActions,
|
|
282
282
|
authorizeProductOfferActions,
|
|
283
|
-
authorizeMoneyTansferActions,
|
|
284
283
|
serialNumbers
|
|
285
284
|
};
|
|
286
285
|
}
|
|
@@ -311,7 +310,7 @@ function createResult(params, options) {
|
|
|
311
310
|
const transaction = params.transaction;
|
|
312
311
|
const eventReservationAcceptedOffers = [];
|
|
313
312
|
const productAcceptedOffers = [];
|
|
314
|
-
const moneyTransferAcceptedOffers = [];
|
|
313
|
+
// const moneyTransferAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IMoneyTransfer>[] = [];
|
|
315
314
|
params.acceptedOffers.forEach((acceptedOffer) => {
|
|
316
315
|
const itemOfferedTypeOf = acceptedOffer.itemOffered.typeOf;
|
|
317
316
|
switch (itemOfferedTypeOf) {
|
|
@@ -321,20 +320,17 @@ function createResult(params, options) {
|
|
|
321
320
|
case factory.permit.PermitType.Permit:
|
|
322
321
|
productAcceptedOffers.push(acceptedOffer);
|
|
323
322
|
break;
|
|
324
|
-
case factory.actionType.MoneyTransfer:
|
|
325
|
-
moneyTransferAcceptedOffers.push(acceptedOffer);
|
|
326
|
-
break;
|
|
327
323
|
default:
|
|
328
324
|
throw new factory.errors.NotImplemented(`${itemOfferedTypeOf} not implemented`);
|
|
329
325
|
}
|
|
330
326
|
});
|
|
331
327
|
// 取引の確定条件が全て整っているかどうか確認
|
|
332
|
-
(0, validation_1.validateTransaction)(transaction, params.acceptPayActions, params.authorizePaymentActions, params.authorizeEventServiceOfferActions, params.
|
|
328
|
+
(0, validation_1.validateTransaction)(transaction, params.acceptPayActions, params.authorizePaymentActions, params.authorizeEventServiceOfferActions, params.authorizeProductOfferActions, eventReservationAcceptedOffers, params.payTransactions, params.customer);
|
|
333
329
|
const { paymentMethods, price } = (0, factory_1.createPaymentMethods)({ authorizePaymentActions: params.authorizePaymentActions });
|
|
334
330
|
const orderedItem = (0, orderedItem_1.acceptedOffers2orderedItem)({
|
|
335
331
|
eventReservationAcceptedOffers,
|
|
336
332
|
productAcceptedOffers,
|
|
337
|
-
moneyTransferAcceptedOffers
|
|
333
|
+
// moneyTransferAcceptedOffers
|
|
338
334
|
});
|
|
339
335
|
// 注文作成
|
|
340
336
|
const orderAsResult = (0, result_1.createOrderAsResult)({
|
|
@@ -373,8 +369,7 @@ function createResult(params, options) {
|
|
|
373
369
|
const authorizeActions = [
|
|
374
370
|
...params.authorizePaymentActions.map(({ id }) => ({ id })),
|
|
375
371
|
...params.authorizeEventServiceOfferActions.map(({ id }) => ({ id })),
|
|
376
|
-
...params.authorizeProductOfferActions.map(({ id }) => ({ id }))
|
|
377
|
-
...params.authorizeMoneyTansferActions.map(({ id }) => ({ id }))
|
|
372
|
+
...params.authorizeProductOfferActions.map(({ id }) => ({ id }))
|
|
378
373
|
];
|
|
379
374
|
let eventId;
|
|
380
375
|
let reservationIds;
|
|
@@ -29,8 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.createTasks = createTasks;
|
|
30
30
|
const moment_1 = __importDefault(require("moment"));
|
|
31
31
|
const factory = __importStar(require("../../../../factory"));
|
|
32
|
-
// | factory.task.IAttributes<factory.taskName.VoidRegisterServiceTransaction
|
|
33
|
-
// | factory.task.IAttributes<factory.taskName.VoidMoneyTransferTransaction>;
|
|
32
|
+
// | factory.task.IAttributes<factory.taskName.VoidRegisterServiceTransaction>;
|
|
34
33
|
/**
|
|
35
34
|
* 取引のタスクを作成する
|
|
36
35
|
*/
|
|
@@ -230,19 +229,6 @@ function createTasks(params, setting
|
|
|
230
229
|
// purpose: { typeOf: transaction.typeOf, id: transaction.id }
|
|
231
230
|
// }
|
|
232
231
|
// };
|
|
233
|
-
// const voidMoneyTransferTaskAttributes: factory.task.IAttributes<factory.taskName.VoidMoneyTransferTransaction> = {
|
|
234
|
-
// project: transaction.project,
|
|
235
|
-
// name: factory.taskName.VoidMoneyTransferTransaction,
|
|
236
|
-
// status: factory.taskStatus.Ready,
|
|
237
|
-
// runsAt: taskRunsAt,
|
|
238
|
-
// remainingNumberOfTries: 10,
|
|
239
|
-
// numberOfTried: 0,
|
|
240
|
-
// executionResults: [],
|
|
241
|
-
// data: {
|
|
242
|
-
// project: transaction.project,
|
|
243
|
-
// purpose: { typeOf: transaction.typeOf, id: transaction.id }
|
|
244
|
-
// }
|
|
245
|
-
// };
|
|
246
232
|
// taskAttributes.push(
|
|
247
233
|
// voidRegisterServiceTaskAttributes,
|
|
248
234
|
// voidMoneyTransferTaskAttributes
|
|
@@ -7,15 +7,12 @@ import type { TaskRepo } from '../repo/task';
|
|
|
7
7
|
import type { TransactionRepo } from '../repo/transaction';
|
|
8
8
|
import type { PlaceOrderRepo } from '../repo/transaction/placeOrder';
|
|
9
9
|
import type { ReturnOrderRepo } from '../repo/transaction/returnOrder';
|
|
10
|
-
import type { MoneyTransferRepo } from '../repo/transaction/moneyTransfer';
|
|
11
10
|
import { deleteTransaction } from './transaction/deleteTransaction';
|
|
12
|
-
import * as MoneyTransferTransactionService from './transaction/moneyTransfer';
|
|
13
11
|
import * as PlaceOrderTransactionService from './transaction/placeOrder';
|
|
14
12
|
import * as ReturnOrderTransactionService from './transaction/returnOrder';
|
|
15
13
|
export type ITransactionOperation<T> = (repos: {
|
|
16
14
|
transaction: TransactionRepo;
|
|
17
15
|
}) => Promise<T>;
|
|
18
|
-
export import moneyTransfer = MoneyTransferTransactionService;
|
|
19
16
|
export import placeOrder = PlaceOrderTransactionService;
|
|
20
17
|
export import returnOrder = ReturnOrderTransactionService;
|
|
21
18
|
export { deleteTransaction };
|
|
@@ -24,7 +21,6 @@ export type IExportTasksOperation<T> = (repos: {
|
|
|
24
21
|
task: TaskRepo;
|
|
25
22
|
placeOrder: PlaceOrderRepo;
|
|
26
23
|
returnOrder: ReturnOrderRepo;
|
|
27
|
-
moneyTransfer: MoneyTransferRepo;
|
|
28
24
|
transaction: TransactionRepo;
|
|
29
25
|
}) => Promise<T>;
|
|
30
26
|
export declare function exportOneTransactionTasksIfExists(params: {
|
|
@@ -27,16 +27,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.deleteTransaction = exports.returnOrder = exports.placeOrder =
|
|
30
|
+
exports.deleteTransaction = exports.returnOrder = exports.placeOrder = void 0;
|
|
31
31
|
exports.exportOneTransactionTasksIfExists = exportOneTransactionTasksIfExists;
|
|
32
32
|
const factory = __importStar(require("../factory"));
|
|
33
33
|
const deleteTransaction_1 = require("./transaction/deleteTransaction");
|
|
34
34
|
Object.defineProperty(exports, "deleteTransaction", { enumerable: true, get: function () { return deleteTransaction_1.deleteTransaction; } });
|
|
35
|
-
const MoneyTransferTransactionService = __importStar(require("./transaction/moneyTransfer"));
|
|
36
35
|
const PlaceOrderTransactionService = __importStar(require("./transaction/placeOrder"));
|
|
37
36
|
// import { issueOrderNumberIfNotExist } from './transaction/placeOrder/issueOrderNumberIfNotExist';
|
|
38
37
|
const ReturnOrderTransactionService = __importStar(require("./transaction/returnOrder"));
|
|
39
|
-
exports.moneyTransfer = MoneyTransferTransactionService;
|
|
40
38
|
exports.placeOrder = PlaceOrderTransactionService;
|
|
41
39
|
exports.returnOrder = ReturnOrderTransactionService;
|
|
42
40
|
function exportOneTransactionTasksIfExists(params) {
|
|
@@ -56,14 +54,6 @@ function exportOneTransactionTasksIfExists(params) {
|
|
|
56
54
|
}
|
|
57
55
|
// 失敗してもここでは戻さない(RUNNINGのまま待機)
|
|
58
56
|
switch (transaction.typeOf) {
|
|
59
|
-
case factory.transactionType.MoneyTransfer:
|
|
60
|
-
await MoneyTransferTransactionService.exportTasksById({
|
|
61
|
-
id: transaction.id,
|
|
62
|
-
...(typeof params.runsTasksAfterInSeconds === 'number')
|
|
63
|
-
? { runsTasksAfterInSeconds: params.runsTasksAfterInSeconds }
|
|
64
|
-
: undefined
|
|
65
|
-
})(repos);
|
|
66
|
-
break;
|
|
67
57
|
case factory.transactionType.PlaceOrder:
|
|
68
58
|
await PlaceOrderTransactionService.exportTasksById({
|
|
69
59
|
id: transaction.id,
|
|
@@ -204,8 +204,8 @@ function validateOrder(params) {
|
|
|
204
204
|
acceptedOffers: permitAcceptedOffers
|
|
205
205
|
});
|
|
206
206
|
break;
|
|
207
|
-
case factory.actionType.MoneyTransfer:
|
|
208
|
-
|
|
207
|
+
// case factory.actionType.MoneyTransfer:
|
|
208
|
+
// break;
|
|
209
209
|
default:
|
|
210
210
|
if ((0, moment_1.default)(order.orderDate)
|
|
211
211
|
.isAfter((0, moment_1.default)('2024-02-01T15:00:00Z'))) {
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
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": "
|
|
15
|
-
"@cinerino/sdk": "13.
|
|
14
|
+
"@chevre/factory": "6.0.0-alpha.0",
|
|
15
|
+
"@cinerino/sdk": "13.2.0",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"postversion": "git push origin --tags",
|
|
100
100
|
"prepublishOnly": "npm run clean && npm run build"
|
|
101
101
|
},
|
|
102
|
-
"version": "24.0.0-alpha.
|
|
102
|
+
"version": "24.0.0-alpha.34"
|
|
103
103
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as factory from '../../factory';
|
|
2
|
-
import { ActionProcessRepo } from './actionProcess';
|
|
3
|
-
export type IAuthorizeMoneyTransferOfferAction = factory.action.authorize.offer.moneyTransfer.IAction;
|
|
4
|
-
/**
|
|
5
|
-
* 通貨転送オファー承認リポジトリ
|
|
6
|
-
*/
|
|
7
|
-
export declare class AuthorizeMoneyTransferOfferActionRepo extends ActionProcessRepo<IAuthorizeMoneyTransferOfferAction, never> {
|
|
8
|
-
/**
|
|
9
|
-
* 取引に対する通貨転送オファー承認アクションを検索する
|
|
10
|
-
*/
|
|
11
|
-
findAuthorizeMoneyTransferOfferActionsByPurpose(params: {
|
|
12
|
-
/**
|
|
13
|
-
* 注文取引でフィルター
|
|
14
|
-
*/
|
|
15
|
-
purpose: {
|
|
16
|
-
typeOf: factory.transactionType;
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* アクションステータスでフィルター
|
|
21
|
-
*/
|
|
22
|
-
actionStatus?: {
|
|
23
|
-
$eq?: factory.actionStatusType.CompletedActionStatus;
|
|
24
|
-
};
|
|
25
|
-
}): Promise<IAuthorizeMoneyTransferOfferAction[]>;
|
|
26
|
-
/**
|
|
27
|
-
* アクションに資産取引情報を保管する
|
|
28
|
-
*/
|
|
29
|
-
saveAssetTransactionNumber(params: {
|
|
30
|
-
id: string;
|
|
31
|
-
update: {
|
|
32
|
-
'object.itemOffered.amount.currency': string;
|
|
33
|
-
'object.itemOffered.object.pendingTransaction': {
|
|
34
|
-
typeOf: factory.assetTransactionType.MoneyTransfer;
|
|
35
|
-
id: string;
|
|
36
|
-
transactionNumber: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
}): Promise<void>;
|
|
40
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.AuthorizeMoneyTransferOfferActionRepo = void 0;
|
|
27
|
-
const factory = __importStar(require("../../factory"));
|
|
28
|
-
// import { MONGO_MAX_TIME_MS } from '../settings';
|
|
29
|
-
const actionProcess_1 = require("./actionProcess");
|
|
30
|
-
/**
|
|
31
|
-
* 通貨転送オファー承認リポジトリ
|
|
32
|
-
*/
|
|
33
|
-
class AuthorizeMoneyTransferOfferActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
34
|
-
/**
|
|
35
|
-
* 取引に対する通貨転送オファー承認アクションを検索する
|
|
36
|
-
*/
|
|
37
|
-
async findAuthorizeMoneyTransferOfferActionsByPurpose(params) {
|
|
38
|
-
const authorizeActions = await this.findAnyActionsByPurpose({
|
|
39
|
-
...params,
|
|
40
|
-
typeOf: factory.actionType.AuthorizeAction,
|
|
41
|
-
object: {
|
|
42
|
-
typeOf: { $eq: factory.offerType.Offer }
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
return authorizeActions.filter((a) => a.object.itemOffered?.typeOf === factory.actionType.MoneyTransfer);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* アクションに資産取引情報を保管する
|
|
49
|
-
*/
|
|
50
|
-
async saveAssetTransactionNumber(params) {
|
|
51
|
-
await this.actionModel.findOneAndUpdate({ _id: { $eq: params.id } }, params.update, { projection: { _id: 1 } })
|
|
52
|
-
.lean()
|
|
53
|
-
.exec()
|
|
54
|
-
.then((doc) => {
|
|
55
|
-
if (doc === null) {
|
|
56
|
-
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.AuthorizeMoneyTransferOfferActionRepo = AuthorizeMoneyTransferOfferActionRepo;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
|
-
import * as factory from '../../factory';
|
|
3
|
-
type IKeyOfProjection = keyof Pick<factory.transaction.ITransaction<factory.transactionType.MoneyTransfer>, 'agent' | 'endDate' | 'expires' | 'project' | 'startDate' | 'status' | 'typeOf'> | Exclude<keyof factory.transaction.ITransaction<factory.transactionType.MoneyTransfer>, 'id'>;
|
|
4
|
-
type IOmittedFieldsInProgress = 'tasksExportAction' | 'tasksExportedAt' | 'tasksExportationStatus';
|
|
5
|
-
export type IMoneyTransferTransactionInProgress = Omit<factory.transaction.moneyTransfer.ITransaction, IOmittedFieldsInProgress>;
|
|
6
|
-
type IStartedTransactionFields = 'expires' | 'id' | 'startDate' | 'status';
|
|
7
|
-
export type IStartedTransaction = Pick<factory.transaction.ITransaction<factory.transactionType>, IStartedTransactionFields>;
|
|
8
|
-
/**
|
|
9
|
-
* 通貨転送取引リポジトリ
|
|
10
|
-
*/
|
|
11
|
-
export declare class MoneyTransferRepo {
|
|
12
|
-
private readonly transactionModel;
|
|
13
|
-
constructor(connection: Connection);
|
|
14
|
-
static CREATE_MONGO_CONDITIONS(params: factory.transaction.ISearchConditions<factory.transactionType.MoneyTransfer>): FilterQuery<import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction>[];
|
|
15
|
-
/**
|
|
16
|
-
* 取引を開始する
|
|
17
|
-
*/
|
|
18
|
-
startMoneyTransfer(params: factory.transaction.IStartParams<factory.transactionType.MoneyTransfer>): Promise<IStartedTransaction>;
|
|
19
|
-
/**
|
|
20
|
-
* 特定取引検索
|
|
21
|
-
*/
|
|
22
|
-
findMoneyTransferById(params: {
|
|
23
|
-
typeOf: factory.transactionType.MoneyTransfer;
|
|
24
|
-
id: string;
|
|
25
|
-
}, inclusion: IKeyOfProjection[]): Promise<factory.transaction.ITransaction<factory.transactionType.MoneyTransfer>>;
|
|
26
|
-
/**
|
|
27
|
-
* 進行中の取引を取得する
|
|
28
|
-
*/
|
|
29
|
-
findMoneyTransferInProgressById(params: {
|
|
30
|
-
typeOf: factory.transactionType.MoneyTransfer;
|
|
31
|
-
id: string;
|
|
32
|
-
}, inclusion: IKeyOfProjection[]): Promise<IMoneyTransferTransactionInProgress>;
|
|
33
|
-
/**
|
|
34
|
-
* 取引を確定する
|
|
35
|
-
*/
|
|
36
|
-
confirmMoneyTransfer(params: {
|
|
37
|
-
typeOf: factory.transactionType.MoneyTransfer;
|
|
38
|
-
id: string;
|
|
39
|
-
result: factory.transaction.IResult<factory.transactionType.MoneyTransfer>;
|
|
40
|
-
potentialActions: factory.transaction.IPotentialActions<factory.transactionType.MoneyTransfer>;
|
|
41
|
-
}): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* 取引を中止する
|
|
44
|
-
*/
|
|
45
|
-
cancelMoneyTransfer(params: {
|
|
46
|
-
typeOf: factory.transactionType.MoneyTransfer;
|
|
47
|
-
id: string;
|
|
48
|
-
}): Promise<void>;
|
|
49
|
-
countMoneyTransfer(params: factory.transaction.ISearchConditions<factory.transactionType.MoneyTransfer>): Promise<{
|
|
50
|
-
count: number;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* 取引を検索する
|
|
54
|
-
*/
|
|
55
|
-
findMoneyTransferTransactions(params: factory.transaction.ISearchConditions<factory.transactionType.MoneyTransfer> & {
|
|
56
|
-
inclusion: IKeyOfProjection[];
|
|
57
|
-
}): Promise<(Pick<factory.transaction.ITransaction<factory.transactionType.MoneyTransfer>, IKeyOfProjection> & {
|
|
58
|
-
id: string;
|
|
59
|
-
})[]>;
|
|
60
|
-
}
|
|
61
|
-
export {};
|