@chevre/domain 20.1.0-alpha.3 → 20.1.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/assetTransaction/pay/potentialActions.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged.js +2 -2
- package/lib/chevre/service/order/placeOrder.js +4 -2
- package/lib/chevre/service/order/sendOrder.js +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +2 -1
- package/package.json +2 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.d.ts +0 -11
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.js +0 -187
|
@@ -10,12 +10,13 @@ function createPayActions(params) {
|
|
|
10
10
|
const payObject = createPayObject(params);
|
|
11
11
|
const informPaymentActions = createInformPaymentActions(params);
|
|
12
12
|
if (payObject !== undefined) {
|
|
13
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
13
14
|
const simpleOrder = {
|
|
14
15
|
// project: params.order.project,
|
|
15
16
|
typeOf: params.order.typeOf,
|
|
16
17
|
seller: params.order.seller,
|
|
17
18
|
// mask
|
|
18
|
-
customer:
|
|
19
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
19
20
|
confirmationNumber: params.order.confirmationNumber,
|
|
20
21
|
orderNumber: params.order.orderNumber,
|
|
21
22
|
price: params.order.price,
|
|
@@ -24,11 +24,11 @@ const TOKEN_EXPIRES_IN = 604800;
|
|
|
24
24
|
function onOrderStatusChanged(params) {
|
|
25
25
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
let tasks = [];
|
|
27
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
27
28
|
const simpleOrder = {
|
|
28
|
-
// project: params.order.project,
|
|
29
29
|
typeOf: params.order.typeOf,
|
|
30
30
|
seller: params.order.seller,
|
|
31
|
-
customer:
|
|
31
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
32
32
|
confirmationNumber: params.order.confirmationNumber,
|
|
33
33
|
orderNumber: params.order.orderNumber,
|
|
34
34
|
price: params.order.price,
|
|
@@ -89,11 +89,12 @@ function placeOrderWithoutTransaction(params) {
|
|
|
89
89
|
// orderNumber: params.object.orderNumber
|
|
90
90
|
// })({ transaction: repos.transaction });
|
|
91
91
|
// アクションを作成する(2022-04-11~)
|
|
92
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
92
93
|
const simpleOrder = {
|
|
93
94
|
// project: order.project,
|
|
94
95
|
typeOf: order.typeOf,
|
|
95
96
|
seller: order.seller,
|
|
96
|
-
customer:
|
|
97
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
97
98
|
confirmationNumber: order.confirmationNumber,
|
|
98
99
|
orderNumber: order.orderNumber,
|
|
99
100
|
price: order.price,
|
|
@@ -148,11 +149,12 @@ function placeOrder(params) {
|
|
|
148
149
|
orderNumber: params.object.orderNumber
|
|
149
150
|
})({ transaction: repos.transaction });
|
|
150
151
|
// アクションを作成する(2022-04-11~)
|
|
152
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
151
153
|
const simpleOrder = {
|
|
152
154
|
// project: order.project,
|
|
153
155
|
typeOf: order.typeOf,
|
|
154
156
|
seller: order.seller,
|
|
155
|
-
customer:
|
|
157
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
156
158
|
confirmationNumber: order.confirmationNumber,
|
|
157
159
|
orderNumber: order.orderNumber,
|
|
158
160
|
price: order.price,
|
|
@@ -42,11 +42,12 @@ function sendOrder(params) {
|
|
|
42
42
|
}
|
|
43
43
|
// SendOrderアクションを作成する
|
|
44
44
|
// minimizeする(2022-04-18~)
|
|
45
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(order);
|
|
45
46
|
const simpleOrder = {
|
|
46
47
|
// project: order.project,
|
|
47
48
|
typeOf: order.typeOf,
|
|
48
49
|
seller: order.seller,
|
|
49
|
-
customer:
|
|
50
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
50
51
|
confirmationNumber: order.confirmationNumber,
|
|
51
52
|
orderNumber: order.orderNumber,
|
|
52
53
|
price: order.price,
|
|
@@ -34,12 +34,13 @@ function createPotentialActions(params) {
|
|
|
34
34
|
const givePointAwardActions = yield (0, givePointAward_1.createGivePointAwardActions)(params);
|
|
35
35
|
// 注文配送メール送信設定
|
|
36
36
|
const sendEmailMessageActions = yield (0, sendEmailMessage_1.createSendEmailMessageActions)(params);
|
|
37
|
+
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order);
|
|
37
38
|
const simpleOrder = {
|
|
38
39
|
// project: params.order.project,
|
|
39
40
|
typeOf: params.order.typeOf,
|
|
40
41
|
seller: params.order.seller,
|
|
41
42
|
// mask
|
|
42
|
-
customer:
|
|
43
|
+
customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id, name: maskedCustomer.name },
|
|
43
44
|
confirmationNumber: params.order.confirmationNumber,
|
|
44
45
|
orderNumber: params.order.orderNumber,
|
|
45
46
|
price: params.order.price,
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.
|
|
12
|
+
"@chevre/factory": "4.277.0-alpha.0",
|
|
13
13
|
"@cinerino/sdk": "3.132.0",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"postversion": "git push origin --tags",
|
|
121
121
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
122
122
|
},
|
|
123
|
-
"version": "20.1.0-alpha.
|
|
123
|
+
"version": "20.1.0-alpha.4"
|
|
124
124
|
}
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as factory from '../../../../factory';
|
|
2
|
-
export declare type IAuthorizeSeatReservationOffer = factory.action.authorize.offer.seatReservation.IAction<factory.service.webAPI.Identifier>;
|
|
3
|
-
/**
|
|
4
|
-
* 予約確定アクションを作成する
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* 予約確定オブジェクトを作成する
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* 予約確定オブジェクトを作成する
|
|
11
|
-
*/
|
package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.js
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import { PhoneNumberFormat, PhoneNumberUtil } from 'google-libphonenumber';
|
|
3
|
-
// import { format } from 'util';
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
/**
|
|
6
|
-
* 予約確定アクションを作成する
|
|
7
|
-
*/
|
|
8
|
-
// export async function createConfirmReservationActions(params: {
|
|
9
|
-
// order: factory.order.IOrder;
|
|
10
|
-
// transaction: factory.transaction.placeOrder.ITransaction;
|
|
11
|
-
// createConfirmReserveActions: boolean;
|
|
12
|
-
// }): Promise<factory.action.interact.confirm.reservation.IAttributes<factory.service.webAPI.Identifier>[]> {
|
|
13
|
-
// const confirmReservationActions: factory.action.interact.confirm.reservation.IAttributes<factory.service.webAPI.Identifier>[] = [];
|
|
14
|
-
// const seatReservationAuthorizeActions = <IAuthorizeSeatReservationOffer[]>
|
|
15
|
-
// params.transaction.object.authorizeActions
|
|
16
|
-
// .filter((a) => a.actionStatus === factory.actionStatusType.CompletedActionStatus)
|
|
17
|
-
// .filter((a) => a.object.typeOf === factory.action.authorize.offer.seatReservation.ObjectType.SeatReservation);
|
|
18
|
-
// const purpose: factory.order.ISimpleOrder = createPurpose({ order: params.order });
|
|
19
|
-
// seatReservationAuthorizeActions.forEach((a) => {
|
|
20
|
-
// const actionResult = a.result;
|
|
21
|
-
// if (a.instrument === undefined) {
|
|
22
|
-
// a.instrument = {
|
|
23
|
-
// typeOf: 'WebAPI',
|
|
24
|
-
// identifier: factory.service.webAPI.Identifier.Chevre
|
|
25
|
-
// };
|
|
26
|
-
// }
|
|
27
|
-
// if (actionResult !== undefined) {
|
|
28
|
-
// const responseBody = actionResult.responseBody;
|
|
29
|
-
// let confirmReservationObject: factory.action.interact.confirm.reservation.IObject<factory.service.webAPI.Identifier.Chevre>
|
|
30
|
-
// | factory.action.interact.confirm.reservation.IObject<factory.service.webAPI.Identifier.COA>;
|
|
31
|
-
// switch (a.instrument.identifier) {
|
|
32
|
-
// case factory.service.webAPI.Identifier.COA:
|
|
33
|
-
// confirmReservationObject = createConfirmReservationActionObject4COA({
|
|
34
|
-
// order: params.order,
|
|
35
|
-
// // tslint:disable-next-line:max-line-length
|
|
36
|
-
// tslint:disable-next-line:max-line-length
|
|
37
|
-
// reserveTransaction: <factory.action.authorize.offer.seatReservation.IResponseBody<factory.service.webAPI.Identifier.COA>>responseBody,
|
|
38
|
-
// requestBody: actionResult.requestBody,
|
|
39
|
-
// price: Number(actionResult.price),
|
|
40
|
-
// acceptedOffers: <factory.action.authorize.offer.seatReservation.IAcceptedOffer4COA[]>a.object.acceptedOffer
|
|
41
|
-
// });
|
|
42
|
-
// break;
|
|
43
|
-
// default:
|
|
44
|
-
// const reserveTransactionNumber = a.object.pendingTransaction?.transactionNumber;
|
|
45
|
-
// if (typeof reserveTransactionNumber !== 'string') {
|
|
46
|
-
// throw new factory.errors.NotFound('AuthorizaAction.object.pendingTransaction.transactionNumber');
|
|
47
|
-
// }
|
|
48
|
-
// confirmReservationObject = createConfirmReservationActionObject({
|
|
49
|
-
// order: params.order,
|
|
50
|
-
// // transaction: params.transaction,
|
|
51
|
-
// // tslint:disable-next-line:max-line-length
|
|
52
|
-
// tslint:disable-next-line:max-line-length
|
|
53
|
-
// // reserveTransaction: <factory.action.authorize.offer.seatReservation.IResponseBody<factory.service.webAPI.Identifier.Chevre>>responseBody,
|
|
54
|
-
// reserveTransactionNumber
|
|
55
|
-
// });
|
|
56
|
-
// }
|
|
57
|
-
// if (params.createConfirmReserveActions) {
|
|
58
|
-
// confirmReservationActions.push({
|
|
59
|
-
// project: params.transaction.project,
|
|
60
|
-
// typeOf: <factory.actionType.ConfirmAction>factory.actionType.ConfirmAction,
|
|
61
|
-
// object: confirmReservationObject,
|
|
62
|
-
// // agent: Projectに統一(2022-05-16~)
|
|
63
|
-
// agent: params.transaction.project,
|
|
64
|
-
// // agent: params.transaction.agent,
|
|
65
|
-
// purpose: purpose,
|
|
66
|
-
// instrument: a.instrument
|
|
67
|
-
// });
|
|
68
|
-
// }
|
|
69
|
-
// }
|
|
70
|
-
// });
|
|
71
|
-
// return confirmReservationActions;
|
|
72
|
-
// }
|
|
73
|
-
// function createPurpose(params: {
|
|
74
|
-
// order: factory.order.IOrder;
|
|
75
|
-
// }): factory.order.ISimpleOrder {
|
|
76
|
-
// return {
|
|
77
|
-
// project: params.order.project,
|
|
78
|
-
// typeOf: params.order.typeOf,
|
|
79
|
-
// seller: params.order.seller,
|
|
80
|
-
// // mask
|
|
81
|
-
// customer: createMaskedCustomer(params.order),
|
|
82
|
-
// confirmationNumber: params.order.confirmationNumber,
|
|
83
|
-
// orderNumber: params.order.orderNumber,
|
|
84
|
-
// price: params.order.price,
|
|
85
|
-
// priceCurrency: params.order.priceCurrency,
|
|
86
|
-
// orderDate: params.order.orderDate
|
|
87
|
-
// };
|
|
88
|
-
// }
|
|
89
|
-
/**
|
|
90
|
-
* 予約確定オブジェクトを作成する
|
|
91
|
-
*/
|
|
92
|
-
// function createConfirmReservationActionObject4COA(params: {
|
|
93
|
-
// order: factory.order.IOrder;
|
|
94
|
-
// reserveTransaction: factory.action.authorize.offer.seatReservation.IResponseBody<factory.service.webAPI.Identifier.COA>;
|
|
95
|
-
// requestBody: any;
|
|
96
|
-
// price: number;
|
|
97
|
-
// acceptedOffers: factory.action.authorize.offer.seatReservation.IAcceptedOffer4COA[];
|
|
98
|
-
// }): factory.action.interact.confirm.reservation.IObject<factory.service.webAPI.Identifier.COA> {
|
|
99
|
-
// const price = params.price;
|
|
100
|
-
// const customer = params.order.customer;
|
|
101
|
-
// const updTmpReserveSeatArgs = params.requestBody;
|
|
102
|
-
// const updTmpReserveSeatResult = params.reserveTransaction;
|
|
103
|
-
// // 電話番号のフォーマットを日本人にリーダブルに調整(COAではこのフォーマットで扱うので)
|
|
104
|
-
// const phoneUtil = PhoneNumberUtil.getInstance();
|
|
105
|
-
// const phoneNumber = phoneUtil.parse(customer.telephone, 'JP');
|
|
106
|
-
// let telNum = phoneUtil.format(phoneNumber, PhoneNumberFormat.NATIONAL);
|
|
107
|
-
// // COAでは数字のみ受け付けるので数字以外を除去
|
|
108
|
-
// telNum = telNum.replace(/[^\d]/g, '');
|
|
109
|
-
// const mailAddr = customer.email;
|
|
110
|
-
// if (mailAddr === undefined) {
|
|
111
|
-
// throw new factory.errors.Argument('order', 'order.customer.email undefined');
|
|
112
|
-
// }
|
|
113
|
-
// return {
|
|
114
|
-
// theaterCode: updTmpReserveSeatArgs.theaterCode,
|
|
115
|
-
// dateJouei: updTmpReserveSeatArgs.dateJouei,
|
|
116
|
-
// titleCode: updTmpReserveSeatArgs.titleCode,
|
|
117
|
-
// titleBranchNum: updTmpReserveSeatArgs.titleBranchNum,
|
|
118
|
-
// timeBegin: updTmpReserveSeatArgs.timeBegin,
|
|
119
|
-
// tmpReserveNum: updTmpReserveSeatResult.tmpReserveNum,
|
|
120
|
-
// tslint:disable-next-line:no-irregular-whitespace
|
|
121
|
-
// reserveName: format('%s %s', customer.familyName, customer.givenName),
|
|
122
|
-
// tslint:disable-next-line:no-irregular-whitespace
|
|
123
|
-
// reserveNameJkana: format('%s %s', customer.familyName, customer.givenName),
|
|
124
|
-
// telNum: telNum,
|
|
125
|
-
// mailAddr: mailAddr,
|
|
126
|
-
// reserveAmount: price, // デフォルトのpriceCurrencyがJPYなのでこれでよし
|
|
127
|
-
// listTicket: params.acceptedOffers.map((o) => o.ticketInfo),
|
|
128
|
-
// transactionNumber: String(updTmpReserveSeatResult.tmpReserveNum),
|
|
129
|
-
// typeOf: 'COAReserveTransaction'
|
|
130
|
-
// };
|
|
131
|
-
// }
|
|
132
|
-
/**
|
|
133
|
-
* 予約確定オブジェクトを作成する
|
|
134
|
-
*/
|
|
135
|
-
// function createConfirmReservationActionObject(params: {
|
|
136
|
-
// order: factory.order.IOrder;
|
|
137
|
-
// reserveTransactionNumber: string;
|
|
138
|
-
// }): factory.action.interact.confirm.reservation.IObject<factory.service.webAPI.Identifier.Chevre> {
|
|
139
|
-
// return {
|
|
140
|
-
// typeOf: factory.assetTransactionType.Reserve,
|
|
141
|
-
// transactionNumber: params.reserveTransactionNumber,
|
|
142
|
-
// potentialActions: {
|
|
143
|
-
// reserve: {
|
|
144
|
-
// purpose: {
|
|
145
|
-
// confirmationNumber: params.order.confirmationNumber,
|
|
146
|
-
// orderNumber: params.order.orderNumber,
|
|
147
|
-
// typeOf: params.order.typeOf
|
|
148
|
-
// }
|
|
149
|
-
// }
|
|
150
|
-
// }
|
|
151
|
-
// };
|
|
152
|
-
// }
|
|
153
|
-
// function createReservationUnderNameIdentifier(params: {
|
|
154
|
-
// order: factory.order.IOrder;
|
|
155
|
-
// transaction: factory.transaction.placeOrder.ITransaction;
|
|
156
|
-
// }): factory.propertyValue.IPropertyValue<string>[] {
|
|
157
|
-
// const order = params.order;
|
|
158
|
-
// const customer = order.customer;
|
|
159
|
-
// // 予約のunderName.identifierを決定する
|
|
160
|
-
// return [
|
|
161
|
-
// { name: 'orderNumber', value: order.orderNumber },
|
|
162
|
-
// // 不要なので廃止(2022-05-24~)
|
|
163
|
-
// // { name: 'transaction', value: params.transaction.id },
|
|
164
|
-
// // ↓legacy-reservationの印刷アウトプットで使用(2022-02-09廃止)
|
|
165
|
-
// // { name: 'paymentMethod', value: paymentMethodNames },
|
|
166
|
-
// ...(Array.isArray(customer.identifier)) ? customer.identifier : []
|
|
167
|
-
// ];
|
|
168
|
-
// }
|
|
169
|
-
// function createReservationUnderName(params: {
|
|
170
|
-
// order: factory.order.IOrder;
|
|
171
|
-
// identifier: factory.propertyValue.IPropertyValue<string>[];
|
|
172
|
-
// }): factory.reservation.IUnderName<factory.reservationType.EventReservation> {
|
|
173
|
-
// return {
|
|
174
|
-
// identifier: params.identifier,
|
|
175
|
-
// name: String(params.order.customer.name),
|
|
176
|
-
// typeOf: params.order.customer.typeOf,
|
|
177
|
-
// ...(typeof params.order.customer.address === 'string') ? { address: params.order.customer.address } : undefined,
|
|
178
|
-
// ...(typeof params.order.customer.age === 'string') ? { age: params.order.customer.age } : undefined,
|
|
179
|
-
// ...(typeof params.order.customer.email === 'string') ? { email: params.order.customer.email } : undefined,
|
|
180
|
-
// ...(typeof params.order.customer.familyName === 'string') ? { familyName: params.order.customer.familyName } : undefined,
|
|
181
|
-
// ...(typeof params.order.customer.gender === 'string') ? { gender: params.order.customer.gender } : undefined,
|
|
182
|
-
// ...(typeof params.order.customer.givenName === 'string') ? { givenName: params.order.customer.givenName } : undefined,
|
|
183
|
-
// ...(typeof params.order.customer.id === 'string') ? { id: params.order.customer.id } : undefined,
|
|
184
|
-
// ...(typeof params.order.customer.telephone === 'string') ? { telephone: params.order.customer.telephone } : undefined,
|
|
185
|
-
// ...(typeof params.order.customer.url === 'string') ? { url: params.order.customer.url } : undefined
|
|
186
|
-
// };
|
|
187
|
-
// }
|