Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
fi

awk -v coverage="$total_coverage" 'BEGIN {
if (coverage + 0 < 25.0) {
printf "后端整体覆盖率 %.1f%%,低于要求的 25.0%%\n", coverage
if (coverage + 0 < 35.0) {
printf "后端整体覆盖率 %.1f%%,低于要求的 35.0%%\n", coverage
exit 1
}
printf "后端整体覆盖率 %.1f%%,达到要求的 25.0%%\n", coverage
printf "后端整体覆盖率 %.1f%%,达到要求的 35.0%%\n", coverage
}'
go vet ./...

Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

本项目从 `v0.2.0` 起按语义化版本记录面向使用者和维护者的重要变化。

## [0.2.1] - 2026-08-03

### 安全与正确性

- 增加真实路由与 SQLite 装配的 HTTP 契约测试,覆盖初始化、登录、邀请码、权限、停用账号和管理员代操作二次确认。
- 统一发票预览、下载、附件下载与支付截图的文件路径解析,阻断目录穿越、绝对路径和符号链接逃逸。
- 验证支付金额按整数分持久化且 API 往返无精度漂移,并覆盖支付记录的跨用户读写删除隔离。
- 收紧发票与支付关联的未找到语义,跨用户关联返回 404 且事务不产生部分写入。

### 前端质量

- 为异步任务 DTO 和轮询流程增加结果泛型,明确支付与发票 OCR 任务契约。
- 统一结构化 API 错误解析,修复日志取消请求误报,并移除通知面板对 PrimeVue 私有状态的依赖。
- 清理认证组件、后台页面及账单核心页面的 47 处显式 `any` 抑制,遗留数量由 103 降至 56。

### 测试与交付

- 前端共享层测试增至 37 项,严格 lint、类型检查和生产构建纳入持续验证。
- 后端整体语句覆盖率为 35.9%,CI 最低防回退门槛由 25% 提高到 35%。
- 本版本不包含新的数据库迁移,升级时可直接沿用 v0.2.0 的数据与上传持久卷。

## [0.2.0] - 2026-08-03

### 数据正确性
Expand Down Expand Up @@ -45,5 +66,6 @@
- 提供支付、发票、邮箱、行程、多用户和异步 OCR 的既有功能。
- 保存可回退 Git 标签和 GHCR 容器镜像。

[0.2.1]: https://github.com/tuoro/Smart-bill-manager/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/tuoro/Smart-bill-manager/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/tuoro/Smart-bill-manager/releases/tag/v0.1.0
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Smart Bill Manager 是一个面向个人与小团队的自托管账单系统,统一管理支付记录、电子发票、差旅行程和邮箱票据。系统支持 OCR 自动提取、多用户账本隔离、管理员代操作和异步任务处理。

当前稳定版本:`v0.2.0`。本版本完成了数据正确性、后端分层、前端状态与请求层、测试门禁的渐进式重构,升级说明见 [CHANGELOG.md](CHANGELOG.md),设计边界见 [架构说明](docs/architecture.md)。
当前稳定版本:`v0.2.1`。本版本补齐关键 HTTP 安全契约、收紧账单核心页面类型,并提高覆盖率防回退门槛;升级说明见 [CHANGELOG.md](CHANGELOG.md),设计边界见 [架构说明](docs/architecture.md)。

## 主要能力

Expand Down Expand Up @@ -50,7 +50,7 @@ docker compose logs -f smart-bill-manager
### 预构建镜像

```bash
docker pull ghcr.io/tuoro/smart-bill-manager:0.2.0
docker pull ghcr.io/tuoro/smart-bill-manager:0.2.1
docker run -d --name smart-bill-manager -p 80:80 \
-e NODE_ENV=production \
-e JWT_SECRET="replace-with-a-persistent-32-char-secret" \
Expand All @@ -59,7 +59,7 @@ docker run -d --name smart-bill-manager -p 80:80 \
-e SBM_REGRESSION_SAMPLES_DIR=/app/backend/internal/services/testdata/regression \
-v smart-bill-data:/app/backend/data \
-v smart-bill-uploads:/app/backend/uploads \
ghcr.io/tuoro/smart-bill-manager:0.2.0
ghcr.io/tuoro/smart-bill-manager:0.2.1
```

生产环境必须持久保存 `JWT_SECRET`,不要在每次启动时重新生成,否则已有登录会话会全部失效。
Expand Down Expand Up @@ -89,7 +89,7 @@ docker compose up -d --build
3. 将金额转换并校验为整数分字段;
4. 每个数据迁移在独立事务内执行,失败时服务拒绝启动。

迁移不会自动创建外部备份。新旧金额字段在 v0.2.0 中继续双写以保留兼容窗口,但正式回退前仍必须恢复已验证的备份。
迁移不会自动创建外部备份。新旧金额字段在 v0.2.x 中继续双写以保留兼容窗口,但正式回退前仍必须恢复已验证的备份。

## 常用配置

Expand Down Expand Up @@ -147,7 +147,7 @@ npm run test:run
npm run build
```

CI 要求前端 ESLint 零警告、后端整体覆盖率不低于 25%,并完成统一 Docker 镜像构建。v0.2.0 的后端整体语句覆盖率为 35.8%;处理器层覆盖仍偏低,不能将整体数字理解为所有接口都已充分覆盖
CI 要求前端 ESLint 零警告、后端整体覆盖率不低于 35%,并完成统一 Docker 镜像构建。v0.2.1 的后端整体语句覆盖率为 35.9%;关键认证、代操作、文件访问、支付与发票关联已通过真实 HTTP 契约覆盖,但不能将整体数字理解为所有接口都已充分覆盖

## 项目结构

Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontend",
"private": true,
"version": "0.2.0",
"version": "0.2.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down