@chevre/domain 21.2.0-alpha.41 → 21.2.0-alpha.44
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/repo/accountTransaction.d.ts +3 -1
- package/lib/chevre/repo/accountTransaction.js +1 -1
- package/lib/chevre/repo/assetTransaction.d.ts +6 -1
- package/lib/chevre/repo/assetTransaction.js +3 -9
- package/lib/chevre/repo/transaction.d.ts +6 -1
- package/lib/chevre/repo/transaction.js +6 -10
- package/package.json +1 -1
|
@@ -229,7 +229,7 @@ class MongoRepository {
|
|
|
229
229
|
// ステータスと期限を見て更新
|
|
230
230
|
yield this.transactionModel.updateMany({
|
|
231
231
|
status: factory.transactionStatusType.InProgress,
|
|
232
|
-
expires: { $lt: params.expires }
|
|
232
|
+
expires: { $lt: params.expires.$lt }
|
|
233
233
|
}, {
|
|
234
234
|
status: factory.transactionStatusType.Expired,
|
|
235
235
|
endDate: new Date()
|
|
@@ -117,6 +117,9 @@ export declare class MongoRepository {
|
|
|
117
117
|
exportTasks(params: {
|
|
118
118
|
now: Date;
|
|
119
119
|
delayInSeconds: number;
|
|
120
|
+
status: {
|
|
121
|
+
$in: factory.transactionStatusType[];
|
|
122
|
+
};
|
|
120
123
|
}): Promise<Pick<import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction, "id" | "typeOf" | "status">[]>;
|
|
121
124
|
/**
|
|
122
125
|
* set task status exported by transaction id
|
|
@@ -129,7 +132,9 @@ export declare class MongoRepository {
|
|
|
129
132
|
* 取引を期限切れにする
|
|
130
133
|
*/
|
|
131
134
|
makeExpired(params: {
|
|
132
|
-
expires:
|
|
135
|
+
expires: {
|
|
136
|
+
$lt: Date;
|
|
137
|
+
};
|
|
133
138
|
}): Promise<void>;
|
|
134
139
|
/**
|
|
135
140
|
* 取引を中止する
|
|
@@ -441,13 +441,7 @@ class MongoRepository {
|
|
|
441
441
|
exportTasks(params) {
|
|
442
442
|
return __awaiter(this, void 0, void 0, function* () {
|
|
443
443
|
const delayedTransactions = yield this.transactionModel.find({
|
|
444
|
-
status: {
|
|
445
|
-
$in: [
|
|
446
|
-
factory.transactionStatusType.Canceled,
|
|
447
|
-
factory.transactionStatusType.Confirmed,
|
|
448
|
-
factory.transactionStatusType.Expired
|
|
449
|
-
]
|
|
450
|
-
},
|
|
444
|
+
status: { $in: params.status.$in },
|
|
451
445
|
tasksExportationStatus: { $eq: factory.transactionTasksExportationStatus.Unexported },
|
|
452
446
|
endDate: {
|
|
453
447
|
$exists: true,
|
|
@@ -502,7 +496,7 @@ class MongoRepository {
|
|
|
502
496
|
// IDをemitしたいのでまずリスト検索(2023-04-27~)
|
|
503
497
|
const expiringTransactions = yield this.transactionModel.find({
|
|
504
498
|
status: { $eq: factory.transactionStatusType.InProgress },
|
|
505
|
-
expires: { $lt: params.expires }
|
|
499
|
+
expires: { $lt: params.expires.$lt }
|
|
506
500
|
})
|
|
507
501
|
.select({
|
|
508
502
|
_id: 1,
|
|
@@ -515,7 +509,7 @@ class MongoRepository {
|
|
|
515
509
|
yield this.transactionModel.updateMany({
|
|
516
510
|
_id: { $in: expiringTransactions.map((t) => t.id) },
|
|
517
511
|
status: { $eq: factory.transactionStatusType.InProgress },
|
|
518
|
-
expires: { $lt: params.expires }
|
|
512
|
+
expires: { $lt: params.expires.$lt }
|
|
519
513
|
}, {
|
|
520
514
|
status: factory.transactionStatusType.Expired,
|
|
521
515
|
endDate: new Date()
|
|
@@ -133,6 +133,9 @@ export declare class MongoRepository {
|
|
|
133
133
|
exportTasks(params: {
|
|
134
134
|
now: Date;
|
|
135
135
|
delayInSeconds: number;
|
|
136
|
+
status: {
|
|
137
|
+
$in: factory.transactionStatusType[];
|
|
138
|
+
};
|
|
136
139
|
}): Promise<Pick<import("@chevre/factory/lib/transaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction, "id" | "typeOf" | "status">[]>;
|
|
137
140
|
/**
|
|
138
141
|
* set task status exported by transaction id
|
|
@@ -145,7 +148,9 @@ export declare class MongoRepository {
|
|
|
145
148
|
* 取引を期限切れにする
|
|
146
149
|
*/
|
|
147
150
|
makeExpired(params: {
|
|
148
|
-
expires:
|
|
151
|
+
expires: {
|
|
152
|
+
$lt: Date;
|
|
153
|
+
};
|
|
149
154
|
}): Promise<void>;
|
|
150
155
|
/**
|
|
151
156
|
* 取引を中止する
|
|
@@ -313,7 +313,9 @@ class MongoRepository {
|
|
|
313
313
|
const doc = yield this.transactionModel.findOne({
|
|
314
314
|
_id: { $eq: params.id },
|
|
315
315
|
typeOf: { $eq: params.typeOf },
|
|
316
|
-
status: { $eq: factory.transactionStatusType.InProgress }
|
|
316
|
+
status: { $eq: factory.transactionStatusType.InProgress },
|
|
317
|
+
// expiresを条件に追加(2023-05-12~),
|
|
318
|
+
expires: { $gt: new Date() }
|
|
317
319
|
})
|
|
318
320
|
.exec();
|
|
319
321
|
if (doc === null) {
|
|
@@ -543,13 +545,7 @@ class MongoRepository {
|
|
|
543
545
|
exportTasks(params) {
|
|
544
546
|
return __awaiter(this, void 0, void 0, function* () {
|
|
545
547
|
const delayedTransactions = yield this.transactionModel.find({
|
|
546
|
-
status: {
|
|
547
|
-
$in: [
|
|
548
|
-
factory.transactionStatusType.Canceled,
|
|
549
|
-
factory.transactionStatusType.Confirmed,
|
|
550
|
-
factory.transactionStatusType.Expired
|
|
551
|
-
]
|
|
552
|
-
},
|
|
548
|
+
status: { $in: params.status.$in },
|
|
553
549
|
tasksExportationStatus: { $eq: factory.transactionTasksExportationStatus.Unexported },
|
|
554
550
|
endDate: {
|
|
555
551
|
$exists: true,
|
|
@@ -604,7 +600,7 @@ class MongoRepository {
|
|
|
604
600
|
// IDをemitしたいのでまずリスト検索(2023-04-27~)
|
|
605
601
|
const expiringTransactions = yield this.transactionModel.find({
|
|
606
602
|
status: { $eq: factory.transactionStatusType.InProgress },
|
|
607
|
-
expires: { $lt: params.expires }
|
|
603
|
+
expires: { $lt: params.expires.$lt }
|
|
608
604
|
})
|
|
609
605
|
.select({
|
|
610
606
|
_id: 1,
|
|
@@ -617,7 +613,7 @@ class MongoRepository {
|
|
|
617
613
|
yield this.transactionModel.updateMany({
|
|
618
614
|
_id: { $in: expiringTransactions.map((t) => t.id) },
|
|
619
615
|
status: { $eq: factory.transactionStatusType.InProgress },
|
|
620
|
-
expires: { $lt: params.expires }
|
|
616
|
+
expires: { $lt: params.expires.$lt }
|
|
621
617
|
}, {
|
|
622
618
|
status: factory.transactionStatusType.Expired,
|
|
623
619
|
endDate: new Date()
|
package/package.json
CHANGED