Repository navigation
feat: HR working-time PDF exports and release 2.2.0 - #38
Conversation
Signed-off-by: Patrick Schiller <p@trickschiller.de>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11e704d0d8
ℹ️ 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".
| const canDownload = | ||
| validRange && | ||
| validSelection && | ||
| !report.isFetching && | ||
| !report.isError && | ||
| !pdfPending && | ||
| Boolean(report.data?.rows.length); |
There was a problem hiding this comment.
Allow PDFs for employees without closed rows
When the selected employee has no completed entries in the period—such as an employee with only an open booking—canDownload is false and disables the PDF button. The PDF endpoint and renderer explicitly support this case by producing a page with the open-booking warning and “no closed entries” message, so this prevents the UI from generating a supported and useful record. Gate PDF downloads on a valid, successfully loaded selection rather than requiring report.data.rows.length.
Useful? React with 👍 / 👎.
| onChange={(event) => { | ||
| const checked = event.target.checked; | ||
| setSelectedEmployeeIds((selected) => | ||
| checked | ||
| ? [...selected, employee.id].sort() | ||
| : selected.filter((id) => id !== employee.id), |
There was a problem hiding this comment.
Cap the multi-employee picker at the API limit
On installations with more than 200 employees, these checkboxes allow selecting an unlimited number even though WorkingTimeReportQueryDto rejects employeeIds arrays larger than 200. Selecting the 201st employee therefore makes the JSON report fail with HTTP 400 and leaves both export buttons unavailable, without the picker enforcing or clearly presenting the limit. Disable further selections at 200 or otherwise split the request.
Useful? React with 👍 / 👎.
HR can now download working-time PDFs for one employee, selected employees or everyone in a reporting period alongside CSV. Each employee starts on a separate page, with personnel number, full timestamps and UTC offsets, booking-day and period totals, approval state and warnings for open bookings. Locations and private notes are excluded.
The change prepares OpenClockwork 2.2.0, including matching API/version metadata, deployment examples, upgrade instructions and curated release notes. The release notes explain the German recording and retention requirements and the limits of policy-based break deductions; the export does not certify that actual breaks were taken or that an installation meets every legal requirement. No new database migrations are introduced relative to 2.1.0.
Requested in Discussion #37. Synthetic two-page PDF example.
Validation: