Files
lotteryAdmin/AGENTS.md
kang 17335cb47a feat(docs, integration): update integration documentation and redirect legacy paths
Introduced a new public documentation site for client integration at `/docs` and `/docs/integration`, removing the need for admin login. Updated the integration guide to redirect from the old admin path to the new documentation site. Added localization support for the integration documentation in English, Nepali, and Chinese. Enhanced the layout structure and improved the handling of currency display in settlement bills.
2026-06-15 11:08:19 +08:00

44 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 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
- 占成/授信/回水/上限等数值字段用 `AdminNumericStepper`(± 步进 + 可手输),勿单独裸 `input[type=number]`
## Learned Workspace Facts
- 无接入站时依赖站点的页面展示 `<AdminNoIntegrationSiteState />`;仅 `profile.is_super_admin` 显示创建入口。
- 超管判定用登录态 `is_super_admin`,勿用站点角色或 `admin_user_site_roles` 绑定推断。
- 站点管理员(`profile.site != null`)代理 UI 绕过选中代理的 `can_create_*` 门控,按自身 manage 权限展示 Tab/操作。
- 站点管理员在代理下创建玩家须传 `agent_node_id`(与超管同逻辑),勿默认挂根代理。
- 客户接入文档公开站:`/docs`(首页)、`/docs/integration`(接入正文),无需 `/admin` 登录;旧 `/admin/docs/integration-guide` 重定向至此。
- `SettlementBillRow``currency_code`;账单金额展示用玩家 `default_currency`