{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arkrel-com/json-schema/arkrel-com-category-rule-patch-input-schema.json",
  "title": "CategoryRulePatchInput",
  "description": "A true partial update. Only the fields you send are changed; every other field keeps its current value. At least one field is required (a body that would change nothing is rejected). `client_id` is set once at creation and can't be changed here. See CategoryRuleInput.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arkrel-com-category-rules-api-openapi.yml#/components/schemas/CategoryRulePatchInput",
  "type": "object",
  "anyOf": [
    {
      "required": [
        "match_field"
      ]
    },
    {
      "required": [
        "pattern_type"
      ]
    },
    {
      "required": [
        "pattern"
      ]
    },
    {
      "required": [
        "amount_direction"
      ]
    },
    {
      "required": [
        "min_amount"
      ]
    },
    {
      "required": [
        "max_amount"
      ]
    },
    {
      "required": [
        "account_id"
      ]
    },
    {
      "required": [
        "is_transfer"
      ]
    },
    {
      "required": [
        "priority"
      ]
    },
    {
      "required": [
        "active"
      ]
    }
  ],
  "properties": {
    "match_field": {
      "type": "string",
      "enum": [
        "description",
        "payee"
      ]
    },
    "pattern_type": {
      "type": "string",
      "enum": [
        "contains",
        "starts_with",
        "exact",
        "regex"
      ]
    },
    "pattern": {
      "type": "string",
      "minLength": 1
    },
    "amount_direction": {
      "type": "string",
      "enum": [
        "any",
        "credit",
        "debit"
      ]
    },
    "min_amount": {
      "type": [
        "number",
        "null"
      ]
    },
    "max_amount": {
      "type": [
        "number",
        "null"
      ]
    },
    "account_id": {
      "type": "string",
      "minLength": 1
    },
    "is_transfer": {
      "type": "boolean"
    },
    "priority": {
      "type": "integer"
    },
    "active": {
      "type": "boolean"
    }
  }
}