Diffo.Provider.Service (Diffo v0.7.0)

Copy Markdown View Source

Ash Resource Fragment for the Service half of the Instance cascade (TMF638).

Compose with Diffo.Provider.BaseInstance on a concrete Service leaf to get the service lifecycle state machine, the state / operating_status attributes, the service lifecycle actions, and the TMF638-shaped jason wire form:

defmodule MyApp.Broadband do
  use Ash.Resource,
    fragments: [Diffo.Provider.BaseInstance, Diffo.Provider.Service],
    domain: MyApp.Domain

  provider do
    specification do
      id "..."
      name "broadband"
      type :serviceSpecification
    end
    # characteristics / features / parties / places / behaviour ...
  end
end

BaseInstance carries everything shared with Resources (identity, the graph relationships, the provider do Extension DSL, build wiring, shared actions). This fragment carries only what is service-specific.

State machine

state (TMF638 ServiceStateType) is wrapped by AshStateMachine: initial → feasibilityChecked → reserved → inactive → active → suspended → terminated, plus cancel. A service terminates or cancels — it never "retires" (retirement is a Specification concept). operating_status (ServiceOperatingStatusType) is an orthogonal status, not part of the machine.

See Diffo.Provider.ServiceState for the state / operating-status vocabulary.

Summary

Functions

extensions()

opts()

persisted()

spark_dsl_config()

validate_sections()