ores.refdata.book

Table of Contents

Operational ledger leaves. The only entity that holds trades. Serves as the basis for accounting, ownership, and regulatory capital treatment. Must belong to exactly one portfolio.

Flags

Primary key

UUID uniquely identifying this book.

Surrogate key for the book record.

Natural keys

party_id

Party that owns this book.

References the parties table.

ctx.generate_uuid()

name

Book name, unique within party.

e.g., 'FXO_EUR_VOL_01'.

std::string("BOOK_") + std::to_string(faker::number::integer(1, 999))

Columns

description

Optional free-text description of the book.

std::string(faker::lorem::sentence())

parent_portfolio_id

Links to exactly one portfolio.

Mandatory: Every book must belong to a portfolio.

ctx.generate_uuid()

owner_unit_id

Business unit that owns this book.

Optional FK to business_units. Should reference a unit that is an owner_unit_id in the book's portfolio ancestry chain.

std::nullopt

ledger_ccy

Functional/accounting currency.

ISO 4217 currency code.

std::string("USD")

gl_account_ref

Reference to external General Ledger.

e.g., 'GL-10150-FXO'. Nullable if not integrated.

std::string("GL-10150-TEST")

cost_center

Internal finance code for P&L attribution.

Links to cost center in finance system.

std::string("CC-001")

book_status

Lifecycle status of the book.

References book_statuses lookup (Active, Closed, Frozen).

std::string("Active")

is_trading_book

Basel III/IV classification.

1 = Trading Book, 0 = Banking Book.

1

SQL

Flags

C++

Flags

Repository

Domain includes

#include <chrono>
#include <optional>
#include <string>
#include <boost/uuid/uuid.hpp>

Entity includes

#include <string>
#include "sqlgen/Timestamp.hpp"
#include "sqlgen/PrimaryKey.hpp"

Conventions

Table display

column header
name Name
party_id Party
ledger_ccy Currency
book_status Status
is_trading_book Trading Book
modified_by Modified By
version Version

Qt

Detail fields

field label widget type is_key is_required placeholder
name Name nameEdit line_edit true true Enter book name
ledger_ccy Ledger Currency ledgerCcyEdit line_edit     Enter ledger currency
gl_account_ref GL Account Ref glAccountRefEdit line_edit     Enter GL account reference
cost_center Cost Center costCenterEdit line_edit     Enter cost center
book_status Status bookStatusEdit line_edit     Enter status

Columns (Qt model)

enum_name field header type width
Name name Name string 200
LedgerCcy ledger_ccy Ledger Ccy string 100
BookStatus book_status Status string 100
CostCenter cost_center Cost Center string 120
IsTradingBook is_trading_book Trading int 70
Version version Version int 80
ModifiedBy modified_by Modified By string 120
RecordedAt recorded_at Recorded At timestamp 150

Custom repository methods

See also

Emacs 29.1 (Org mode 9.6.6)