Skip to content

Allow itemized invoices for multiple PR fixes#493

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
phucnguyen1707:fix/invoice-multiple-pr-links
Jul 8, 2026
Merged

Allow itemized invoices for multiple PR fixes#493
ralyodio merged 1 commit into
profullstack:masterfrom
phucnguyen1707:fix/invoice-multiple-pr-links

Conversation

@phucnguyen1707

Copy link
Copy Markdown
Contributor

Summary

  • allow fixed/bounty code gigs to submit one itemized invoice for multiple PR fixes when enough direct PR links back the billed units
  • keep the agreed-amount cap for non-code invoices, flat over-cap invoices, overpriced PR units, or invoices without enough unique PR links
  • include both top-level and line-item PR links in invoice metadata/emails so posters can verify all merged work
  • mirror the same validation in the invoice form so the UI does not block valid multi-PR code invoices

Why

The current fixed-price cap treats a $1 code gig as a single total payout, even when the work agreement is effectively $1 per merged PR. That prevents workers from submitting one clean invoice for 2+ merged PRs and forces serial revoke/resend invoice flows.

Guardrails

  • Only applies to category=code invoices with itemized line items
  • Each billed unit must be at or below the agreed rate
  • The invoice needs at least as many unique direct GitHub PR URLs as billed units
  • GitHub owner/repo casing is normalized before dedupe so the same PR cannot be counted twice with different casing

Tests

  • pnpm exec vitest run 'src/app/api/gigs/[id]/invoice/route.test.ts' src/lib/github-links.test.ts
  • pnpm run type-check
  • pnpm exec eslint 'src/app/api/gigs/[id]/invoice/route.ts' 'src/app/api/gigs/[id]/invoice/route.test.ts' src/components/gigs/InvoiceButton.tsx
  • pnpm run build
  • pre-commit: full lint + type-check + test:run + build

@ralyodio
ralyodio merged commit 8395aac into profullstack:master Jul 8, 2026
5 checks passed
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