Skip to content

Count consultants only from their first day - #46

Open
jberglund wants to merge 3 commits into
mainfrom
consultant-first-day
Open

jberglund wants to merge 3 commits into
mainfrom
consultant-first-day

Conversation

@jberglund

Copy link
Copy Markdown
Contributor

Closes #41. Closes #44 (a duplicate of #41).

Follow-up to #43, which let managers register consultants ahead with a first_day that nothing read yet. Until now, someone registered for a later date counted as working from the day they were registered: their consultant page showed a full month's capacity, and month close listed them with missing hours for months before they started.

What changed

  • Capacity (capacityMinutes) takes both ends of someone's time at Variant, so expected hours start on their first day. The consultant page, the timesheet's expected hours, the office summary, the monthly report and month close all pass it in.
  • Who's included in a month: a new filter, employedDuring(first, last) in domain/users/employment.ts, keeps people who were at Variant on at least one day of the period. Month close and the monthly report's capacity use it.
  • Lists: the consultant list, administration's member lists and the dev login page show "First day …". Office headcounts count those who haven't started apart, as they do those who have left ("1 have left · 1 starting").
  • Fixture: the seed sets first days from joinedWeek, and gains Ida Lie, who starts in three weeks.

Unchanged on purpose: assignment pickers still offer future starters, so they can be staffed before they start, and logging hours before the first day stays allowed.

Tests

  • Unit and data tests for capacity from the first day, month close's expected hours, and the consultant list's headcount.
  • A new end-to-end test: a manager registers someone starting mid next month, their page shows next month's capacity from that day, and they log in without signing up. It finds elements by layer attributes, field names, the app's own URL builders and formatters, not markup or copy. Making the consultant page ignore the first day makes it fail.

Worth knowing

🤖 Generated with Claude Code

jberglund and others added 2 commits November 11, 2026 10:12
Capacity now takes both ends of someone's time at Variant, so expected
hours start on their first day. Month close and the monthly report leave
out anyone who wasn't at Variant in the month. Lists show the first day,
and office headcounts count those who haven't started apart, as they do
those who have left. Assignment pickers still offer them, so they can be
staffed before they start.

The fixture gains someone starting in three weeks, and the seed sets
first days from when people joined.

Closes #41. Closes #44.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A manager registers someone starting mid next month. Their consultant
page shows the first day and next month's capacity from that day, and
they then log in without signing up. The test finds things by layer
attributes, field names, the app's own URLs and formats, not markup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 76bc3bf0-2a9e-4c80-877e-297e7e791717
Commits

Reviewing files that changed from the base of the PR and between 9141538 and 388509d.

Files selected for processing: 20

  • apps/web/e2e/registerConsultant.e2e.ts
  • apps/web/src/administration/organizationMember.data.ts
  • apps/web/src/administration/organizationMember.tsx
  • apps/web/src/consultants/consultantDetails.query.tsx
  • apps/web/src/consultants/consultantList.query.tsx
  • apps/web/src/consultants/consultants.test.tsx
  • apps/web/src/dev/dev.routes.tsx
  • apps/web/src/domain/capacity/capacity.test.ts
  • apps/web/src/domain/capacity/capacity.ts
  • apps/web/src/domain/users/employment.ts
  • apps/web/src/monthClose/consultantHours.data.ts
  • apps/web/src/monthClose/consultantHours.test.ts
  • apps/web/src/monthClose/monthClose.test.tsx
  • apps/web/src/officeSummary/officeSummary.query.tsx
  • apps/web/src/officeSummary/officeSummary.test.ts
  • apps/web/src/officeSummary/officeSummary.ts
  • apps/web/src/reports/monthlyReport.query.tsx
  • apps/web/src/timesheet/monthPage.tsx
  • packages/db/src/fixtureData.ts
  • packages/db/src/seedDatabase.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Main moved dates to Temporal, so first days and employment now use
Temporal.PlainDate, and employedDuring takes a month.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Leave consultants out before their first day Manually adding consultants, and setting start time

1 participant