Skip to content

docs(wiki): sync CommonShelf/CAS master data documentation with current implementation#25

Merged
hzb666 merged 6 commits intodevelopfrom
copilot/update-wiki-documentation
Mar 31, 2026
Merged

docs(wiki): sync CommonShelf/CAS master data documentation with current implementation#25
hzb666 merged 6 commits intodevelopfrom
copilot/update-wiki-documentation

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 31, 2026

根据最近一段时间的代码调整,wiki 中与常用货架和 CAS 主数据相关的说明已与当前实现脱节(路由前缀、接口清单、页面职责与用户操作链路不一致)。本 PR 聚焦更新这些文档,确保开发与使用说明对齐现状。

  • 后端 API 文档对齐(wiki/backend/api-reference.md

    • 修正路由挂载说明:common_shelf.routerchemical_name_map.router 挂载到 /api
    • 将常用货架接口清单从旧路径 /api/inventory/common-shelf/* 更新为当前 /api/common-shelf/*
    • 新增 chemical_name_map(CAS 主数据)接口章节(list/create/update/delete)。
  • 工作流文档补充(wiki/backend/api-workflows.md

    • 增加 common_shelf.pychemical_name_map.py 的职责描述。
    • 明确“常用货架手动添加依赖 CAS 主数据”链路,补齐缺失主数据时的补录逻辑说明。
    • 更新事件层描述为当前行为(加瓶、扣减 1 瓶等)。
    • 根据评审反馈修正文案:常用货架由独立 common_shelf 表(CommonShelf 模型)维护。
  • 前端页面地图与用户指南更新

    • wiki/frontend/page-map.mdCommonShelf 页面 API 对照补充 chemicalNameMapAPI
    • wiki/user-guide/inventory-and-borrowing.md:新增 CAS 主数据管理入口说明、权限边界与缺失主数据时的操作指引。
    • 根据评审反馈修正文案:CAS 主数据维护与“拿一瓶/扣减 1 瓶”为登录用户可操作;“删除整组”仍为管理员权限。
  • 版本演进记录

    • wiki/changelog.md 新增 0.9.1,概括 CommonShelf 分组化改造、CAS 主数据能力与前端联动变更,并补充分组逻辑说明。
## 0.9.1

- 重构常用货架为“分组 + 瓶级条目”模型,新增分组定位、位置建议、加瓶/扣减与条目级维护接口。
- 分组逻辑:按 `CAS + 品牌(标准化)+ 规格(标准化)` 生成 `group_key`;只要三者之一变化,就会进入新分组或触发分组合并确认。
- 新增 CAS 主数据维护能力(`/api/chemical-name-map`),支持在常用货架补录链路中先补主数据再续写加瓶操作。
- 前端常用货架页新增 CAS 主数据管理入口,手动添加流程与主数据校验联动,减少名称缺失导致的展示不一致。
Original prompt

根据最近一段时间修改的代码更新wiki文档

@deepsource-io
Copy link
Copy Markdown

deepsource-io bot commented Mar 31, 2026

DeepSource Code Review

We reviewed changes in 5da8260...f51c45c on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Mar 31, 2026 9:15p.m. Review ↗
Python Mar 31, 2026 9:15p.m. Review ↗
Secrets Mar 31, 2026 9:15p.m. Review ↗

Copilot AI changed the title [WIP] Update wiki documentation based on recently modified code docs(wiki): sync CommonShelf/CAS master data documentation with current implementation Mar 31, 2026
Copilot AI requested a review from hzb666 March 31, 2026 20:40
@hzb666
Copy link
Copy Markdown
Owner

hzb666 commented Mar 31, 2026

@copilot 版本号不要到1.0,现在还是0.9.1。此外你介绍一下分组逻辑是什么

Copy link
Copy Markdown
Author

Copilot AI commented Mar 31, 2026

@copilot 版本号不要到1.0,现在还是0.9.1。此外你介绍一下分组逻辑是什么

已按要求修改:版本号已从 1.0.0 调整为 0.9.1,并在 changelog 中补充了分组逻辑说明(CAS + 品牌(标准化) + 规格(标准化) 生成 group_key,任一维度变化会进入新分组或触发合并确认)。对应提交:e53040a

截图如下:
更新日志 0.9.1

Comment thread wiki/backend/api-workflows.md Outdated
- `dashboard/my-borrows` 和 `dashboard/pending-stockin` 为首页和仪表盘聚合数据。
- `import/template` 与 `import` 组成 Excel 导入链路。
- 常用货架不单独建表,而是同 `inventory` 共表,通过 `is_common` 语义和专用路由完成分组维护。
- 常用货架不单独建表,而是通过 `CommonShelf` 模型维护,按 `CAS + 品牌 + 规格` 形成分组键 `group_key`,并由 `/api/common-shelf/*` 提供分组级与瓶级操作。
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot 常用货架就是单独的表啊

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修正这处表述:常用货架是独立 common_shelf 表(CommonShelf 模型)维护,不再写成“未单独建表”。对应提交:73f5dab

截图:
wiki 变更截图

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot ,任何登录用户都可以维护cas,并且拿取和加入也不是只有管理员

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修正权限描述:CAS 主数据维护与“拿一瓶/扣减 1 瓶”均为登录用户可操作;仅“删除整组”保留管理员权限。对应提交:73f5dab

截图:
wiki 变更截图

@hzb666 hzb666 marked this pull request as ready for review March 31, 2026 21:07
Copilot AI requested a review from hzb666 March 31, 2026 21:07
@hzb666
Copy link
Copy Markdown
Owner

hzb666 commented Mar 31, 2026

@copilot +只要登录即可执行,不是管理员专属。没有限制为什么改写这一句呢

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Mar 31, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0

Incremental Changes (vs commit 5eb2755)

The incremental diff makes minor wording improvements to the documentation:

  1. Line 143: Changed - 删除分组 to - 删除整组(仅管理员) — clearer terminology
  2. Line 146: Removed redundant phrase 删除整组仍然只有管理员可用; — already implied by line 143

Verification

Claim Source Code Status
remove_one = logged-in user common_shelf.py:398 with get_current_user ✅ Correct
delete_group = admin only common_shelf.py:472 with require_admin ✅ Correct

All previous inline comments are addressed:

  1. ✅ "常用货架就是单独的表啊" → Documentation now correctly states CommonShelf has its own table (common_shelf table with CommonShelf model)
  2. ✅ "任何登录用户都可以维护cas..." → Documentation correctly states CAS maintenance and "take one" are for logged-in users, only "delete group" requires admin
Files Reviewed (5 files)
  • wiki/backend/api-reference.md - Updated routes and API endpoints
  • wiki/backend/api-workflows.md - Added module descriptions
  • wiki/changelog.md - Added version 0.9.1 entry
  • wiki/frontend/page-map.md - Updated API mappings
  • wiki/user-guide/inventory-and-borrowing.md - Updated permissions and user flow

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73f5dabb61

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- 导出分组

其中“拿一瓶”仍然只有管理员可用
删除整组仍然只有管理员可用;“拿一瓶”(扣减 1 瓶)登录用户即可操作
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clarify delete-group permission consistently

This updated sentence says deleting a whole group is admin-only, but the checklist immediately above still states that logged-in users can delete groups (- 删除分组). The contradictory guidance in the same section will mislead non-admin users about what they can actually do and undermines the “sync with implementation” goal; please align the bullet list with the permission statement so the user guide has a single, accurate rule.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Copilot AI commented Mar 31, 2026

@copilot +只要登录即可执行,不是管理员专属。没有限制为什么改写这一句呢

已按你的意思处理:把这句限制小节删掉了,避免看起来像额外加限制;权限说明保留在下方能力列表里(登录用户可拿取/加入,删整组才是管理员)。对应提交:5eb2755

截图:
wiki 变更截图

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • git diff --check
  • git status --short

另外我已完成本次变更提交(18b154b)并创建了 follow-up PR(通过 make_pr 工具)。

View task →

@hzb666 hzb666 merged commit babcac6 into develop Mar 31, 2026
7 checks passed
@hzb666 hzb666 deleted the copilot/update-wiki-documentation branch March 31, 2026 22:34
hzb666 added a commit that referenced this pull request Apr 1, 2026
* refactor: 简化部分页面代码,重构localstorage

* docs(wiki): 更新wiki

* refactor: localstorage新文件

* refactor(backend): 简化后端业务逻辑代码

* fix(auth): 修复登录态与会话边界

* feat(browser-extension,frontend): 增强购物车导入功能与订单类型自动识别

- 新增浏览器扩展购物车标签页选择逻辑(cart-tab-selection.js)
- 添加订单类型自动检测功能
- 新增站点配置工具函数,统一 URL 构建逻辑
- 重构前端购物车导入页面,将模型、控制器拆分到独立文件

* refactor(auth): 收口会话缓存边界与校验流程

- 统一 SessionCacheIdentity 缓存边界
- 简化 SSE 控制消息解析分支
- 精简静态路径清洗校验流程

* refactor(core): 整理后端校验流程和辅助逻辑

- 整理日志聚合、导入和外部查询的辅助代码
- 统一会话缓存同步和 SSE 订阅参数
- 简化数据库、缓存和拼音工具的参数处理

* feat(cache): 增加版本化缓存失效机制

- 新增 CACHE_VERSION 配置
- 后端在版本变化时清理 Redis 前缀缓存
- 后端在版本变化时撤销全部用户会话
- 前端启动前探测 cache_version 并清理本地缓存
  - 保持业务数据与数据库结构不受影响

* style: 新增鉴权骨架屏

- 新增鉴权骨架屏组件,仪表盘、表格页、导入页三个样式

* feature: 在每个业务页面接入sse

- 接入sse,实现静默更新或提醒更新的不同逻辑
- 完善stalebanner组件

* style: 完善前缀输入框样式

* feat(api):完善操作日志与导入链路

- 新增库存申购用户操作日志模型与服务
- 接入用户订单库存关键路径日志写入
- 用户日志聚合改读日志表并补计数查询
- 导入改为预览确认两阶段并记录入库日志
- 会话流程改为单事务提交后执行副作用
- 新增日志归档脚本并补日志查询索引

* feat(ui):改造导入与日志页面

- 导入改为预览与确认两阶段流程
- 操作日志页扩展多类型展示与详情渲染
- 常用货架搜索高亮与别名展示优化
- 接入版本化静态资源与生成脚本测试
- 调整前端构建压缩与资源引用配置

* build(config):更新容器与Nginx配置

- 前端镜像改为 Alpine 并启用 Brotli 模块
- 增加 nginx 主配置并调整站点配置
- 补充静态资源缓存与编码协商头
- 调整忽略规则以纳入前端脚本目录

* docs(readme):精简技术栈徽章

- 移除重复与冗余的技术徽章展示
- 保留核心运行环境与许可证标识

* feat(db): 新增CommonShelf与CAS主数据模型

- 新增common_shelf数据模型
- 新增chemical_name_map模型
- 调整模型导出与数据库初始化
- 删除旧common搜索相关服务

* feat(api): 实现CommonShelf与CAS主数据接口

- 新增CAS主数据管理接口
- 重写CommonShelf核心接口
- 调整订单到货与入库相关流程
- 复用并整理货架生成查询服务
- 补齐操作日志与接口挂载

* feat(export): 调整库存与CommonShelf导出日志

- 调整库存导出字段结构
- 新增CommonShelf导出能力
- 补齐纯度备注相关日志字段
- 同步导出服务实现

* feat(ui): 重构CommonShelf并接入CAS主数据

- 重构CommonShelf页面与弹窗结构
- 接入CAS主数据管理与补录流程
- 调整表单配置校验与表格列
- 同步日志展示与到货录入交互
- 更新前端依赖与静态资源脚本

* fix: use SET NULL instead of CASCADE for operator_id in common_shelf_operation_log

Prevents silent deletion of audit log history when a user is deleted.
Aligns with the pattern used by reagent_order_operation_log and
consumable_order_operation_log.

* fix: address PR review comments on FTS param name, header reading, number input onChange, and SQLite RETURNING fallback

Agent-Logs-Url: https://github.com/hzb666/LabStorageManager/sessions/70d909b4-1246-4e9d-a115-72f5f98fda88

Co-authored-by: hzb666 <29155232+hzb666@users.noreply.github.com>

* fix: add SQLite RETURNING fallback to all DELETE...RETURNING call sites via shared db_compat helpers

Agent-Logs-Url: https://github.com/hzb666/LabStorageManager/sessions/d6b5a2ea-0c3f-4935-9a03-43cde20c8f49

Co-authored-by: hzb666 <29155232+hzb666@users.noreply.github.com>

* docs(wiki): sync CommonShelf/CAS master data documentation with current implementation (#25)

* Add floating Caps Lock warning for password inputs on login flows (#26)

* feat(frontend): add floating caps lock hint for password input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants