users.php → 工单管理 的「配置」Tab 只管理部门 / 状态 / 预设回复三块 DB 字典,与 SPA「工单中心」已有的 8 个标量配置分裂成两处;且同一套 CRUD 在 admin_post 与 TicketConfigRest 里各写了一遍,REST 侧此前 没有任何调用方。 - 删除原生 config tab:UsersMenusTicketsConfig.php 整份移除, UsersMenusTicketsCenter 由 512 行降到 251 行(六个写处理方法、 分发分支、十条提示码与 ticket_delete_button 一并清理) - SPA /users/ticket 改为 customPage:内嵌 SchemaPage 承载原有 8 字段, 三块字典改为 n-data-table + n-modal + n-dialog,取色器/管理员多选/ 拖拽排序替代原生手填表单 - TicketConfigRest 成为三块字典的唯一实现,新增 api/modules/tickets.js 封装 aksrt/v1/admin/tickets* - 双向深链:原生页跳 SPA 配置页,SPA 页跳回原生工单列表 契约测试同步更新,并新增 ticket-spa-config-contract 守护接线。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
52 lines
2.0 KiB
Markdown
52 lines
2.0 KiB
Markdown
# Admin contract map
|
|
|
|
Generated by process, not a migration guide. Source of truth for menu ↔ schema wiring.
|
|
|
|
## Rules
|
|
|
|
1. Every `schemaPage` must have matching PHP section under the same domain.
|
|
2. Enum field values must be identical in PHP schema and JS schema.
|
|
3. REST `'callback' => [$this, 'method']` methods must exist (class or trait).
|
|
4. Deploy `assets/admin/build/` as one atomic unit after `npm run build`.
|
|
5. No compat aliases, dual-read, or silent frontend catch for missing APIs.
|
|
|
|
## Audit
|
|
|
|
```bash
|
|
php tools/audit-admin-contracts.php
|
|
```
|
|
|
|
Exit code `1` means hard contract errors.
|
|
|
|
## Domain builders
|
|
|
|
| Domain | PHP builder map key | Menu constants file |
|
|
|--------|---------------------|---------------------|
|
|
| global | `AKSRT_Admin_Schema_Global` | `assets/admin/src/constants/sections/global.js` |
|
|
| page_display | `AKSRT_Admin_Schema_Page_Display` | `page-display.js` |
|
|
| post_list | `AKSRT_Admin_Schema_Post_List` | `post-list.js` |
|
|
| permissions | `AKSRT_Admin_Schema_Permissions` | `permissions.js` |
|
|
| users | `AKSRT_Admin_Schema_Users` | `users.js` |
|
|
| payment | `AKSRT_Admin_Schema_Payment` | `payment.js` |
|
|
| extensions | `AKSRT_Admin_Schema_Extensions` | `extensions.js` |
|
|
| tools | `AKSRT_Admin_Schema_Tools` | `tools.js` |
|
|
| shop | `AKSRT_Admin_Schema_Shop` | `shop.js` |
|
|
|
|
## Known custom pages (not schema REST)
|
|
|
|
These use dedicated Vue pages + dedicated REST modules:
|
|
|
|
- Homepage: `HomepageSettings` + `/settings/homepage`
|
|
- Footer: `FooterSettings` + footer settings API
|
|
- Permissions capabilities matrix: `PermissionsCapabilities` + `/permissions/capabilities`
|
|
- Shop products/orders and other operational tables
|
|
- 工单中心: `UsersTicket` + schema `users/ticket` + `aksrt/v1/admin/tickets*`(部门 / 状态 / 预设回复)
|
|
|
|
## Deploy checklist
|
|
|
|
1. `cd assets/admin && npm ci && npm run build`
|
|
2. Confirm `build/index.js` and every dynamically imported `./Chunk.hash.js` exist
|
|
3. Replace the entire remote `assets/admin/build/` directory
|
|
4. Hard-refresh wp-admin (or purge CDN)
|
|
5. Re-run `php tools/audit-admin-contracts.php`
|