@chevre/domain 21.22.0-alpha.1 → 21.22.0-alpha.2
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/placeOrderInProgress/confirm.js +4 -12
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +0 -19
- package/package.json +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +0 -7
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +0 -57
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts +0 -6
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +0 -78
|
@@ -78,7 +78,7 @@ function confirm(params) {
|
|
|
78
78
|
expiresInSeconds: publishCodeExpiresInSeconds
|
|
79
79
|
})(repos);
|
|
80
80
|
}
|
|
81
|
-
const {
|
|
81
|
+
const { result, eventId, reservationIds } = createResult(Object.assign(Object.assign({}, params), { orderNumber, transaction: transaction, authorizeActions: completedAuthorizeActions, code }));
|
|
82
82
|
// デフォルトEメールメッセージを検索
|
|
83
83
|
let emailMessageOnOrderSent;
|
|
84
84
|
if (repos.emailMessage !== undefined) {
|
|
@@ -92,8 +92,8 @@ function confirm(params) {
|
|
|
92
92
|
}
|
|
93
93
|
// ポストアクションを作成
|
|
94
94
|
const potentialActions = yield (0, potentialActions_1.createPotentialActions)({
|
|
95
|
-
|
|
96
|
-
order: orderWithAcceptedOffers,
|
|
95
|
+
order: result.order,
|
|
96
|
+
// order: orderWithAcceptedOffers, // 現時点でcreateEmailMessageでorder.acceptedOffersを使用している(2024-02-06~)
|
|
97
97
|
potentialActions: params.potentialActions,
|
|
98
98
|
transaction: transaction,
|
|
99
99
|
emailMessage: emailMessageOnOrderSent,
|
|
@@ -158,9 +158,6 @@ function createResult(params) {
|
|
|
158
158
|
orderNumber: params.orderNumber,
|
|
159
159
|
transaction: transaction,
|
|
160
160
|
orderDate: params.result.order.orderDate,
|
|
161
|
-
// OrderPaymentDueオプションを追加(2023-08-25~)
|
|
162
|
-
// 注文作成時のステータスとなる
|
|
163
|
-
// orderStatus: (USE_ORDER_PAYMENT_DUE_ON_PLACED) ? factory.orderStatus.OrderPaymentDue : factory.orderStatus.OrderProcessing,
|
|
164
161
|
orderStatus: factory.orderStatus.OrderPaymentDue,
|
|
165
162
|
isGift: false,
|
|
166
163
|
authorizeActions: params.authorizeActions
|
|
@@ -191,13 +188,8 @@ function createResult(params) {
|
|
|
191
188
|
order.identifier = identifier;
|
|
192
189
|
order.url = url;
|
|
193
190
|
const authorizeActions = params.authorizeActions.map(({ id }) => ({ id }));
|
|
194
|
-
let orderAsResult;
|
|
195
|
-
// if (USE_ACCEPTED_OFFERS_AS_TRANSACTION_RESULT) {
|
|
196
|
-
// orderAsResult = order;
|
|
197
|
-
// } else {
|
|
198
|
-
// }
|
|
199
191
|
const { acceptedOffers } = order, orderWithoutAcceptedOffers = __rest(order, ["acceptedOffers"]);
|
|
200
|
-
orderAsResult = orderWithoutAcceptedOffers;
|
|
192
|
+
const orderAsResult = orderWithoutAcceptedOffers;
|
|
201
193
|
let eventId;
|
|
202
194
|
let reservationIds;
|
|
203
195
|
if (params.options.expectsReservationIds) {
|
|
@@ -11,17 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createPotentialActions = void 0;
|
|
13
13
|
const givePointAward_1 = require("./potentialActions/givePointAward");
|
|
14
|
-
// import { createMoneyTransferActions } from './potentialActions/moneyTransfer';
|
|
15
|
-
// import { createRegisterServiceActions } from './potentialActions/registerService';
|
|
16
14
|
const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
|
|
17
15
|
/**
|
|
18
16
|
* 取引のポストアクションを作成する
|
|
19
17
|
*/
|
|
20
18
|
function createPotentialActions(params) {
|
|
21
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
// const registerServiceActions = await createRegisterServiceActions(params);
|
|
23
|
-
// 通貨転送アクション
|
|
24
|
-
// const moneyTransferActions = await createMoneyTransferActions(params);
|
|
25
20
|
// ポイントインセンティブに対する承認アクションの分だけ、ポイントインセンティブ付与アクションを作成する
|
|
26
21
|
const givePointAwardActions = yield (0, givePointAward_1.createGivePointAwardActions)(params);
|
|
27
22
|
// 注文配送メール送信設定
|
|
@@ -35,20 +30,6 @@ function createPotentialActions(params) {
|
|
|
35
30
|
};
|
|
36
31
|
// optimize(2024-01-22~)
|
|
37
32
|
return {
|
|
38
|
-
// order: {
|
|
39
|
-
// project: params.transaction.project,
|
|
40
|
-
// typeOf: factory.actionType.OrderAction,
|
|
41
|
-
// object: simpleOrder,
|
|
42
|
-
// agent: params.transaction.project,
|
|
43
|
-
// potentialActions: {
|
|
44
|
-
// givePointAward: givePointAwardActions,
|
|
45
|
-
// sendOrder: sendOrderActionAttributes // optimize(2024-01-16~)
|
|
46
|
-
// },
|
|
47
|
-
// purpose: {
|
|
48
|
-
// typeOf: params.transaction.typeOf,
|
|
49
|
-
// id: params.transaction.id
|
|
50
|
-
// }
|
|
51
|
-
// }
|
|
52
33
|
order: {
|
|
53
34
|
potentialActions: {
|
|
54
35
|
givePointAward: givePointAwardActions,
|
package/package.json
CHANGED
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as factory from '../../../../factory';
|
|
2
|
-
export type IAuthorizeMoneyTransferOffer = factory.action.authorize.offer.moneyTransfer.IAction;
|
|
3
|
-
export declare function createMoneyTransferActions(params: {
|
|
4
|
-
order: factory.order.IOrder;
|
|
5
|
-
transaction: factory.transaction.placeOrder.ITransaction;
|
|
6
|
-
authorizeActions: factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>>[];
|
|
7
|
-
}): Promise<factory.action.interact.confirm.moneyTransfer.IAttributes[]>;
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createMoneyTransferActions = void 0;
|
|
13
|
-
const factory = require("../../../../factory");
|
|
14
|
-
const order_1 = require("../../../../factory/order");
|
|
15
|
-
function createMoneyTransferActions(params) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const moneyTransferActions = [];
|
|
18
|
-
const authorizeMoneyTransferActions = params.authorizeActions
|
|
19
|
-
.filter((a) => a.object.typeOf === factory.offerType.Offer)
|
|
20
|
-
.filter((a) => { var _a; return ((_a = a.object.itemOffered) === null || _a === void 0 ? void 0 : _a.typeOf) === factory.actionType.MoneyTransfer; });
|
|
21
|
-
const moneyTransferPurpose = {
|
|
22
|
-
typeOf: params.order.typeOf,
|
|
23
|
-
seller: {
|
|
24
|
-
id: params.order.seller.id,
|
|
25
|
-
typeOf: params.order.seller.typeOf,
|
|
26
|
-
name: params.order.seller.name
|
|
27
|
-
},
|
|
28
|
-
// mask
|
|
29
|
-
customer: (0, order_1.createMaskedCustomer)(params.order, { noProfile: true }),
|
|
30
|
-
orderNumber: params.order.orderNumber,
|
|
31
|
-
price: params.order.price,
|
|
32
|
-
priceCurrency: params.order.priceCurrency,
|
|
33
|
-
orderDate: params.order.orderDate
|
|
34
|
-
};
|
|
35
|
-
// const paymentMethod = params.order.paymentMethods[0];
|
|
36
|
-
authorizeMoneyTransferActions.forEach((a) => {
|
|
37
|
-
var _a;
|
|
38
|
-
const actionResult = a.result;
|
|
39
|
-
if (actionResult !== undefined) {
|
|
40
|
-
const pendingTransaction = (_a = a.object.itemOffered.object) === null || _a === void 0 ? void 0 : _a.pendingTransaction;
|
|
41
|
-
moneyTransferActions.push({
|
|
42
|
-
project: params.transaction.project,
|
|
43
|
-
typeOf: factory.actionType.ConfirmAction,
|
|
44
|
-
object: {
|
|
45
|
-
// pendingTransaction: { id: actionResult.responseBody.id },
|
|
46
|
-
transactionNumber: pendingTransaction.transactionNumber,
|
|
47
|
-
typeOf: factory.assetTransactionType.MoneyTransfer
|
|
48
|
-
},
|
|
49
|
-
agent: params.transaction.project,
|
|
50
|
-
purpose: moneyTransferPurpose
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return moneyTransferActions;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
exports.createMoneyTransferActions = createMoneyTransferActions;
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as factory from '../../../../factory';
|
|
2
|
-
export declare function createRegisterServiceActions(params: {
|
|
3
|
-
order: factory.order.IOrder;
|
|
4
|
-
transaction: factory.transaction.placeOrder.ITransaction;
|
|
5
|
-
authorizeActions: factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>>[];
|
|
6
|
-
}): Promise<factory.action.interact.confirm.registerService.IAttributes[]>;
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createRegisterServiceActions = void 0;
|
|
13
|
-
const factory = require("../../../../factory");
|
|
14
|
-
const availableProductTypes_1 = require("../../../../factory/availableProductTypes");
|
|
15
|
-
const order_1 = require("../../../../factory/order");
|
|
16
|
-
function createRegisterServiceActions(params) {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const registerServiceActions = [];
|
|
19
|
-
const authorizeProductOfferActions = params.authorizeActions
|
|
20
|
-
.filter((a) => Array.isArray(a.object)
|
|
21
|
-
&& a.object.length > 0
|
|
22
|
-
&& a.object[0].typeOf === factory.offerType.Offer
|
|
23
|
-
&& availableProductTypes_1.availableProductTypes.indexOf(a.object[0].itemOffered.typeOf) >= 0);
|
|
24
|
-
const registerServicePurpose = {
|
|
25
|
-
typeOf: params.order.typeOf,
|
|
26
|
-
seller: {
|
|
27
|
-
id: params.order.seller.id,
|
|
28
|
-
typeOf: params.order.seller.typeOf,
|
|
29
|
-
name: params.order.seller.name
|
|
30
|
-
},
|
|
31
|
-
// mask
|
|
32
|
-
customer: (0, order_1.createMaskedCustomer)(params.order, { noProfile: true }),
|
|
33
|
-
orderNumber: params.order.orderNumber,
|
|
34
|
-
price: params.order.price,
|
|
35
|
-
priceCurrency: params.order.priceCurrency,
|
|
36
|
-
orderDate: params.order.orderDate
|
|
37
|
-
};
|
|
38
|
-
authorizeProductOfferActions.forEach((a) => {
|
|
39
|
-
var _a;
|
|
40
|
-
const actionResult = a.result;
|
|
41
|
-
if (actionResult !== undefined) {
|
|
42
|
-
const registerServiceObject = createRegisterServiceActionObject({
|
|
43
|
-
order: params.order,
|
|
44
|
-
// potentialActions: params.potentialActions,
|
|
45
|
-
transaction: params.transaction,
|
|
46
|
-
transactionNumber: (_a = a.instrument) === null || _a === void 0 ? void 0 : _a.transactionNumber
|
|
47
|
-
});
|
|
48
|
-
// 廃止(2023-08-18~)
|
|
49
|
-
// const orderProgramMembershipTask = createOrderProgramMembershipTask({
|
|
50
|
-
// order: params.order,
|
|
51
|
-
// authorizeAction: a
|
|
52
|
-
// });
|
|
53
|
-
registerServiceActions.push({
|
|
54
|
-
project: params.transaction.project,
|
|
55
|
-
typeOf: factory.actionType.ConfirmAction,
|
|
56
|
-
object: registerServiceObject,
|
|
57
|
-
agent: params.transaction.project,
|
|
58
|
-
purpose: registerServicePurpose,
|
|
59
|
-
potentialActions: {
|
|
60
|
-
// ...(orderProgramMembershipTask !== undefined)
|
|
61
|
-
// ? { orderProgramMembership: [orderProgramMembershipTask] }
|
|
62
|
-
// : undefined
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
return registerServiceActions;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
exports.createRegisterServiceActions = createRegisterServiceActions;
|
|
71
|
-
function createRegisterServiceActionObject(params) {
|
|
72
|
-
return {
|
|
73
|
-
transactionNumber: params.transactionNumber,
|
|
74
|
-
endDate: params.order.orderDate,
|
|
75
|
-
// object: {},
|
|
76
|
-
typeOf: factory.assetTransactionType.RegisterService
|
|
77
|
-
};
|
|
78
|
-
}
|