admin roadmap filter & search, user management, reopen rejected, system health
This commit is contained in:
@@ -31,9 +31,26 @@ export const payoutRepo = {
|
||||
return client.payout.findUnique({ where: { bookingId } });
|
||||
},
|
||||
|
||||
async listByStatus(status: PayoutStatus) {
|
||||
async listByStatus(
|
||||
status: PayoutStatus,
|
||||
filters?: {
|
||||
dateFrom?: Date;
|
||||
dateTo?: Date;
|
||||
processorEmail?: string;
|
||||
}
|
||||
) {
|
||||
const where: Prisma.PayoutWhereInput = { status };
|
||||
if (filters?.dateFrom || filters?.dateTo) {
|
||||
where.createdAt = {
|
||||
...(filters.dateFrom && { gte: filters.dateFrom }),
|
||||
...(filters.dateTo && { lte: filters.dateTo }),
|
||||
};
|
||||
}
|
||||
if (filters?.processorEmail) {
|
||||
where.processedBy = { email: filters.processorEmail };
|
||||
}
|
||||
return prisma.payout.findMany({
|
||||
where: { status },
|
||||
where,
|
||||
orderBy: { heldUntil: "asc" },
|
||||
include: payoutListInclude,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user