Story: Books, portfolios, business units modelling

Table of Contents

This page documents a story in Sprint 12. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

Goal

Model the next layer of entities: business units, books + portfolios, the business-centre coding scheme; first implementation slice of portfolios; verify country↔currency link.

Status

Field Value
State DONE
Parent sprint Sprint 12
Now Completed 2026-02-19.
Waiting on None.
Next None.
Last touched 2026-02-19

Acceptance

  • Business unit, book, portfolio designs documented.
  • Business-centre coding scheme entity present (~500 FpML entries).
  • Portfolio implementation first slice landed.
  • Country↔currency link verified.

Tasks

Task State Start End Description
Business unit entity DONE 2026-05-19 2026-02-17 Internal organisational units (desks, branches): unit_id, party_id, parent_business_unit_id, unit_name, unit_id_code, business_centre. Supports hierarchy.
Book and Portfolio entities DONE 2026-05-19 2026-02-18 Portfolio = logical aggregation nodes (never hold trades). Book = operational ledger leaves (hold trades). Strict separation; legal ownership at Book level; trading vs banking book flag; Basel-friendly. Combined hierarchy rules documented.
Add business centre scheme entity DONE 2026-05-19 2026-02-18 FpML business-centre coding scheme (v9-4); 4-char codes (ISO country + location); 500+ entries; FK to country (nullable for index publication calendars).
Add portfolio support DONE 2026-05-19 2026-02-19 Implementation of the portfolio entity based on the modelling analysis; hierarchical-tree storage following the Postgres-tree pattern.
Add country link to currencies DONE 2026-05-19 2026-02-19 Verify the existing country support links cleanly to currencies.

Decisions

Strict Portfolio vs Book separation
portfolios aggregate; only books hold trades. Basel-friendly.
Leaf invariant
the only entity that holds trades is the Book.

Out of scope

  • Trade attribution + P&L roll-up (separate workstream).

See also

None.

Emacs 29.1 (Org mode 9.6.6)