{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/karbonhq/json-schema/karbonhq-work-item-with-fee-settings-and-user-role-assignments-schema.json",
  "title": "WorkItemWithFeeSettingsAndUserRoleAssignments",
  "description": "A Work Item with Fee Settings and User Role assignments",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/karbonhq-work-items-api-openapi.yml#/components/schemas/WorkItemWithFeeSettingsAndUserRoleAssignments",
  "allOf": [
    {
      "$ref": "#/$defs/WorkItem"
    },
    {
      "$ref": "#/$defs/WorkFeeSettings"
    },
    {
      "$ref": "#/$defs/WorkItemUserRoleAssignments"
    }
  ],
  "$defs": {
    "WorkFeeSettings": {
      "description": "The Fee Settings for a Work Item",
      "properties": {
        "FeeSettings": {
          "description": "The Fee Settings describe how the work will be billed, for FixedFee work the Fee Settings can include the value to be billed",
          "type": "object",
          "properties": {
            "FeeType": {
              "type": "string",
              "description": "The way the fee is calculated for the Work Item",
              "enum": [
                "FixedFee",
                "TimeAndMaterials",
                "NonBillable"
              ]
            },
            "FeeValue": {
              "type": [
                "number",
                "null"
              ],
              "description": "The value of the fee in the currency of the Karbon account, this value must be null if FeeType is not FixedFee"
            }
          }
        }
      }
    },
    "WorkItem": {
      "description": "The base data for a Work Item",
      "required": [
        "ClientKey",
        "StartDate",
        "Title",
        "WorkItemKey"
      ],
      "type": "object",
      "properties": {
        "WorkItemKey": {
          "type": "string",
          "description": "A Karbon-generated unique identifier for the Work Item"
        },
        "AssigneeEmailAddress": {
          "type": "string",
          "description": "The email address of the user to whom the Work Item has been assigned"
        },
        "AssigneeKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the user to whom the Work Item has been assigned"
        },
        "AssigneeName": {
          "type": "string",
          "description": "The name of the user to whom the Work Item has been assigned"
        },
        "Title": {
          "type": "string",
          "description": "The title of the Work Item"
        },
        "ClientKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Client for whom the Work Item is prepared"
        },
        "ClientName": {
          "type": "string",
          "description": "The name of the Client for whom the Work Item is prepared"
        },
        "ClientType": {
          "type": "string",
          "enum": [
            "Contact",
            "Organization",
            "ClientGroup"
          ],
          "description": "The type of the Client"
        },
        "ClientUserDefinedIdentifier": {
          "type": "string",
          "description": "A unique identifier that you had created to identify the Client. This parameter is not case sensitive."
        },
        "RelatedClientGroupKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Client Group of the Client"
        },
        "ClientGroupKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Client Group of the Client"
        },
        "RelatedClientGroupName": {
          "type": "string",
          "description": "The name of the related Client Group"
        },
        "StartDate": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time at which the Work Item should start"
        },
        "DueDate": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time by which the Work Item should be complete"
        },
        "DeadlineDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The date and time by which the Work Item should be complete according to a party outside of your firm. e.g. A tax filing date or payroll processing cut-off date."
        },
        "CompletedDate": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time at which the Work Item was completed"
        },
        "ToDoPeriod": {
          "type": "string",
          "format": "date-time",
          "description": "The period, in which the Work Item should start."
        },
        "WorkType": {
          "type": "string",
          "description": "The type of work related to the Work Item"
        },
        "WorkStatus": {
          "type": "string",
          "description": "The current status of the Work Item"
        },
        "PrimaryStatus": {
          "type": "string",
          "enum": [
            "Planned",
            "ReadyToStart",
            "InProgress",
            "Waiting",
            "Completed"
          ],
          "description": "The current parent-level Status of the Work Item. If `WorkStatus` and `PrimaryStatus` have different values, `PrimaryStatus` will be the source of truth for Work Item status.\n"
        },
        "SecondaryStatus": {
          "type": "string",
          "description": "The current child-level Status of the Work Item"
        },
        "WorkTemplateKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Template that generated this Work Item"
        },
        "WorkTemplateTile": {
          "type": "string",
          "description": "The title of the Work Template"
        },
        "WorkScheduleKey": {
          "type": "string",
          "description": "A Karbon-generated value used to identify the Work Schedule for this Work Item"
        },
        "EstimatedBudget": {
          "deprecated": true,
          "type": "number",
          "format": "decimal",
          "description": "Deprecated! - previously used as the estimated budget for the Work Item"
        }
      }
    },
    "WorkItemUserRoleAssignments": {
      "description": "The User assignments for specific Roles on a Work Item",
      "properties": {
        "UserRoleAssignments": {
          "type": "array",
          "description": "The array that describes the roles of the users associated with this Work Item.",
          "items": {
            "type": "object",
            "required": [
              "RoleKey",
              "UserProfileKey"
            ],
            "properties": {
              "RoleKey": {
                "type": "string",
                "description": "A Karbon-generated value used to identify the role of the user"
              },
              "UserProfileKey": {
                "type": "string",
                "description": "A Karbon-generated value used to identify the user"
              }
            }
          }
        }
      }
    }
  }
}