@chevre/domain 21.8.0-alpha.5 → 21.8.0-alpha.7
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.
|
@@ -29,6 +29,23 @@ const accountTransactionIdentifier_1 = require("../factory/accountTransactionIde
|
|
|
29
29
|
*/
|
|
30
30
|
function givePointAward(params) {
|
|
31
31
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
// 入金識別子が存在する場合、冪等性の確保(2023-08-24~)
|
|
33
|
+
const pendingTransactionIdentifier = params.object.identifier;
|
|
34
|
+
if (typeof pendingTransactionIdentifier === 'string' && pendingTransactionIdentifier.length > 0) {
|
|
35
|
+
// すでにConfirmedのMoneyTransfer取引が存在すれば何もしない
|
|
36
|
+
const assetTransactions = yield repos.assetTransaction.search({
|
|
37
|
+
limit: 1,
|
|
38
|
+
project: { id: { $eq: params.project.id } },
|
|
39
|
+
typeOf: factory.assetTransactionType.MoneyTransfer,
|
|
40
|
+
statuses: [factory.transactionStatusType.Confirmed],
|
|
41
|
+
object: {
|
|
42
|
+
pendingTransaction: { identifier: { $eq: pendingTransactionIdentifier } }
|
|
43
|
+
}
|
|
44
|
+
}, ['_id']);
|
|
45
|
+
if (assetTransactions.length > 0) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
32
49
|
// アクション開始
|
|
33
50
|
const action = yield repos.action.start(params);
|
|
34
51
|
try {
|
|
@@ -14,7 +14,6 @@ exports.onOrderStatusChanged = void 0;
|
|
|
14
14
|
* 注文ステータス変更時処理
|
|
15
15
|
*/
|
|
16
16
|
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
17
|
-
const moment = require("moment");
|
|
18
17
|
const factory = require("../../factory");
|
|
19
18
|
const order_1 = require("../../factory/order");
|
|
20
19
|
const product_1 = require("../offer/product");
|
|
@@ -130,8 +129,7 @@ function onOrderStatusChanged(params) {
|
|
|
130
129
|
exports.onOrderStatusChanged = onOrderStatusChanged;
|
|
131
130
|
function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
132
131
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
const taskRunsAt =
|
|
134
|
-
.toDate();
|
|
132
|
+
const taskRunsAt = new Date();
|
|
135
133
|
const tasks = [];
|
|
136
134
|
yield Promise.all(order.paymentMethods.map((invoice) => __awaiter(this, void 0, void 0, function* () {
|
|
137
135
|
// PaymentAutomaticallyAppliedであれば、自動決済処理を実行(2023-08-24~)
|
|
@@ -181,14 +179,14 @@ function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
|
181
179
|
return tasks;
|
|
182
180
|
});
|
|
183
181
|
}
|
|
184
|
-
const COA_TASK_DELAY_IN_SECONDS = 0;
|
|
182
|
+
// const COA_TASK_DELAY_IN_SECONDS = 0;
|
|
185
183
|
function createConfirmReserveTransactionTasks(order, simpleOrder) {
|
|
186
184
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
187
|
-
const taskRunsAt =
|
|
188
|
-
|
|
189
|
-
const taskRunsAt4coa = moment(order.orderDate)
|
|
190
|
-
|
|
191
|
-
|
|
185
|
+
const taskRunsAt = new Date();
|
|
186
|
+
const taskRunsAt4coa = new Date();
|
|
187
|
+
// const taskRunsAt4coa = moment(order.orderDate)
|
|
188
|
+
// .add(COA_TASK_DELAY_IN_SECONDS, 'seconds')
|
|
189
|
+
// .toDate();
|
|
192
190
|
const confirmObjects = [
|
|
193
191
|
...(0, factory_1.createConfirmReservationActionObject4ChevreByOrder)({ order }),
|
|
194
192
|
...(0, factory_1.createConfirmReservationActionObject4COAByOrder)({ order })
|
|
@@ -242,8 +240,7 @@ function createConfirmReserveTransactionTasks(order, simpleOrder) {
|
|
|
242
240
|
}
|
|
243
241
|
function createConfirmRegisterServiceTransactionTasks(order, simpleOrder) {
|
|
244
242
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
245
|
-
const taskRunsAt =
|
|
246
|
-
.toDate();
|
|
243
|
+
const taskRunsAt = new Date();
|
|
247
244
|
if (USE_CONFIRM_REGISTER_SERVICE_TRANSACTION) {
|
|
248
245
|
const confirmObjects = (0, factory_1.createConfirmRegisterServiceActionObjectByOrder)({ order });
|
|
249
246
|
const tasks = [];
|
|
@@ -317,14 +314,14 @@ function createSendOrderTransactionTaskIfNotExist(params) {
|
|
|
317
314
|
}
|
|
318
315
|
});
|
|
319
316
|
}
|
|
320
|
-
const RETURN_COA_TASK_DELAY_IN_SECONDS = 0;
|
|
317
|
+
// const RETURN_COA_TASK_DELAY_IN_SECONDS = 0;
|
|
321
318
|
function createReturnReserveTransactionTasks(order, simpleOrder) {
|
|
322
319
|
var _a, _b;
|
|
323
|
-
const taskRunsAt =
|
|
324
|
-
|
|
325
|
-
const taskRunsAt4coa = moment(order.dateReturned)
|
|
326
|
-
|
|
327
|
-
|
|
320
|
+
const taskRunsAt = new Date();
|
|
321
|
+
const taskRunsAt4coa = new Date();
|
|
322
|
+
// const taskRunsAt4coa = moment(order.dateReturned)
|
|
323
|
+
// .add(RETURN_COA_TASK_DELAY_IN_SECONDS, 'seconds')
|
|
324
|
+
// .toDate();
|
|
328
325
|
const tasks = [];
|
|
329
326
|
const returnActionRecipient = {
|
|
330
327
|
typeOf: order.seller.typeOf,
|
|
@@ -399,12 +396,13 @@ function createReturnReserveTransactionTasks(order, simpleOrder) {
|
|
|
399
396
|
}
|
|
400
397
|
return tasks;
|
|
401
398
|
}
|
|
402
|
-
const RETURN_PAY_TASK_DELAY_IN_SECONDS = 0;
|
|
399
|
+
// const RETURN_PAY_TASK_DELAY_IN_SECONDS = 0;
|
|
403
400
|
function createReturnPayTransactionTasks(order, __, returnOrderTransaction) {
|
|
404
401
|
var _a, _b;
|
|
405
|
-
const taskRunsAt =
|
|
406
|
-
|
|
407
|
-
|
|
402
|
+
const taskRunsAt = new Date();
|
|
403
|
+
// const taskRunsAt = moment(order.dateReturned)
|
|
404
|
+
// .add(RETURN_PAY_TASK_DELAY_IN_SECONDS, 'seconds')
|
|
405
|
+
// .toDate();
|
|
408
406
|
const tasks = [];
|
|
409
407
|
const returnOrderPotentialActions = (_b = (_a = returnOrderTransaction === null || returnOrderTransaction === void 0 ? void 0 : returnOrderTransaction.potentialActions) === null || _a === void 0 ? void 0 : _a.returnOrder.find((action) => action.object.orderNumber === order.orderNumber)) === null || _b === void 0 ? void 0 : _b.potentialActions;
|
|
410
408
|
const returnPayActionsByReturnOrderTransaction = returnOrderPotentialActions === null || returnOrderPotentialActions === void 0 ? void 0 : returnOrderPotentialActions.returnPaymentMethod;
|
package/package.json
CHANGED