feat: add smoke tests, agent credit ledger, and player cashback page
Introduce admin smoke-test suite with API probes, agent credit transaction history, and player cashback records; fix SmokeTestModule DI and polish admin/player UI assets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -474,10 +474,33 @@ export class CashbackService {
|
||||
}
|
||||
|
||||
async getUserCashbacks(userId: bigint) {
|
||||
return this.prisma.cashbackItem.findMany({
|
||||
where: { userId },
|
||||
include: { batch: true },
|
||||
const items = await this.prisma.cashbackItem.findMany({
|
||||
where: { userId, batch: { status: 'CONFIRMED' } },
|
||||
include: {
|
||||
batch: {
|
||||
select: {
|
||||
batchNo: true,
|
||||
periodStart: true,
|
||||
periodEnd: true,
|
||||
confirmedAt: true,
|
||||
status: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
|
||||
return items.map((item) => ({
|
||||
id: item.id.toString(),
|
||||
batchNo: item.batch.batchNo,
|
||||
periodStart: item.batch.periodStart,
|
||||
periodEnd: item.batch.periodEnd,
|
||||
confirmedAt: item.batch.confirmedAt,
|
||||
effectiveStake: item.effectiveStake.toString(),
|
||||
betCount: item.betCount,
|
||||
rate: item.rate.toString(),
|
||||
amount: item.amount.toString(),
|
||||
createdAt: item.createdAt,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user