{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assetlab-ca/json-schema/assetlab-ca-asset-lifecycle-event-schema.json",
  "title": "AssetLifecycleEvent",
  "description": "One event of a facility lifecycle strategy — a condition-triggered maintenance or\nrehabilitation intervention (\"Roof recoat at condition 70-85 adds 5 years\").\nEvents are keyed on an asset-type scope — exactly one of `asset_type_id` or\n`asset_type_group_id` — never on individual assets: an asset resolves its type's\nown strategy first, else its type group's, and tiers never blend. Costs are a\nfixed amount per application (assets carry no units). Replacement is deliberately\nnot an event — it stays the renewal forecast and the asset's replacement value.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assetlab-ca-asset-lifecycle-events-api-openapi.yml#/components/schemas/AssetLifecycleEvent",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "asset_type_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Asset type the scope applies to (type-level strategy)"
    },
    "asset_type_group_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Asset type group the scope applies to (group-level strategy)"
    },
    "name": {
      "type": "string"
    },
    "event_class": {
      "type": "string",
      "enum": [
        "preventive",
        "rehabilitation"
      ]
    },
    "trigger_condition_max": {
      "type": "integer",
      "description": "Fires when projected condition falls to this"
    },
    "trigger_condition_min": {
      "type": "integer",
      "description": "An asset already below this has missed the event"
    },
    "impact_method": {
      "type": "string",
      "enum": [
        "add_years",
        "reset_condition"
      ]
    },
    "impact_add_years": {
      "type": [
        "number",
        "null"
      ]
    },
    "impact_reset_to": {
      "type": [
        "integer",
        "null"
      ]
    },
    "fixed_cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "Per application, in current-year money; never indexed for inflation. Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "cost_source": {
      "type": [
        "string",
        "null"
      ],
      "description": "Provenance of the cost (e.g. \"Engineering 2026\")"
    },
    "cost_reviewed_on": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Server-set on every write — writing an event confirms its cost"
    },
    "max_applications": {
      "type": "integer"
    },
    "min_years_between": {
      "type": "number"
    },
    "sort_order": {
      "type": "integer"
    },
    "work_generation": {
      "type": "string",
      "enum": [
        "none",
        "work_order",
        "project"
      ],
      "description": "What a due application becomes when created from the interventions list; nothing is created on a schedule"
    },
    "work_generation_category_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Work category for generated work orders"
    },
    "work_generation_priority": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "LOW",
        "MEDIUM",
        "HIGH",
        "URGENT"
      ]
    },
    "is_active": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}