Task: Update business_centre codegen model and enable variability knobs
Table of Contents
This page documents a task in the Commission: business_centre story. It captures the goal, current status, acceptance, and any notes or results.
Goal
business_centre has a codegen entity model (projects/modeling/business_centre.org or equivalent entity_org) that accurately describes its current DB/domain/repository/service/messaging/Qt structure, with the variability knobs enabled for every profile the entity should have (sql, domain, repository, service, generator, protocol, nats-eventing, nats-handler, qt), so it can be regenerated end-to-end instead of remaining hand-maintained.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Commission: business_centre |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-07-12 |
Acceptance
- A codegen entity model for business_centre exists, modelled on an already-commissioned comparable entity (e.g. currency or country), with every field from the current hand-written domain struct/DB table represented.
- The model's variability knobs are enabled for sql, domain, repository, service, generator, protocol, nats-eventing, nats-handler, and qt (component = refdata throughout).
- The model does not itself regenerate anything – that is the next task's scope. This task ends with a model that `compass codegen generate` can run against.
Plan
Scaffolded via compass add entity_org --component refdata --slug
business_centre, producing
projects/ores.refdata/modeling/ores.refdata.business_centre.org
(#+type: ores.codegen.entity, the current unified format – studied
business_day_convention_type.org and
currency_pair.org as precedent for the shape, plus the meta-model doc
projects/ores.codegen/modeling/org_entity_meta_model.org). Filled in:
- Frontmatter
#+has_tenant_id: true,#+coding_scheme: required,#+image_id: true– tracedhas_coding_scheme=/=has_image_idthroughprojects/ores.codegen/src/codegen/core.pyandsql_schema_create.mustacheto confirmcoding_scheme: requiredgenerates exactly business_centre's existing composite primary key(tenant_id, code, coding_scheme_code, valid_from, valid_to)and FK-validatescoding_scheme_codeagainstores_dq_coding_schemes_tbl– matching the current hand-written SQL precisely. No other entity in the tree yet usescoding_scheme: required(business_centre is the first); confirmed by grep across every*.orgmodel. country_alpha2_codewired to the standard Insert-trigger Validations table, callingores_refdata_validate_country_fn(same pattern ascurrency_pair's FK columns) – this is what producessecurity definer set search_pathautomatically (verified: the fixedsql_schema_create.mustachetemplate already carries it, unlike the oldersql_schema_table_create.mustachebusiness_centre's current SQL banner references).- Qt: standard
flagged_combowiring forcountry_alpha2_code, same shape ascurrency_pair's currency combos – flagged a gap in* Notes:fetch_country_codesdoesn't exist yet inLookupFetcher.hpp(onlyfetch_currency_codesand siblings); the current hand-writtenBusinessCentreDetailDialog::populateCountries()uses a bespokeQtConcurrentfetch instead. Also flaggedcity_name's "derived from description" domain comment as unconfirmed – the current dialog just treats it as always-read-only free text, no live derivation found. - Validated with
compass codegen generate --model ... --profile <p> --dry-runforall,qt,nats-eventing, andnats-handler: every profile parses cleanly and every output path lands in the correct split-project location (ores.refdata.api,ores.refdata.core,ores.qt/refdata,ores.sql) – confirms the model is well-formed and theqtprofile in particular resolves toores.qt/refdata, notores.qt/party, satisfying the story's cross-component-leakage acceptance criterion once actually regenerated.
Notes
Test Scenarios
Manual QA scenarios (scaffolded via compass add test_scenario, run
through the QA Validation Runner panel) that verify this task. Link
new ones here as they're created; the scenario doc itself links back
via its "Verifies task" field.
| Scenario | State | Notes |
|---|---|---|
PRs
| PR | Title |
|---|---|
Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
Result
Model authored, all applicable variability knobs enabled (sql, domain,
repository, service, generator, protocol, nats-eventing, nats-handler,
qt), and validated via dry-run across every profile with zero errors
and correct output locations. Not yet regenerated – that's the next
task. Two gaps flagged in the model's own * Notes for that task to
resolve: missing fetch_country_codes LookupFetcher, and an
unconfirmed city_name derivation claim.