@chevre/domain 25.2.0-alpha.3 → 25.2.0-alpha.30
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/customerTelephone2COATelNum.d.ts +3 -0
- package/lib/chevre/factory/customerTelephone2COATelNum.js +23 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
- package/lib/chevre/repo/action/acceptPay.js +47 -19
- package/lib/chevre/repo/action/actionProcess.js +57 -57
- package/lib/chevre/repo/action.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
- package/lib/chevre/repo/order.d.ts +735 -0
- package/lib/chevre/repo/order.js +13 -20
- package/lib/chevre/repo/orderInTransaction.d.ts +45 -0
- package/lib/chevre/repo/orderInTransaction.js +175 -0
- package/lib/chevre/repo/person.d.ts +0 -15
- package/lib/chevre/repo/person.js +122 -108
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
- package/lib/chevre/repo/transaction/placeOrder.js +43 -83
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +5 -5
- package/lib/chevre/service/offer/event/authorize/factory.js +30 -20
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize.js +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +17 -14
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
- package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder.d.ts +2 -0
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
- package/lib/chevre/service/payment/any/authorize.js +13 -37
- package/lib/chevre/service/payment/any/factory.d.ts +6 -6
- package/lib/chevre/service/payment/any/factory.js +19 -22
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +3 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
- package/lib/chevre/service/reserve/searchByOrder.js +2 -6
- package/lib/chevre/service/task/confirmReserveTransaction.js +2 -7
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -0
- package/lib/chevre/service/task/placeOrder.js +2 -2
- package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
- package/lib/chevre/service/task/voidPayTransaction.js +3 -7
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +7 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +16 -12
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +112 -91
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +4 -0
- package/lib/chevre/service/transaction/placeOrder/confirm.js +31 -74
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +2 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +19 -9
- package/package.json +5 -4
|
@@ -2,17 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateAgent = updateAgent;
|
|
4
4
|
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
5
|
+
const libphonenumber_js_1 = require("libphonenumber-js");
|
|
5
6
|
const factory_1 = require("../../../factory");
|
|
6
|
-
function fixCustomer(params) {
|
|
7
|
+
function fixCustomer(params, options) {
|
|
7
8
|
return async (repos) => {
|
|
9
|
+
const { useLibphonenumber } = options;
|
|
8
10
|
let formattedTelephone;
|
|
9
11
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
if (useLibphonenumber) {
|
|
13
|
+
const phoneNumber = (0, libphonenumber_js_1.parsePhoneNumberFromString)(String(params.agent.telephone), params.agent.telephoneRegion);
|
|
14
|
+
if (phoneNumber === undefined || !phoneNumber.isValid()) {
|
|
15
|
+
throw new factory_1.factory.errors.Argument('telephone', 'Invalid phone number');
|
|
16
|
+
}
|
|
17
|
+
formattedTelephone = phoneNumber.format('E.164');
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const phoneUtil = google_libphonenumber_1.PhoneNumberUtil.getInstance();
|
|
21
|
+
const phoneNumber = phoneUtil.parse(params.agent.telephone, params.agent.telephoneRegion);
|
|
22
|
+
if (!phoneUtil.isValidNumber(phoneNumber)) {
|
|
23
|
+
throw new factory_1.factory.errors.Argument('telephone', 'Invalid phone number');
|
|
24
|
+
}
|
|
25
|
+
formattedTelephone = phoneUtil.format(phoneNumber, google_libphonenumber_1.PhoneNumberFormat.E164);
|
|
14
26
|
}
|
|
15
|
-
formattedTelephone = phoneUtil.format(phoneNumber, google_libphonenumber_1.PhoneNumberFormat.E164);
|
|
16
27
|
}
|
|
17
28
|
catch (error) {
|
|
18
29
|
throw new factory_1.factory.errors.Argument('telephone', (error instanceof Error) ? error.message : String(error));
|
|
@@ -68,9 +79,9 @@ function fixCustomer(params) {
|
|
|
68
79
|
/**
|
|
69
80
|
* 取引人プロフィール更新
|
|
70
81
|
*/
|
|
71
|
-
function updateAgent(params) {
|
|
82
|
+
function updateAgent(params, options) {
|
|
72
83
|
return async (repos) => {
|
|
73
|
-
const { customer, transaction } = await fixCustomer(params)(repos);
|
|
84
|
+
const { customer, transaction } = await fixCustomer(params, options)(repos);
|
|
74
85
|
// also save in orderInTransaction(2024-06-20~)
|
|
75
86
|
if (customer !== undefined) {
|
|
76
87
|
// // 注文ドキュメントを参照(2026-06-24~)
|
|
@@ -95,6 +106,5 @@ function updateAgent(params) {
|
|
|
95
106
|
customer: customerInOrder
|
|
96
107
|
});
|
|
97
108
|
}
|
|
98
|
-
// return newAgent;
|
|
99
109
|
};
|
|
100
110
|
}
|
package/package.json
CHANGED
|
@@ -11,15 +11,16 @@
|
|
|
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": "9.5.0-alpha.
|
|
14
|
+
"@chevre/factory": "9.5.0-alpha.11",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
18
18
|
"@surfrock/sdk": "2.0.0",
|
|
19
19
|
"debug": "4.4.3",
|
|
20
|
-
"google-libphonenumber": "
|
|
20
|
+
"google-libphonenumber": "3.2.18",
|
|
21
21
|
"http-status": "2.1.0",
|
|
22
22
|
"jsonwebtoken": "9.0.0",
|
|
23
|
+
"libphonenumber-js": "1.13.8",
|
|
23
24
|
"lodash.difference": "^4.5.0",
|
|
24
25
|
"moment": "^2.29.1",
|
|
25
26
|
"moment-timezone": "^0.5.33",
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
"@sendgrid/helpers": "8.0.0",
|
|
35
36
|
"@size-limit/preset-big-lib": "12.0.0",
|
|
36
37
|
"@types/debug": "4.1.13",
|
|
37
|
-
"@types/google-libphonenumber": "
|
|
38
|
+
"@types/google-libphonenumber": "7.4.19",
|
|
38
39
|
"@types/jsonwebtoken": "9.0.1",
|
|
39
40
|
"@types/lodash.difference": "^4.5.6",
|
|
40
41
|
"@types/node": "22.19.7",
|
|
@@ -91,5 +92,5 @@
|
|
|
91
92
|
"postversion": "git push origin --tags",
|
|
92
93
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
94
|
},
|
|
94
|
-
"version": "25.2.0-alpha.
|
|
95
|
+
"version": "25.2.0-alpha.30"
|
|
95
96
|
}
|