PayrollManagementSystem/backend/tests/unit
liuwenxin 91fc6f6293 fix(product): 删除引用保护/单价小数位校验,IntegrityError 全局兜底转 400
- delete_product 补 count_refs 引用检查(业务明细+发货明细 RESTRICT
  外键)与并发窗口 IntegrityError→400 兜底(customer 先例同构),
  docstring 与两个 api 层过时注释同步更新
- 产品 schema 复用 schemas/business._check_amount:sale_price 走
  (PRICE_MAX, scale=4)、stock_quantity 走 AMOUNT_MAX——此前私写
  _parse_non_negative 不查小数位与容量,5 位小数被 Numeric(14,4)
  静默截断(舍入即算错钱);新增 6 个秒级 schema 单测锁定口径
- 全局注册 IntegrityError handler:漏补引用保护的删除类操作收敛为
  400 通用文案(e2e 撞见一个补一个的模式无法保证全覆盖),完整
  异常记日志;rating/customer 的「非 1062 按 500」注释同步更正

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-14 18:48:32 +08:00
..
__init__.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_audit_serialization.py fix(system): code-review 15 项修复(预览基数/维度校验/脱敏穿透/并发版本号等) 2026-10-13 02:28:20 +08:00
test_audit_service.py feat(system): 完成后端系统管理(审计/角色/操作日志/日志查询) 2026-10-10 16:28:04 +08:00
test_auth_schemas.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_captcha.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_config.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_exception_handlers.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_formula.py feat(system): 计提公式模板注册表与精确分数计算函数 2026-10-12 16:22:32 +08:00
test_jwt.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_log_schemas.py feat(system): 完成后端系统管理(审计/角色/操作日志/日志查询) 2026-10-10 16:28:04 +08:00
test_logging.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_login_limiter.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_models.py feat(business): 新增业务数据七表及 V5 迁移(业务/明细/状态留痕/发货/回款/评级配置) 2026-10-13 11:22:34 +08:00
test_param_registry.py feat(system): 计提公式模板注册表与精确分数计算函数 2026-10-12 16:22:32 +08:00
test_param_snapshot.py feat(system): 计提参数版本管理、变更留痕与计算预览接口 2026-10-12 20:24:17 +08:00
test_product_schema.py fix(product): 删除引用保护/单价小数位校验,IntegrityError 全局兜底转 400 2026-10-14 18:48:32 +08:00
test_response.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_role_schemas.py feat(system): 完成后端系统管理(审计/角色/操作日志/日志查询) 2026-10-10 16:28:04 +08:00
test_security.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00
test_token_blacklist.py chore: 初始化项目结构与登录鉴权模块 2026-10-09 18:46:36 +08:00