Skip to content

fix(contractor-onboarding) - fix maxDate for contractor of record#1042

Open
gabrielseco wants to merge 7 commits into
mainfrom
pbyr-3890-fix-maxDate
Open

fix(contractor-onboarding) - fix maxDate for contractor of record#1042
gabrielseco wants to merge 7 commits into
mainfrom
pbyr-3890-fix-maxDate

Conversation

@gabrielseco
Copy link
Copy Markdown
Collaborator

@gabrielseco gabrielseco commented May 20, 2026

Adds a maxDate to the service_duration.expirationDate when the product selected is contractor of record

https://www.loom.com/share/7d7c49eb8c9c445db4f7b8d2abb4c3e5


Note

Medium Risk
Touches dynamic form field evaluation (watch()/calculateDynamicProperties) and date handling, which can affect validation/render performance and date constraints across forms. Scoped to contractor onboarding and test components, but regressions could impact date pickers and dynamic field props.

Overview
Adds a COR-specific constraint in contractor onboarding so service_duration.expiration_date dynamically gets a maxDate set to 12 months after service_duration.provisional_start_date (using parseLocalDate to avoid timezone day-shifts).

Updates FieldSetField to pass full form values into calculateDynamicProperties when needed (instead of only the fieldset’s watched values), and updates the test date component to actually apply min/max attributes from minDate/maxDate. Includes new onboarding tests covering COR vs non-COR max-date behavior, plus a small fixture tweak (mot: 200).

Reviewed by Cursor Bugbot for commit ee9933f. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 211.92 kB 211.84 kB +80 B (+0.0%) 🔴
Total (raw) 574.62 kB 574.1 kB +516 B (+0.1%) 🔴
CSS (gzip) 20.86 kB 20.86 kB 0 B (0%) 🟢
CSS (raw) 108.83 kB 108.83 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 211.92 kB / 250 kB (84.8%)
  • ✅ Total raw: 574.62 kB / 600 kB (95.8%)
  • ✅ CSS gzipped: 20.86 kB / 25 kB (83.4%)

Largest Files (Top 5)

  1. chunk-5BU3CD2P.js - 14 kB (0 B (0%))
  2. styles.css - 10.43 kB (0 B (0%))
  3. index.css - 10.43 kB (0 B (0%))
  4. index.js - 6.11 kB (-2 B (-0.0%))
  5. chunk-ER46UFIU.js - 5.89 kB (0 B (0%))
View All Files (312 total)
File Size (gzip) Change
chunk-5BU3CD2P.js 14 kB 0 B (0%)
styles.css 10.43 kB 0 B (0%)
index.css 10.43 kB 0 B (0%)
index.js 6.11 kB -2 B (-0.0%)
chunk-ER46UFIU.js 5.89 kB 0 B (0%)
chunk-NY3XFPIA.js 5.81 kB new
chunk-JXAAON7I.js 5.26 kB 0 B (0%)
chunk-KRAXNGOZ.js 4.65 kB new
chunk-CFD6IFT6.js 4.45 kB new
chunk-3PKL3V6F.js 4.06 kB 0 B (0%)

✅ Bundle size check passed

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 90.09% 90.06% +0.04% 🟢
Statements 89.76% 89.73% +0.04% 🟢
Functions 87.75% 87.73% +0.02% 🟢
Branches 80.24% 80.11% +0.12% 🟢

Detailed Breakdown

Lines Coverage
  • Covered: 3702 / 4109
  • Coverage: 90.09%
  • Change: +0.04% (6 lines)
Statements Coverage
  • Covered: 3762 / 4191
  • Coverage: 89.76%
  • Change: +0.04% (6 statements)
Functions Coverage
  • Covered: 1003 / 1143
  • Coverage: 87.75%
  • Change: +0.02% (2 functions)
Branches Coverage
  • Covered: 2314 / 2884
  • Coverage: 80.24%
  • Change: +0.12% (10 branches)

✅ Coverage check passed

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-hql5mqbb8-remotecom.vercel.app
Latest Commit:ee9933f

Deployed with vercel-action

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7152bc5. Configure here.

Comment thread src/components/form/fields/FieldSetField.tsx Outdated
Comment thread src/flows/ContractorOnboarding/jsfModify.tsx
field = {
...field,
...(field.calculateDynamicProperties(watchedValues, field) ||
...(field.calculateDynamicProperties(allFormValues, field) ||
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this the calculateDynamicProperties that we use in jsfModify doesn't work correctly

inputType: 'date',
meta: {
mot: 20,
mot: 0,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I added minDates to the datepicker mocked, this is needed, mot in other fixtures is also 0

@gabrielseco gabrielseco self-assigned this May 20, 2026
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.

1 participant