Files
baiyue-firstleg/docs/order-warehouse-real-api-regression.md
T
2026-07-30 18:01:36 +08:00

38 lines
1.8 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.
# 订单、仓库与往来单位真实 API 回归说明
脚本:`scripts/order-warehouse-real-api-regression.ps1`。
## 运行环境
- Gateway:`19002`
- Order:`19204`
- Warehouse:`19205`
- Auth、IAM:本地已启动服务,由 Gateway 发现
- MySQL:`127.0.0.1:3306`
- 默认本地管理员密码和 MySQL 密码仅通过脚本参数传入,生成报告不会记录密码或令牌
```powershell
powershell -ExecutionPolicy Bypass -File .\scripts\order-warehouse-real-api-regression.ps1 `
-GatewayBaseUrl http://127.0.0.1:19002 `
-OrderBaseUrl http://127.0.0.1:19204 `
-WarehouseBaseUrl http://127.0.0.1:19205
```
## 覆盖范围
脚本真实访问 HTTP 和 MySQL,覆盖:
1. 仓库与往来单位租户隔离、启用过滤和停用详情限制。
2. 仓库地址、收货能力和截单时间回显。
3. 订单草稿创建、编辑、重新保存、详情和提交。
4. 企业审核未通过时禁止创建订单。
5. 创建、编辑和提交阶段的仓库及往来单位停用校验。
6. 客户名称、仓库名称、仓库地址、收货时间和参与方地址历史快照。
7. 重复提交返回 HTTP 409 和统一错误码 `A0409`。
8. 平台履约权限写入快递信息,商户身份禁止写入且详情只读回显。
9. Order、Warehouse 直连 `api-docs`,并静态审查 Gateway 聚合路由源配置。备用 Gateway 不要求实际加载 docs 转发路由。
脚本使用固定高位 ID 初始化仓库和往来单位测试数据,可重复执行。无论成功或失败,`finally` 清理都会恢复演示企业、仓库和往来单位状态,删除临时仓库、往来单位及测试订单;若履约权限原本不存在,也会删除临时权限和角色关系。报告只保留脱敏的测试证据。
这是本地测试联调脚本,不创建数据库备份,不执行生产迁移或发布操作。