v3.2.1 4 February 2026 Fix Improvement

Production Bug Fixes & Schema Hardening

Added

  • PUT /api/v1/invoices/:id — New endpoint for updating draft invoices with full line item replacement, server-side total recalculation via Decimal.js, and audit logging
  • Invoice reference field — Optional customer PO/reference number on invoices
  • Composite database indexes — Optimised query performance for tenant-scoped lookups across invoices, transactions, contacts, and accounts
  • Metadata support — Extended Stripe-style metadata to accounts, invoice lines, financial periods, and recurring transactions

Changed

  • Invoice number uniqueness scoped to per-organisation — multi-tenant orgs can now use independent numbering sequences
  • Quote number uniqueness enforced per-organisation
  • NOT NULL constraints tightened across tenant-scoped columns, boolean flags, and audit timestamps for stronger data integrity
  • ON DELETE CASCADE standardised across all organisation foreign keys for clean data lifecycle management
  • Transaction source types extended to support year-end closing journals

Fixed

  • Draft invoices could not be edited — no update endpoint existed, only create and status transitions
  • Dashboard “Bank Balance” link pointed to an invalid route instead of the correct prefixed account ID
  • Duplicate database index removed

Technical Notes

  • Comprehensive schema audit and hardening applied across the full database — ownership, constraints, indexes, and multi-tenancy scoping reviewed and tightened
  • All changes applied as transactional migrations with pre-flight validation and safe rollback