@chevre/domain 21.8.0-alpha.6 → 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 {
|
package/package.json
CHANGED