Some checks failed
lotteryadmin CI / build (push) Has been cancelled
- 在赔率行数据结构和接口中新增 provider_code 字段支持多开注商 - 管理后台赔率配置页新增开注商筛选,支持查看和编辑指定开注商赔率 - 未指定专属赔率时,自动继承通用(Global)赔率并显示继承标识 - 新增赔率快照展示组件,显示票据下注时锁定的开注商赔率快照 - 优化赔率保存流程,支持基于开注商区分并批量更新赔率数据 - 更新多语言文案,增加开注商与赔率来源标识翻译 - 调整环境配置文档和默认域名为新的开注商域名地址 - 优化界面标签样式,清晰区分通用、专属和继承赔率来源 - Tickets模块新增赔率快照数据类型及详细展示表格 - 修复管理后台及票据详情页部分链接和操作按钮,提升用户体验
56 lines
4.6 KiB
Markdown
56 lines
4.6 KiB
Markdown
<!-- BEGIN:nextjs-agent-rules -->
|
||
# This is NOT the Next.js you know
|
||
|
||
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
|
||
<!-- END:nextjs-agent-rules -->
|
||
|
||
## 玩家双模式(钱包 / 信用)
|
||
|
||
后端字段(`players` 表):
|
||
|
||
| 字段 | 值 | 含义 |
|
||
|------|-----|------|
|
||
| `funding_mode` | `wallet` / `credit` | 主站钱包 vs 信用盘 |
|
||
| `auth_source` | `main_site_sso` / `lottery_native` | 主站 SSO vs 彩票端账号 |
|
||
|
||
**后台统一用法(不要各页手写 `funding_mode === "credit"`):**
|
||
|
||
- `isCreditFundingPlayer(row)` / `playerUsesCredit(row)` — 是否信用盘
|
||
- `playerShowsTransferOrders(row)` — 是否展示主站转账单
|
||
- `playerFundingModeLabel` / `playerAuthSourceLabel` — 文案
|
||
- `playerBalanceCells` — 列表余额列(信用用 major 额度,钱包用 minor)
|
||
- `<PlayerFundingModeBadge />` / `<PlayerLedgerSourceBadge />` — 表格徽章
|
||
|
||
**模块边界:**
|
||
|
||
- `/admin/wallet/*`:仅**主站钱包**流水与转账单
|
||
- `/admin/settlement-center` → **账务流水**单页(筛选 + 分类 + 表格 + ⋯ 操作),合并信用/收付/调账/坏账;**账单**单页用分类筛选待确认/待收付等
|
||
- 玩家详情:按 `funding_mode` 切换 Tab(信用流水 / 钱包流水;信用盘隐藏转账单)
|
||
|
||
新增涉及玩家资金的页面时,先读 `src/lib/admin-player-display.ts`。
|
||
|
||
## Learned User Preferences
|
||
|
||
- 排障/上线评估时用 MCP(postgres)直查库验证数据与权限,勿仅凭代码推断生产态。
|
||
- 占成/授信/回水/上限等数值字段用 `AdminNumericStepper`(± 步进 + 可手输),勿单独裸 `input[type=number]`。
|
||
- 对外文档(接入 + 后台运营手册)禁用 RBAC slug(如 `prd.settlement.agent.manage`);对客户称「贵司」;排版忌 AI 感,正文对比度与字号可读优先。
|
||
- 文档 i18n:`useTranslation` 须显式 `ns`;`returnObjects` 列表用 `Array.isArray` 守卫;避免节名与表头 key 冲突(如 `billStatus`)。
|
||
- 运营页少堆 `text-xs` 说明与多层免责条;口径/默认范围合并进各模块一行 `summary`,勿叠加 filterPanel/queryHint/disclaimer 等小字(对账、报表中心已按此精简)。
|
||
- i18n 按语言懒加载,不要一次 import 三语全套。
|
||
- 金额展示须防大额截断:卡片/摘要用 `AdminMoneyDisplay`(自适应字号 + `break-all`,禁止 `truncate`);表格金额列用 `.admin-money-value`。
|
||
|
||
## Learned Workspace Facts
|
||
|
||
- 无接入站时依赖站点的页面展示 `<AdminNoIntegrationSiteState />`;仅 `profile.is_super_admin` 显示创建入口。
|
||
- 超管判定用登录态 `is_super_admin`,勿用站点角色或 `admin_user_site_roles` 绑定推断。
|
||
- 站点运营内置角色 `site_admin|site_finance|site_cs`(`admin_user_site_roles`,无代理绑定);识别用 `isSiteOperator`/`isSiteAdminOperator`(`admin-session-variants.ts`)。仪表盘按 `account_kind` 分流:`SiteDashboardConsole` / `SiteFinanceDashboardConsole` / `SiteCsDashboardConsole`。
|
||
- 站点管理员(`isSiteAdminOperator`)代理 UI 绕过选中代理的 `can_create_*` 门控,按自身 manage 权限展示 Tab/操作;在代理下创建玩家须传 `agent_node_id`,勿默认挂根代理。
|
||
- 客户对外文档:`/docs`、`/docs/integration`、`/docs/admin` 公开免登录;读者为接入方与站点运营/代理;顶栏「管理后台」链 `/admin`;SSO 无登录换票、JWT+`player/me`、iframe `data.token`;Docs 侧栏 `--docs-sticky-top`;静态校验用 `document.body.innerText`。
|
||
- `SettlementBillRow` 无 `currency_code`;账单金额展示用玩家 `default_currency`。
|
||
- 浏览器 `/api/v1/*` 由 Next 转发到 `LOTTERY_API_UPSTREAM`;与本地 Postgres 对账前须确认 upstream 与所查库一致。
|
||
- 当前联调/生产默认:H5 `https://lottery-front.cjdhr.top`、API `https://lottery-api.cjdhr.top`、管理端/文档 `https://lottery-admin.cjdhr.top`。
|
||
- 风控页默认:风险池仅显示有占用/高风险;单号详情可看占用来源;组合明细在注单详情页。
|
||
- 模块边界:对账中心=主站↔彩票钱包划转;报表中心=钱包盘经营分析;结算中心=信用账期占成/收付。
|
||
- 报表中心:默认近 30 天;盈亏类按 `draws.business_date`;金额读 API `currency_code`;导出仅后端 `report-jobs` 全量(按筛选,无需先预览);注单盈亏≠信用账期结算。
|
||
- 对账中心:校验 `transfer_orders` vs 彩票 `wallet_txns`;差异 B 侧引用=彩票 `wallet_txns` 流水号;补单/冲正在钱包转账单页。
|