Feature: Add invoice template system with custom branding
User Story
As a freelancer, I want to customize invoice appearance (logo, colors, footer text) so my brand is consistent across all client communications.
Current Behavior
- All invoices use default LancePay template
- No customization options
- Generic "LancePay" branding
Proposed Feature
Add invoice template editor:
API Endpoints:
GET /api/routes-d/branding/templates // List templates
POST /api/routes-d/branding/templates // Create template
PUT /api/routes-d/branding/templates/[id] // Update template
GET /api/routes-d/branding/templates/[id] // Get template
Template Schema:
interface InvoiceTemplate {
id: string;
userId: string;
name: string;
isDefault: boolean;
// Branding
logoUrl?: string;
primaryColor: string; // hex color
accentColor: string;
// Customization
showLogo: boolean;
showFooter: boolean;
footerText?: string; // "Thank you for your business!"
// Layout
layout: 'modern' | 'classic' | 'minimal';
createdAt: Date;
updatedAt: Date;
}
Invoice Preview:
┌─────────────────────────────────────┐
│ [USER LOGO] Invoice #12345 │
│ │
│ Bill To: client@company.com │
│ Amount: $500.00 │
│ Due: Jan 30, 2026 │
│ │
│ [Pay with USDC Button] │
│ │
│ Custom footer: "Thanks for your │
│ business! Net 30 terms apply." │
└─────────────────────────────────────┘
Acceptance Criteria
Files to Create
app/api/routes-d/branding/templates/route.ts
app/api/routes-d/branding/templates/[id]/route.ts
components/settings/TemplateEditor.tsx
lib/invoice-renderer.tsx (PDF generation)
Database Migration
model InvoiceTemplate {
id String @id @default(cuid())
userId String
name String
isDefault Boolean @default(false)
logoUrl String?
primaryColor String @default("#000000")
accentColor String @default("#059669")
showLogo Boolean @default(true)
showFooter Boolean @default(true)
footerText String?
layout String @default("modern")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@index([userId, isDefault])
}
Priority
Medium - Nice-to-have for brand-conscious freelancers
Feature: Add invoice template system with custom branding
User Story
As a freelancer, I want to customize invoice appearance (logo, colors, footer text) so my brand is consistent across all client communications.
Current Behavior
Proposed Feature
Add invoice template editor:
API Endpoints:
Template Schema:
Invoice Preview:
Acceptance Criteria
Files to Create
app/api/routes-d/branding/templates/route.tsapp/api/routes-d/branding/templates/[id]/route.tscomponents/settings/TemplateEditor.tsxlib/invoice-renderer.tsx(PDF generation)Database Migration
Priority
Medium - Nice-to-have for brand-conscious freelancers