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_start events 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
  • Added TerminateServiceUseCase
    • Creates terminate_service orders
    • Supports idempotent replay by operation_id
    • Resolves the target service_instance
    • Marks child capability_instance rows as terminated
    • Marks the parent service_instance as terminated
    • Marks the service_order as completed
    • Includes a TF-SDK termination placeholder before child capability state updates
  • 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_at support for service/capability state updates
  • 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

Merge request reports

Loading
Loading