@chevre/domain 21.8.0-alpha.8 → 21.8.0-alpha.9
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.
|
@@ -10,8 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.confirmPayTransaction = void 0;
|
|
13
|
+
const createDebug = require("debug");
|
|
13
14
|
const factory = require("../../factory");
|
|
14
15
|
const PayTransactionService = require("../assetTransaction/pay");
|
|
16
|
+
const debug = createDebug('chevre-domain:service:order');
|
|
15
17
|
function confirmPayTransaction(data) {
|
|
16
18
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
17
19
|
// アクション開始
|
|
@@ -82,6 +84,7 @@ function onConfirmed(params) {
|
|
|
82
84
|
const paymentMethodIds = order.paymentMethods.filter((invoice) => typeof invoice.paymentMethodId === 'string' && invoice.paymentMethodId.length > 0)
|
|
83
85
|
.map((invoice) => invoice.paymentMethodId);
|
|
84
86
|
if (paymentMethodIds.length > 0) {
|
|
87
|
+
debug('checking allPayTransactionConfirmed...', 'orderNumber:', params.purpose.orderNumber);
|
|
85
88
|
const referencedPayTransactions = yield repos.assetTransaction.search({
|
|
86
89
|
project: { id: { $eq: params.project.id } },
|
|
87
90
|
typeOf: factory.assetTransactionType.Pay,
|
|
@@ -89,6 +92,7 @@ function onConfirmed(params) {
|
|
|
89
92
|
}, ['status']);
|
|
90
93
|
allPayTransactionConfirmed =
|
|
91
94
|
referencedPayTransactions.every((payTransation) => payTransation.status === factory.transactionStatusType.Confirmed);
|
|
95
|
+
debug('allPayTransactionConfirmed?:', allPayTransactionConfirmed, 'referencedPayTransactions:', JSON.stringify(referencedPayTransactions), 'orderNumber:', params.purpose.orderNumber);
|
|
92
96
|
}
|
|
93
97
|
else {
|
|
94
98
|
allPayTransactionConfirmed = true;
|
|
@@ -13,17 +13,20 @@ exports.onOrderStatusChanged = void 0;
|
|
|
13
13
|
/**
|
|
14
14
|
* 注文ステータス変更時処理
|
|
15
15
|
*/
|
|
16
|
+
const createDebug = require("debug");
|
|
16
17
|
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
17
18
|
const factory = require("../../factory");
|
|
18
19
|
const order_1 = require("../../factory/order");
|
|
19
20
|
const product_1 = require("../offer/product");
|
|
20
21
|
const factory_1 = require("./onOrderStatusChanged/factory");
|
|
22
|
+
const debug = createDebug('chevre-domain:service:order');
|
|
21
23
|
const USE_CONFIRM_REGISTER_SERVICE_TRANSACTION = process.env.USE_CONFIRM_REGISTER_SERVICE_TRANSACTION === '1';
|
|
22
24
|
const TOKEN_EXPIRES_IN = 604800;
|
|
23
25
|
function onOrderStatusChanged(params) {
|
|
24
26
|
// tslint:disable-next-line:max-func-body-length
|
|
25
27
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
26
28
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
29
|
+
debug('onOrderStatusChanged called.', params.order.orderNumber, params.order.orderStatus, params.order.orderDate);
|
|
27
30
|
let tasks = [];
|
|
28
31
|
const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order, { noProfile: true });
|
|
29
32
|
const simpleOrder = {
|
package/package.json
CHANGED