Book cost_center should reference a real accounts entity
Table of Contents
This page is a capture in the deferred bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
What
Book.cost_center (projects/ores.refdata/modeling/ores.refdata.book.org:145-152) is
declared as a plain nullable std::string — "Internal finance code for
P&L attribution" — with no validation, no foreign key, and no link to
any ledger/chart-of-accounts structure. There is currently no
ores.accounts (or equivalent) component in the codebase at all.
Investigate what a "cost centre" should really be: a reference to a
chart-of-accounts / cost-centre master entity, likely owned by a new or
existing accounts-domain component, and reconcile Book's field
accordingly (soft-FK combo, validation, or a dedicated entity).
Why
A free-text cost centre invites drift (typos, inconsistent codes, no way to rename/reorganise centrally) and blocks any reporting or validation that depends on cost centres being a closed, well-known set. Matching it to a real accounts entity would let the Qt layer render it as a validated combo (same pattern as other soft-FK fields) instead of an unchecked string.
References
projects/ores.refdata/modeling/ores.refdata.book.org— currentcost_centerfield definition (line 145) and Qt field/column mapping (lines 280-292).
See also
- Story: Commission: book — where this was noticed.