{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-data-automatic-earnings-with-keys-schema.json",
  "title": "data_automatic_earnings_withKeys",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimble-vista-pr-openapi.yml#/components/schemas/data_automatic_earnings_withKeys",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "__ryvitKeys": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Array of key paths that can be used to retrieve this object."
        },
        "__modifiedUTC": {
          "type": "string",
          "description": "UTC timestamp of when this object was last modified in the cache."
        }
      }
    },
    {
      "$ref": "#/$defs/data_automatic_earnings"
    }
  ],
  "$defs": {
    "data_automatic_earnings": {
      "title": "Automatic Earnings Cache Record Schema",
      "required": [
        "PRCo",
        "Employee",
        "EarnCode",
        "Seq",
        "StdHours",
        "RateAmt",
        "LimitOvrAmt",
        "Frequency",
        "OvrStdLimitYN",
        "EquipMechOpt",
        "KeyID",
        "UseRegRate"
      ],
      "type": "object",
      "properties": {
        "PRCo": {
          "maximum": 255,
          "minimum": 0,
          "type": "integer",
          "description": "Payroll Company ID"
        },
        "Employee": {
          "type": "integer",
          "description": "Employee ID"
        },
        "EarnCode": {
          "type": "integer",
          "description": "Earning or Deduction Code"
        },
        "Seq": {
          "maximum": 255,
          "minimum": 0,
          "type": "integer",
          "description": "Sequence"
        },
        "PaySeq": {
          "maximum": 255,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ],
          "description": "Pay Sequence"
        },
        "PRDept": {
          "maxLength": 10,
          "type": [
            "string",
            "null"
          ],
          "description": "Payroll Department"
        },
        "InsCode": {
          "maxLength": 10,
          "type": [
            "string",
            "null"
          ],
          "description": "Insurance Code"
        },
        "Craft": {
          "maxLength": 10,
          "type": [
            "string",
            "null"
          ],
          "description": "Craft"
        },
        "Class": {
          "maxLength": 10,
          "type": [
            "string",
            "null"
          ],
          "description": "Class"
        },
        "JCCo": {
          "maximum": 255,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ],
          "description": "Job Cost Company ID"
        },
        "Job": {
          "maxLength": 10,
          "type": [
            "string",
            "null"
          ],
          "description": "Job ID"
        },
        "PhaseGroup": {
          "maximum": 255,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ],
          "description": "Phase Group"
        },
        "Phase": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": "Phase"
        },
        "GLCo": {
          "maximum": 255,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ],
          "description": "GL Company ID"
        },
        "EMCo": {
          "maximum": 255,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ],
          "description": "Equipment Management Company ID"
        },
        "Equipment": {
          "maxLength": 10,
          "type": [
            "string",
            "null"
          ],
          "description": "Equipment ID"
        },
        "EMGroup": {
          "maximum": 255,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ],
          "description": "Equipment Management Group"
        },
        "RevCode": {
          "maxLength": 10,
          "type": [
            "string",
            "null"
          ],
          "description": "Revenue Code"
        },
        "UsageUnits": {
          "pattern": "^[-+]?[0-9]{1,8}(?:.[0-9]{0,2})?$",
          "type": [
            "string",
            "null"
          ],
          "description": "Usage Units"
        },
        "StdHours": {
          "enum": [
            "Y",
            "N"
          ],
          "type": "string",
          "description": "Standard Hours Flag"
        },
        "Hours": {
          "pattern": "^[-+]?[0-9]{1,8}(?:.[0-9]{0,2})?$",
          "type": [
            "string",
            "null"
          ],
          "description": "Hours"
        },
        "RateAmt": {
          "pattern": "^[-+]?[0-9]{1,11}(?:.[0-9]{0,5})?$",
          "type": "string",
          "description": "Rate Amount"
        },
        "LimitOvrAmt": {
          "pattern": "^[-+]?[0-9]{1,10}(?:.[0-9]{0,2})?$",
          "type": "string",
          "description": "Limit Override Amount"
        },
        "Frequency": {
          "maxLength": 10,
          "type": "string",
          "description": "Frequency"
        },
        "Notes": {
          "type": [
            "string",
            "null"
          ],
          "description": "Notes"
        },
        "OvrStdLimitYN": {
          "enum": [
            "Y",
            "N"
          ],
          "type": "string",
          "description": "Override Standard Limit Y/N"
        },
        "UniqueAttchID": {
          "maxLength": 36,
          "minLength": 36,
          "pattern": "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}",
          "type": [
            "string",
            "null"
          ],
          "description": "Unique Attachment ID"
        },
        "MechanicsCC": {
          "maxLength": 10,
          "type": [
            "string",
            "null"
          ],
          "description": "Mechanics Cost Code"
        },
        "EquipMechOpt": {
          "maxLength": 1,
          "type": "string",
          "description": "Equipment Mechanic Option"
        },
        "KeyID": {
          "type": "integer",
          "description": "Key ID - likely a surrogate key"
        },
        "UseRegRate": {
          "enum": [
            "Y",
            "N"
          ],
          "type": "string",
          "description": "Use Regular Rate Y/N"
        },
        "__custom_fields": {
          "type": "object",
          "description": "This property will be added if there are any custom fields defined for this object in Vista. Each custom field will be a property of this object."
        }
      },
      "description": "Schema for a single record from the dbo.PRAE table, intended for cache validation."
    }
  }
}