find all payments

This commit is contained in:
2026-01-19 11:44:28 +03:30
parent 013b543503
commit 3b76081fed
3 changed files with 20 additions and 3 deletions
@@ -25,7 +25,8 @@ export class PaymentRepository extends EntityRepository<Payment> {
order = 'desc',
userId,
from,
to
to,
orderId
} = opts;
const offset = (page - 1) * limit;
@@ -53,6 +54,9 @@ export class PaymentRepository extends EntityRepository<Payment> {
where.order = { user: { id: userId } };
}
if (orderId) {
where.order = { id: orderId }
}
// Filter by date range
if (from || to) {
where.createdAt = {};