ores.http.refdata

Table of Contents

1. Diagram

ores.http.refdata component diagram

Figure 1: ores.http.refdata

2. Summary

ores.http.refdata is the adapter part that projects the reference-data domain onto the HTTP server's REST surface. It holds the generated route units for the refdata models that opt in, and each unit owns one route per derived verb.

Refdata's models opt in through the :ores.cpp.http-route.enabled: property in their own model drawer, so a model that needs no route can leave the facet off. The units speak the canonical protocol over NATS and hold no service, repository or database context: the refdata service stays the only place that decides, and the caller's own token travels with every forwarded request.

The part declares #+component_kind: adapter. Its CMakeLists.txt files are hand-authored, because the link libraries belong to the HTTP surface rather than to the domain, and codegen writes only the two component_files.cmake lists. A regeneration therefore never writes over the build.

The units are output of the ores.cpp.http-route facet, which is opt-in per model. The facet writes here because the part is named after the domain the units project, which is the fractal naming rule in Component architecture.

3. Inputs

  • HTTP requests on the /api/v1/refdata/... paths the units register.
  • The caller's bearer token, forwarded to the service on every NATS request.
  • The connected NATS client the hand-written per-component aggregator passes to register_routes.
  • The refdata models under projects/ores.refdata/modeling/ whose drawers opt in to the ores.cpp.http-route facet.

4. Outputs

  • One route unit per opted-in model, at src/routes/refdata/<unit>_routes.cpp and include/ores.http/routes/refdata/<unit>_routes.hpp.
  • The routes and their OpenAPI schemas, registered on the router and the endpoint registry.
  • NATS request messages to the refdata service, one per route.

5. Entry points

  • include/ores.http/routes/refdata/ – the generated unit headers.
  • src/routes/refdata/ – the generated unit implementations.
  • currency_routes – the unit-level entry the host calls to install the currency entity's routes.

6. Dependencies

  • ores.http.api – the router, the route builder, the OpenAPI registry and the request/response types.
  • ores.nats – NATS transport for service calls.
  • ores.refdata.api – the canonical protocol messages the units send.
  • ores.utility – the codecs and the wire support types.
  • ores.logging – logger factory.

7. See also

target_link_libraries(${lib_target_name}
    PUBLIC
        ores.http.api.lib
        ores.nats.lib
        ores.logging.lib
    PRIVATE
        ores.refdata.api.lib
        ores.utility.lib)
target_link_libraries(${tests_target_name}
    PRIVATE
        ${lib_target_name}
        ores.testing.lib
        Catch2::Catch2
        ores.openssl_cleanup
        Threads::Threads)

Emacs 29.3 (Org mode 9.6.15)