{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-data-projection-totals-with-keys-schema.json",
  "title": "data_projection_totals_withKeys",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimble-vista-jc-openapi.yml#/components/schemas/data_projection_totals_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_projection_totals"
    }
  ],
  "$defs": {
    "data_projection_totals": {
      "title": "JC Projection Totals Cache Record",
      "required": [
        "JCCo",
        "Job",
        "PhaseGroup",
        "Phase",
        "CostType",
        "LastProjectedMth",
        "ProjHours",
        "ProjUnits",
        "ProjCost"
      ],
      "type": "object",
      "properties": {
        "JCCo": {
          "maximum": 255,
          "minimum": 1,
          "type": "integer",
          "description": "Job Cost company."
        },
        "Job": {
          "maxLength": 10,
          "type": "string",
          "description": "Job number. Key to jc/jobs(JCCo, Job)."
        },
        "PhaseGroup": {
          "type": "integer",
          "description": "Phase group. Key to jc/job_phases(JCCo, Job, PhaseGroup, Phase)."
        },
        "Phase": {
          "maxLength": 20,
          "type": "string",
          "description": "Phase. Key to jc/job_phases(JCCo, Job, PhaseGroup, Phase)."
        },
        "CostType": {
          "type": "integer",
          "description": "Cost type. Key to jc/cost_types(PhaseGroup, CostType)."
        },
        "LastProjectedMth": {
          "pattern": "^([0-9]{4})-(1[0-2]|0[1-9])-01$",
          "type": "string",
          "description": "Latest projected month for this job/phase/cost type (YYYY-MM-01). Month where ProjHours, ProjUnits, or ProjCost were last non-zero.",
          "format": "date"
        },
        "ProjHours": {
          "pattern": "^[-+]?[0-9]{1,9}(?:.[0-9]{0,2})?$",
          "type": "string",
          "description": "Summed projected hours at LastProjectedMth (numeric)."
        },
        "ProjUnits": {
          "pattern": "^[-+]?[0-9]{1,9}(?:.[0-9]{0,3})?$",
          "type": "string",
          "description": "Summed projected units at LastProjectedMth (numeric)."
        },
        "ProjCost": {
          "pattern": "^[-+]?[0-9]{1,12}(?:.[0-9]{0,2})?$",
          "type": "string",
          "description": "Summed projected cost at LastProjectedMth (numeric)."
        }
      },
      "additionalProperties": false,
      "description": "Current cost projection totals per job, phase, and cost type. Derived from JCCP: identifies the latest projected month with non-zero ProjHours, ProjUnits, or ProjCost, then returns summed projection amounts at that month."
    }
  }
}