Skip to content

feat: Invoice Template System#271

Merged
davedumto merged 2 commits intodavedumto:mainfrom
DanielEmmanuel1:feature/268-invoice-template-system
Feb 26, 2026
Merged

feat: Invoice Template System#271
davedumto merged 2 commits intodavedumto:mainfrom
DanielEmmanuel1:feature/268-invoice-template-system

Conversation

@DanielEmmanuel1
Copy link
Contributor

Description

This PR implements the Invoice Template System as specified in Issue #268. It allows users to create, manage, and use templates for recurring billing to speed up their invoicing workflow.

Key Changes

  • Database Schema: Added InvoiceTemplate model with fields for client info, amount, currency, and usage tracking. Added relation to Invoice to track the source template.
  • API Endpoints:
    • GET /api/routes-d/invoices/templates: List active templates (supports favorites/limit).
    • POST /api/routes-d/invoices/templates: Create new templates.
    • PATCH /api/routes-d/invoices/templates/[id]: Update templates.
    • DELETE /api/routes-d/invoices/templates/[id]: Soft-delete templates.
    • POST /api/routes-d/invoices/from-template: Create an invoice using a template with optional overrides.
  • Frontend Components:
    • TemplateSelector.tsx: Allows users to pick a template when creating an invoice.
    • TemplateManager.tsx: Full CRUD interface for managing templates.
    • FavoriteTemplates.tsx: Added to the dashboard for quick access to the 3 most-used templates.

Security

  • All operations are scoped to the authenticated user via privyId.
  • Soft-delete ensures historical invoices created from templates remain linked but the template is hidden from active selection.

Closes #268

@vercel
Copy link

vercel bot commented Feb 26, 2026

@DanielEmmanuel1 is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

Resolved conflicts in:
- app/api/routes-d/escrow/release/route.ts: kept waterfall/Stellar payment
  logic from feature branch, added logger import from upstream, replaced
  console.error with structured logger.error calls
- lib/waterfall.ts: combined source parameter (feature branch) with tx
  parameter (upstream), use db = tx ?? prisma throughout for consistency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@davedumto davedumto merged commit 37bc576 into davedumto:main Feb 26, 2026
1 of 3 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.

Add invoice template system for recurring billing

2 participants