Skip to content

feat: add a Billing page with the plan and paged invoice history - #181

Merged
Chea-Ilong merged 2 commits into
mainfrom
feat/payment-receipts
Oct 17, 2026
Merged

Chea-Ilong merged 2 commits into
mainfrom
feat/payment-receipts

Conversation

@Chea-Ilong

Copy link
Copy Markdown
Collaborator

Summary

  • New Billing page at /billing, opened from Settings → Plan & credits → Invoices → View billing:
    • Current plan at the top: plan name, Monthly/Yearly, "Active until …" (or ended or free), credits, and a Change plan / Renew / Upgrade link to pricing.
    • Invoices below: date, description, receipt number, amount, a Paid status (plus Sandbox for test payments) and a PDF download button, 20 at a time with Load more.
  • Receipt view: clicking an invoice opens the full receipt over the page, with Download PDF. The PDF comes from the backend, so it's the same file the email attaches.
  • Links: /billing?receipt=<id> opens a receipt directly, and is where receipt emails link. A signed-out visitor gets the sign-in dialog first. The older /settings?receipt=<id> links redirect there.
  • Settings: the billing history list moved out of Settings into the new page.

Needs COPPSARY/Motify-Backend#72 (GET /v1/payments, /receipt, /receipt.pdf).

Test plan

  • tsc --noEmit and svelte-check: 0 errors, 0 warnings
  • src/api/billing.test.ts (history paging, receipt fetch, PDF download) and src/app/routes.test.ts
  • Screenshots on desktop and mobile with 23 sample invoices: Load more fetches the remaining 3, then hides; the receipt opens at /billing?receipt=…
  • Tried locally against the sandbox backend
  • Full vitest run: the 39 failing tests (App.test.ts, direct-ai.test.ts, interests.test.ts, early-notice-card.test.ts, project-drafts.test.ts) fail the same way on main without this change.

🤖 Generated with Claude Code

Billing (/billing, linked from Settings > Plan & credits) shows the current plan
with its interval and end date, then every paid payment as an invoice row with
a status and a PDF download, loading 20 at a time. Opening a row shows the full
receipt over the page; /billing?receipt=<id> is where receipt emails link, and
the older /settings?receipt=<id> links still open it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 15:58

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
motionly Ready Ready Preview Oct 17, 2026 4:06pm UTC

Under the CI's Node 20 and jsdom, a Response built from jsdom's Blob fails with
"object.stream is not a function"; a string body tests the same download.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Chea-Ilong
Chea-Ilong merged commit a74bf98 into main Oct 17, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — 818558b6 Deployed Oct 17, 2026 by vercel[bot]
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