Files
lotteryLaravel/AGENTS.md
kang 2d32f006c5 feat: 增强代理结算和账单管理功能
- 在多个控制器中引入 SettlementPartyEnrichment 服务,以优化代理结算和账单的处理逻辑。
- 更新 AgentSettlementBillIndexController 和 AgentSettlementBillShowController,支持根据账单 ID 和关键字进行查询。
- 在 AgentSettlementPeriodCloseController 中添加对站点管理权限的验证,确保只有具备相应权限的管理员能够关闭账期。
- 在 AgentSettlementPeriodIndexController 中更新账期数据的返回格式,提升数据的完整性和可用性。
- 引入对相对占成比例的支持,增强代理资料的管理能力,确保数据一致性。
2026-06-05 18:00:56 +08:00

36 lines
2.0 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.
# lotterLaravel — Agent 须知
## 数据库:禁止擅自清空
**未经用户明确同意,不得执行:**
| 禁止 | 说明 |
|------|------|
| `php artisan migrate:fresh` | 删表重建,业务数据全失 |
| `php artisan db:wipe` | 清空所有表 |
| `php -r` / 脚本中的 `migrate:fresh``db:wipe` | 易误连 `.env` 开发库(如 `pgsql` / `lottery` |
**可以做的:** `php artisan migrate`(增量)、`php artisan test`(走 `phpunit.xml` 的 SQLite 内存库)。
用户明确要求 `migrate:fresh` 时:先说明目标库名与数据将全部丢失,待用户确认后再执行。
详见 `.cursor/rules/database-destructive-commands.mdc`
## 后台 RBAC
`app/Support/AdminAuthorizationRegistry.php` 后,在已有库执行 `php artisan lottery:admin-auth-sync --audit`(见 `docs/admin-rbac.md`)。`migrate:fresh --seed` 会走迁移内的 resync一般不必再手动 sync。
## 双模式玩家(主站钱包 / 代理信用)
- `players.auth_source``main_site_sso`(主站 JWT`lottery_native`(彩票端账号密码)。
- `players.funding_mode``wallet`(主站划转)与 `credit`(授信下注);**禁止**仅用整站 `credit_line_mode` 代替玩家级判断,用 `PlayerFundingMode::usesCredit($player)`
- 生产环境配置独立 `LOTTERY_NATIVE_JWT_SECRET`(勿与主站 SSO 混用)。
## 信用占成盘(代理账期结算)
- 业务真理源:`docs/信用占成盘代理系统设计说明文档.md`;实施路线:`docs/信用占成盘代理体系改造计划.md`
- **代理账期**代码包:`App\Services\AgentSettlement\`(勿与彩票开奖 `App\Services\Settlement\` / `SettlementBatch` 混用)。
- **禁止**在生产关账路径使用 `DesignDocExample12` 硬编码账单;仅单元/Feature 测试可引用。
-`testing` 环境关账受 `AGENT_SETTLEMENT_ALLOW_PRODUCTION_CLOSE`(默认 `true`)控制;预发可设为 `false` 门禁。
- 占成账单聚合必须读注单**快照**`share_snapshot`),禁止按当前 `agent_profiles` 重算历史。