Skip to content

feat(contractor-invoices): support skipping a scheduled invoice and previewing a draft invoice PDF - #1265

Merged
cammellos merged 2 commits into
mainfrom
feat/contractor-invoice-skip-and-preview
Aug 28, 2026
Merged

feat(contractor-invoices): support skipping a scheduled invoice and previewing a draft invoice PDF#1265
cammellos merged 2 commits into
mainfrom
feat/contractor-invoice-skip-and-preview

Conversation

@cammellos

Copy link
Copy Markdown
Collaborator

Summary

Wires the SDK up to the two new eor_web capabilities from tiger MR !92157:

  • Skip an existing invoice scheduleSkipInvoiceScheduleButton cancels the schedule loaded on the create_invoice_schedule step (PATCH .../contractor-invoice-schedules/:id with status: "deleted") and returns the wizard to the invoice_schedule step.
  • Preview a contractor invoicePreviewInvoiceButton generates a draft (non-persisted) PDF preview from the current, unsaved create_invoice_schedule form values via the new POST /employments/:id/contractor-invoices/preview endpoint.

Neither capability existed in the SDK before this, including in the generated OpenAPI client — those bindings are hand-added in src/client/{sdk.gen.ts,types.gen.ts,index.ts} (matching hey-api's output shape) from a spec generated locally via mix eorapidocs against the rebased backend branch, since the backend MR hasn't merged/deployed yet. This should be reconciled with a full client regeneration (npm run openapi-ts) once !92157 is deployed to production.

Context

This builds on Gabriel's merged two-step invoice-schedule flow (invoice_schedule + create_invoice_schedule, create/update/prefill). A separate, now-superseded branch (#1251) attempted an earlier single-step version of this work before that flow existed — closed in favor of this, built cleanly on top of the current main.

Test plan

  • New unit tests for buildInvoicePreviewPayload (tests/utils.test.ts)
  • New integration tests in ContractorOnboarding.test.tsx: skip flow, preview flow (asserting the request omits periodicity/nr_occurrences), and error-path field-error surfacing
  • Full suite green, tsc --noEmit, oxlint, oxfmt clean
  • Manual check in example/src/ContractorOnboarding.tsx against a locally running tiger backend

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 259.19 kB 257.44 kB +1.75 kB (+0.7%) 🔴
Total (raw) 693.63 kB 689.62 kB +4.01 kB (+0.6%) 🔴
CSS (gzip) 21.69 kB 21.69 kB 0 B (0%) 🟢
CSS (raw) 112.77 kB 112.77 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 259.19 kB / 350 kB (74.1%)
  • ✅ Total raw: 693.63 kB / 850 kB (81.6%)
  • ✅ CSS gzipped: 21.69 kB / 25 kB (86.8%)

Largest Files (Top 5)

  1. chunk-AUPAAQUT.js - 14 kB (0 B (0%))
  2. styles.css - 10.85 kB (0 B (0%))
  3. index.css - 10.85 kB (0 B (0%))
  4. index.js - 6.79 kB (+20 B (+0.3%))
  5. chunk-KDHFTLCW.js - 6.58 kB (new)
View All Files (421 total)
File Size (gzip) Change
chunk-AUPAAQUT.js 14 kB 0 B (0%)
styles.css 10.85 kB 0 B (0%)
index.css 10.85 kB 0 B (0%)
index.js 6.79 kB +20 B (+0.3%)
chunk-KDHFTLCW.js 6.58 kB new
chunk-D6G3ZRDQ.js 6.43 kB new
chunk-VQEJRNLZ.js 5.82 kB new
chunk-C4HFMTSB.js 5.33 kB 0 B (0%)
chunk-P2YLLK6M.js 4.65 kB new
chunk-MKOMDNWM.js 4.22 kB new

✅ Bundle size check passed

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 85.48% 85.42% +0.06% 🟢
Statements 85.04% 84.98% +0.06% 🟢
Functions 83.70% 83.56% +0.13% 🟢
Branches 76.89% 76.90% 0%

Detailed Breakdown

Lines Coverage
  • Covered: 4355 / 5095
  • Coverage: 85.48%
  • Change: +0.06% (55 lines)
Statements Coverage
  • Covered: 4428 / 5207
  • Coverage: 85.04%
  • Change: +0.06% (55 statements)
Functions Coverage
  • Covered: 1155 / 1380
  • Coverage: 83.70%
  • Change: +0.13% (11 functions)
Branches Coverage
  • Covered: 2699 / 3510
  • Coverage: 76.89%
  • Change: 0% (16 branches)

✅ Coverage check passed

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-30i1mjm87-remotecom.vercel.app
Latest Commit:78700e8

Deployed with vercel-action

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

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

Deployed with vercel-action

…reviewing a draft invoice PDF

Wires the SDK up to the two new eor_web capabilities from tiger MR !92157:
skipping an existing invoice schedule (PATCH status: deleted) and previewing
a contractor invoice as a draft PDF before it's created. Neither existed in
the SDK before this, including in the generated OpenAPI client — those
bindings are hand-added here (matching hey-api's output shape) from a spec
generated locally via `mix eorapidocs` against the rebased backend branch,
since the backend MR hasn't merged/deployed yet.
…v auth fallback

fetchAccessToken() required an interactively-obtained VITE_REFRESH_TOKEN even
for VITE_REMOTE_GATEWAY=local, where no such token exists; falls back to the
same JWT-bearer flow fetchCompanyManagerToken() already uses via VITE_USER_ID.
@cammellos
cammellos force-pushed the feat/contractor-invoice-skip-and-preview branch from 136e9ff to 78700e8 Compare August 27, 2026 11:42
@cammellos
cammellos merged commit 08738eb into main Aug 28, 2026
10 checks passed
@cammellos
cammellos deleted the feat/contractor-invoice-skip-and-preview branch August 28, 2026 15:37
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.

2 participants