{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assetlab-ca/json-schema/assetlab-ca-asset-lifecycle-event-create-schema.json",
  "title": "AssetLifecycleEventCreate",
  "description": "Exactly one of `asset_type_id` / `asset_type_group_id` is required.\n`impact_add_years` is required for `add_years`, `impact_reset_to` for\n`reset_condition`. `cost_reviewed_on` is server-set.\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/AssetLifecycleEventCreate",
  "type": "object",
  "required": [
    "name",
    "event_class",
    "trigger_condition_max",
    "impact_method"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 200
    },
    "asset_type_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "asset_type_group_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "event_class": {
      "type": "string",
      "enum": [
        "preventive",
        "rehabilitation"
      ]
    },
    "trigger_condition_max": {
      "type": "integer",
      "minimum": 1,
      "maximum": 99
    },
    "trigger_condition_min": {
      "type": "integer",
      "minimum": 0,
      "maximum": 98,
      "default": 0
    },
    "impact_method": {
      "type": "string",
      "enum": [
        "add_years",
        "reset_condition"
      ]
    },
    "impact_add_years": {
      "type": [
        "number",
        "null"
      ],
      "exclusiveMinimum": 0,
      "maximum": 100
    },
    "impact_reset_to": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 100
    },
    "fixed_cost": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "cost_source": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200
    },
    "max_applications": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "default": 1
    },
    "min_years_between": {
      "type": "number",
      "minimum": 1,
      "maximum": 100,
      "default": 1
    },
    "sort_order": {
      "type": "integer",
      "minimum": 0
    },
    "is_active": {
      "type": "boolean",
      "default": true
    },
    "work_generation": {
      "type": "string",
      "enum": [
        "none",
        "work_order",
        "project"
      ],
      "default": "none"
    },
    "work_generation_category_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "work_generation_priority": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "LOW",
        "MEDIUM",
        "HIGH",
        "URGENT"
      ]
    }
  }
}