Basic Full Stack Assignment – Invoice Details Page
🎯 Objective
Build a simple Invoice Details Module with:
• Basic database
• Backend APIs
• Clean frontend page
• Basic payment logic
The UI should be inspired by the following reference:
UI Inspiration (Design Reference Only):
[Link]
Important:
• This link is only for layout inspiration.
• Do NOT copy assets or design exactly.
• Build your own clean implementation inspired by the structure.
🗄️ Part 1 – Database
Create 3 models:
1️⃣ Invoice
• id
• invoiceNumber
• customerName
• issueDate
• dueDate
• status (DRAFT | PAID)
• total
• amountPaid
• balanceDue
• isArchived (boolean)
2️⃣ InvoiceLine
• id
• invoiceId
• description
• quantity
• unitPrice
• lineTotal
lineTotal = quantity × unitPrice
3️⃣ Payment
• id
• invoiceId
• amount
• paymentDate
⚙️ Part 2 – Backend APIs
🔹 1. Get Invoice Details
GET /api/invoices/:id
Must return:
• Invoice details
• Line items
• Payments
• total
• amountPaid
• balanceDue
🔹 2. Add Payment
POST /api/invoices/:id/payments
Rules:
• amount > 0
• amount ≤ balanceDue
• Update:
o amountPaid
o balanceDue
o If balanceDue = 0 → status = PAID
🔹 3. Archive Invoice
POST /api/invoices/archive
Set:
isArchived = true
🔹 4. Restore Invoice
Set:
isArchived = false
🎨 Part 3 – Frontend
Create route:
/invoices/:id
Design should be inspired by the Dribbble reference above.
Page Must Include
🔹 Header Section
• Invoice Number
• Customer Name
• Status badge
• Issue Date
• Due Date
🔹 Line Items Table
Columns:
• Description
• Quantity
• Unit Price
• Line Total
🔹 Totals Section
• Total
• Amount Paid
• Balance Due
🔹 Payments Section
• List of payments
• “Add Payment” button
• Simple modal to add payment
🧠 Business Rules
1. Line total = quantity × unit price
2. Total = sum of line totals
3. BalanceDue = total – amountPaid
4. Do NOT allow overpayment
5. If fully paid → status = PAID
🚫 Plus point if you complete below
functionality:
• Authentication
• PDF generation
• Tax logic
• Multi-currency
• Overdue logic
• Advanced UI animations
📂 Submission Requirements
• GitHub repository
• README with:
o Setup instructions
o How to run backend
o How to run frontend