• Adds JournalEntryLine child entity with debit/credit legs per
    account, completing the pbc-finance GL foundation.
    
    Domain:
      - JournalEntryLine entity: lineNo, accountCode, debit (>=0),
        credit (>=0), description. FK to parent JournalEntry with
        CASCADE delete. Unique (journal_entry_id, line_no).
      - JournalEntry gains @OneToMany lines collection (EAGER fetch,
        ordered by lineNo).
    
    Event subscribers now write balanced double-entry lines:
      - SalesOrderConfirmed: DR 1100 (AR), CR 4100 (Revenue)
      - PurchaseOrderConfirmed: DR 1200 (Inventory), CR 2100 (AP)
    
    The parent JournalEntry.amount is retained as a denormalized
    summary; the lines are the source of truth for accounting. The
    seeded account codes (1100, 1200, 2100, 4100, 5100) match the
    chart from the previous commit.
    
    JournalEntryController.toResponse() now includes the lines array
    so the SPA can display debit/credit legs inline.
    
    Schema: 004-finance-entry-lines.xml adds finance__journal_entry_line
    with FK, unique (entry, lineNo), non-negative check on dr/cr.
    
    Smoke verified on fresh Postgres:
      - Confirm SO-2026-0001 -> AR entry with 2 lines:
        DR 1100 $1950, CR 4100 $1950
      - Confirm PO-2026-0001 -> AP entry with 2 lines:
        DR 1200 $2550, CR 2100 $2550
      - Both entries balanced (sum DR = sum CR)
    
    Caught by smoke: LazyInitializationException on the new lines
    collection — fixed by switching FetchType from LAZY to EAGER
    (entries have 2-4 lines max, eager is appropriate).
    zichun authored
     
    Browse Code »