Skip to content

domain-service

Stateless domain logic that does not belong to any single Aggregate. See Concepts: Domain Service.

Fields

Field Required Description
apiVersion yes schema.esdm.io/core/v1
kind yes domain-service
name yes The Domain Service name.
scope yes scope.boundedContext reference.
functions yes Non-empty list of operations the service offers.
description no Free-form prose.
metadata no Non-semantic labels and annotations.

functions[]

Each function declares its name, optionally its inputs and output, and a prose rule describing what it computes.

Field Required Description
name yes The function name.
inputs no JSON Schema describing the input parameters.
output no JSON Schema describing the result.
rule no Prose description of the function's behavior.

Example

apiVersion: schema.esdm.io/core/v1
kind: domain-service
name: course-rating
scope:
  domain: golf-club-management
  boundedContext: course-catalog
functions:
  - name: compute-slope-rating
    inputs:
      type: object
      properties:
        courseId: { type: string }
        teeBoxId: { type: string }
      required: [courseId, teeBoxId]
    output:
      type: object
      properties:
        slope: { type: number }
        rating: { type: number }
      required: [slope, rating]
    rule: Compute the USGA slope and course rating for the given tee box.