{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-data-crew-timesheets-with-keys-schema.json",
  "title": "data_crew_timesheets_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_crew_timesheets_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_crew_timesheets"
    }
  ],
  "$defs": {
    "data_crew_timesheets": {
      "required": [
        "PRCo",
        "Crew",
        "PostDate",
        "SheetNum",
        "JCCo",
        "Job",
        "Shift",
        "PhaseGroup",
        "Status",
        "KeyID"
      ],
      "type": "object",
      "properties": {
        "PRCo": {
          "type": "integer",
          "description": "Payroll company. Parent crews(PRCo, Crew) must exist."
        },
        "Crew": {
          "maxLength": 10,
          "type": "string",
          "description": "Crew identifier. Key to pr/crews(PRCo, Crew)."
        },
        "PostDate": {
          "type": "string",
          "description": "Sheet post date (bPRRH.PostDate).",
          "format": "datetime"
        },
        "SheetNum": {
          "type": "integer",
          "description": "Sheet number within crew and post date (bPRRH.SheetNum). Sheet 1 holds standard phases from PR Crews."
        },
        "PRGroup": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Payroll group."
        },
        "JCCo": {
          "type": "integer",
          "description": "Job Cost company on the sheet header."
        },
        "Job": {
          "maxLength": 10,
          "type": "string",
          "description": "Job on the sheet header."
        },
        "Shift": {
          "type": "integer",
          "description": "Shift."
        },
        "PhaseGroup": {
          "type": "integer",
          "description": "Phase group."
        },
        "Phase1": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Phase1Units": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal value as string."
        },
        "Phase1CostType": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "Phase2": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Phase2Units": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal value as string."
        },
        "Phase2CostType": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "Phase3": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Phase3Units": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal value as string."
        },
        "Phase3CostType": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "Phase4": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Phase4Units": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal value as string."
        },
        "Phase4CostType": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "Phase5": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Phase5Units": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal value as string."
        },
        "Phase5CostType": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "Phase6": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Phase6Units": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal value as string."
        },
        "Phase6CostType": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "Phase7": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Phase7Units": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal value as string."
        },
        "Phase7CostType": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "Phase8": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Phase8Units": {
          "type": [
            "string",
            "null"
          ],
          "description": "Decimal value as string."
        },
        "Phase8CostType": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "CreatedOn": {
          "type": "string",
          "description": "Created timestamp.",
          "format": "datetime"
        },
        "CreatedBy": {
          "maxLength": 128,
          "type": "string",
          "description": ""
        },
        "ApprovedBy": {
          "maxLength": 128,
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "Status": {
          "maximum": 4,
          "minimum": 0,
          "type": "integer",
          "description": "Timesheet workflow status (bPRRH.Status). 0=Initialized, 1=AwaitingApproval, 2=ReadyToSend, 3=SendInProgress, 4=SendComplete."
        },
        "SendSeq": {
          "type": [
            "integer",
            "null"
          ],
          "description": ""
        },
        "PRBatchMth": {
          "type": [
            "string",
            "null"
          ],
          "description": "PR batch month when sent.",
          "format": "datetime"
        },
        "PRBatchId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "PR batch id when sent."
        },
        "Notes": {
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "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": ""
        },
        "KeyID": {
          "type": "integer",
          "description": "Surrogate KeyID."
        },
        "EmployeeHours": {
          "type": "array",
          "items": {
            "required": [
              "Employee",
              "LineSeq",
              "KeyID"
            ],
            "type": "object",
            "properties": {
              "Employee": {
                "type": "integer",
                "description": "Employee number."
              },
              "LineSeq": {
                "type": "integer",
                "description": "Line sequence within sheet/employee."
              },
              "Craft": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Class": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Phase1RegHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase1OTHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase1DblHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase2RegHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase2OTHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase2DblHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase3RegHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase3OTHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase3DblHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase4RegHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase4OTHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase4DblHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase5RegHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase5OTHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase5DblHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase6RegHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase6OTHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase6DblHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase7RegHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase7OTHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase7DblHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase8RegHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase8OTHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase8DblHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "RegRate": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "OTRate": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "DblRate": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "TotalHrs": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "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": ""
              },
              "KeyID": {
                "type": "integer",
                "description": "Surrogate KeyID."
              },
              "__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": "Employee Hours tab row (PRRE)."
          },
          "description": "Employee Hours tab (PRRE). Present when the sheet has employee hours."
        },
        "EquipmentUsage": {
          "type": "array",
          "items": {
            "required": [
              "EMCo",
              "EMGroup",
              "Equipment",
              "LineSeq",
              "KeyID"
            ],
            "type": "object",
            "properties": {
              "EMCo": {
                "type": "integer",
                "description": ""
              },
              "EMGroup": {
                "type": "integer",
                "description": ""
              },
              "Equipment": {
                "maxLength": 10,
                "type": "string",
                "description": ""
              },
              "Employee": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Employee number."
              },
              "Phase1Usage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase1CType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": ""
              },
              "Phase1Rev": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Phase2Usage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase2CType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": ""
              },
              "Phase2Rev": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Phase3Usage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase3CType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": ""
              },
              "Phase3Rev": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Phase4Usage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase4CType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": ""
              },
              "Phase4Rev": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Phase5Usage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase5CType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": ""
              },
              "Phase5Rev": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Phase6Usage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase6CType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": ""
              },
              "Phase6Rev": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Phase7Usage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase7CType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": ""
              },
              "Phase7Rev": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Phase8Usage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase8CType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": ""
              },
              "Phase8Rev": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "LineSeq": {
                "type": "integer",
                "description": "Line sequence within sheet/employee."
              },
              "TotalUsage": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "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": ""
              },
              "KeyID": {
                "type": "integer",
                "description": "Surrogate KeyID."
              },
              "__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": "Equipment Usage tab row (PRRQ)."
          },
          "description": "Equipment Usage tab (PRRQ). Present when the sheet has equipment usage."
        },
        "NonJobEarnings": {
          "type": "array",
          "items": {
            "required": [
              "Employee",
              "LineSeq",
              "EarnCode",
              "Hours",
              "StdPayRate",
              "KeyID"
            ],
            "type": "object",
            "properties": {
              "Employee": {
                "type": "integer",
                "description": "Employee number."
              },
              "LineSeq": {
                "type": "integer",
                "description": "Line sequence within sheet/employee."
              },
              "Craft": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Class": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "EarnCode": {
                "type": "integer",
                "description": "Earn code."
              },
              "Hours": {
                "type": "string",
                "description": "Decimal value as string."
              },
              "StdPayRate": {
                "maxLength": 1,
                "enum": [
                  "Y",
                  "N"
                ],
                "type": "string",
                "description": "Use standard pay rate (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": ""
              },
              "KeyID": {
                "type": "integer",
                "description": "Surrogate KeyID."
              },
              "__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": "Non-Job Earnings tab row (PRRN)."
          },
          "description": "Non-Job Earnings tab (PRRN). Present when the sheet has non-job earnings."
        },
        "OtherJobEarnings": {
          "type": "array",
          "items": {
            "required": [
              "Employee",
              "LineSeq",
              "EarnCode",
              "KeyID"
            ],
            "type": "object",
            "properties": {
              "Employee": {
                "type": "integer",
                "description": "Employee number."
              },
              "LineSeq": {
                "type": "integer",
                "description": "Line sequence within sheet/employee."
              },
              "Craft": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "Class": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              },
              "EarnCode": {
                "type": "integer",
                "description": "Earn code."
              },
              "Phase1Value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase2Value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase3Value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase4Value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase5Value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase6Value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase7Value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "Phase8Value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Decimal value as string."
              },
              "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": ""
              },
              "KeyID": {
                "type": "integer",
                "description": "Surrogate KeyID."
              },
              "__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": "Other Job Earnings tab row (PRRO). Phase values are hours/amounts against header phases."
          },
          "description": "Other Job Earnings tab (PRRO). Present when the sheet has other job earnings."
        },
        "__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."
        }
      }
    }
  }
}