@chevre/domain 20.14.0-alpha.2 → 20.14.0-alpha.4
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/service/transaction/orderProgramMembership.js +21 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -9
- package/lib/chevre/service/transaction/returnOrder.d.ts +0 -4
- package/lib/chevre/service/transaction/returnOrder.js +1 -3
- package/package.json +1 -1
|
@@ -32,8 +32,23 @@ exports.ISS_PREFIX = 'https://cognito-idp.ap-northeast-1.amazonaws.com/';
|
|
|
32
32
|
function orderProgramMembership(params, paymentMethodType) {
|
|
33
33
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
var _a, _b, _c;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
let customer;
|
|
36
|
+
try {
|
|
37
|
+
customer = yield repos.person.findById({ userId: String(params.agent.id) });
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
// Not Found: User.をハンドル(2023-03-31~)
|
|
41
|
+
if (error instanceof factory.errors.NotFound) {
|
|
42
|
+
// no op
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (customer === undefined) {
|
|
49
|
+
// Userが存在しなければリトライは不要
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
37
52
|
// issに依存するので存在確認
|
|
38
53
|
const issByCustomer = (_b = (_a = customer.identifier) === null || _a === void 0 ? void 0 : _a.find((p) => p.name === 'iss')) === null || _b === void 0 ? void 0 : _b.value;
|
|
39
54
|
if (typeof issByCustomer !== 'string' || issByCustomer.length === 0) {
|
|
@@ -92,6 +107,10 @@ function orderProgramMembership(params, paymentMethodType) {
|
|
|
92
107
|
=== OfferService.product.ERROR_MESSAGE_ALREADY_REGISTERED) {
|
|
93
108
|
return;
|
|
94
109
|
}
|
|
110
|
+
// Not Found: OwnershipInfos of PaymentCard.をハンドル(2023-03-31~)
|
|
111
|
+
if (error instanceof factory.errors.NotFound && error.entityName === 'OwnershipInfos of PaymentCard') {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
95
114
|
throw error;
|
|
96
115
|
}
|
|
97
116
|
});
|
|
@@ -9,5 +9,4 @@ export declare function createPotentialActions(params: {
|
|
|
9
9
|
potentialActions?: factory.transaction.returnOrder.IPotentialActionsParams;
|
|
10
10
|
transaction: factory.transaction.returnOrder.ITransaction;
|
|
11
11
|
emailMessageOnOrderReturned?: factory.creativeWork.message.email.ICreativeWork;
|
|
12
|
-
createReturnReserveActions: boolean;
|
|
13
12
|
}): Promise<factory.transaction.returnOrder.IPotentialActions>;
|
|
@@ -34,25 +34,17 @@ function createPotentialActions(params) {
|
|
|
34
34
|
const returnPaymentMethodActions = yield (0, returnPaymentMethod_1.createReturnPaymentMethodActions)(Object.assign(Object.assign({}, params), { order, returnOrderActionParams }));
|
|
35
35
|
// ポイント特典の数だけ、返却アクションを作成
|
|
36
36
|
const returnPointAwardActions = yield (0, returnPointAward_1.createReturnPointAwardActions)(Object.assign(Object.assign({}, params), { order }));
|
|
37
|
-
// const cancelReservationActions = await createCancelReservationActions({ ...params, order });
|
|
38
37
|
const returnMoneyTransferActions = yield (0, returnMoneyTransfer_1.createReturnMoneyTransferActions)(Object.assign(Object.assign({}, params), { order, returnOrderActionParams }));
|
|
39
38
|
// 返品後のEメール送信アクション
|
|
40
39
|
const sendEmailMessaegActionsOnReturn = yield (0, sendEmailMessage_1.createSendEmailMessaegActionsOnReturn)(Object.assign(Object.assign({}, params), { order, returnOrderActionParams }));
|
|
41
40
|
const potentialActionsOnReturnOrder = {
|
|
42
|
-
// useConfirmRefund設定を追加(2022-06-08~)
|
|
43
|
-
// 廃止(2022-08-10~)
|
|
44
|
-
// useConfirmRefund: params.useConfirmRefund,
|
|
45
|
-
// ↓refundはもはや不要なので廃止(2022-08-27~)
|
|
46
|
-
// refund: returnPaymentMethodActions,
|
|
47
41
|
returnPaymentMethod: returnPaymentMethodActions,
|
|
48
42
|
returnMoneyTransfer: returnMoneyTransferActions,
|
|
49
43
|
returnPointAward: returnPointAwardActions,
|
|
50
44
|
sendEmailMessage: sendEmailMessaegActionsOnReturn
|
|
51
45
|
};
|
|
52
46
|
// recipientを最低限の情報に
|
|
53
|
-
const recipient = Object.assign({ id: order.seller.id,
|
|
54
|
-
// project: order.seller.project,
|
|
55
|
-
typeOf: order.seller.typeOf }, (order.seller.name !== undefined) ? { name: order.seller.name } : undefined);
|
|
47
|
+
const recipient = Object.assign({ id: order.seller.id, typeOf: order.seller.typeOf }, (order.seller.name !== undefined) ? { name: order.seller.name } : undefined);
|
|
56
48
|
return {
|
|
57
49
|
project: order.project,
|
|
58
50
|
typeOf: factory.actionType.ReturnAction,
|
|
@@ -33,10 +33,6 @@ export declare function confirm(params: factory.transaction.returnOrder.IConfirm
|
|
|
33
33
|
dateReturned: Date;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
/**
|
|
37
|
-
* confirmReserveActionをchevreへ完全移行後に廃止
|
|
38
|
-
*/
|
|
39
|
-
createReturnReserveActions: boolean;
|
|
40
36
|
}): (repos: {
|
|
41
37
|
emailMessage?: EmailMessageRepo;
|
|
42
38
|
order: OrderRepo;
|
|
@@ -351,9 +351,7 @@ function confirm(params) {
|
|
|
351
351
|
orders: orders,
|
|
352
352
|
potentialActions: params.potentialActions,
|
|
353
353
|
transaction: transaction,
|
|
354
|
-
emailMessageOnOrderReturned: emailMessageOnOrderReturned
|
|
355
|
-
createReturnReserveActions: params.createReturnReserveActions
|
|
356
|
-
// useConfirmRefund: params.useConfirmRefund
|
|
354
|
+
emailMessageOnOrderReturned: emailMessageOnOrderReturned
|
|
357
355
|
});
|
|
358
356
|
// ステータス変更
|
|
359
357
|
yield repos.transaction.confirm({
|
package/package.json
CHANGED