feat(timesheet): v14.5.0 Time & Timesheets module (TIME-01..07)#265
Merged
Conversation
Period-based submit -> review -> approve/reject/reopen workflow layered on top of the existing raw time logs (which are never mutated). - New per-company `timesheet_approval` collection (one doc per user/period), registered across schemaType, collections, schema, createSchema, mongoQueries. - Modules/TimesheetApproval: pure approvalRules (state machine + validation), controller (submit/status/mine/pending/review), routes, init. - Review is enforced server-side to owner/admin via permissionGuard.getRoleType; members may submit only their own period; an approved period is locked. - Totals (minutes + entry count) are snapshotted at submit for reviewer context. - 30 unit tests for the approval rules. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- TimesheetApproval.vue in the User Timesheet toolbar: employees see their period status and a submit/resubmit control; owners/admins get a pending queue with approve / reject (with reason). Calls the TIME-01 API; raw time entries are untouched. - env.TIMESHEET_APPROVAL endpoint constant + en.js i18n strings. - .claude/test-cases/TimesheetApproval.md (16 UI/integration cases). Full suite green: 255 tests across 22 suites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LogStartTime is stored in Unix seconds (manualLogtime getTimeStamp), but computePeriodTotals queried it with millisecond bounds, so a submitted period's totalMinutes/entryCount snapshot was always 0. Convert the day bounds to seconds before the range query. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- `billable` boolean on the timesheet entry schema (defaults true; only an explicit false is non-billable, so pre-existing entries count as billable). - manualLogTime persists `billable` on create + edit. - Modules/TimeSheet: pure billableRules (normalizeBillable + summarize) and a getBillableSummary endpoint (/api/v1/timesheet/billable-summary) returning billable vs non-billable minute/entry totals for a user set + period. - 7 unit tests for the billable rules (full suite 262 green). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Billable toggle in the Add/Edit Time Log form (defaults on; sends `billable`). - BillableSummary.vue in the User Timesheet toolbar β billable vs non-billable hours for the selected period + visible users. - en.js i18n; .claude/test-cases/BillableFlag.md (10 UI/API cases). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Once a period is approved (TIME-01), its time entries become read-only. - coversDate rule + isPeriodLocked guard (Modules/TimesheetApproval). - manualLogTime (edit) and deleteManualLogtime block any change to an entry whose day falls inside an approved period β enforced server-side (tamper-proof). - Add/Edit Time Log surfaces the server lock message. - 6 coversDate unit tests (full suite 268 green). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Pure timesheetCsv builder (RFC-4180 escaping) + /api/v1/timesheet/export-csv endpoint resolving user names (global DB) and project names (company DB). - Columns: User, Project, Date, Description, Billable, Hours (decimal). - Export CSV button in the User Timesheet toolbar (period + user/project scoped). - 9 unit tests (full suite 277 green). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The desktop tracker auto-pauses when there's no activity for a configurable threshold (default 5 min; 0 disables). - Implemented in the Electron main process using the existing AV-safe signal (powerMonitor.getSystemIdleTime + cursor) β no global input hook. - On idle >= threshold while tracking: sends idle:detected and reuses the proven stop-tracker pathway to pause, plus a system notification. Fires once per idle spell; resets on activity and on (re)start. - Threshold configurable + persisted (idle-config.json) via idle:set-threshold / idle:get-threshold. Ships when the tracker installers are rebuilt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Pure reminderRules (who needs reminding + the message) + a per-company service that emails members who haven't logged time today via service.SendEmail (Resend/SMTP, graceful when mail is unconfigured). - Prod cron daily at 17:00 (runRemindersForAllCompanies); POST /api/v1/timesheet/send-reminders runs the same path on demand (testing). - 7 unit tests (full suite 284 green). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- New per-company billing_rates collection (scope: user/project/default). - Pure billingRules (resolveRate precedence user>project>default + buildInvoice) + endpoints POST/GET /rates and POST /generate-invoice (billable time x rate). - TimesheetInvoice.vue: a rate input + Invoice button in the timesheet toolbar that generates and downloads an invoice CSV. - 12 unit tests (full suite 296 green). Seeds the v14.6.0 Profitability theme (FIN-01). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the βοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v14.5.0 β Time & Timesheets module (TIME-01 β TIME-07)
First module of v14.5.0, built end-to-end. One PR for the whole module.
Tasks
timesheet_approvalcollection; submit β approve/reject/reopen; owner/admin gate enforced server-side;TimesheetApproval.vuein the User Timesheet toolbar.billableon each entry (default true); toggle in Add/Edit Time Log;getBillableSummary+ a billable/non-billable readout./export-csv(user names from global DB, project names from company DB) + an Export CSV button./send-remindersemail nudge to members who haven't logged.billing_ratescollection + invoice generation from billable time; rate input + Invoice button.Tests: 296 unit tests across 26 suites (+71 new). Per-feature manual test cases in
.claude/test-cases/.Notes: all server-side time mutations now respect period locks; fixed a TIME-01 totals bug (LogStartTime is seconds). TIME-05 lives in
time-tracker-app/(separate build). TIME-07 seeds the v14.6.0 Profitability theme.π€ Generated with Claude Code