Loading
SRM Refactor: Implementation of service terminate command
Summary
Implemented handling for command.srm.service.terminate using the same command workflow structure as the existing deploy message.
Changes
- Added
TerminateServiceCommandCoordinator- Performs stage-2 validation with
SrmServiceTerminateV1 - Publishes
failed_before_startevents for invalid answerable messages - Commits accepted state before publishing
accepted - Runs completion in a separate transaction
- Converts post-accept failures into terminal failed completion events
- Performs stage-2 validation with
- Added
TerminateServiceUseCase- Creates
terminate_serviceorders - Supports idempotent replay by
operation_id - Resolves the target
service_instance - Marks child
capability_instancerows asterminated - Marks the parent
service_instanceasterminated - Marks the
service_orderascompleted - Includes a TF-SDK termination placeholder before child capability state updates
- Creates
- Wired terminate handling into DataBus composition
- Added terminate use-case factory wiring
- Replaced the previous terminate no-op subscriber callback with the terminate coordinator
- Extended runtime inventory repositories
- Added capability instance
update_state(...) - Added optional
terminated_atsupport for service/capability state updates
- Added capability instance
- Added focused tests
- Terminate use-case behavior
- Terminate command coordinator behavior
- DataBus dependency wiring
- NATS subscriber coordinator delegation
- Repository persistence coverage for capability termination state updates