Report: Fix check for insufficient breaktime

未关闭 适合新手
#487 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
api, backend

调研方向

首先找到 ReportViewSet.aggregate_days_content 和 calculate_worktime_breaktime,然后追踪 actual_breaktime 和 corrected_breaktime 的赋值和使用方式。检查现有报告测试中关于休息时间不足的部分,并为低于 30/45 分钟阈值的休息补充或调整测试覆盖。完成标准是检查能够检测出休息时间不足,且变量命名体现法定最低时长。

由索引模型根据 Issue 内容生成。

描述

The aggregate_days_content method of the ReportViewSet class checks if a worker has taken a break of less than 30/45 minutes depending on the worktime.
However, the condition for this check will never be fullfilled because the corrected_breaktime is checked.
This variable is set by the method calculate_worktime_breaktime to always be at least 30/45 minutes.
A possible solution would be to replace corrected_breaktime with actual_breaktime.

The name of corrected_breaktime could also be seen as misleading since the variable is the minimum length of breaktime set by the law.
The variable could be renamed to something like legal_breaktime.

主要语言
Python
星标
0
派生
4
平均合并
2 天 16 小时
30 天内合并 PR
5

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ClockGU/clock-backend 的其他 Issue

查看 ClockGU/clock-backend 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。