forze-specs-infrastructure
Forze specs and infrastructure wiring
Kernel specs declare model types and logical name. Integration configs on dependency modules map each name to physical infrastructure (relations, collections, Redis namespaces, buckets, queues, task queues, transaction routes). At runtime, usecases obtain DocumentQueryPort, DocumentCommandPort, SearchQueryPort, and other ports from ExecutionContext once those modules are merged into a DepsPlan; specs only supply the route (name) and types the factories receive. Use with forze-domain-aggregates for spec fields, forze-deps-modules for custom modules, and forze-wiring for runtime setup.
Prefer StrEnum names
Use a shared StrEnum for spec names and dependency routes. BaseSpec.name and built-in deps modules accept str | StrEnum, so enum values keep application specs, deps-module maps, and transaction routes aligned during refactors.
from enum import StrEnum
class ResourceName(StrEnum):
PROJECTS = "projects"
PROJECT_ATTACHMENTS = "project-attachments"
ORDERS = "orders"