{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-worksheet-amendment-schema.json",
  "title": "worksheetAmendment",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-financials-api-openapi.yml#/components/schemas/worksheetAmendment",
  "allOf": [
    {
      "$ref": "#/$defs/worksheetAmendmentLink"
    },
    {
      "type": "object",
      "properties": {
        "jobId": {
          "type": "string",
          "format": "uuid",
          "description": "The unique identifier of the Amendment."
        },
        "currentState": {
          "type": "string",
          "description": "The current state of the Amendment."
        },
        "totalPrice": {
          "type": "number",
          "description": "The total price of the Amendment."
        },
        "title": {
          "type": "string",
          "description": "The title of the Amendment."
        },
        "createdDate": {
          "type": "string",
          "description": "The date/time the Amendment was created in UTC format."
        },
        "modifiedDate": {
          "type": "string",
          "description": "The date/time the Amendment was last modified in UTC format."
        },
        "sections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/worksheetSection"
          }
        }
      }
    }
  ],
  "$defs": {
    "worksheetAmendmentLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The unique identifier of the Amendment."
        },
        "_link": {
          "type": "string",
          "description": "The unique URI of the Amendment."
        }
      }
    },
    "worksheetItem": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The unique ID for the item."
        },
        "itemName": {
          "type": "string",
          "description": "The name of the item."
        },
        "price": {
          "type": "number",
          "description": "The user entered price for this item."
        },
        "totalPrice": {
          "type": "number",
          "description": "Represents the contribution to the total of this Worksheet."
        },
        "parentItemId": {
          "type": "string",
          "description": "The unique ID for the parent item of this item."
        },
        "hierarchySortOrder": {
          "type": "number",
          "description": "Represents the user set sort order defined on this Worksheet."
        },
        "tradeId": {
          "type": "string",
          "format": "uuid",
          "description": "The unique ID for the trade of this item."
        }
      }
    },
    "worksheetSection": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The unique ID for the Worksheet section."
        },
        "sectionType": {
          "type": "string",
          "description": "An identifier for the type of Worksheet section.",
          "enum": [
            "Invoice",
            "Work Not Doing",
            "Supplements",
            "Discounts",
            "Upgrades",
            "Change Order",
            "Worksheet",
            "Insurance Claim"
          ]
        },
        "totalPrice": {
          "type": "number",
          "description": "The total price of this Worksheet worksheet section."
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/worksheetItem"
          }
        }
      }
    }
  }
}