{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/karmacheck/json-schema/karmacheck-service-group-services-case-schema.json",
  "title": "ServiceGroupServicesCase",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/karmacheck-cases-api-openapi.yml#/components/schemas/ServiceGroupServicesCase",
  "allOf": [
    {
      "$ref": "#/$defs/ServiceGroupServicesAll"
    },
    {
      "type": "object",
      "required": [
        "serviceGroupServices"
      ],
      "properties": {
        "serviceGroupServices": {
          "type": "array",
          "description": "A list of services, each containing detailed information about a service.",
          "items": {
            "type": "object",
            "required": [
              "caseId",
              "packageName",
              "candidateId",
              "groupProfileId"
            ],
            "properties": {
              "caseId": {
                "type": "string"
              },
              "packageName": {
                "type": "string",
                "description": "The name of the package that was ordered for the case."
              },
              "candidateId": {
                "type": "string",
                "description": "The ID of the candidate that's associated with the case."
              },
              "groupProfileId": {
                "type": "string",
                "description": "The ID of the group that the case was ordered under."
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "ServiceCategory": {
      "title": "ServiceCategory",
      "type": "string",
      "description": "The category that a service belongs to.",
      "enum": [
        "Payment",
        "Identity Verification",
        "Criminal Check",
        "Motor Vehicle Record Check",
        "Verification",
        "Occupational Health Screening",
        "Professional License"
      ]
    },
    "ServiceCategoryId": {
      "title": "ServiceCategoryId",
      "type": "string",
      "description": "The unique ID of the service category.",
      "enum": [
        "service-cat-payment",
        "service-cat-idv",
        "service-cat-criminal",
        "service-cat-mvr",
        "service-cat-verification",
        "service-cat-ohs",
        "service-cat-pro-lic"
      ]
    },
    "ServiceGroupServicesAll": {
      "title": "ServiceGroupServicesAll",
      "type": "object",
      "required": [
        "serviceGroupServices"
      ],
      "properties": {
        "serviceGroupServices": {
          "type": "array",
          "description": "A list of services, each containing detailed information about a service.",
          "items": {
            "type": "object",
            "required": [
              "serviceGroupId",
              "serviceGroupName",
              "serviceGroupDescription",
              "serviceId",
              "serviceName",
              "serviceDescription",
              "serviceTypeId",
              "serviceTypeName",
              "serviceGroupEnabled",
              "serviceEnabled",
              "serviceAutoProcessEnabled",
              "serviceTypeEnabled",
              "conditional",
              "defaultSelected",
              "enabled",
              "serviceGroupServicesId"
            ],
            "properties": {
              "serviceGroupId": {
                "type": "string"
              },
              "serviceGroupName": {
                "type": "string"
              },
              "serviceGroupPrice": {
                "type": "number",
                "description": "The price of the package in United States cents. This is the price that candidates will pay via Stripe during onboarding to begin their check. Customers can request that a price be set on a package to pass on some or all of the price of the check to the candidate."
              },
              "serviceGroupDescription": {
                "type": "string"
              },
              "serviceId": {
                "type": "string",
                "description": "The unique ID of the service. See [Service](docs/reference/service.md) for a list of possible services."
              },
              "serviceName": {
                "type": "string",
                "description": "The name of the service."
              },
              "serviceDescription": {
                "type": "string"
              },
              "serviceTypeId": {
                "$ref": "#/$defs/ServiceTypeId"
              },
              "serviceTypeName": {
                "$ref": "#/$defs/ServiceTypeName"
              },
              "serviceSubTypeId": {
                "type": "string",
                "enum": [
                  "jurisdiction-nationwide",
                  "jurisdiction-district",
                  "jurisdiction-statewide"
                ],
                "description": "The ID of the subtype for the service. This is applicable only when `serviceId` is `ee774b82-a411-4e2b-a38f-c0641bd836e7` (Federal Criminal Search)."
              },
              "serviceSubTypeName": {
                "type": "string",
                "enum": [
                  "Nationwide",
                  "District",
                  "Statewide"
                ],
                "description": "The service subtype."
              },
              "serviceGroupEnabled": {
                "type": "boolean"
              },
              "serviceEnabled": {
                "type": "boolean"
              },
              "serviceAutoProcessEnabled": {
                "type": "boolean",
                "description": "True if the service is available for a case that's ordered using the PII entry flow. False if the service is unavailable when using the PII entry flow."
              },
              "serviceTypeEnabled": {
                "type": "boolean"
              },
              "serviceCategory": {
                "$ref": "#/$defs/ServiceCategory"
              },
              "serviceCategoryId": {
                "$ref": "#/$defs/ServiceCategoryId"
              },
              "serviceSubCategory": {
                "$ref": "#/$defs/ServiceSubCategory"
              },
              "serviceSubCategoryId": {
                "$ref": "#/$defs/ServiceSubCategoryId"
              },
              "conditional": {
                "type": "boolean",
                "description": "True if the service is available only when adding to an order; false otherwise. A conditional service indicates that another service needs to run before this service can run."
              },
              "defaultSelected": {
                "type": "boolean",
                "description": "True if the service is selected by default when a dashboard user selects the package for a case; false otherwise."
              },
              "enabled": {
                "type": "boolean",
                "description": "True if the service is enabled for the package; false otherwise."
              },
              "serviceGroupServicesId": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "ServiceSubCategory": {
      "title": "ServiceSubCategory",
      "type": "string",
      "description": "The subcategory that a service belongs to.",
      "enum": [
        "Drug Screening",
        "TB",
        "Titer",
        "Vaccination",
        "Physical"
      ]
    },
    "ServiceSubCategoryId": {
      "title": "ServiceSubCategoryId",
      "type": "string",
      "description": "The unique ID of the service subcategory.",
      "enum": [
        "service-subcat-drug",
        "service-subcat-tb",
        "service-subcat-titer",
        "service-subcat-vacc",
        "service-subcat-physical"
      ]
    },
    "ServiceTypeId": {
      "title": "ServiceTypeId",
      "type": "string",
      "description": "The unique ID of the service type. A service can be one of the following types: screening, legal, payment, identity, or shipment.",
      "enum": [
        "30bc2c03-c8dd-409a-8da6-e0070ea6a681",
        "a3b74b1b-b665-40be-bad2-2a49c801cf3f",
        "service-type-payment",
        "service-type-idv",
        "service-type-shipment"
      ]
    },
    "ServiceTypeName": {
      "title": "ServiceTypeName",
      "type": "string",
      "description": "The type of service.",
      "enum": [
        "Screening",
        "Legal",
        "Payment",
        "Identity",
        "Shipment"
      ]
    }
  }
}