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:
@@ -37,9 +37,11 @@ const zh: Record<string, string> = {
|
||||
'nav.matches': '赛事管理',
|
||||
'nav.outrights': '优胜冠军',
|
||||
'nav.bets': '注单管理',
|
||||
'nav.credit_transactions': '额度流水',
|
||||
'nav.cashback': '返水管理',
|
||||
'nav.contents': '公共管理',
|
||||
'nav.audit': '操作日志',
|
||||
'nav.smoke_tests': '自动化测试',
|
||||
'nav.players': '直属玩家',
|
||||
'nav.subAgents': '下级代理',
|
||||
'nav.myBets': '注单查询',
|
||||
@@ -215,9 +217,11 @@ const en: Record<string, string> = {
|
||||
'nav.matches': 'Matches',
|
||||
'nav.outrights': 'Outrights',
|
||||
'nav.bets': 'Bets',
|
||||
'nav.credit_transactions': 'Credit ledger',
|
||||
'nav.cashback': 'Cashback',
|
||||
'nav.contents': 'Public Content',
|
||||
'nav.audit': 'Audit Log',
|
||||
'nav.smoke_tests': 'Smoke tests',
|
||||
'nav.players': 'My Players',
|
||||
'nav.subAgents': 'Sub-Agents',
|
||||
'nav.myBets': 'Bet Search',
|
||||
@@ -393,9 +397,11 @@ const ms: Record<string, string> = {
|
||||
'nav.matches': 'Perlawanan',
|
||||
'nav.outrights': 'Juara',
|
||||
'nav.bets': 'Pertaruhan',
|
||||
'nav.credit_transactions': 'Lejar kredit',
|
||||
'nav.cashback': 'Rebat',
|
||||
'nav.contents': 'Kandungan awam',
|
||||
'nav.audit': 'Log audit',
|
||||
'nav.smoke_tests': 'Ujian asap',
|
||||
'nav.players': 'Pemain saya',
|
||||
'nav.subAgents': 'Sub-ejen',
|
||||
'nav.myBets': 'Carian pertaruhan',
|
||||
|
||||
@@ -129,7 +129,13 @@ export const adminPagesMs: Record<string, string> = {
|
||||
'agent.credit.decrease': 'Kurang',
|
||||
'agent.col.credit_type': 'Jenis',
|
||||
'agent.col.credit_change': 'Perubahan',
|
||||
'agent.col.credit_before': 'Sebelum',
|
||||
'agent.col.credit_after': 'Selepas',
|
||||
'agent.credit_tx.filter_agent_ph': 'Nama pengguna ejen',
|
||||
'agent.credit_tx.filter_agent_id': 'ID ejen',
|
||||
'agent.credit_tx.filter_agent_id_ph': 'ID pengguna',
|
||||
'agent.credit_tx.col.operator': 'Operator',
|
||||
'agent.credit_tx.view_all': 'Lihat semua lejar kredit',
|
||||
'agent.col.no_records': 'Tiada rekod',
|
||||
'agent.btn.confirm_adjust': 'Sahkan',
|
||||
'agent.field.select_user': 'Pilih pengguna',
|
||||
@@ -597,4 +603,39 @@ export const adminPagesMs: Record<string, string> = {
|
||||
'msg.freeze_extra': ' Mereka tidak akan dapat log masuk.',
|
||||
'msg.freeze_done': '{action} selesai',
|
||||
'msg.freeze_failed': '{action} gagal',
|
||||
|
||||
'smoke.intro': 'Jalankan ujian asap automatik: penyelesaian, peraturan pertaruhan, kredit ejen, rebat, sondakan DB, dan integrasi pertaruhan→penyelesaian→dompet.',
|
||||
'smoke.intro_rule': 'Kes peraturan menggunakan logik sama seperti ujian unit Jest; tiada data perniagaan ditulis.',
|
||||
'smoke.intro_db': 'Kit Database hanya semak sambungan dan konfigurasi (baca sahaja).',
|
||||
'smoke.intro_bet_flow': 'Kit aliran pertaruhan mencipta perlawanan/pemain sementara, mengesahkan bekuan/payout/kredit ejen, kemudian membersihkan.',
|
||||
'smoke.intro_note': 'Merangkumi kebanyakan regresi UAT; semak rebat secara manual jika perlu.',
|
||||
'smoke.field.suites': 'Kit ujian',
|
||||
'smoke.ph.suites': 'Pilih kit untuk dijalankan',
|
||||
'smoke.btn.run': 'Jalankan ujian',
|
||||
'smoke.last_run': 'Jalanan terakhir',
|
||||
'smoke.results_title': 'Keputusan kes',
|
||||
'smoke.empty': 'Belum dijalankan. Klik Jalankan ujian.',
|
||||
'smoke.stat.pass': 'Lulus',
|
||||
'smoke.stat.fail': 'Gagal',
|
||||
'smoke.stat.total': 'Jumlah',
|
||||
'smoke.col.id': 'ID',
|
||||
'smoke.col.suite': 'Kit',
|
||||
'smoke.col.name': 'Kes',
|
||||
'smoke.col.uat': 'UAT',
|
||||
'smoke.col.duration': 'Masa',
|
||||
'smoke.col.steps': 'Langkah',
|
||||
'smoke.col.message': 'Mesej',
|
||||
'smoke.no_steps': 'Tiada butiran langkah',
|
||||
'smoke.status.PASS': 'Lulus',
|
||||
'smoke.status.FAIL': 'Gagal',
|
||||
'smoke.status.SKIP': 'Langkau',
|
||||
'smoke.msg.all_passed': 'Semua lulus ({n})',
|
||||
'smoke.msg.has_failures': '{n} kes gagal',
|
||||
'smoke.msg.run_failed': 'Gagal menjalankan ujian',
|
||||
'smoke.log_title': 'Log terperinci',
|
||||
'smoke.btn.copy_all': 'Salin semua log',
|
||||
'smoke.btn.copy_one': 'Salin',
|
||||
'smoke.msg.copy_ok': 'Disalin ke papan keratan',
|
||||
'smoke.msg.copy_failed': 'Gagal menyalin — pilih log secara manual',
|
||||
'audit.action.RUN_SMOKE_TESTS': 'Jalankan ujian asap',
|
||||
};
|
||||
|
||||
@@ -132,7 +132,13 @@ export const adminPagesZh: Record<string, string> = {
|
||||
'agent.credit.decrease': '减少',
|
||||
'agent.col.credit_type': '类型',
|
||||
'agent.col.credit_change': '变动',
|
||||
'agent.col.credit_before': '变动前',
|
||||
'agent.col.credit_after': '变动后',
|
||||
'agent.credit_tx.filter_agent_ph': '代理用户名',
|
||||
'agent.credit_tx.filter_agent_id': '代理 ID',
|
||||
'agent.credit_tx.filter_agent_id_ph': '用户 ID',
|
||||
'agent.credit_tx.col.operator': '操作人',
|
||||
'agent.credit_tx.view_all': '查看全部额度流水',
|
||||
'agent.col.no_records': '暂无记录',
|
||||
'agent.btn.confirm_adjust': '确认调整',
|
||||
'agent.field.select_user': '选择用户',
|
||||
@@ -692,6 +698,41 @@ export const adminPagesZh: Record<string, string> = {
|
||||
'msg.freeze_extra': '冻结后该账号将无法登录。',
|
||||
'msg.freeze_done': '已{action}',
|
||||
'msg.freeze_failed': '{action}失败',
|
||||
|
||||
'smoke.intro': '在后台一键运行自动化冒烟测试,覆盖结算引擎、下注规则、代理额度逻辑、返水规则、数据库探针,以及下注→结算→钱包全链路集成用例。',
|
||||
'smoke.intro_rule': '规则类用例与 Jest 单元测试同源逻辑,不写入业务数据。',
|
||||
'smoke.intro_db': '「数据库」套件仅做连接与配置探针(只读)。',
|
||||
'smoke.intro_bet_flow': '「下注结算链路」套件会创建临时赛事/玩家并自动清理,验证冻结、派彩与代理额度。',
|
||||
'smoke.intro_note': '可替代大部分 UAT 手工回归;发返水等仍建议抽样人工确认。',
|
||||
'smoke.field.suites': '测试套件',
|
||||
'smoke.ph.suites': '选择要运行的套件',
|
||||
'smoke.btn.run': '运行测试',
|
||||
'smoke.last_run': '最近一次运行',
|
||||
'smoke.results_title': '用例结果',
|
||||
'smoke.empty': '尚未运行测试,请点击「运行测试」。',
|
||||
'smoke.stat.pass': '通过',
|
||||
'smoke.stat.fail': '失败',
|
||||
'smoke.stat.total': '合计',
|
||||
'smoke.col.id': '编号',
|
||||
'smoke.col.suite': '套件',
|
||||
'smoke.col.name': '用例',
|
||||
'smoke.col.uat': 'UAT',
|
||||
'smoke.col.duration': '耗时',
|
||||
'smoke.col.steps': '步骤',
|
||||
'smoke.col.message': '说明',
|
||||
'smoke.no_steps': '无步骤明细',
|
||||
'smoke.status.PASS': '通过',
|
||||
'smoke.status.FAIL': '失败',
|
||||
'smoke.status.SKIP': '跳过',
|
||||
'smoke.msg.all_passed': '全部通过({n} 项)',
|
||||
'smoke.msg.has_failures': '有 {n} 项失败,请查看明细',
|
||||
'smoke.msg.run_failed': '测试运行失败',
|
||||
'smoke.log_title': '详细日志',
|
||||
'smoke.btn.copy_all': '复制全部日志',
|
||||
'smoke.btn.copy_one': '复制',
|
||||
'smoke.msg.copy_ok': '已复制到剪贴板',
|
||||
'smoke.msg.copy_failed': '复制失败,请手动选中日志复制',
|
||||
'audit.action.RUN_SMOKE_TESTS': '运行自动化测试',
|
||||
};
|
||||
|
||||
export const adminPagesEn: Record<string, string> = {
|
||||
@@ -827,7 +868,13 @@ export const adminPagesEn: Record<string, string> = {
|
||||
'agent.credit.decrease': 'Decrease',
|
||||
'agent.col.credit_type': 'Type',
|
||||
'agent.col.credit_change': 'Change',
|
||||
'agent.col.credit_before': 'Before',
|
||||
'agent.col.credit_after': 'After',
|
||||
'agent.credit_tx.filter_agent_ph': 'Agent username',
|
||||
'agent.credit_tx.filter_agent_id': 'Agent ID',
|
||||
'agent.credit_tx.filter_agent_id_ph': 'User ID',
|
||||
'agent.credit_tx.col.operator': 'Operator',
|
||||
'agent.credit_tx.view_all': 'View all credit ledger',
|
||||
'agent.col.no_records': 'No records',
|
||||
'agent.btn.confirm_adjust': 'Confirm',
|
||||
'agent.field.select_user': 'Select user',
|
||||
@@ -1388,4 +1435,39 @@ export const adminPagesEn: Record<string, string> = {
|
||||
'msg.freeze_extra': ' They will not be able to sign in.',
|
||||
'msg.freeze_done': '{action} completed',
|
||||
'msg.freeze_failed': '{action} failed',
|
||||
|
||||
'smoke.intro': 'Run automated smoke tests from the admin console: settlement, betting rules, agent credit logic, cashback rules, read-only DB probes, and bet→settle→wallet integration.',
|
||||
'smoke.intro_rule': 'Rule cases reuse the same logic as Jest unit tests; no business data is written.',
|
||||
'smoke.intro_db': 'The Database suite only checks connectivity and config (read-only).',
|
||||
'smoke.intro_bet_flow': 'The Bet-flow suite creates temporary matches/players, verifies freeze/payout/agent credit, then cleans up.',
|
||||
'smoke.intro_note': 'Covers most UAT regression; spot-check cashback payout manually if needed.',
|
||||
'smoke.field.suites': 'Suites',
|
||||
'smoke.ph.suites': 'Select suites to run',
|
||||
'smoke.btn.run': 'Run tests',
|
||||
'smoke.last_run': 'Last run',
|
||||
'smoke.results_title': 'Case results',
|
||||
'smoke.empty': 'No run yet. Click Run tests.',
|
||||
'smoke.stat.pass': 'Pass',
|
||||
'smoke.stat.fail': 'Fail',
|
||||
'smoke.stat.total': 'Total',
|
||||
'smoke.col.id': 'ID',
|
||||
'smoke.col.suite': 'Suite',
|
||||
'smoke.col.name': 'Case',
|
||||
'smoke.col.uat': 'UAT',
|
||||
'smoke.col.duration': 'Duration',
|
||||
'smoke.col.steps': 'Steps',
|
||||
'smoke.col.message': 'Message',
|
||||
'smoke.no_steps': 'No step details',
|
||||
'smoke.status.PASS': 'Pass',
|
||||
'smoke.status.FAIL': 'Fail',
|
||||
'smoke.status.SKIP': 'Skip',
|
||||
'smoke.msg.all_passed': 'All passed ({n})',
|
||||
'smoke.msg.has_failures': '{n} case(s) failed — see details',
|
||||
'smoke.msg.run_failed': 'Failed to run tests',
|
||||
'smoke.log_title': 'Detailed log',
|
||||
'smoke.btn.copy_all': 'Copy full log',
|
||||
'smoke.btn.copy_one': 'Copy',
|
||||
'smoke.msg.copy_ok': 'Copied to clipboard',
|
||||
'smoke.msg.copy_failed': 'Copy failed — select the log manually',
|
||||
'audit.action.RUN_SMOKE_TESTS': 'Run smoke tests',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user