books/backend/Books.Api/Database/Migrations/004_FiscalYearAuditFields.sql
Nicolaj Hartmann 1f75c5d791 Add all backend domain, commands, repositories, and tests
This commit includes all previously untracked backend files:

Domain:
- Accounts, Attachments, BankConnections, Customers
- FiscalYears, Invoices, JournalEntryDrafts
- Orders, Products, UserAccess

Commands & Handlers:
- Full CQRS command structure for all domains

Repositories:
- PostgreSQL repositories for all read models
- Bank transaction and ledger repositories

GraphQL:
- Input types, scalars, and types for all entities
- Mutations and queries

Infrastructure:
- Banking integration (Enable Banking client)
- File storage, Invoicing, Reporting, SAF-T export
- Database migrations (003-029)

Tests:
- Integration tests for GraphQL endpoints
- Domain tests
- Invoicing and reporting tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:19:42 +01:00

14 lines
776 B
SQL

-- Add audit fields for fiscal year state transitions
-- Tracks who and when reopened/locked fiscal years
ALTER TABLE fiscal_year_read_models
ADD COLUMN IF NOT EXISTS reopened_date TIMESTAMPTZ,
ADD COLUMN IF NOT EXISTS reopened_by VARCHAR(255),
ADD COLUMN IF NOT EXISTS locked_date TIMESTAMPTZ,
ADD COLUMN IF NOT EXISTS locked_by VARCHAR(255);
-- Add comment for documentation
COMMENT ON COLUMN fiscal_year_read_models.reopened_date IS 'Timestamp when the fiscal year was last reopened';
COMMENT ON COLUMN fiscal_year_read_models.reopened_by IS 'User who reopened the fiscal year';
COMMENT ON COLUMN fiscal_year_read_models.locked_date IS 'Timestamp when the fiscal year was locked';
COMMENT ON COLUMN fiscal_year_read_models.locked_by IS 'User who locked the fiscal year';