currency
Table of Contents
An ISO 4217 currency that can be traded or referenced in financial transactions.
Currencies are system-managed reference data shared across all tenants via the system
tenant. Each currency carries a code (e.g. USD), name, symbol, and rounding
configuration. Currencies have an associated market tier and may appear in
party–currency junction records when a party operates in a specific currency.
Codegen models
Source models that drive generation for this entity. Multiple models coexist because the entity spans both the table facet (SQL schema + IO) and the domain entity facet (C++ + Qt).
| Artefact | Type | Archetype |
|---|---|---|
| ores.refdata.currency_table.org | table model | org_entity_meta_model.org |
| sql_currency_populate.mustache | populate template | — |
| sql_non_iso_currency_populate.mustache | populate template | — |
Missing: domain entity org model (ores.refdata.currency.org) — currency still
uses the legacy JSON model path. Required before C++ codegen can regenerate it.
SQL
Schema artefacts. The create script is generated by both the table model
(sql_schema_create.mustache, which appends the validate function and is the
canonical output) and the domain entity model (sql_schema_domain_entity_create.mustache,
which is overwritten).
Populate data
| Artefact | Dataset | Archetype |
|---|---|---|
| iso_currencies_artefact_populate.sql | ISO 4217 | sql_currency_populate.mustache |
| fpml_non_iso_currency_artefact_populate.sql | FpML non-ISO | sql_non_iso_currency_populate.mustache |
| fpml_non_iso_currency_dataset_populate.sql | FpML dataset | hand-crafted |
| crypto_currencies_large_artefact_populate.sql | Crypto (large) | hand-crafted |
| crypto_currencies_small_artefact_populate.sql | Crypto (small) | hand-crafted |
C++ Domain (refdata.api)
Domain structs, SQL-mapping tables, and JSON IO.
C++ Repository (refdata.core)
SQL ↔ domain mapping and persistence layer.
C++ Service (refdata.core)
NATS request handler and business logic.
| Artefact | Archetype |
|---|---|
| currency_service.hpp | cpp_service.hpp.mustache |
| currency_service.cpp | cpp_service.cpp.mustache |
C++ Generator (refdata.api)
Test data generator.
| Artefact | Archetype |
|---|---|
| currency_generator.hpp | cpp_domain_type_generator.hpp.mustache |
| currency_generator.cpp | cpp_domain_type_generator.cpp.mustache |
C++ Messaging
Protocol (request/response types)
| Artefact | Archetype |
|---|---|
| currency_protocol.hpp | cpp_protocol.hpp.mustache |
| currency_history_protocol.hpp | hand-crafted |
Eventing (NATS change events)
| Artefact | Archetype |
|---|---|
| currency_changed_event.hpp | cpp_nats_changed_event.hpp.mustache |
Handler (NATS message handlers)
| Artefact | Archetype |
|---|---|
| currency_handler.hpp | cpp_nats_handler.hpp.mustache |
Qt (ores.qt.refdata)
Desktop UI components.
Other projections
Additional projections outside the standard refdata component.
| Artefact | Component | Archetype |
|---|---|---|
| currency_dialog.hpp | ores.wt.service | hand-crafted |
| currency_dialog.cpp | ores.wt.service | hand-crafted |
| currency_list_widget.hpp | ores.wt.service | hand-crafted |
| currency_list_widget.cpp | ores.wt.service | hand-crafted |
| add_currency_options.hpp | ores.cli | hand-crafted |
| add_currency_options.cpp | ores.cli | hand-crafted |
| currency_mapper.hpp | ores.ore.core | hand-crafted |
| currency_mapper.cpp | ores.ore.core | hand-crafted |
| dq_currencies_artefact_create.sql | dq | hand-crafted |
| dq_currencies_artefact_drop.sql | dq | hand-crafted |
Tests
| Artefact | Layer |
|---|---|
| domain_currency_tests.cpp | domain |
| domain_currency_version_tests.cpp | domain |
| domain_currency_version_json_io_tests.cpp | domain |
| generators_currency_generator_tests.cpp | generator |
| presentation_currency_field_mapper_tests.cpp | presentation |
| repository_currency_repository_tests.cpp | repository |
| refdata_currencies_test.sql | SQL |
| domain_currency_mapper_tests.cpp | ore |
| xml_currency_config_tests.cpp | ore |
Related entities
These are distinct entities closely related to currency. Each has its own entity view (to be created).
currency_market_tier— classification of currencies by market liquidityparty_currency— junction: currencies a party operates in