{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shepherd-vet/json-schema/shepherd-vet-restcollection-model-base-open-api-client-discount-controller-client-discount-schema.json",
  "title": "RESTCollectionModelBase_OpenApiClientDiscountController.ClientDiscount",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shepherd-vet-clientdiscount-api-openapi.yml#/components/schemas/RESTCollectionModelBase_OpenApiClientDiscountController.ClientDiscount",
  "type": "object",
  "properties": {
    "embed": {
      "type": "string"
    },
    "item": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OpenApiClientDiscountController.ClientDiscount"
      }
    },
    "page": {
      "format": "int32",
      "type": "integer"
    },
    "recordsPerPage": {
      "format": "int32",
      "type": "integer"
    },
    "searchQuery": {
      "type": "string"
    },
    "sort": {
      "type": "string"
    },
    "totalRecords": {
      "format": "int32",
      "type": "integer"
    }
  },
  "$defs": {
    "OpenApiClientDiscountController.Client": {
      "description": "Client REST model.",
      "type": "object",
      "properties": {
        "clientStatus": {
          "$ref": "#/$defs/OpenApiClientDiscountController.ClientStatus",
          "description": "The client status."
        },
        "clientStatusId": {
          "description": "The client status identifier.",
          "type": "string"
        },
        "email": {
          "description": "The email.",
          "type": "string"
        },
        "firstName": {
          "description": "The first name.",
          "type": "string"
        },
        "lastName": {
          "description": "The last name.",
          "type": "string"
        },
        "middleName": {
          "description": "The middle name.",
          "type": "string"
        },
        "dateCreated": {
          "format": "date-time",
          "type": "string"
        },
        "dateUpdated": {
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    },
    "OpenApiClientDiscountController.ClientDiscount": {
      "description": "ClientDiscount REST model. Represents a single shared discount record used for BOTH\nclient-level and patient-level discount assignments. The name keeps the legacy\nClientDiscount spelling for backwards compatibility, but the same record can be\nreferenced by either a client (clientDiscountId) or a patient (discountId\non the patient endpoint).",
      "required": [
        "name"
      ],
      "type": "object",
      "properties": {
        "amount": {
          "format": "int32",
          "description": "The discount Amount (percent) applied to eligible line items for either the client\nor the patient holding this assignment. Will be 0 if the discount is differentiated\nby ProductType. Embed \"clientDiscountProductTypes\" to get the per-type values.",
          "type": "integer"
        },
        "byProductType": {
          "description": "Boolean value indicating if a single default percent is used, or if the discount is\ndifferentiated by ProductType. Applies the same way to client-level and\npatient-level assignments.",
          "type": "boolean"
        },
        "clientDiscountProductTypes": {
          "description": "Discount product types. When ByProductType is true these provide the\nper-ProductType percent overrides used for both client-level and patient-level\nassignments.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/OpenApiClientDiscountController.ClientDiscountProductType"
          }
        },
        "clients": {
          "description": "Clients that currently have this discount assigned at the client level. Patient\nassignments are not listed here.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/OpenApiClientDiscountController.Client"
          }
        },
        "description": {
          "description": "The discount description.",
          "type": "string"
        },
        "isActive": {
          "description": "Value indicating whether this discount is currently active. Inactive discounts\nremain on existing client/patient records but no longer affect estimate or invoice\nline items.",
          "type": "boolean"
        },
        "isPetAssureDiscount": {
          "description": "Value indicating whether this discount is a Pet Assure discount. Pet Assure\ndiscounts are CLIENT-ONLY. They cannot be assigned at the patient level and are\nrejected by the patient endpoint.",
          "type": "boolean"
        },
        "name": {
          "description": "The discount's display name (used identically on client and patient assignments).",
          "type": "string"
        },
        "dateCreated": {
          "format": "date-time",
          "type": "string"
        },
        "dateUpdated": {
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    },
    "OpenApiClientDiscountController.ClientDiscountProductType": {
      "description": "ClientDiscountProductType REST model.",
      "type": "object",
      "properties": {
        "amount": {
          "format": "int32",
          "description": "The client discount product type amount",
          "type": "integer"
        },
        "productTypeId": {
          "format": "uuid",
          "description": "Product type identifier.",
          "type": "string"
        },
        "dateCreated": {
          "format": "date-time",
          "type": "string"
        },
        "dateUpdated": {
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    },
    "OpenApiClientDiscountController.ClientStatus": {
      "description": "ClientStatus REST model",
      "type": "object",
      "properties": {
        "abrv": {
          "description": "Short unique identifier for the lookup.",
          "type": "string"
        },
        "description": {
          "description": "The description of the lookup entry.",
          "type": "string"
        },
        "name": {
          "description": "The name of the lookup entry.",
          "type": "string"
        },
        "dateCreated": {
          "format": "date-time",
          "type": "string"
        },
        "dateUpdated": {
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "type": "string"
        }
      }
    }
  }
}