Skip to content

generate new endpoints#1114

Open
gabrielseco wants to merge 7 commits into
mainfrom
pbyr-4192-fe-use-new-endpoints
Open

generate new endpoints#1114
gabrielseco wants to merge 7 commits into
mainfrom
pbyr-4192-fe-use-new-endpoints

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Note

Medium Risk
Breaking changes in generated client exports and pre-onboarding URL shapes can break integrators; onboarding compliance UI is incomplete until acknowledge is wired to the new POST/DELETE endpoints.

Overview
Regenerates the OpenAPI SDK to align with a unified pre-onboarding requirements model: list via getV1OnboardingEmploymentsEmploymentIdPreOnboardingRequirements, document creation via .../requirements/{slug}/documents, and new acknowledge / delete acknowledge endpoints. Older document-requirements list and create pre-onboarding documents exports are removed or renamed (PreOnboardingDocumentRequirementPreOnboardingRequirement).

The generated HTTP client no longer hardcodes baseUrl: 'https://gateway.remote.com/' in client.gen.ts. The same regeneration also adds WD GPH pay read APIs, postV1Timesheets, a second OAuth token helper, and drops getV1PayslipsId from exports.

In the example app, onboarding enables the pre_onboarding_requirements feature. The review step branches requirements by type: document rows stay on the existing preview/sign flow (DocumentRequirement, renamed from Requirement); acknowledgement rows render a new checkbox UI with dependency tooltips and HTML descriptions via transformHtmlToComponents. Acknowledgement toggling is still a stub (console.log only, no API call yet).

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

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 223.87 kB 223.9 kB -30 B (-0.0%) 🟢
Total (raw) 604.55 kB 604.6 kB -52 B (-0.0%) 🟢
CSS (gzip) 20.89 kB 20.89 kB 0 B (0%) 🟢
CSS (raw) 109.09 kB 109.09 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 223.87 kB / 250 kB (89.5%)
  • ✅ Total raw: 604.55 kB / 650 kB (93.0%)
  • ✅ CSS gzipped: 20.89 kB / 25 kB (83.5%)

Largest Files (Top 5)

  1. chunk-Y3CJRZLA.js - 14 kB (0 B (0%))
  2. styles.css - 10.44 kB (0 B (0%))
  3. index.css - 10.44 kB (0 B (0%))
  4. chunk-75G45FLQ.js - 6.36 kB (new)
  5. index.js - 6.32 kB (-6 B (-0.1%))
View All Files (341 total)
File Size (gzip) Change
chunk-Y3CJRZLA.js 14 kB 0 B (0%)
styles.css 10.44 kB 0 B (0%)
index.css 10.44 kB 0 B (0%)
chunk-75G45FLQ.js 6.36 kB new
index.js 6.32 kB -6 B (-0.1%)
chunk-T72I5CZC.js 6.1 kB new
chunk-G2LZFGZA.js 5.31 kB 0 B (0%)
chunk-JACQIU3A.js 4.76 kB new
chunk-VCLFF3BM.js 4.57 kB new
chunk-PV37MNM4.js 3.89 kB new

✅ Bundle size check passed

},
},
});
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

MSW mocks use outdated endpoints

Medium Severity

This commit switches pre-onboarding hooks to generated routes under pre-onboarding-requirements (including {requirement_slug}/documents), but default MSW handlers and test overrides still mock the removed pre-onboarding-document-requirements and pre-onboarding-documents paths, so mocked requests never match and PreOnboarding tests fail.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 32f7f31. Configure here.

});
await refetchRequirements();
return response; */
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Acknowledge handler is no-op

High Severity

onAcknowledgeRequirement is exposed on the public hook bag but the acknowledge mutation and requirements refetch are commented out, so callers complete without recording an acknowledgement on the API.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d0b6d3f. Configure here.

const onAcknowledgeRequirement = async (requirementSlug: string) => {
if (!activeRequirementSlug) {
throw new Error('No active requirement selected');
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wrong guard on acknowledge

Medium Severity

onAcknowledgeRequirement throws when activeRequirementSlug is unset even though it receives requirementSlug. Acknowledgement steps may never call onCreateDocument, which is what sets the active slug.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d0b6d3f. Configure here.

throw new Error('No active requirement selected');
}

console.log('onAcknowledgeRequirement', requirementSlug);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Debug log left in handler

Low Severity

onAcknowledgeRequirement includes a console.log debug statement that will run in production when the handler is invoked.

Fix in Cursor Fix in Web

Triggered by project rule: Code Review Guidelines

Reviewed by Cursor Bugbot for commit d0b6d3f. Configure here.

const { mutateAsyncOrThrow: acknowledgeRequirementMutationAsync } =
mutationToPromise(acknowledgeRequirementMutation);
const { mutateAsyncOrThrow: deleteAcknowledgeRequirementMutationAsync } =
mutationToPromise(deleteAcknowledgeRequirementMutation);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove-ack mutation never used

Low Severity

useRemoveAcknowledgePreOnboardingRequirement and deleteAcknowledgeRequirementMutationAsync are wired via mutationToPromise but nothing in this file calls the delete mutation, including the commented toggle logic.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d0b6d3f. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 3 potential issues.

There are 8 total unresolved issues (including 5 from previous reviews).

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 e921580. Configure here.


const handleChange = (checked: CheckedState) => {
console.log('handleChange', checked);
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ack checkbox ignores API

High Severity

The new acknowledgement checkbox uses a controlled checked value from requirement.status, but handleChange only logs and never calls PreOnboardingRequirementsBag’s onAcknowledgeRequirement (or any mutation). Toggling the box cannot persist acknowledgement or update requirement status in the example flow.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e921580. Configure here.

console.log('isDisabled', isDisabled);
console.log('isChecked', isChecked);
console.log('isBlocked', isBlocked);
console.log('isLocked', isLocked);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Debug console logs committed

Medium Severity

AckRequirement adds multiple console.log calls in handleChange and during render (isDisabled, isChecked, isBlocked, isLocked). These look like temporary debugging, not production logging, and violate the project’s console policy.

Fix in Cursor Fix in Web

Triggered by project rule: Code Review Guidelines

Reviewed by Cursor Bugbot for commit e921580. Configure here.

{isBlocked ? (
<BlockedDependencyTooltip
dependsOnRequirement={requirement.depends_on_requirement}
>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Blocked ack missing dependency guard

Medium Severity

When an acknowledgement requirement is blocked, the UI always wraps the checkbox in BlockedDependencyTooltip and passes requirement.depends_on_requirement without a null check, unlike document requirements that use optional chaining on the same field.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e921580. Configure here.

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