Build a time tracker whose output is a correct invoice, with the double-billing problem solved properly. Stack: your choice, Postgres, one command to run. Model: Client, Project, Task, TimeEntry, Expense, Invoice, InvoiceLine. Billing correctness is the whole build: - A TimeEntry has a billable flag and an `invoice_id` that is null until invoiced. Invoicing selects unbilled billable entries in a date range and sets that id inside one transaction. There is no other way for an entry to become billed. - An invoiced entry is immutable. Editing it requires voiding the invoice or writing an adjustment entry, and the UI must explain which. - Rates resolve by specificity — person on project, then project, then person, then default — using the rate in force **on the entry's date**. Changing a rate today must never change the value of work already logged. Test this first. - Expenses attach to a project with a receipt file, a category, and an optional markup percentage, and flow into the invoice as their own lines. Invoice document: number from a configurable sequence with no gaps, issue and due dates, client billing details, line items grouped by project, task or person as chosen, subtotal, a tax line with a configurable rate, and a total. Render to PDF. Store the rendered PDF rather than regenerating it — a regenerated invoice can silently differ from the one the client received. States: draft, sent, partially paid, paid, void. Payments are recorded manually with a date, amount and method; several payments can settle one invoice. Voiding never deletes: it releases the entries back to unbilled and records who voided it and when. Reports: unbilled hours by client, ageing of unpaid invoices in 30/60/90-day buckets, and revenue by month from invoice dates. Write tests for the invoicing transaction being atomic, for an entry never appearing on two invoices under concurrent invoicing, for historical rate resolution, and for void releasing entries exactly once. Do not integrate a payment processor or an accounting system. Export a CSV your accountant can import.