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:
2026-06-09 16:05:48 +08:00
parent 9c6c5e51f3
commit d5e7c8edb3
52 changed files with 3357 additions and 67 deletions

View File

@@ -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,
}));
}
}