{
  "openapi": "3.1.1",
  "info": {
    "title": "PawthosX.Business.API | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.clinicos.vet/backend/business",
      "description": "Production server"
    }
  ],
  "paths": {
    "/admin/s3/buckets/{bucketName}/cors": {
      "post": {
        "tags": [
          "AdminS3"
        ],
        "summary": "Configure CORS on an S3 bucket to allow access from clinicos.vet subdomains.\nThis should be called once per bucket, typically during tenant provisioning.",
        "parameters": [
          {
            "name": "bucketName",
            "in": "path",
            "description": "The S3 bucket name to configure",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "tags": [
          "AdminS3"
        ],
        "summary": "Check if a bucket has CORS configured.",
        "parameters": [
          {
            "name": "bucketName",
            "in": "path",
            "description": "The S3 bucket name to check",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tenants/{tenantId}/api-keys": {
      "get": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Lists all API keys for a tenant.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "The tenant ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of API keys (without the actual key values).",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyListItem"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyListItem"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyListItem"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Creates a new API key for the tenant.\nIMPORTANT: The full API key is only returned once during creation.\nStore it securely - you cannot retrieve it again.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "The tenant ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The create request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tenants/{tenantId}/api-keys/{keyHash}": {
      "get": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Gets details of a specific API key.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "The tenant ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyHash",
            "in": "path",
            "description": "The key hash (identifier).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Revokes an API key permanently.\nThe key can no longer be used and cannot be reactivated.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "The tenant ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyHash",
            "in": "path",
            "description": "The key hash (identifier).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tenants/{tenantId}/api-keys/{keyHash}/suspend": {
      "post": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Suspends an API key (temporarily disables it).\nThe key can be reactivated later.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "The tenant ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyHash",
            "in": "path",
            "description": "The key hash (identifier).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tenants/{tenantId}/api-keys/{keyHash}/reactivate": {
      "post": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Reactivates a suspended API key.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "The tenant ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyHash",
            "in": "path",
            "description": "The key hash (identifier).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRecord"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tenants/{tenantId}/api-keys/{keyHash}/regenerate": {
      "post": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Regenerates an API key (creates a new key and revokes the old one).\nIMPORTANT: The new API key is only returned once. Store it securely.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "The tenant ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyHash",
            "in": "path",
            "description": "The key hash of the key to regenerate.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Get a paginated and filtered list of appointments",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by appointment status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Filter by client ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "description": "Filter by patient ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Filter by location ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assignedToId",
            "in": "query",
            "description": "Filter by assigned provider ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term for client/patient name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of appointments",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Create a new appointment with schedule item",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppointmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppointmentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppointmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Get a single appointment by ID with basic information",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The appointment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Appointments"
        ],
        "summary": "Update an existing appointment and optionally its schedule item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentWithScheduleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentWithScheduleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentWithScheduleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Appointments"
        ],
        "summary": "Delete an appointment and its schedule item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Appointments/{id}/detail": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Get a single appointment by ID with detailed information (vitals, forms, SOAP notes)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The appointment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentDetailDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/import-historical": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Import a historical (already-occurred) visit as a Completed appointment (ITE-260).\nSkips the schedule-conflict check — batch imports of past history are expected to\noverlap each other and existing bookings. The backing schedule item is created\nwithout a location (exempt from the overlap EXCLUDE constraint, invisible to\nroom-scoped calendar views) and stamped CreatedBySource = \"import\".",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportHistoricalAppointmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportHistoricalAppointmentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ImportHistoricalAppointmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/discharge": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Get discharge document for an appointment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The appointment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeDocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/check-in": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Check in an appointment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/uncheck-in": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Undo a check-in done by mistake (status: CheckedIn → Scheduled)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/start": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Start an appointment (move to in-progress)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/complete": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Complete an appointment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CompleteAppointmentRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CompleteAppointmentRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CompleteAppointmentRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/discharge-checklist": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Evaluate the \"Missing Before Discharge\" safety checklist for an appointment (PAW-628).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeChecklistDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeChecklistDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeChecklistDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/discharge-checklist/override": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Override a required discharge-checklist item with a reason (PAW-628). Records an\naudit entry; the override unblocks the item for completion.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OverrideChecklistItemRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OverrideChecklistItemRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OverrideChecklistItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeChecklistItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeChecklistItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DischargeChecklistItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/cancel": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Cancel an appointment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CancelAppointmentRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CancelAppointmentRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CancelAppointmentRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/no-show": {
      "post": {
        "tags": [
          "Appointments"
        ],
        "summary": "Mark appointment as no-show",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/NoShowAppointmentRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/NoShowAppointmentRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/NoShowAppointmentRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/dispensed-items": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Get all dispensed inventory items for an appointment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The appointment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of dispensed items with billing status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DispensedItemDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DispensedItemDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DispensedItemDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/consent-events": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Returns the consent audit trail for the treatment plan attached to this\nappointment. Returns an empty list when no plan exists. Used by the\nChronicle and Schedule consent viewer modals.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateConsentEventListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateConsentEventListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateConsentEventListResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/dispensed-items/{transactionId}/billing": {
      "patch": {
        "tags": [
          "Appointments"
        ],
        "summary": "Update the billing status of a dispensed item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The appointment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "transactionId",
            "in": "path",
            "description": "The inventory transaction ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The billing status update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDispensedItemBillingDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDispensedItemBillingDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDispensedItemBillingDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/{id}/dispensed-items/{transactionId}": {
      "patch": {
        "tags": [
          "Appointments"
        ],
        "summary": "Update a dispensed item's dispense type and prescription details",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The appointment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "transactionId",
            "in": "path",
            "description": "The inventory transaction ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The dispense type and prescription update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDispensedItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDispensedItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDispensedItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DispensedItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispensedItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispensedItemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Appointments/previous-travel-destination": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Get the previous travel destination for a staff member on a given date.\nUsed for chaining travel appointments (use last destination as next starting point).",
        "parameters": [
          {
            "name": "staffId",
            "in": "query",
            "description": "The staff member ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "The date to check (YYYY-MM-DD format)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "beforeTime",
            "in": "query",
            "description": "Optional: only consider appointments ending before this time (ISO 8601 format)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Previous travel destination information if found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PreviousTravelDestinationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviousTravelDestinationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviousTravelDestinationDto"
                }
              }
            }
          }
        }
      }
    },
    "/appointment-types": {
      "get": {
        "tags": [
          "AppointmentTypes"
        ],
        "summary": "Get all appointment types",
        "responses": {
          "200": {
            "description": "List of all appointment types",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "AppointmentTypes"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppointmentTypeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppointmentTypeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppointmentTypeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              }
            }
          }
        }
      }
    },
    "/appointment-types/note-formats": {
      "get": {
        "tags": [
          "AppointmentTypes"
        ],
        "summary": "List the available generated-note formats (PAW-744). Code-defined\nregistry — the settings UI's Note Format dropdown renders whatever this\nreturns so the FE stays dumb about format ids.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SoapNoteFormatInfo"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SoapNoteFormatInfo"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SoapNoteFormatInfo"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/appointment-types/{id}": {
      "get": {
        "tags": [
          "AppointmentTypes"
        ],
        "summary": "Get a specific appointment type by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The appointment type ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "AppointmentTypes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentTypeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentTypeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentTypeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "AppointmentTypes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/appointment-types/{id}/default-services": {
      "get": {
        "tags": [
          "AppointmentTypes"
        ],
        "summary": "Get default services for an appointment type",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServicesListDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServicesListDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServicesListDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "AppointmentTypes"
        ],
        "summary": "Add a default service to an appointment type",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddAppointmentTypeDefaultServiceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddAppointmentTypeDefaultServiceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddAppointmentTypeDefaultServiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServiceDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/appointment-types/{id}/default-services/{serviceId}": {
      "put": {
        "tags": [
          "AppointmentTypes"
        ],
        "summary": "Update a default service on an appointment type",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentTypeDefaultServiceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentTypeDefaultServiceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentTypeDefaultServiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeDefaultServiceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "AppointmentTypes"
        ],
        "summary": "Delete a default service from an appointment type",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/BillableItems": {
      "get": {
        "tags": [
          "BillableItems"
        ],
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "BillableItems"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBillableItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBillableItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBillableItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/BillableItems/{id}": {
      "get": {
        "tags": [
          "BillableItems"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "BillableItems"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBillableItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBillableItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBillableItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "BillableItems"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Breeds": {
      "get": {
        "tags": [
          "Breeds"
        ],
        "summary": "Get breeds, optionally filtered by species",
        "parameters": [
          {
            "name": "speciesId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BreedListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreedListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreedListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Breeds"
        ],
        "summary": "Create a new breed",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBreedDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBreedDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBreedDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              }
            }
          }
        }
      }
    },
    "/Breeds/{id}": {
      "get": {
        "tags": [
          "Breeds"
        ],
        "summary": "Get a breed by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Breeds"
        ],
        "summary": "Update an existing breed",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBreedDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBreedDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBreedDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BreedDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Breeds"
        ],
        "summary": "Soft-delete a breed",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/clients/export/bulk/pdf": {
      "post": {
        "tags": [
          "BulkClientExport"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkClientExportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkClientExportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BulkClientExportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/zip": { }
            }
          }
        }
      }
    },
    "/clients/export/bulk/csv": {
      "post": {
        "tags": [
          "BulkClientExport"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkClientExportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkClientExportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BulkClientExportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/zip": { }
            }
          }
        }
      }
    },
    "/patients/export/bulk/pdf": {
      "post": {
        "tags": [
          "BulkPatientExport"
        ],
        "summary": "Download multiple patient records as a ZIP of PDFs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/zip": { }
            }
          }
        }
      }
    },
    "/patients/export/bulk/csv": {
      "post": {
        "tags": [
          "BulkPatientExport"
        ],
        "summary": "Download multiple patient records as a ZIP of CSVs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/zip": { }
            }
          }
        }
      }
    },
    "/CareQueue": {
      "get": {
        "tags": [
          "CareQueue"
        ],
        "summary": "Get the full CareQueue state for today (or the supplied date).",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "Optional date (YYYY-MM-DD). Defaults to today.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CareQueueStateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareQueueStateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareQueueStateDto"
                }
              }
            }
          }
        }
      }
    },
    "/CareQueue/reorder": {
      "patch": {
        "tags": [
          "CareQueue"
        ],
        "summary": "Persist a manual reorder of the queue. Body provides the desired\ntop-to-bottom order of appointment ids.",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CareQueueReorderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CareQueueReorderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CareQueueReorderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CareQueueStateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareQueueStateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareQueueStateDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/CaseMilestones": {
      "get": {
        "tags": [
          "CaseMilestones"
        ],
        "summary": "Get all milestones for a case",
        "parameters": [
          {
            "name": "caseId",
            "in": "query",
            "description": "The case ID (required)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "CaseMilestones"
        ],
        "summary": "Create a new milestone for a case",
        "parameters": [
          {
            "name": "caseId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCaseMilestoneRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCaseMilestoneRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCaseMilestoneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/CaseMilestones/{id}": {
      "get": {
        "tags": [
          "CaseMilestones"
        ],
        "summary": "Get a single milestone by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The milestone ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "CaseMilestones"
        ],
        "summary": "Update an existing milestone",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCaseMilestoneRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCaseMilestoneRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCaseMilestoneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseMilestoneResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "CaseMilestones"
        ],
        "summary": "Delete a milestone",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/CaseMilestones/bulk": {
      "post": {
        "tags": [
          "CaseMilestones"
        ],
        "summary": "Bulk update milestones (for reordering/status changes)",
        "parameters": [
          {
            "name": "caseId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateCaseMilestonesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateCaseMilestonesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateCaseMilestonesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Cases": {
      "get": {
        "tags": [
          "Cases"
        ],
        "summary": "Get all cases for a patient",
        "parameters": [
          {
            "name": "patientId",
            "in": "query",
            "description": "The patient ID (required)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CaseResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CaseResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CaseResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Cases"
        ],
        "summary": "Create a new case",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCaseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCaseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Cases/{id}": {
      "get": {
        "tags": [
          "Cases"
        ],
        "summary": "Get a single case by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The case ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Cases"
        ],
        "summary": "Update an existing case",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCaseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCaseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Cases"
        ],
        "summary": "Delete a case",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/chat/export/email": {
      "post": {
        "tags": [
          "ChatExport"
        ],
        "summary": "Email a chat conversation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendChatEmailRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendChatEmailRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendChatEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ChatExportEmailResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatExportEmailResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatExportEmailResult"
                }
              }
            }
          }
        }
      }
    },
    "/ClientAppInvite/link-status": {
      "get": {
        "tags": [
          "ClientAppInvite"
        ],
        "summary": "Whether each of the given clients has linked the pet-owner app to this clinic.\nInformational (drives the \"App connected\" badge) — 502 when Client.API is\nunreachable so the UI can simply hide the badges.",
        "parameters": [
          {
            "name": "clientIds",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ClientAppInvite/{clientId}/invite": {
      "post": {
        "tags": [
          "ClientAppInvite"
        ],
        "summary": "Generate an app invite token for a client. Returns a deep link and QR-encodable URL.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppInviteResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppInviteResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppInviteResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ClientAppInvite/{clientId}/invite/send": {
      "post": {
        "tags": [
          "ClientAppInvite"
        ],
        "summary": "Generate an invite and send it via SMS or email through the communication workflow.\nCreates a thread in the clinic's chat inbox with the invite message.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInviteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInviteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/clients/{clientId}/export/pdf": {
      "post": {
        "tags": [
          "ClientExport"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClientRecordExportOptions"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClientRecordExportOptions"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClientRecordExportOptions"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": { }
            }
          }
        }
      }
    },
    "/clients/{clientId}/export/email": {
      "post": {
        "tags": [
          "ClientExport"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendClientRecordEmailRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendClientRecordEmailRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendClientRecordEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              }
            }
          }
        }
      }
    },
    "/clients/{clientId}/export/csv": {
      "post": {
        "tags": [
          "ClientExport"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClientRecordExportOptions"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClientRecordExportOptions"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClientRecordExportOptions"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": { }
            }
          }
        }
      }
    },
    "/Clients": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Get a paginated list of clients with optional search and sorting",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search query matching client name, email, phone, or an emergency contact's name/phone; a full client ID matches that client exactly",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Field to sort by",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order (asc/desc)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "description": "Include clients whose account status is Inactive (default: false)",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of clients",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Clients"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Clients/{id}": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Get a client by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The client ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Clients"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClientDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClientDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Clients"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/clinic-config": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get all clinic configuration domains",
        "responses": {
          "200": {
            "description": "Complete clinic configuration including all settings domains",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicConfigDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicConfigDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicConfigDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/financial": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get financial settings",
        "responses": {
          "200": {
            "description": "Financial configuration including pricing, taxes, and payment settings",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/financial - Update financial settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinancialSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/FinancialSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/FinancialSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/communications": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get communications settings",
        "responses": {
          "200": {
            "description": "Communications configuration including SMS, email, and notification settings",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CommunicationsSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunicationsSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunicationsSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/communications - Update communications settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommunicationsSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CommunicationsSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CommunicationsSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CommunicationsSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunicationsSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunicationsSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/inventory": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get inventory settings",
        "responses": {
          "200": {
            "description": "Inventory configuration including stock levels, ordering, and pharmacy settings",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/inventory - Update inventory settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventorySettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/InventorySettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/InventorySettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/diagnostics": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get diagnostics settings",
        "responses": {
          "200": {
            "description": "Diagnostics configuration including lab integrations and imaging settings",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/diagnostics - Update diagnostics settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiagnosticsSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DiagnosticsSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DiagnosticsSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/ai": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get AI settings",
        "responses": {
          "200": {
            "description": "AI configuration including model preferences and feature toggles",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AiSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/ai - Update AI settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AiSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AiSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AiSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/compliance": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get compliance settings",
        "responses": {
          "200": {
            "description": "Compliance configuration including HIPAA and data retention policies",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/compliance - Update compliance settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplianceSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplianceSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ComplianceSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/client-app": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get client app settings",
        "responses": {
          "200": {
            "description": "Client app configuration including payment and notification preferences",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientAppSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientAppSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientAppSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/client-app - Update client app settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientAppSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientAppSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ClientAppSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientAppSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientAppSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientAppSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/phone-system": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get phone system settings",
        "responses": {
          "200": {
            "description": "Phone system configuration including vendor credentials and features",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneSystemSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneSystemSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneSystemSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/phone-system - Update phone system settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneSystemSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneSystemSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneSystemSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneSystemSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneSystemSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneSystemSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/voice-ai": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get Voice AI settings",
        "responses": {
          "200": {
            "description": "Voice AI configuration for autonomous call handling",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAiSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAiSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAiSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/voice-ai - Update Voice AI settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceAiSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceAiSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceAiSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAiSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAiSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAiSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/voice-ai/phone-number": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "GET /clinic-config/voice-ai/phone-number - Get the Voice AI phone number for this tenant",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "POST /clinic-config/voice-ai/phone-number - Import and assign a Voice AI phone number",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceAiPhoneNumberRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceAiPhoneNumberRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceAiPhoneNumberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "DELETE /clinic-config/voice-ai/phone-number - Remove the Voice AI phone number",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/clinic-config/region": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get region settings (locale, currency, units)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RegionSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegionSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegionSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/region - Update region settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegionSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegionSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegionSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RegionSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegionSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegionSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/erx": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get external e-prescribing (VetHubRx) settings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErxSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/erx - Update external e-prescribing (VetHubRx) settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErxSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ErxSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ErxSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErxSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/prescribing-rules": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "GET /clinic-config/prescribing-rules — read-only description of the\nprescribing rules the clinic's current region enforces. Drives the\nGovernance Preview settings page (PAW-476 slice 5).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrescribingRulesResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrescribingRulesResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrescribingRulesResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/transparency-page": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "Get transparency page settings (public CMA-style pricing page)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPageSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPageSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPageSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/transparency-page - Update transparency page settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransparencyPageSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TransparencyPageSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TransparencyPageSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPageSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPageSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPageSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-config/client-feedback": {
      "get": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "GET /clinic-config/client-feedback - Get NPS / client-feedback settings (PAW-469)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicConfig"
        ],
        "summary": "PATCH /clinic-config/client-feedback - Update NPS / client-feedback settings (PAW-469)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientFeedbackSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/clinic-settings": {
      "get": {
        "tags": [
          "ClinicSettings"
        ],
        "summary": "Get clinic settings from DynamoDB profile data",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicSettingsDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ClinicSettings"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClinicSettingsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClinicSettingsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClinicSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/Clocking/status": {
      "get": {
        "tags": [
          "Clocking"
        ],
        "summary": "Get current user's clock status (clocked in, out, or on lunch).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockStatusResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockStatusResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockStatusResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Clocking/in": {
      "post": {
        "tags": [
          "Clocking"
        ],
        "summary": "Clock in (creates a new time entry for today).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClockInRequestDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClockInRequestDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClockInRequestDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Clocking/out": {
      "post": {
        "tags": [
          "Clocking"
        ],
        "summary": "Clock out (updates today's time entry with clock-out time).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClockOutRequestDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClockOutRequestDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClockOutRequestDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Clocking/lunch/start": {
      "post": {
        "tags": [
          "Clocking"
        ],
        "summary": "Start lunch break.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LunchStartRequestDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LunchStartRequestDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LunchStartRequestDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Clocking/lunch/end": {
      "post": {
        "tags": [
          "Clocking"
        ],
        "summary": "End lunch break.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LunchEndRequestDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LunchEndRequestDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LunchEndRequestDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Clocking/pin": {
      "post": {
        "tags": [
          "Clocking"
        ],
        "summary": "Set or update the user's clocking PIN for kiosk use.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetClockingPinRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetClockingPinRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetClockingPinRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Compliance/dashboard": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "Compliance dashboard rollup. Reads from the unified\n`compliance_events` projection (PAW-484/PAW-485). Default range\nwhen caller omits parameters is \"last 30 days\". The optional\ncategory filter scopes the per-category breakdown\nonly — headline metrics always reflect the full picture in range.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceDashboardDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceDashboardDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceDashboardDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/consent-documents/by-response/{responseId}": {
      "get": {
        "tags": [
          "ConsentDocuments"
        ],
        "parameters": [
          {
            "name": "responseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentDocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/consent-documents/{id}/pdf": {
      "get": {
        "tags": [
          "ConsentDocuments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/DeaBooks": {
      "get": {
        "tags": [
          "DeaBooks"
        ],
        "summary": "Get all DEA controlled substance books",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status (default: true); pass an empty value for all books",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of DEA books",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DeaBooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDEABookDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDEABookDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDEABookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              }
            }
          }
        }
      }
    },
    "/DeaBooks/{id}": {
      "get": {
        "tags": [
          "DeaBooks"
        ],
        "summary": "Get a specific DEA book by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The DEA book ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/DeaBooks/{id}/deactivate": {
      "patch": {
        "tags": [
          "DeaBooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeactivateDEABookDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DeactivateDEABookDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DeactivateDEABookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/DeaBooks/{id}/reactivate": {
      "patch": {
        "tags": [
          "DeaBooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ReactivateDEABookDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ReactivateDEABookDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ReactivateDEABookDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEABookDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/DeaBooks/{id}/entries": {
      "get": {
        "tags": [
          "DeaBooks"
        ],
        "summary": "Get entries for a DEA book with optional filters",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The DEA book ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by container status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "containerId",
            "in": "query",
            "description": "Filter by container ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of entries to return (default: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DeaBooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDEAEntryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDEAEntryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDEAEntryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryDto"
                }
              }
            }
          }
        }
      }
    },
    "/DeaBooks/{id}/containers": {
      "get": {
        "tags": [
          "DeaBooks"
        ],
        "summary": "Get current container states for a DEA book",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The DEA book ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by container status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContainerStateDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContainerStateDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContainerStateDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/DeaBooks/{id}/audit": {
      "get": {
        "tags": [
          "DeaBooks"
        ],
        "summary": "Get audit trail for a DEA book (for compliance export)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The DEA book ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete audit trail of all entries",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DEAEntryListResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/deabooks/{bookId}/export/pdf": {
      "get": {
        "tags": [
          "DeaExport"
        ],
        "summary": "Download DEA log as PDF",
        "parameters": [
          {
            "name": "bookId",
            "in": "path",
            "description": "The DEA book ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "managerName",
            "in": "query",
            "description": "Optional manager name to include in report header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Optional start date for filtering entries",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Optional end date for filtering entries",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/deabooks/{bookId}/export/email": {
      "post": {
        "tags": [
          "DeaExport"
        ],
        "summary": "Email DEA log as PDF attachment",
        "parameters": [
          {
            "name": "bookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendDEAEmailRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendDEAEmailRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendDEAEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              }
            }
          }
        }
      }
    },
    "/diagnosis-terms": {
      "get": {
        "tags": [
          "DiagnosisTerms"
        ],
        "summary": "List active diagnosis terms for a species (e.g. `?speciesCode=DOG`),\nordered by body system then name so the client can group them directly.",
        "parameters": [
          {
            "name": "speciesCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosisTermListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosisTermListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosisTermListResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/DiscountCodes": {
      "get": {
        "tags": [
          "DiscountCodes"
        ],
        "summary": "Get a paginated list of discount codes with optional filters",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Filter by scope (Order/LineItem)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Filter by category",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 50)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of discount codes",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DiscountCodes"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDiscountCodeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDiscountCodeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDiscountCodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              }
            }
          }
        }
      }
    },
    "/DiscountCodes/{id}": {
      "get": {
        "tags": [
          "DiscountCodes"
        ],
        "summary": "Get a discount code by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The discount code ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "DiscountCodes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDiscountCodeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDiscountCodeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDiscountCodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "DiscountCodes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/DiscountCodes/code/{code}": {
      "get": {
        "tags": [
          "DiscountCodes"
        ],
        "summary": "Get a discount code by its code string",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "description": "The discount code string (e.g., \"SAVE10\")",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountCodeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/DiscountCodes/{id}/validate": {
      "post": {
        "tags": [
          "DiscountCodes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineItemId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountValidationResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountValidationResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscountValidationResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/Drafts": {
      "get": {
        "tags": [
          "Drafts"
        ],
        "summary": "Get a paginated and filtered list of form drafts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "formType",
            "in": "query",
            "description": "Filter by form type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flowType",
            "in": "query",
            "description": "Filter by flow type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flowKey",
            "in": "query",
            "description": "Filter by flow key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of form drafts",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Drafts"
        ],
        "summary": "Create a new form draft",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFormDraftRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFormDraftRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFormDraftRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Drafts/{id}": {
      "get": {
        "tags": [
          "Drafts"
        ],
        "summary": "Get a single form draft by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The form draft ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Drafts"
        ],
        "summary": "Update an existing form draft",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFormDraftRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFormDraftRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFormDraftRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDraftResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Drafts"
        ],
        "summary": "Delete a form draft by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Drafts/flow/{flowKey}": {
      "get": {
        "tags": [
          "Drafts"
        ],
        "summary": "Get all form drafts for a specific flow",
        "parameters": [
          {
            "name": "flowKey",
            "in": "path",
            "description": "The flow key identifier",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of form drafts for the specified flow",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FormDraftResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FormDraftResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FormDraftResponseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Drafts/flow/complete": {
      "post": {
        "tags": [
          "Drafts"
        ],
        "summary": "Complete an intake flow by processing all drafts and creating client/patient records",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteIntakeFlowRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteIntakeFlowRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteIntakeFlowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowCompletionResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowCompletionResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowCompletionResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/print-jobs/pending": {
      "get": {
        "tags": [
          "EdgePrintJobs"
        ],
        "summary": "Edge gateway polls for pending print jobs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrintJobDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrintJobDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrintJobDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/print-jobs/{id}/status": {
      "patch": {
        "tags": [
          "EdgePrintJobs"
        ],
        "summary": "Edge gateway reports print job completion or failure",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrintJobStatusDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrintJobStatusDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrintJobStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/printers": {
      "get": {
        "tags": [
          "EdgePrinters"
        ],
        "summary": "Edge fetches all active web-defined printers",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrinterDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrinterDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrinterDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/printers/mappings": {
      "get": {
        "tags": [
          "EdgePrinters"
        ],
        "summary": "Edge fetches its saved printer mappings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrinterMappingDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrinterMappingDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrinterMappingDto"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "EdgePrinters"
        ],
        "summary": "Edge saves/updates its CUPS queue mappings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEdgePrinterMappingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEdgePrinterMappingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEdgePrinterMappingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrinterMappingDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrinterMappingDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EdgePrinterMappingDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/email-verification/resend": {
      "post": {
        "tags": [
          "EmailVerification"
        ],
        "summary": "Resend email verification to the currently authenticated user",
        "responses": {
          "200": {
            "description": "Success message"
          }
        }
      }
    },
    "/email-verification/resend/{userId}": {
      "post": {
        "tags": [
          "EmailVerification"
        ],
        "summary": "Resend email verification to a specific user (admin only)",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "description": "User ID (Firebase UID) to send verification to",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success message"
          }
        }
      }
    },
    "/erx/medications": {
      "get": {
        "tags": [
          "Erx"
        ],
        "summary": "Search the vendor's NDC medication catalog.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ErxMedicationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ErxMedicationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ErxMedicationDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/erx/pharmacies": {
      "get": {
        "tags": [
          "Erx"
        ],
        "summary": "Search the vendor's pharmacy directory (query + optional 2-letter state).",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ErxPharmacyDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ErxPharmacyDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ErxPharmacyDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/erx/prescriptions": {
      "post": {
        "tags": [
          "Erx"
        ],
        "summary": "Send a non-controlled prescription to an outside pharmacy via VetHubRx. Creates the\nOutsideMedication record (Status=Sending) and returns it; the final Sent/Failed\nstate arrives asynchronously via webhook.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendErxPrescriptionRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendErxPrescriptionRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendErxPrescriptionRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              }
            }
          }
        }
      }
    },
    "/erx/provider-registrations": {
      "get": {
        "tags": [
          "Erx"
        ],
        "summary": "The provider roster: every eligible vet with registration + verification state,\nplus whether the integration is configured/enabled. Polls the vendor for\nregistrations that aren't in a terminal state (design: poll on surface load).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderRosterDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderRosterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderRosterDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Erx"
        ],
        "summary": "Register a vet with VetHubRx (action \"A\") and store the verification URL.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterErxProviderRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterErxProviderRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterErxProviderRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderDto"
                }
              }
            }
          }
        }
      }
    },
    "/erx/provider-registrations/{userId}": {
      "get": {
        "tags": [
          "Erx"
        ],
        "summary": "A single provider's registration, polling the vendor for fresh verification state.",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErxProviderDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appointmentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Estimates"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEstimateDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEstimateDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEstimateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Estimates"
        ],
        "summary": "Hard-delete an estimate. Allowed only when the estimate is provably inert — a\nEstimateStatus.Draft that has never been converted and has no line\nthat has performed/dispensed anything. Anything with committed side effects\n(dispensed stock, DEA entries, a cut Rx) is refused with 409: the raw cascade\ndelete reverses none of that, so those lines must be voided first (which restores\nstock, files the DEA correction, cancels the Rx). Mirrors the per-line delete guard\nat Task&lt;ActionResult&gt; EstimatesController.DeleteItemAsync(string id, string lineId).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Estimates/by-appointment/{appointmentId}": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "summary": "Fetch the appointment's estimate, auto-creating an empty draft on first\naccess. The estimate is the single authoring + execution surface rendered in\nthe chronicle Services tab; a draft must exist before lines can be added.",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/linkable": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "summary": "List a patient's open, standalone estimates that can be linked to an appointment — i.e.\npre-existing quotes (created from the client/patient record) that are not yet converted\n(`InvoiceId == null`), not declined, and not already tied to an appointment\n(`AppointmentId == null`). Drives the \"Link existing estimate\" picker on the\nServices tab.",
        "parameters": [
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateListResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/link-appointment": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "    Link a pre-existing open estimate to an appointment. Honors the unique index on\n    `treatment_plans.appointment_id` (one estimate per appointment):\n    * No estimate on the appointment yet → set AppointmentId on the chosen one.\n* The appointment's auto-created estimate is empty → drop it and re-point the chosen\n    estimate (preserves the chosen estimate's identity + consent history).\n* The appointment's estimate already has lines → merge the chosen estimate's lines into\n    it and remove the chosen estimate.\n    Returns the resulting estimate the Services tab should render.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkAppointmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkAppointmentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LinkAppointmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/convert-to-invoice": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Convert a treatment plan to an estimate using the selected tier's quantities.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvertToInvoiceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvertToInvoiceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConvertToInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/{invoiceId}/revert-to-estimate": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "    Revert an UNPAID invoice back to an editable estimate. Archives the bill (marks it\n    InvoiceStatus.Superseded, keeping its lines as a read-only record), unstamps\n    the dispense-linked transactions (so the dispenses re-appear as unbilled on the estimate),\n    releases its appointment, reopens the source estimate to Draft, and records an\n    ConsentEventType.InvoiceReverted consent event. Blocked once the invoice has\n    any payment (PartiallyPaid/Paid or any non-failed Payment) — those need refund/void first.\n    Does NOT reverse dispenses: lines stay Performed with their InventoryTransactionId on the\nestimate; returning stock is the separate per-line void flow. Routed under /invoices\n(absolute route) to match the bill it acts on; Billing-permission gated at controller level.",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RevertToEstimateRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RevertToEstimateRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RevertToEstimateRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/present": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Record that the plan was presented to the client (overlay opened). Logs a\nPlanPresented event and bumps status to Presented. Idempotent if status\nis already Presented — always logs the event.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PresentEstimateRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PresentEstimateRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PresentEstimateRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Estimates/{id}/accept": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Record the client's acceptance of a presented plan WITHOUT converting it to an\ninvoice. The in-visit present flow uses this: the client approves the plan (consent +\noptional signature + chosen tier) up front; the bill is created later by\nconvert-to-invoice once services are performed. Sets status Accepted + tier and logs a\nPlanAccepted consent event; leaves the estimate un-converted (no InvoiceId).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptEstimateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptEstimateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptEstimateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/decline": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Client declined the plan. Sets status to Declined and logs an event.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/DeclineEstimateRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/DeclineEstimateRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/DeclineEstimateRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Estimates/{id}/consent-events": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateConsentEventListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateConsentEventListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateConsentEventListResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/convert-readiness": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "summary": "Read-only convert-to-invoice readiness for an appointment estimate. Converting is the\nlast step before payment, so the gate blocks while any line is still Pending or a\nperformed take-home label hasn't been filled. Drives the Convert button's disabled\nstate + blockers popover (mirrors the BillableItem availability pre-check). Standalone\n(no-appointment) estimates are always ready — the quote itself becomes the bill.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertReadinessDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertReadinessDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertReadinessDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/items": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Add a single line (procedure / inventory / retail) to an estimate.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddEstimateItemRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddEstimateItemRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddEstimateItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/items/populate-defaults": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Seed the estimate's lines from its appointment type's default services. Rebuilds the\nretired appointment-services \"populate-defaults\" onto the estimate line: each active\ndefault service becomes a Pending line. The dispense fee is charged once per unique\ninventory item across the whole estimate (existing lines count), matching the old behaviour.\nNo-op (ItemsAdded = 0) when the estimate has no appointment, the appointment has no type,\nor the type has no active default services.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PopulateEstimateDefaultsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PopulateEstimateDefaultsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PopulateEstimateDefaultsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/items/{lineId}": {
      "put": {
        "tags": [
          "Estimates"
        ],
        "summary": "Update a single estimate line (quantity / price / billing flag / order / tier qtys).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEstimateItemRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEstimateItemRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEstimateItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Estimates"
        ],
        "summary": "Delete a single estimate line. Blocks when the line is performed-and-dispensed (use void).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Estimates/{id}/items/{lineId}/availability": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "summary": "Stock-only availability pre-check for a charge line on the estimate (design\n§5 / §9.1): are the BillableItem's components on hand at the line's quantity?\nRead-only — no validate-pass, no stock movement. Mirrors the invoice-side\ncheck off the same `CheckAvailabilityAsync`, so the estimate UI can flag\na short charge before the user opens the perform modal.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemAvailabilityDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemAvailabilityDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillableItemAvailabilityDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/items/{lineId}/take-home-components": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "summary": "List a performed charge line's take-home component dispenses (per-component\ndisposition). A charge fans out to N component transactions; the ones dispensed\ntake-home (DispenseType=Prescription) may have a deferred SIG. This returns each\nwith whether its SIG/label is filled, so the UI can walk the unfilled ones\nthrough the post-dispense prescription flow and clear the SIG_REQUIRED convert\nblock. See docs/june-updates/charge-component-disposition.md.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChargeTakeHomeComponentDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChargeTakeHomeComponentDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChargeTakeHomeComponentDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/items/{lineId}/perform": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Mark an estimate line performed. For an undispensed inventory line this runs\nthe in-visit dispense (stamping `InventoryTransactionId` on the line; no\nInvoice involvement until convert). Gas items have no transaction.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PerformEstimateItemRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PerformEstimateItemRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PerformEstimateItemRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/items/{lineId}/decline": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Mark an estimate line declined by the client. Drops it from billing and reassigns any dispense fee.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/DeclineEstimateItemRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/DeclineEstimateItemRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/DeclineEstimateItemRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateLineItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/items/{lineId}/void": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Void a performed-and-dispensed estimate line: reverse the dispense (restore\nthe lot, write a Returned transaction, file a DEA correction for controlled\nsubstances, cancel any tied Rx), then remove the line. Falls through to a\nplain delete when there is no dispense to undo. Anchors entirely on the\nline's `InventoryTransactionId`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/VoidEstimateItemRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/VoidEstimateItemRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/VoidEstimateItemRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VoidEstimateItemResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoidEstimateItemResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoidEstimateItemResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Estimates/{id}/pdf": {
      "get": {
        "tags": [
          "Estimates"
        ],
        "summary": "Generate a PDF for a saved treatment plan.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": { }
            }
          }
        }
      }
    },
    "/Estimates/{id}/email-to-client": {
      "post": {
        "tags": [
          "Estimates"
        ],
        "summary": "Email the estimate PDF to the client through the unified communications inbox.\nComposes an Email-channel message (visible in /chat) with the rendered PDF\nattached, then records the presentation: Draft plans bump to Presented and a\nPlanPresented consent event is logged either way.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/EmailEstimateToClientRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/EmailEstimateToClientRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/EmailEstimateToClientRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailEstimateToClientResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailEstimateToClientResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailEstimateToClientResponse"
                }
              }
            }
          }
        }
      }
    },
    "/exam-templates": {
      "get": {
        "tags": [
          "ExamTemplates"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ExamTemplates"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExamTemplateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExamTemplateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExamTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              }
            }
          }
        }
      }
    },
    "/exam-templates/{id}": {
      "get": {
        "tags": [
          "ExamTemplates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ExamTemplates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExamTemplateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExamTemplateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExamTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExamTemplateDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ExamTemplates"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Expenses": {
      "get": {
        "tags": [
          "Expenses"
        ],
        "summary": "Get expenses for a date range with optional filters",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ExpenseSource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Expenses"
        ],
        "summary": "Create a manual expense",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExpenseDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExpenseDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExpenseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Expenses/{id}": {
      "get": {
        "tags": [
          "Expenses"
        ],
        "summary": "Get expense by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Expenses"
        ],
        "summary": "Update an expense (only manual expenses can be updated)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExpenseDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExpenseDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExpenseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Expenses"
        ],
        "summary": "Delete an expense (only manual expenses can be deleted)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Expenses/summary": {
      "get": {
        "tags": [
          "Expenses"
        ],
        "summary": "Get expense summary (totals by category) for a date range",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseSummaryDto"
                }
              }
            }
          }
        }
      }
    },
    "/Featurebase/changelog": {
      "get": {
        "tags": [
          "Featurebase"
        ],
        "summary": "Published changelog entries for the home page's Release Notes panel, newest first.",
        "description": "Returns `configured: false` with no entries when no API key is set, so the panel\nrenders empty instead of the home page logging a failure on every load.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum entries to return (1–100, default 30).",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FeaturebaseChangelogResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeaturebaseChangelogResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeaturebaseChangelogResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Featurebase/token": {
      "get": {
        "tags": [
          "Featurebase"
        ],
        "summary": "Mint a Featurebase identity JWT for the current user.",
        "description": "Returns `{ \"token\": null }` — not an error — when no signing secret is\nconfigured, so the widgets degrade to anonymous instead of the app logging\na failure on every load.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/feature-flags": {
      "get": {
        "tags": [
          "FeatureFlags"
        ],
        "summary": "Get every known feature flag evaluated for the current tenant. Flag names are\nreturned verbatim (PascalCase) — the frontend looks them up by exact name.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlagsResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlagsResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlagsResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Flowboard": {
      "get": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Get the complete flowboard state for today or a specific date",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "Optional date (YYYY-MM-DD). Defaults to today.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardStateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardStateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardStateDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Flowboard/visits/{appointmentId}": {
      "get": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Get a single visit by appointment ID",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Flowboard/rooms/{roomId}/status": {
      "put": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Update the status of a room (Available, Needs Cleaning, Out of Service, etc.)",
        "parameters": [
          {
            "name": "roomId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoomStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoomStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoomStatusRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Flowboard/visits/{appointmentId}/room": {
      "put": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Assign a patient to a room",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignPatientToRoomRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignPatientToRoomRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AssignPatientToRoomRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Remove a patient from their current room",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Flowboard/visits/{appointmentId}/next-up": {
      "put": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Queue a patient in a room's \"Next Up\" list",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueForRoomRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueForRoomRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/QueueForRoomRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Remove a patient from a room's \"Next Up\" queue (returns them to the waiting list)",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Flowboard/visits/{appointmentId}/progress": {
      "post": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Progress the current milestone to completed and start the next one",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Flowboard/visits/{appointmentId}/discharge/start": {
      "post": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Start the discharge process for a patient",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Flowboard/visits/{appointmentId}/discharge/complete": {
      "post": {
        "tags": [
          "Flowboard"
        ],
        "summary": "Complete the discharge process - marks patient as discharged",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowboardVisitDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/GroupCodes": {
      "get": {
        "tags": [
          "GroupCodes"
        ],
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "GroupCodes"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupCodeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupCodeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupCodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              }
            }
          }
        }
      }
    },
    "/GroupCodes/{id}": {
      "get": {
        "tags": [
          "GroupCodes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "GroupCodes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGroupCodeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGroupCodeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGroupCodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupCodeDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "GroupCodes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/GroupVisits/start": {
      "post": {
        "tags": [
          "GroupVisits"
        ],
        "summary": "Start a group visit. Creates a synthetic ScheduleItem + Appointment bound to the\ngroup, returning the appointment ID for the caller to navigate to.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartGroupVisitRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StartGroupVisitRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StartGroupVisitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupVisitDto"
                }
              }
            }
          }
        }
      }
    },
    "/GroupVisits/{appointmentId}": {
      "get": {
        "tags": [
          "GroupVisits"
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupVisitDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupVisitDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupVisitDto"
                }
              }
            }
          }
        }
      }
    },
    "/GroupVisits/{appointmentId}/soap": {
      "post": {
        "tags": [
          "GroupVisits"
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupSoapNoteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupSoapNoteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupSoapNoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupSoapNoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupSoapNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupSoapNoteDto"
                }
              }
            }
          }
        }
      }
    },
    "/GroupVisits/{appointmentId}/soap/{soapId}": {
      "patch": {
        "tags": [
          "GroupVisits"
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "soapId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGroupSoapNoteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGroupSoapNoteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGroupSoapNoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupSoapNoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupSoapNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupSoapNoteDto"
                }
              }
            }
          }
        }
      }
    },
    "/GroupVisits/{appointmentId}/treatments": {
      "post": {
        "tags": [
          "GroupVisits"
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupTreatmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupTreatmentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupTreatmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GroupTreatmentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupTreatmentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupTreatmentDto"
                }
              }
            }
          }
        }
      }
    },
    "/GroupVisits/{appointmentId}/soap/{soapId}/exceptions": {
      "post": {
        "tags": [
          "GroupVisits"
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "soapId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemberExceptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemberExceptionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemberExceptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MemberExceptionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberExceptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberExceptionDto"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Get health status of all dependent services",
        "responses": {
          "200": {
            "description": "OK"
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/homeagain/species": {
      "get": {
        "tags": [
          "HomeAgain"
        ],
        "summary": "Get the list of species supported by HomeAgain.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/homeagain/colors": {
      "get": {
        "tags": [
          "HomeAgain"
        ],
        "summary": "Get the list of colors supported by HomeAgain.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/homeagain/breeds/{species}": {
      "get": {
        "tags": [
          "HomeAgain"
        ],
        "summary": "Get the list of breeds for a given species supported by HomeAgain.",
        "parameters": [
          {
            "name": "species",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/homeagain/enroll": {
      "post": {
        "tags": [
          "HomeAgain"
        ],
        "summary": "Enroll a single pet microchip with HomeAgain.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAgainEnrollRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAgainEnrollRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAgainEnrollRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainEnrollResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainEnrollResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainEnrollResult"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/credentials/xplorpay": {
      "get": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Get XplorPay credentials status (not the actual credentials)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsStatusDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Store XplorPay credentials securely",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XplorPayCredentialsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/XplorPayCredentialsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/XplorPayCredentialsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsStatusDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Delete XplorPay credentials",
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/integrations/credentials/xplorpay/terminals": {
      "get": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "List all named payment terminals",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TerminalStatusDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TerminalStatusDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TerminalStatusDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Add or update a named payment terminal",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertTerminalDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertTerminalDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertTerminalDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalStatusDto"
                }
              }
            }
          }
        }
      }
    },
    "/integrations/credentials/xplorpay/terminals/{name}": {
      "delete": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Delete a named payment terminal",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/integrations/credentials/mango-voice": {
      "get": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Get Mango Voice credentials status (not the actual credentials)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MangoCredentialsStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MangoCredentialsStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MangoCredentialsStatusDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Store Mango Voice credentials securely",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MangoVoiceCredentialsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MangoVoiceCredentialsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MangoVoiceCredentialsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MangoCredentialsStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MangoCredentialsStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MangoCredentialsStatusDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Delete Mango Voice credentials",
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/integrations/credentials/telnyx": {
      "get": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Get Telnyx WebRTC credentials status (not the actual credentials)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TelnyxCredentialsStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelnyxCredentialsStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelnyxCredentialsStatusDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Store Telnyx WebRTC credentials securely",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelnyxCredentialsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TelnyxCredentialsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TelnyxCredentialsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TelnyxCredentialsStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelnyxCredentialsStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelnyxCredentialsStatusDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Delete Telnyx WebRTC credentials",
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/integrations/credentials/homeagain": {
      "get": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Get HomeAgain credentials status (not the actual credentials)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainCredentialsStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainCredentialsStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainCredentialsStatusDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Store HomeAgain credentials securely",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAgainCredentialsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAgainCredentialsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/HomeAgainCredentialsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainCredentialsStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainCredentialsStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeAgainCredentialsStatusDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Delete HomeAgain credentials",
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/internal/prescribing/seed-monographs": {
      "post": {
        "tags": [
          "InternalPrescribing"
        ],
        "summary": "Loads the checked-in drug-monograph fixture into the central reference DB:\nchunks → embeddings (OpenAI ada-002) → upsert. Idempotent and re-runnable —\nre-running with revised fixture text fully replaces each drug's chunks.\nSwap the fixture for partner-supplied data and re-hit this endpoint.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/internal/widget/outbound": {
      "post": {
        "tags": [
          "InternalWidget"
        ],
        "summary": "Send a message to a widget session (from staff via Orchestrate unified inbox)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetOutboundRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetOutboundRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetOutboundRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/InventoryApprovals": {
      "get": {
        "tags": [
          "InventoryApprovals"
        ],
        "summary": "Get pending inventory approvals with optional type filter",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Filter by approval type (Adjustment, Destruction, DispenseSignOff, PurchaseOrder)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/InventoryApprovals/{id}": {
      "get": {
        "tags": [
          "InventoryApprovals"
        ],
        "summary": "Get a specific inventory approval by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The approval ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/InventoryApprovals/count": {
      "get": {
        "tags": [
          "InventoryApprovals"
        ],
        "summary": "Get the count of pending inventory approvals",
        "responses": {
          "200": {
            "description": "Number of pending approvals",
            "content": {
              "text/plain": {
                "schema": {
                  "pattern": "^-?(?:0|[1-9]\\d*)$",
                  "type": [
                    "integer",
                    "string"
                  ],
                  "format": "int32"
                }
              },
              "application/json": {
                "schema": {
                  "pattern": "^-?(?:0|[1-9]\\d*)$",
                  "type": [
                    "integer",
                    "string"
                  ],
                  "format": "int32"
                }
              },
              "text/json": {
                "schema": {
                  "pattern": "^-?(?:0|[1-9]\\d*)$",
                  "type": [
                    "integer",
                    "string"
                  ],
                  "format": "int32"
                }
              }
            }
          }
        }
      }
    },
    "/InventoryApprovals/{id}/approve": {
      "post": {
        "tags": [
          "InventoryApprovals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ApproveRequestDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ApproveRequestDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ApproveRequestDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              }
            }
          }
        }
      }
    },
    "/InventoryApprovals/{id}/reject": {
      "post": {
        "tags": [
          "InventoryApprovals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RejectRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryApprovalDto"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get inventory items with optional filters",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by item status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Filter by category",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "description": "Filter by vendor ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasDeaBook",
            "in": "query",
            "description": "Filter by DEA controlled status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term for item name/SKU",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "drugForm",
            "in": "query",
            "description": "Filter by drug form",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rxRequired",
            "in": "query",
            "description": "Filter by Rx-Required status (true = Rx-Required, false = OTC)",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Inventory"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get a specific inventory item by ID with stock information",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The inventory item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/batch": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchImportRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchImportRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BatchImportRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BatchImportResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchImportResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchImportResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/units-per-container": {
      "patch": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUnitsPerContainerDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUnitsPerContainerDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUnitsPerContainerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryItemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/lots": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get inventory lots for an item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The inventory item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status (default: true)",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of inventory lots with quantities and expiration dates",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryLotDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryLotDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryLotDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/lots/{lotId}": {
      "put": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryLotDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryLotDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryLotDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/lots/{lotId}/adjust": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustLotQuantityDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustLotQuantityDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustLotQuantityDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/lots/{lotId}/containers": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotContainerDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotContainerDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotContainerDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddLotContainerDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddLotContainerDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddLotContainerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotContainerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotContainerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotContainerDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/lots/{lotId}/containers/{containerId}": {
      "patch": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "containerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLotContainerDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLotContainerDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLotContainerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotContainerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotContainerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLotContainerDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/transactions": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get transaction history for an inventory item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The inventory item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter by transaction type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of transactions to return (default: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryTransactionDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryTransactionDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryTransactionDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/validate-dispense": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DispenseValidationResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispenseValidationResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispenseValidationResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/dispense": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DispenseResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispenseResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispenseResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/adjust": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustInventoryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustInventoryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustInventoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransactionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransactionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransactionDto"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/stock-summary": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get stock summary for all inventory items",
        "responses": {
          "200": {
            "description": "List of items with aggregated stock information",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryItemDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryItemDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryItemDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/low-stock": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get items below their reorder point",
        "responses": {
          "200": {
            "description": "List of items that need to be reordered",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryItemDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryItemDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryItemDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/expiring": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get lots expiring within a specified number of days",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "Number of days to look ahead (default: 30)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of lots with upcoming expiration dates",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{id}/locations": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get location breakdown for a specific inventory item (aggregated across all lots)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotLocationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotLocationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotLocationDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{itemId}/lots/{lotId}/locations": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get location breakdown for a specific lot",
        "parameters": [
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotLocationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotLocationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryLotLocationDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Inventory/{itemId}/transfer": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Transfer inventory from one location to another",
        "parameters": [
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferInventoryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferInventoryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TransferInventoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransactionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransactionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransactionDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/InventoryLocations": {
      "get": {
        "tags": [
          "InventoryLocations"
        ],
        "summary": "Get all inventory locations with optional active filter",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "InventoryLocations"
        ],
        "summary": "Create a new inventory location",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryLocationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryLocationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryLocationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/InventoryLocations/{id}": {
      "get": {
        "tags": [
          "InventoryLocations"
        ],
        "summary": "Get a specific inventory location by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "InventoryLocations"
        ],
        "summary": "Update an existing inventory location",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryLocationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryLocationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryLocationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "InventoryLocations"
        ],
        "summary": "Delete (deactivate) an inventory location",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/InventoryLocations/default": {
      "get": {
        "tags": [
          "InventoryLocations"
        ],
        "summary": "Get the default inventory location",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/InventoryLocations/{id}/set-default": {
      "post": {
        "tags": [
          "InventoryLocations"
        ],
        "summary": "Set a location as the default",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Get a paginated list of estimates with optional filters",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by estimate status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Filter by client ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "description": "Filter by patient ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Invoices"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/outstanding": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Clinic-wide open-invoice list (ITE-317): every bill still awaiting money —\nDraft, Unpaid, or PartiallyPaid — oldest first, with the remaining balance\ncomputed from recorded payments. This is the AR view /billing renders.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OutstandingInvoiceDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OutstandingInvoiceDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OutstandingInvoiceDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Get an estimate by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The estimate ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Invoices"
        ],
        "summary": "Hard-delete an invoice. Allowed only when the invoice is provably inert — a\nInvoiceStatus.Draft (never sent) with no payment, no dispensed line,\nand not the product of a merge. Anything with committed side effects is refused\nwith 409. An invoice that came from an estimate is refused too: use\n\"revert to estimate\" so the source estimate is returned to a clean state rather\nthan left accepted-but-unbilled. Deleting a paid/dispensed bill would strand\npayments and inventory — those must be reversed through their own paths first.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Invoices/by-appointment/{appointmentId}": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Get the most recent estimate for an appointment",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/items": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceLineItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceLineItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceLineItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/items/{itemId}": {
      "put": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceLineItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceLineItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceLineItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Invoices/merge": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Payment-time combination: merge two or more open, unpaid invoices belonging to\nthe same client into one new invoice. Only bills past the estimate→invoice\napproval gate qualify — the merge copies their lines (dispense links carried\nover; dispensing and approval are untouched), re-runs the price rule engine\nagainst the combined line set, and archives the sources as Superseded with\n`mergedIntoInvoiceId` pointing at the new bill.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeInvoicesRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeInvoicesRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MergeInvoicesRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/sign": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignInvoiceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SignInvoiceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SignInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/issue": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/void": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "    Cancel a bill that should never have been billed (wrong patient, duplicate, service\n    not rendered, goodwill write-off): Status → InvoiceStatus.Void, terminal.\n    This is the exit for invoices built directly in the Payments panel, which have no\n    source estimate and therefore can't revert. A required reason lands in the payment\n    audit log. Refused once any money is attached — reverse the payments first (a Void\n    bill can never take or hold a payment). Dispensed lines do NOT block: voiding the\n    bill never returns stock (there is no reverse-dispense primitive; see\n    docs/dispensing.md §5) — stock corrections are a separate inventory adjustment.\n    Distinct from Superseded (finalized then replaced): merge and revert keep producing\n    Superseded; Void means cancelled outright.\n    Releases the bill's claims on everything upstream of it — the appointment slot, the\nsource quote's invoice_id, and the reverse dispense links — so a live quote\nstops resolving to a written-off bill. Unlike revert-to-estimate this leaves the\nquote's EstimateStatus untouched: void cancels the bill, it does not\nreopen the quote for editing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidInvoiceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidInvoiceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VoidInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/send-invoice": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/invoice-pdf": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Download invoice as PDF",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The estimate ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/send-receipt": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Invoices/{id}/apply-discount": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyDiscountDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyDiscountDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyDiscountDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppliedDiscountDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppliedDiscountDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppliedDiscountDto"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/discounts/{appliedDiscountId}": {
      "delete": {
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appliedDiscountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Invoices/{id}/discounts": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Get all applied discounts for an estimate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The estimate ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AppliedDiscountDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AppliedDiscountDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AppliedDiscountDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/group-codes": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Expand a group code (kit) onto the estimate as individual line items.\nEach component line is tagged with the originating GroupCodeId; any price\nrules attached to the kit are applied during the resulting recalculation.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddGroupCodeToInvoiceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddGroupCodeToInvoiceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddGroupCodeToInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/line-items/by-group-code/{groupCodeId}": {
      "delete": {
        "tags": [
          "Invoices"
        ],
        "summary": "Remove every line item on the estimate that was emitted from the given group code.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupCodeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/preview-rules": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Runs the price rule engine over a proposed set of line items without\npersisting. Used by the invoice grid to show rule discounts (BOGO,\nspend thresholds, etc.) live as the user edits, while keeping the\nserver as the single source of truth for the math — no client-side\nevaluator to drift.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewPriceRulesRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewPriceRulesRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewPriceRulesRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewPriceRulesResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewPriceRulesResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewPriceRulesResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Invoices/{id}/items/from-dispense": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Add a dispensed inventory item to an estimate as a line item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The estimate ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The dispense transaction details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDispensedToInvoiceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDispensedToInvoiceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddDispensedToInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/JourneyMilestones": {
      "get": {
        "tags": [
          "JourneyMilestones"
        ],
        "summary": "Get all milestones for an appointment",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "query",
            "description": "The appointment ID (required)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "JourneyMilestones"
        ],
        "summary": "Create a new milestone for an appointment",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJourneyMilestoneRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJourneyMilestoneRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJourneyMilestoneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/JourneyMilestones/{id}": {
      "get": {
        "tags": [
          "JourneyMilestones"
        ],
        "summary": "Get a single milestone by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The milestone ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "JourneyMilestones"
        ],
        "summary": "Update an existing milestone",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateJourneyMilestoneRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateJourneyMilestoneRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateJourneyMilestoneRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyMilestoneResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "JourneyMilestones"
        ],
        "summary": "Delete a milestone",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/JourneyMilestones/bulk": {
      "post": {
        "tags": [
          "JourneyMilestones"
        ],
        "summary": "Bulk update milestones (for reordering/status changes)",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateMilestonesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateMilestonesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateMilestonesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Kiosk/lookup": {
      "get": {
        "tags": [
          "Kiosk"
        ],
        "summary": "Lookup users for kiosk display. Returns only users that require time tracking.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KioskUserDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KioskUserDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KioskUserDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Kiosk/status/{userId}": {
      "get": {
        "tags": [
          "Kiosk"
        ],
        "summary": "Get clock status for a specific user (for kiosk display).",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockStatusResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockStatusResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockStatusResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Kiosk/clock/in": {
      "post": {
        "tags": [
          "Kiosk"
        ],
        "summary": "Clock in via kiosk (requires user ID + PIN).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KioskClockRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/KioskClockRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/KioskClockRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Kiosk/clock/out": {
      "post": {
        "tags": [
          "Kiosk"
        ],
        "summary": "Clock out via kiosk (requires user ID + PIN).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KioskClockRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/KioskClockRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/KioskClockRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockingActionResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/LabPanels": {
      "get": {
        "tags": [
          "LabPanels"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "LabPanels"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabPanelDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabPanelDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabPanelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              }
            }
          }
        }
      }
    },
    "/LabPanels/{id}": {
      "get": {
        "tags": [
          "LabPanels"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "LabPanels"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabPanelDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabPanelDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabPanelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabPanelDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "LabPanels"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Labs": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "Get all lab orders with optional filtering",
        "parameters": [
          {
            "name": "patientId",
            "in": "query",
            "description": "Filter by patient ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by order status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resultStatus",
            "in": "query",
            "description": "Filter by result status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "testType",
            "in": "query",
            "description": "Filter by test type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Filter by source",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of records to skip",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "Number of records to take",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "orderedById",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of lab orders",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Labs"
        ],
        "summary": "Create a new lab order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/stats": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "Get lab order stats (counts by status)",
        "responses": {
          "200": {
            "description": "Statistics including counts by status",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabStatsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabStatsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabStatsDto"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/critical": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "Get critical lab orders",
        "responses": {
          "200": {
            "description": "List of lab orders marked as critical",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Labs/queue/{queue}": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "One page of a lab work queue (ITE-638).",
        "description": "     Replaces the unpaged `pending-review` endpoint. The queues are selected by the server\n     now: they used to be client-side slices of `GET /labs` fetched unfiltered and unpaged,\n     which made the screen scale with a clinic's whole lab history rather than with the size of\n     the queue.\n\n     take is capped by the repository, so an omitted or oversized page size still returns\na bounded response.",
        "parameters": [
          {
            "name": "queue",
            "in": "path",
            "description": "review | flagged | awaitingresults | reviewed",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/LabQueue"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Rows to skip.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "Rows to return. Capped server-side.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "orderedById",
            "in": "query",
            "description": "Narrow to one orderer — the Userhub staff filter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderListResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/queue-counts": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "How many orders each lab queue holds (ITE-638).",
        "description": "The badges are on screen constantly, and they are what kept the unbounded fetch alive —\ncounting in the browser meant loading every lab order to do it. This is four numbers and\nno rows.",
        "parameters": [
          {
            "name": "orderedById",
            "in": "query",
            "description": "Narrow to one orderer — the Userhub staff filter. The badges\n    must count what the filtered rails show, or the numbers and the lists disagree.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabQueueCountsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabQueueCountsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabQueueCountsDto"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/unconfirmed-submissions": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "     Orders whose submission was never confirmed with the laboratory (ITE-494).\n\n     The queue that answers \"did that bloodwork actually get ordered?\". Nothing here may be\nresubmitted automatically — a duplicate requisition means a second blood draw.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Labs/{id}/resolve-unconfirmed-submission": {
      "post": {
        "tags": [
          "Labs"
        ],
        "summary": "Clears an order from the unconfirmed queue once someone has checked with the lab.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/patient/{patientId}": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "Get labs for a specific patient",
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of lab orders for the patient",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Labs/appointment/{appointmentId}": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "Get labs for a specific appointment",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "description": "The appointment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of lab orders for the appointment",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabOrderDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Labs/{id}": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "Get a specific lab order by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The lab order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Labs"
        ],
        "summary": "Update a lab order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLabOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Labs"
        ],
        "summary": "Delete a lab order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Labs/{id}/review": {
      "post": {
        "tags": [
          "Labs"
        ],
        "summary": "Review a lab order (mark as reviewed with result status)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewLabOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewLabOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewLabOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/{id}/results": {
      "post": {
        "tags": [
          "Labs"
        ],
        "summary": "Add a result to a lab order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabResultDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabResultDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabResultDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/{id}/reference-intervals": {
      "post": {
        "tags": [
          "Labs"
        ],
        "summary": "     Correct the reference intervals on results of an unfinalized lab order, and re-derive the\n     abnormality flags that depended on them (ITE-499).\n\n     A batch even for a single row: the case this exists for is a whole panel run against the\nwrong species profile, and correcting 25 analytes one call at a time is 25 chances to\nhalf-finish and leave a CBC interpreted against two species at once.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The lab order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The corrections to apply, and an optional shared reason",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AmendReferenceIntervalsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AmendReferenceIntervalsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AmendReferenceIntervalsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/{id}/results/{resultId}": {
      "delete": {
        "tags": [
          "Labs"
        ],
        "summary": "Delete a result from a lab order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resultId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Labs/{id}/notes": {
      "get": {
        "tags": [
          "Labs"
        ],
        "summary": "Get notes for a lab order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The lab order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of notes for the lab order",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabNoteDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabNoteDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LabNoteDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Labs"
        ],
        "summary": "Add a note to a lab order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabNoteDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabNoteDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabNoteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LabNoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabNoteDto"
                }
              }
            }
          }
        }
      }
    },
    "/Labs/{id}/notes/{noteId}": {
      "delete": {
        "tags": [
          "Labs"
        ],
        "summary": "Delete a note from a lab order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/LocationClosures": {
      "get": {
        "tags": [
          "LocationClosures"
        ],
        "summary": "Gets location closures for a specific date, optionally filtered by location.",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "The date to get closures for (required, format: YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Optional filter by location ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LocationClosureListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationClosureListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationClosureListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "LocationClosures"
        ],
        "summary": "Creates a new location closure.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLocationClosureDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLocationClosureDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLocationClosureDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LocationClosureResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationClosureResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationClosureResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/LocationClosures/toggle": {
      "post": {
        "tags": [
          "LocationClosures"
        ],
        "summary": "Toggles a location closure. Creates one if it doesn't exist, deletes it if it does.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToggleLocationClosureDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ToggleLocationClosureDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ToggleLocationClosureDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ToggleLocationClosureResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToggleLocationClosureResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToggleLocationClosureResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/LocationClosures/{id}": {
      "delete": {
        "tags": [
          "LocationClosures"
        ],
        "summary": "Deletes a location closure by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Locations": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Get a paginated list of locations with optional filters",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search query for location name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Field to sort by",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order (asc/desc)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of locations",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LocationListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Locations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLocationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLocationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLocationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Locations/{id}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Get a location by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The location ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Locations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLocationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLocationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLocationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Locations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Locations/{id}/toggle-status": {
      "patch": {
        "tags": [
          "Locations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Locations/active": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Get all active locations (convenience endpoint)",
        "responses": {
          "200": {
            "description": "List of active locations sorted by display order",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationResponseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Locations/hours": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets operating hours for every location (used by the schedule grid so\neach room column can reflect its own hours). Returns a flat list across\nall locations; rooms with no configured hours are simply absent.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Locations/{locationId}/hours": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets operating hours for a location (all days).",
        "parameters": [
          {
            "name": "locationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Bulk upsert operating hours for a location (all 7 days at once).",
        "parameters": [
          {
            "name": "locationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLocationHoursDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLocationHoursDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLocationHoursDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationHoursResponseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Locations/{locationId}/species-restrictions": {
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Replace all species restrictions for a location.\nPass empty array to remove all restrictions (unrestricted).",
        "parameters": [
          {
            "name": "locationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSpeciesRestrictionsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSpeciesRestrictionsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSpeciesRestrictionsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Logos": {
      "get": {
        "tags": [
          "Logos"
        ],
        "summary": "Get all logos for the tenant",
        "responses": {
          "200": {
            "description": "List of all logos for the tenant",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogoListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Logos"
        ],
        "summary": "Create a new logo entry and get presigned upload URL.\nClient should upload the file directly to S3 using the returned upload URL.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLogoRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLogoRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLogoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateLogoResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateLogoResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateLogoResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Logos/{id}": {
      "get": {
        "tags": [
          "Logos"
        ],
        "summary": "Get a specific logo by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The logo ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Logos"
        ],
        "summary": "Update logo metadata",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLogoRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLogoRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLogoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Logos"
        ],
        "summary": "Delete a logo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Logos/default": {
      "get": {
        "tags": [
          "Logos"
        ],
        "summary": "Get the default logo for the tenant",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Logos/{id}/set-default": {
      "post": {
        "tags": [
          "Logos"
        ],
        "summary": "Set a logo as the default",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/medication-requests": {
      "get": {
        "tags": [
          "MedicationRequests"
        ],
        "summary": "List requests. `status` filters the workflow state; `billingState=unbilled`\nis the \"Ready to bill\" pickup worklist (derived, never stored).",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "billingState",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MedicationRequestDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MedicationRequestDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MedicationRequestDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "MedicationRequests"
        ],
        "summary": "Capture a request (front desk, Inventory permission). Nothing billable is\ncreated; the request lands in the provider's approve queue. OTC items\nauto-approve and rest at Approved until pickup.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaptureMedicationRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CaptureMedicationRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CaptureMedicationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/medication-requests/{id}": {
      "get": {
        "tags": [
          "MedicationRequests"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/medication-requests/{id}/approve": {
      "post": {
        "tags": [
          "MedicationRequests"
        ],
        "summary": "Approve (provider with Dispense permission + the primary-provider flag). For Rx\nthis authors the Prescription, routes it, and creates the request's own quote\nestimate with its Pending line (one estimate per request).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveMedicationRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveMedicationRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveMedicationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/medication-requests/{id}/deny": {
      "post": {
        "tags": [
          "MedicationRequests"
        ],
        "summary": "Deny (provider gate mirrors approve). Terminal; nothing billable exists.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DenyMedicationRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DenyMedicationRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DenyMedicationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/medication-requests/{id}/cancel": {
      "post": {
        "tags": [
          "MedicationRequests"
        ],
        "summary": "Cancel from Requested or Approved (a cancel after dispense is a void on the\nestimate line instead). Declines the pending quote line and cancels the Rx.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelMedicationRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelMedicationRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CancelMedicationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/medication-requests/{id}/dispense": {
      "post": {
        "tags": [
          "MedicationRequests"
        ],
        "summary": "Dispense an Approved request from inventory at pickup (Dispense permission).\nRuns the shared dispense engine and fulfills the request's own Pending line;\nworks for both Rx and phoned-in OTC requests.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseMedicationRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseMedicationRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseMedicationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/mentor-metrics/me": {
      "get": {
        "tags": [
          "MentorMetrics"
        ],
        "summary": "Mentor summary for the current user. Returns null Data if they aren't mentoring anyone.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMentorSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMentorSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMentorSummaryDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/mentor-metrics/{mentorId}/summary": {
      "get": {
        "tags": [
          "MentorMetrics"
        ],
        "summary": "Mentor summary for any mentor in the tenant. Manager-only.",
        "parameters": [
          {
            "name": "mentorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMentorSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMentorSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMentorSummaryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/mentor-metrics/{mentorId}/timeline": {
      "get": {
        "tags": [
          "MentorMetrics"
        ],
        "summary": "Mentor's clinical timeline for the period. Accessible to the mentor themself\nor any user with UserManagement; everyone else gets 403.",
        "parameters": [
          {
            "name": "mentorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfMentorTimelineEntryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfMentorTimelineEntryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfMentorTimelineEntryDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/mentor-metrics/mentee/{menteeId}/performance": {
      "get": {
        "tags": [
          "MentorMetrics"
        ],
        "summary": "Per-mentee performance for the given period. Accessible to the mentee's mentor\nor any user with UserManagement; everyone else gets 403.",
        "parameters": [
          {
            "name": "menteeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMenteePerformanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMenteePerformanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfMenteePerformanceDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/mentor-metrics/mentors": {
      "get": {
        "tags": [
          "MentorMetrics"
        ],
        "summary": "List every user in the tenant who mentors at least one other user. Manager-only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfMentorListEntryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfMentorListEntryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfMentorListEntryDto"
                }
              }
            }
          }
        }
      }
    },
    "/Metrics/ebitda": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get EBITDA summary with trend data",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: mtd, qtd, ytd, or specific month (e.g., \"2026-01\")",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfEBITDASummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfEBITDASummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfEBITDASummaryDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/labor": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get labor efficiency metrics by role",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: today, week, month, or date range",
            "schema": {
              "type": "string",
              "default": "month"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfLaborEfficiencyDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfLaborEfficiencyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfLaborEfficiencyDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/variance": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get statistical variance alerts",
        "parameters": [
          {
            "name": "threshold",
            "in": "query",
            "description": "Standard deviation threshold (default 1.5)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double",
              "default": 1.5
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfVarianceAlertsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfVarianceAlertsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfVarianceAlertsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/schedule-heatmap": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get schedule heatmap data (appointment density by day/hour)",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: week, month, quarter",
            "schema": {
              "type": "string",
              "default": "week"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfScheduleHeatmapDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfScheduleHeatmapDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfScheduleHeatmapDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/presence": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get AI presence/activity data",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: today, week, month",
            "schema": {
              "type": "string",
              "default": "today"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPresenceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPresenceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPresenceDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/daily-goals": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get daily goal progress metrics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDailyGoalMetricDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDailyGoalMetricDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDailyGoalMetricDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Metrics"
        ],
        "summary": "Update daily goal targets",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UpdateDailyGoalDto"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UpdateDailyGoalDto"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UpdateDailyGoalDto"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDailyGoalMetricDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDailyGoalMetricDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDailyGoalMetricDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Metrics/kpi-summary": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get KPI summary with sparklines",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfKPISummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfKPISummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfKPISummaryDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/trends": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get trend data for sparkline charts",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: 12m, 6m, 3m",
            "schema": {
              "type": "string",
              "default": "12m"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfTrendsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfTrendsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfTrendsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/pnl": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get P and L summary data",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: mtd, qtd, ytd",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPnLDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPnLDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPnLDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/labor-breakdown": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get labor breakdown for stacked bar chart",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: 4w, 8w, 12w",
            "schema": {
              "type": "string",
              "default": "4w"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfLaborBreakdownChartDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfLaborBreakdownChartDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfLaborBreakdownChartDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/inventory-health": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get inventory health metrics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfInventoryHealthDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfInventoryHealthDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfInventoryHealthDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/patient-funnel": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get patient funnel data",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "Date filter (defaults to today)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPatientFunnelDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPatientFunnelDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPatientFunnelDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/provider-rankings": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get provider rankings",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: mtd, qtd, ytd",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of providers to return (default 5)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfProviderRankingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfProviderRankingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfProviderRankingsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/financial-details": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get financial details for table view",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: mtd, qtd, ytd",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfFinancialDetailsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfFinancialDetailsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfFinancialDetailsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/communications": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get communications metrics",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: today, week, month",
            "schema": {
              "type": "string",
              "default": "today"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCommunicationsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCommunicationsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCommunicationsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/dashboard-summary": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get dashboard summary metrics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDashboardSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDashboardSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDashboardSummaryDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/normalized-performance": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get normalized performance metrics",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: mtd, qtd, ytd",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfNormalizedPerformanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfNormalizedPerformanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfNormalizedPerformanceDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/ai-impact": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get AI impact metrics (marketing-friendly numbers derived from real data)",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: today, week, month, mtd, ytd",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfAiImpactMetricsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfAiImpactMetricsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfAiImpactMetricsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/top-revenue-items": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get top revenue-generating items (services and inventory)",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: mtd, qtd, ytd",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of items to return (default 10)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfTopRevenueItemsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfTopRevenueItemsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfTopRevenueItemsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/procedure-category-rankings": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get revenue rankings by procedure/service category",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: mtd, qtd, ytd",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of categories to return (default 5)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 5
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfProcedureCategoryRankingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfProcedureCategoryRankingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfProcedureCategoryRankingsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/patient-transactions": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get recent patient transactions for the master grid",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based, default 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of transactions per page (default 10)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recurringOnly",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPatientTransactionsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPatientTransactionsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfPatientTransactionsDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/dvm-production": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get DVM production metrics (PAW-108, Phase 1): per-provider revenue/hours/visits and clinic totals.",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDvmProductionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDvmProductionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDvmProductionDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/signals": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get the severity-weighted DVM Production signals on their own (PAW-579), for the\nBI Overview tab and the home page.",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDvmSignalDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDvmSignalDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDvmSignalDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/compensation-settings": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "List veterinarian compensation settings (PAW-108 Phase 2).\nOne row per primary-provider user; `IsConfigured` is false for un-modeled providers.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfCompensationSettingDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfCompensationSettingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfCompensationSettingDto"
                }
              }
            }
          }
        }
      }
    },
    "/Metrics/compensation-settings/{userId}": {
      "put": {
        "tags": [
          "Metrics"
        ],
        "summary": "Upsert a veterinarian's compensation settings. Requires user_management permission\nsince this controls how margin/profit numbers are reported.",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertCompensationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertCompensationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertCompensationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationSettingDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationSettingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationSettingDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Metrics/compensation-exclusions": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get service-mix buckets excluded from production-pay revenue (PAW-578):\nclinic-wide buckets plus per primary-provider overrides.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationExclusionsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationExclusionsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationExclusionsDto"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Metrics"
        ],
        "summary": "Replace the excluded-bucket set for one scope (\"clinic\" or a single \"vet\").\nRequires user_management since it changes how production pay is reported.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertCompensationExclusionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertCompensationExclusionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertCompensationExclusionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationExclusionsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationExclusionsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfCompensationExclusionsDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Metrics/dvm-production/{providerId}/diagnosis": {
      "post": {
        "tags": [
          "Metrics"
        ],
        "summary": "AI root-cause diagnosis for one provider's DVM Production drill-down (PAW-576).\nPOST since it may trigger an LLM call; the result is cached server-side.",
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDvmDiagnosisDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDvmDiagnosisDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDvmDiagnosisDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Metrics/deferred-services": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Clinic-wide breakdown of deferred (client-declined) services by individual service over a\nperiod, weighted by frequency. Drives the BI \"Deferred Services\" card.",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Period filter: mtd, qtd, ytd, week, \"yyyy-MM\", or \"yyyy-MM-dd:yyyy-MM-dd\"",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDeferredServicesBreakdownDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDeferredServicesBreakdownDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfDeferredServicesBreakdownDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/Metrics/deferred-services/list": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Drill-down list of the deferred services behind one breakdown bucket (by service key) over a period.",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "mtd"
            }
          },
          {
            "name": "serviceKey",
            "in": "query",
            "schema": {
              "type": "string",
              "default": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDeferredServiceItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDeferredServiceItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessMetricsResponseDtoOfListOfDeferredServiceItemDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/nps/insights": {
      "get": {
        "tags": [
          "NpsAnalytics"
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NpsInsightsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NpsInsightsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NpsInsightsDto"
                }
              }
            }
          }
        }
      }
    },
    "/nps/responses": {
      "get": {
        "tags": [
          "NpsAnalytics"
        ],
        "parameters": [
          {
            "name": "unresolvedOnly",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "minScore",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "maxScore",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NpsResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NpsResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NpsResponseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/nps/responses/{id}": {
      "patch": {
        "tags": [
          "NpsAnalytics"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNpsResponseDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNpsResponseDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNpsResponseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NpsResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NpsResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NpsResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/online-booking/readiness": {
      "get": {
        "tags": [
          "OnlineBookingReadiness"
        ],
        "summary": "Evaluates online-booking readiness for the tenant. Optional filters narrow the\nevaluation to one appointment type and/or species; a clinic-local date\nadditionally runs the real engine for that day and returns its slots — the ITE-560\nslot tester (\"preview as a client\").",
        "parameters": [
          {
            "name": "appointmentTypeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "speciesId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BookingReadinessReport"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingReadinessReport"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingReadinessReport"
                }
              }
            }
          }
        }
      }
    },
    "/Partners": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get a list of partners with optional filters",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Filter by partner type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term for partner name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of partners matching the filters",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Partners"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePartnerDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePartnerDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePartnerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              }
            }
          }
        }
      }
    },
    "/Partners/{id}": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get a specific partner by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The partner ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Partners"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnerDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnerDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Partners"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Partners/{id}/access": {
      "put": {
        "tags": [
          "Partners"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnerAccessDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnerAccessDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePartnerAccessDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              }
            }
          }
        }
      }
    },
    "/PatientGroups": {
      "get": {
        "tags": [
          "PatientGroups"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PatientGroups"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientGroupDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientGroupDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientGroupDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              }
            }
          }
        }
      }
    },
    "/PatientGroups/by-patient/{patientId}": {
      "get": {
        "tags": [
          "PatientGroups"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientGroupSummaryDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientGroupSummaryDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientGroupSummaryDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/PatientGroups/{id}": {
      "get": {
        "tags": [
          "PatientGroups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "PatientGroups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientGroupDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientGroupDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientGroupDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupDto"
                }
              }
            }
          }
        }
      }
    },
    "/PatientGroups/{id}/members": {
      "post": {
        "tags": [
          "PatientGroups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientGroupMemberDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientGroupMemberDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientGroupMemberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupMemberDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupMemberDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupMemberDto"
                }
              }
            }
          }
        }
      }
    },
    "/PatientGroups/{id}/members/{memberId}": {
      "patch": {
        "tags": [
          "PatientGroups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientGroupMemberDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientGroupMemberDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientGroupMemberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupMemberDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupMemberDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientGroupMemberDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PatientGroups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/PatientGroups/{id}/members/{memberId}/promote": {
      "post": {
        "tags": [
          "PatientGroups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromoteMemberRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PromoteMemberRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PromoteMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PromoteMemberResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromoteMemberResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromoteMemberResponse"
                }
              }
            }
          }
        }
      }
    },
    "/patients/{patientId}/masses": {
      "get": {
        "tags": [
          "PatientMasses"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientMassResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientMassResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientMassResponseDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PatientMasses"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientMassRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientMassRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientMassRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/patients/{patientId}/masses/{massId}": {
      "put": {
        "tags": [
          "PatientMasses"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "massId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientMassRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientMassRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientMassRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PatientMasses"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "massId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/patients/{patientId}/masses/{massId}/measurements": {
      "post": {
        "tags": [
          "PatientMasses"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "massId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientMassMeasurementRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientMassMeasurementRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientMassMeasurementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassMeasurementDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassMeasurementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassMeasurementDto"
                }
              }
            }
          }
        }
      }
    },
    "/patients/{patientId}/masses/{massId}/measurements/{measurementId}": {
      "put": {
        "tags": [
          "PatientMasses"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "massId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "measurementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientMassMeasurementRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientMassMeasurementRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientMassMeasurementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassMeasurementDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassMeasurementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMassMeasurementDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/patients/{patientId}/problems": {
      "get": {
        "tags": [
          "PatientProblems"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientProblemDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientProblemDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientProblemDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PatientProblems"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientProblemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientProblemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientProblemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientProblemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientProblemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientProblemDto"
                }
              }
            }
          }
        }
      }
    },
    "/patients/{patientId}/problems/{id}": {
      "put": {
        "tags": [
          "PatientProblems"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientProblemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientProblemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientProblemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientProblemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientProblemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientProblemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PatientProblems"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/patients/{patientId}/export/pdf": {
      "post": {
        "tags": [
          "PatientRecordExport"
        ],
        "summary": "Download patient record as PDF",
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PatientRecordExportOptions"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PatientRecordExportOptions"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PatientRecordExportOptions"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": { }
            }
          }
        }
      }
    },
    "/patients/{patientId}/export/email": {
      "post": {
        "tags": [
          "PatientRecordExport"
        ],
        "summary": "Email patient record as PDF attachment",
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendPatientRecordEmailRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendPatientRecordEmailRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendPatientRecordEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendResult"
                }
              }
            }
          }
        }
      }
    },
    "/patients/{patientId}/export/csv": {
      "post": {
        "tags": [
          "PatientRecordExport"
        ],
        "summary": "Download patient record as CSV",
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PatientRecordExportOptions"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PatientRecordExportOptions"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PatientRecordExportOptions"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": { }
            }
          }
        }
      }
    },
    "/Patients": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get a paginated list of patients with optional filters",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Filter by client ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "species",
            "in": "query",
            "description": "Filter by species",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search query matching patient name, breed, microchip number, or owner name; multiple words are ANDed so \"Max Myers\" finds patient Max owned by Myers; a full patient ID matches that patient exactly",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Field to sort by",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order (asc/desc)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "tagId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of patients with appointment summary data",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Patients"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get a patient by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Patients"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Patients"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Patients/{id}/client": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get the client (owner) for a patient",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/contacts": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get the contacts (people) related to a patient, with relationship type and per-patient\npermissions. Primary owner first. Part of the patient↔client relationship layer (PAW-626).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Patients"
        ],
        "summary": "Add a non-primary contact (co-owner, emergency contact, etc.) to a patient (PAW-659/PAW-650).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPatientContactRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPatientContactRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddPatientContactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/transfer-ownership": {
      "post": {
        "tags": [
          "Patients"
        ],
        "summary": "Transfer a patient's primary ownership to another client (PAW-659). Moves a pet between\nclients (wrong-client correction, owner passed away, sold/rehomed). The previous owner is\nkept as a co-owner or removed per the request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOwnershipRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOwnershipRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOwnershipRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/contacts/{contactId}": {
      "delete": {
        "tags": [
          "Patients"
        ],
        "summary": "Remove a contact from a patient. The primary owner cannot be removed — transfer ownership first.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PatientContactDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/soapnotes": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get all SOAP notes for a patient",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SoapNoteDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SoapNoteDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SoapNoteDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/vitals/summary": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get vitals summary for a patient including latest measurements and vital types",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VitalsSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalsSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalsSummaryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/activity": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get activity timeline for a patient from the event-driven PatientActivity table",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of activities to return (default: 50)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientActivityTimelineDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientActivityTimelineDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientActivityTimelineDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/external-medications": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get outside medications (out-of-band, e.g. filled at an online/outside pharmacy)\nrecorded on a patient for tracking. Intentionally separate from inventory and Rx\ngovernance — there may be no matching inventory item. NOTE: the \"external-medications\"\nroute (and the external_medication_requests table) are kept stable across the\nOutsideMedication rename — the rename freed \"MedicationRequest\" for the stateful\nrequest entity (docs/medication-request-lifecycle-design.md).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OutsideMedicationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OutsideMedicationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OutsideMedicationDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Patients"
        ],
        "summary": "Record a new external (out-of-band) medication request on a patient. Tracking only —\nthis never touches inventory or the Rx governance workflow.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The medication request details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOutsideMedicationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOutsideMedicationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOutsideMedicationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/external-medications/{requestId}/status": {
      "post": {
        "tags": [
          "Patients"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOutsideMedicationStatusDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOutsideMedicationStatusDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOutsideMedicationStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutsideMedicationDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/external-medications/{requestId}": {
      "delete": {
        "tags": [
          "Patients"
        ],
        "summary": "Delete an external medication request from a patient.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "description": "The external medication request ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/medications": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get medication history for a patient including prescriptions and OTC dispenses",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMedicationsResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMedicationsResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientMedicationsResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/unbilled-items": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get unbilled items for a patient (dispensed medications not yet on an invoice)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DispensedItemDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DispensedItemDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DispensedItemDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/deferred-services": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Get the deferred (client-declined) services for a patient, most-recently-declined first.\nEach item links back to its appointment for drill-down.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeferredServiceItemDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeferredServiceItemDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeferredServiceItemDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Patients/{id}/deceased": {
      "post": {
        "tags": [
          "Patients"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkDeceasedRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkDeceasedRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MarkDeceasedRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Get a paginated list of payments with optional filters",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by payment status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "method",
            "in": "query",
            "description": "Filter by payment method",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Filter by client ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "query",
            "description": "Filter by estimate ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Free-text search across payment number, invoice/estimate number, and client name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Get a specific payment by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The payment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/estimate/{invoiceId}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Get payment summary for an estimate",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "description": "The estimate ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoicePaymentSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoicePaymentSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoicePaymentSummaryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/cash": {
      "post": {
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCashPaymentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCashPaymentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCashPaymentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/mark-as-paid": {
      "post": {
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarkAsPaidPaymentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarkAsPaidPaymentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarkAsPaidPaymentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/check": {
      "post": {
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckPaymentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckPaymentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckPaymentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/ach": {
      "post": {
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAchPaymentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAchPaymentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAchPaymentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/card-on-file": {
      "post": {
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCardOnFilePaymentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCardOnFilePaymentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCardOnFilePaymentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/text2pay": {
      "post": {
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateText2PayDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateText2PayDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateText2PayDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/terminal": {
      "post": {
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTerminalPaymentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTerminalPaymentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTerminalPaymentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/terminal/auth-only": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Add a card on file by reading the card at the terminal and tokenizing it.\nUses the gateway's token-only endpoint: the card is never authorized or charged,\nso — unlike a real auth — there is no hold to release afterwards and nothing to void.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAuthOnlyDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAuthOnlyDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAuthOnlyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AuthOnlyResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthOnlyResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthOnlyResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/{id}/refund": {
      "post": {
        "tags": [
          "Payments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundPaymentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundPaymentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RefundPaymentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/{id}/reverse": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Reverse a payment - tries void first (for unsettled transactions), falls back to refund.\nThis is the recommended endpoint for canceling payments as it automatically picks the right method.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The payment ID to reverse",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The reverse payment request containing amount and reason",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReversePaymentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReversePaymentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReversePaymentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReversePaymentResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReversePaymentResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReversePaymentResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/reconciliation/summary": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Get reconciliation summary for a specific date",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "The date to get summary for (defaults to today in clinic timezone)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reconciliation summary including totals by payment method",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationSummaryDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/reconciliation/summary/range": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Get reconciliation summaries for a date range (max 365 days)",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date of the range",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date of the range",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReconciliationSummaryDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReconciliationSummaryDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReconciliationSummaryDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/reconciliation/close": {
      "post": {
        "tags": [
          "Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloseOutDayDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CloseOutDayDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CloseOutDayDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CloseOutResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CloseOutResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CloseOutResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/batch/close": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Close the current open batch in XplorPay, settling all unsettled transactions.\nThis initiates the batch-out process with the payment processor.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCloseResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCloseResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCloseResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Payments/refund/blind": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Process a blind (standalone) terminal refund.\nThis refund is not tied to a previous transaction - customer presents card at terminal.\nUsed when the original transaction was processed elsewhere or cannot be found.",
        "requestBody": {
          "description": "The blind refund request details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBlindRefundDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBlindRefundDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBlindRefundDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BlindRefundResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlindRefundResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlindRefundResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/PaymentTokens/client/{clientId}": {
      "get": {
        "tags": [
          "PaymentTokens"
        ],
        "summary": "Get all payment tokens for a client",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "description": "The client ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of payment tokens for the client",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenListResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/PaymentTokens/{id}": {
      "get": {
        "tags": [
          "PaymentTokens"
        ],
        "summary": "Get a specific payment token by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The payment token ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "PaymentTokens"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentTokenDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentTokenDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentTokenDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PaymentTokens"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/PaymentTokens": {
      "post": {
        "tags": [
          "PaymentTokens"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentTokenDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentTokenDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentTokenDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTokenDto"
                }
              }
            }
          }
        }
      }
    },
    "/Phones/webrtc/credentials": {
      "get": {
        "tags": [
          "Phones"
        ],
        "summary": "Get WebRTC credentials for Telnyx client initialization.\nReturns SIP credentials needed to establish WebRTC connection.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebRtcCredentialsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebRtcCredentialsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebRtcCredentialsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Phones/calls/history": {
      "get": {
        "tags": [
          "Phones"
        ],
        "summary": "Get call history from the VoiceCalls table (Telnyx/Retell calls).",
        "parameters": [
          {
            "name": "take",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CallHistoryResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallHistoryResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallHistoryResponse"
                }
              }
            }
          }
        }
      }
    },
    "/PriceRules": {
      "get": {
        "tags": [
          "PriceRules"
        ],
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupCodeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PriceRules"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavePriceRuleDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SavePriceRuleDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SavePriceRuleDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/PriceRules/{id}": {
      "get": {
        "tags": [
          "PriceRules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "PriceRules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavePriceRuleDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SavePriceRuleDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SavePriceRuleDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRuleDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PriceRules"
        ],
        "summary": "Two-step delete. An active rule deactivates (200 with outcome\n\"deactivated\"); calling delete again on an inactive rule hard-deletes\nit along with its audit rows (200 with outcome \"hardDeleted\").",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DeletePriceRuleResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletePriceRuleResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletePriceRuleResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/PriceRules/activity": {
      "get": {
        "tags": [
          "PriceRules"
        ],
        "summary": "Aggregated activity per price rule over paid estimates: times fired,\ntotal discount given away, last fired. Restricted to paid estimates\nbecause audit rows on draft estimates are reconciled on every recalc.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceRuleActivityRowDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceRuleActivityRowDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceRuleActivityRowDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/Printers/test-print": {
      "post": {
        "tags": [
          "Printers"
        ],
        "summary": "Queues the standardised test label (ITE-618) so a newly configured queue can be\nchecked without printing a real prescription. It travels the same path as a real\nlabel — same geometry source, same S3 upload, same PrintJob, same gateway — because a\ntest that bypassed the pipeline would not prove the pipeline works.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintTestLabelRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintTestLabelRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PrintTestLabelRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrintLabelResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintLabelResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintLabelResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Printers": {
      "get": {
        "tags": [
          "Printers"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrinterDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrinterDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrinterDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Printers"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePrinterDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePrinterDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePrinterDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Printers/{id}": {
      "get": {
        "tags": [
          "Printers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Printers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrinterDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrinterDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrinterDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Printers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Printers/{id}/set-default": {
      "post": {
        "tags": [
          "Printers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/print-jobs": {
      "post": {
        "tags": [
          "PrintJobs"
        ],
        "summary": "Create a print job from an uploaded PDF file (multipart/form-data)",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "ContentType": {
                        "type": "string"
                      },
                      "ContentDisposition": {
                        "type": "string"
                      },
                      "Headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "Length": {
                        "pattern": "^-?(?:0|[1-9]\\d*)$",
                        "type": [
                          "integer",
                          "string"
                        ],
                        "format": "int64"
                      },
                      "Name": {
                        "type": "string"
                      },
                      "FileName": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "printerName": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "sourceType": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "sourceId": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/print-jobs/from-source": {
      "post": {
        "tags": [
          "PrintJobs"
        ],
        "summary": "Create a print job from an existing backend data source (backend generates PDF)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePrintJobFromSourceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePrintJobFromSourceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePrintJobFromSourceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/print-jobs/{id}": {
      "get": {
        "tags": [
          "PrintJobs"
        ],
        "summary": "Get print job status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/print-jobs/download-pdf": {
      "get": {
        "tags": [
          "PrintJobs"
        ],
        "summary": "Download a PDF for browser-based viewing/printing (no print job created)",
        "parameters": [
          {
            "name": "sourceType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/PtoRequests": {
      "get": {
        "tags": [
          "PtoRequests"
        ],
        "summary": "Get a paginated and filtered list of PTO requests",
        "parameters": [
          {
            "name": "UserId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Type",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PtoRequestType"
            }
          },
          {
            "name": "Status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PtoRequestStatus"
            }
          },
          {
            "name": "StartDateFrom",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "StartDateTo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ReviewedByUserId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Query",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortOrder",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PtoRequests"
        ],
        "summary": "Create a new PTO request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePtoRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePtoRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePtoRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/PtoRequests/{id}": {
      "get": {
        "tags": [
          "PtoRequests"
        ],
        "summary": "Get a single PTO request by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "PtoRequests"
        ],
        "summary": "Update an existing PTO request",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePtoRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePtoRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePtoRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PtoRequests"
        ],
        "summary": "Delete a PTO request by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/PtoRequests/{id}/resolve": {
      "post": {
        "tags": [
          "PtoRequests"
        ],
        "summary": "Resolve (approve or deny) a PTO request",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolvePtoRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolvePtoRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ResolvePtoRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PtoRequestResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/nps/{token}": {
      "get": {
        "tags": [
          "PublicNps"
        ],
        "summary": "Loads the survey form for a signed token. Returns 404 for invalid/expired tokens.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NpsPublicSurveyDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NpsPublicSurveyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NpsPublicSurveyDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PublicNps"
        ],
        "summary": "Submits a survey response. Returns the GoogleReviewUrl when score &gt;= 9 and a Place ID is configured.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NpsSubmitDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/NpsSubmitDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NpsSubmitDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NpsSubmitResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NpsSubmitResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NpsSubmitResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/price-list-entries": {
      "get": {
        "tags": [
          "PublicPriceList"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PublicPriceList"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePublicPriceListEntryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePublicPriceListEntryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePublicPriceListEntryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListEntryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListEntryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListEntryDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/price-list-entries/{id}": {
      "patch": {
        "tags": [
          "PublicPriceList"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePublicPriceListEntryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePublicPriceListEntryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePublicPriceListEntryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListEntryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListEntryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPriceListEntryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PublicPriceList"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/price-list-entries/reorder": {
      "patch": {
        "tags": [
          "PublicPriceList"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderPublicPriceListDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderPublicPriceListDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderPublicPriceListDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/public/questionnaires/{token}": {
      "get": {
        "tags": [
          "PublicQuestionnaires"
        ],
        "summary": "Get a questionnaire by public token (no authentication required)",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "description": "The public access token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuestionnaireDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuestionnaireDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicQuestionnaireDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/questionnaires/submit": {
      "post": {
        "tags": [
          "PublicQuestionnaires"
        ],
        "summary": "Submit a questionnaire response via public token (no authentication required)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitQuestionnaireResponseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitQuestionnaireResponseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitQuestionnaireResponseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/public/sms-consent/{token}": {
      "get": {
        "tags": [
          "PublicSmsConsent"
        ],
        "summary": "Get SMS consent form data by magic link token",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "description": "The magic link token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSmsConsentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSmsConsentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSmsConsentDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/sms-consent/submit": {
      "post": {
        "tags": [
          "PublicSmsConsent"
        ],
        "summary": "Submit SMS consent from magic link form",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSmsConsentFromLinkRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSmsConsentFromLinkRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSmsConsentFromLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              }
            }
          }
        }
      }
    },
    "/PurchaseOrders": {
      "get": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Get a list of purchase orders with optional filters",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by order status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "description": "Filter by vendor ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/PurchaseOrders/{id}": {
      "get": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Get a specific purchase order by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The purchase order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "PurchaseOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/PurchaseOrders/{id}/items": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPurchaseOrderItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPurchaseOrderItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddPurchaseOrderItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/PurchaseOrders/{id}/items/{itemId}": {
      "delete": {
        "tags": [
          "PurchaseOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/PurchaseOrders/{id}/send": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/PurchaseOrders/{id}/receive": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiveOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiveOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiveOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/PurchaseOrders/from-import": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderFromImportDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderFromImportDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePurchaseOrderFromImportDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/PurchaseOrders/{id}/close": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/PurchaseOrders/{id}/cancel": {
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/QiEvents": {
      "get": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Get all QI events with optional filtering",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "take",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Create a new QI event",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQiEventDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQiEventDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQiEventDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              }
            }
          }
        }
      }
    },
    "/QiEvents/stats": {
      "get": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Get QI event stats (counts by status)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventStatsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventStatsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventStatsDto"
                }
              }
            }
          }
        }
      }
    },
    "/QiEvents/{id}": {
      "get": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Get a specific QI event by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/QiEvents/{id}/status": {
      "patch": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Update QI event status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQiEventStatusDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQiEventStatusDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQiEventStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/QiEvents/{id}/resolve": {
      "post": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Resolve a QI event",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/QiEvents/{id}/notes": {
      "get": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Get notes for a QI event",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QiEventNoteDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QiEventNoteDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QiEventNoteDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Add a note to a QI event",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQiEventNoteDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQiEventNoteDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQiEventNoteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventNoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QiEventNoteDto"
                }
              }
            }
          }
        }
      }
    },
    "/QiEvents/{id}/notes/{noteId}": {
      "delete": {
        "tags": [
          "QiEvents"
        ],
        "summary": "Delete a note from a QI event",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/QuestionnaireResponses": {
      "get": {
        "tags": [
          "QuestionnaireResponses"
        ],
        "summary": "Get a paginated and filtered list of questionnaire responses",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "questionnaireId",
            "in": "query",
            "description": "Filter by questionnaire ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "description": "Filter by patient ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Filter by client ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appointmentId",
            "in": "query",
            "description": "Filter by appointment ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by response status",
            "schema": {
              "$ref": "#/components/schemas/QuestionnaireResponseStatus"
            }
          },
          {
            "name": "submittedAfter",
            "in": "query",
            "description": "Filter by submission date (after)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "submittedBefore",
            "in": "query",
            "description": "Filter by submission date (before)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of questionnaire responses",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "QuestionnaireResponses"
        ],
        "summary": "Create a new questionnaire response",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireResponseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireResponseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireResponseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/QuestionnaireResponses/{id}": {
      "get": {
        "tags": [
          "QuestionnaireResponses"
        ],
        "summary": "Get a single questionnaire response by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The questionnaire response ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "QuestionnaireResponses"
        ],
        "summary": "Update an existing questionnaire response",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuestionnaireResponseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuestionnaireResponseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuestionnaireResponseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "QuestionnaireResponses"
        ],
        "summary": "Delete a questionnaire response",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/QuestionnaireResponses/{id}/links": {
      "post": {
        "tags": [
          "QuestionnaireResponses"
        ],
        "summary": "Create a public link for a questionnaire response",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireLinkRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireLinkRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireLinkResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireLinkResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireLinkResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Questionnaires/process-reminders": {
      "post": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Sends due expiry reminders for unfilled questionnaires in the calling tenant.\nDriven per-tenant by Orchestrate's QuestionnaireSchedulerService.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Questionnaires": {
      "get": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Get a paginated and filtered list of questionnaires",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter by questionnaire type",
            "schema": {
              "$ref": "#/components/schemas/QuestionnaireType"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by questionnaire status",
            "schema": {
              "$ref": "#/components/schemas/QuestionnaireStatus"
            }
          },
          {
            "name": "isTemplate",
            "in": "query",
            "description": "Filter by template flag",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term for questionnaire name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of questionnaires",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Create a new questionnaire",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuestionnaireRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              }
            }
          }
        }
      }
    },
    "/Questionnaires/{id}": {
      "get": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Get a single questionnaire by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The questionnaire ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Update an existing questionnaire",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuestionnaireRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuestionnaireRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuestionnaireRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Delete a questionnaire",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Questionnaires/{id}/used-by": {
      "get": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Lists automations that reference this questionnaire. Empty list if none.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuestionnaireUsedByItemDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuestionnaireUsedByItemDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuestionnaireUsedByItemDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Questionnaires/{id}/validation-info": {
      "get": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Lightweight lookup used by Orchestrate.API to verify that a questionnaire exists and\nis in a state suitable for automation references (Published). Returns 404 when missing\nso the caller can map to a typed orphan-validation error.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireValidationInfoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireValidationInfoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireValidationInfoDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Questionnaires/send": {
      "post": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Send a questionnaire to a client via email/SMS.\nUsed by the unified automation action system from Orchestrate.API.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendQuestionnaireRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendQuestionnaireRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendQuestionnaireRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireSendResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireSendResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireSendResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Questionnaires/send-manual": {
      "post": {
        "tags": [
          "Questionnaires"
        ],
        "summary": "Manually send a questionnaire to a client via email/SMS.\nUsed by staff from the UI (chat, client profile, patient profile).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendQuestionnaireRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendQuestionnaireRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendQuestionnaireRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireSendResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireSendResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionnaireSendResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/batches": {
      "post": {
        "tags": [
          "RabiesTags"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRabiesTagBatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRabiesTagBatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRabiesTagBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagBatchDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagBatchDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagBatchDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "RabiesTags"
        ],
        "parameters": [
          {
            "name": "inventoryLocationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activeOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagBatchDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagBatchDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagBatchDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/batches/{id}": {
      "put": {
        "tags": [
          "RabiesTags"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRabiesTagBatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRabiesTagBatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRabiesTagBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagBatchDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagBatchDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagBatchDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/batches/{batchId}/next": {
      "get": {
        "tags": [
          "RabiesTags"
        ],
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NextAvailableTagDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextAvailableTagDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextAvailableTagDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/next": {
      "get": {
        "tags": [
          "RabiesTags"
        ],
        "summary": "Suggest the next available tag from the active batch for a location + tag type.",
        "parameters": [
          {
            "name": "inventoryLocationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagType",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "OneYear"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NextAvailableTagDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextAvailableTagDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextAvailableTagDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/assign": {
      "post": {
        "tags": [
          "RabiesTags"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignRabiesTagRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignRabiesTagRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AssignRabiesTagRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/{tagId}/void": {
      "post": {
        "tags": [
          "RabiesTags"
        ],
        "parameters": [
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidRabiesTagRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidRabiesTagRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VoidRabiesTagRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/{tagId}/replace": {
      "post": {
        "tags": [
          "RabiesTags"
        ],
        "parameters": [
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceRabiesTagRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceRabiesTagRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceRabiesTagRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesTagDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/by-patient/{patientId}": {
      "get": {
        "tags": [
          "RabiesTags"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/rabies-tags/by-vaccination/{vaccinationRecordId}": {
      "get": {
        "tags": [
          "RabiesTags"
        ],
        "parameters": [
          {
            "name": "vaccinationRecordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RabiesTagDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/sessions": {
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Create a new RDVM portal session (anonymous)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRdvmSessionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRdvmSessionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRdvmSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmSessionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmSessionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmSessionDto"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/register": {
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Register a new RDVM for a clinic",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRdvmRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRdvmRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRdvmRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmRegistrationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmRegistrationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmRegistrationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/auth/send-verification": {
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Send a verification code to the RDVM's email",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmVerificationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmVerificationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmVerificationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SendRdvmVerificationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendRdvmVerificationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendRdvmVerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/auth/verify": {
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Verify the 6-digit code and authenticate the RDVM",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRdvmCodeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRdvmCodeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRdvmCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmVerifyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmVerifyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmVerifyResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/portal/session": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get the current RDVM portal session status",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmPortalSessionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmPortalSessionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmPortalSessionDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/referrals": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get all referrals created by the authenticated RDVM",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmReferralsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmReferralsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmReferralsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Create a new referral",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRdvmReferralRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRdvmReferralRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRdvmReferralRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/referrals/{referralId}": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get details of a specific referral",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDetailDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/referrals/{referralId}/messages": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get messages for a referral",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmReferralMessagesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmReferralMessagesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmReferralMessagesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Send a message on a referral",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmReferralMessageRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmReferralMessageRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmReferralMessageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralMessageDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralMessageDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralMessageDto"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/slots": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get available appointment slots for a clinic.\nSame logic as the widget booking - providers are embedded in slot data.",
        "parameters": [
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID (required)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "The date to get slots for",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "appointmentTypeId",
            "in": "query",
            "description": "Optional filter by appointment type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Optional filter by location",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "description": "Optional filter by provider",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmSlotsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmSlotsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmSlotsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/appointment-types": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get appointment types available for RDVM referrals.",
        "parameters": [
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID (required)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmAppointmentTypesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmAppointmentTypesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmAppointmentTypesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/species": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get species available for RDVM referrals.",
        "parameters": [
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID (required)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmSpeciesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmSpeciesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRdvmSpeciesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/triage/conversations": {
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Start a new triage AI conversation.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartRdvmTriageRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StartRdvmTriageRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StartRdvmTriageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StartRdvmTriageResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartRdvmTriageResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartRdvmTriageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/triage/conversations/{threadId}/messages": {
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Send a message to an existing triage conversation.",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmTriageMessageRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmTriageMessageRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendRdvmTriageMessageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SendRdvmTriageMessageResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendRdvmTriageMessageResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendRdvmTriageMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/triage/conversations/{threadId}": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get conversation history for a triage thread.",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "description": "The triage conversation thread ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmTriageHistoryResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmTriageHistoryResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmTriageHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/referrals/{referralId}/documents": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Get documents for a referral\nRDVM can see:\n- Documents they uploaded\n- Documents shared by the clinic (IsSent = true)\n- All documents if they have canViewRecords permission",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Upload a document from RDVM portal",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The clinic ID",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "sessionId": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "clinicId": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "documentType": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/referrals/{referralId}/documents/{documentId}/download": {
      "get": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Download a document from RDVM portal",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "description": "The document ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Found"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/referrals/{referralId}/documents/{documentId}": {
      "patch": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Update the description on a referral document (RDVM can only update their own uploads)",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDocumentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDocumentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmDocumentDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Delete a document uploaded by the RDVM (can only delete own uploads)",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "description": "The document ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/rdvm/referrals/{referralId}/export": {
      "post": {
        "tags": [
          "RdvmPortal"
        ],
        "summary": "Export patient records on-demand (requires canViewRecords permission)\nReturns PDF directly for download, not stored as a document",
        "parameters": [
          {
            "name": "referralId",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Export options",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RdvmExportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RdvmExportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RdvmExportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Recordings": {
      "get": {
        "tags": [
          "Recordings"
        ],
        "summary": "Get a paginated and filtered list of recordings",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by recording status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "description": "Filter by patient ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "query",
            "description": "Filter by user ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of recordings",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Recordings/{id}": {
      "get": {
        "tags": [
          "Recordings"
        ],
        "summary": "Get a single recording by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The recording ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Recordings"
        ],
        "summary": "Update recording metadata",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecordingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecordingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecordingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              }
            }
          }
        }
      }
    },
    "/Recordings/appointment/{appointmentId}": {
      "get": {
        "tags": [
          "Recordings"
        ],
        "summary": "Get recording by appointment ID",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "description": "The appointment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Recordings/{id}/audio-url": {
      "get": {
        "tags": [
          "Recordings"
        ],
        "summary": "Get a presigned URL for downloading recording audio",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Recordings/{id}/audio-urls": {
      "get": {
        "tags": [
          "Recordings"
        ],
        "summary": "Get presigned URLs for every stored audio session of a recording, oldest-first.\nA recording finalized more than once (e.g. a post-op dictation after the main capture)\nhas one entry per session; audio-url returns only the latest.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Recordings/{id}/exam/save": {
      "post": {
        "tags": [
          "Recordings"
        ],
        "summary": "Explicit \"Save exam\" for the custom exam step (PAW-740): persists the narrative\nresponses like the autosave PATCH, then runs the binding interpreter so bound fields\nemit real vitals and physical-exam findings. This is the single semantic commit point —\nthe debounced autosave keeps persisting narrative JSON but never interprets.\nBinding failures never block the save; they come back as per-field results.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveCustomExamRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveCustomExamRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SaveCustomExamRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SaveCustomExamResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveCustomExamResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveCustomExamResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Recordings/{id}/status": {
      "put": {
        "tags": [
          "Recordings"
        ],
        "summary": "Update recording transcript status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecordingStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecordingStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecordingStatusRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordingDetailDto"
                }
              }
            }
          }
        }
      }
    },
    "/RecurringExpenses": {
      "get": {
        "tags": [
          "RecurringExpenses"
        ],
        "summary": "Get all recurring expenses",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "RecurringExpenses"
        ],
        "summary": "Create a recurring expense",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRecurringExpenseDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRecurringExpenseDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRecurringExpenseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              }
            }
          }
        }
      }
    },
    "/RecurringExpenses/{id}": {
      "get": {
        "tags": [
          "RecurringExpenses"
        ],
        "summary": "Get recurring expense by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "RecurringExpenses"
        ],
        "summary": "Update a recurring expense",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecurringExpenseDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecurringExpenseDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecurringExpenseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringExpenseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "RecurringExpenses"
        ],
        "summary": "Delete (deactivate) a recurring expense",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hardDelete",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ReferralMessages/unread": {
      "get": {
        "tags": [
          "ReferralMessages"
        ],
        "summary": "Get the count of unread referral messages",
        "responses": {
          "200": {
            "description": "Object containing the unread message count"
          }
        }
      }
    },
    "/ReferralMessages/{id}/read": {
      "put": {
        "tags": [
          "ReferralMessages"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Referrals": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "summary": "Get a list of referrals with optional filters",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by referral status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "description": "Filter by patient ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of records to skip",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "Number of records to take",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of referrals matching the filters",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Referrals"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/stats": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "summary": "Get referral statistics",
        "responses": {
          "200": {
            "description": "Statistics including counts by status",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralStatsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralStatsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralStatsDto"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "summary": "Get a specific referral by ID with full details",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Referrals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}/status": {
      "put": {
        "tags": [
          "Referrals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralStatusDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralStatusDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDto"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}/approve": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Approve a pending RDVM referral - creates Patient/Client from pending info or links to existing",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ApproveReferralRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ApproveReferralRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ApproveReferralRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}/reject": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Reject a pending RDVM referral - sets status to Cancelled and removes schedule item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RejectReferralRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RejectReferralRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RejectReferralRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmReferralDto"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}/messages": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "summary": "Get messages for a specific referral",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of messages for the referral",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralMessageListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralMessageListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralMessageListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Referrals"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralMessageDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralMessageDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralMessageDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralMessageDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralMessageDto"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}/documents": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "summary": "Get all documents for a referral",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Upload a document to a referral",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Document type (ReferralLetter, LabResults, etc.)",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "documentType": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}/documents/{documentId}": {
      "patch": {
        "tags": [
          "Referrals"
        ],
        "summary": "Update mutable fields (description) on a referral document",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDocumentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDocumentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Referrals"
        ],
        "summary": "Delete a document",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "description": "The document ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}/documents/{documentId}/download": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "summary": "Download a document",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "description": "The document ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/{id}/share-records": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Share patient records with the RDVM by generating a PDF export",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The referral ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The export options",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SharePatientRecordsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SharePatientRecordsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SharePatientRecordsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/rdvm-users": {
      "get": {
        "tags": [
          "Referrals"
        ],
        "summary": "Get all RDVM users (referring veterinarians) who have registered for portal access",
        "responses": {
          "200": {
            "description": "List of RDVM users with their approval status",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmUserListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmUserListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmUserListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/rdvm-users/{accessId}/approve": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Approve an RDVM user's portal access request",
        "parameters": [
          {
            "name": "accessId",
            "in": "path",
            "description": "The access request ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/rdvm-users/{accessId}/reject": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Reject an RDVM user's portal access request",
        "parameters": [
          {
            "name": "accessId",
            "in": "path",
            "description": "The access request ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Optional rejection reason",
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RejectRdvmRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RejectRdvmRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RejectRdvmRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Referrals/rdvm-users/{accessId}/permissions": {
      "put": {
        "tags": [
          "Referrals"
        ],
        "summary": "Update an RDVM user's permissions and access settings",
        "parameters": [
          {
            "name": "accessId",
            "in": "path",
            "description": "The access request ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The permission settings to update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRdvmUserPermissionsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRdvmUserPermissionsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRdvmUserPermissionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RdvmApprovalResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders": {
      "get": {
        "tags": [
          "Reminders"
        ],
        "summary": "Get reminders with filtering and pagination",
        "parameters": [
          {
            "name": "PatientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ClientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IncludePatients",
            "in": "query",
            "description": "When filtering by string? GetRemindersQuery.ClientId, also include reminders for the client's\npatients (resolved through the primary-owner `PatientContact` rows), so a client\nview can roll up the whole household. Off by default: existing callers keep the\nexact-match behaviour (only reminders whose ClientId matches).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "AppointmentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Category",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ReminderCategory"
            }
          },
          {
            "name": "Status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ReminderStatus"
            }
          },
          {
            "name": "IsActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "IsCompleted",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "DueDateFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "DueDateTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "SortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortOrder",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of reminders",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Reminders"
        ],
        "summary": "Create a new reminder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReminderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReminderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReminderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}": {
      "get": {
        "tags": [
          "Reminders"
        ],
        "summary": "Get a single reminder by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The reminder ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Reminders"
        ],
        "summary": "Update an existing reminder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Reminders"
        ],
        "summary": "Delete a reminder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Reminders/{id}/toggle-active": {
      "post": {
        "tags": [
          "Reminders"
        ],
        "summary": "Toggle the active status of a reminder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}/snooze": {
      "post": {
        "tags": [
          "Reminders"
        ],
        "summary": "Snooze a reminder until a specific date/time",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SnoozeReminderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SnoozeReminderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SnoozeReminderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}/suppress": {
      "post": {
        "tags": [
          "Reminders"
        ],
        "summary": "Suppress a reminder — deliberately silence it without deactivating or completing it",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuppressReminderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SuppressReminderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SuppressReminderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}/unsuppress": {
      "post": {
        "tags": [
          "Reminders"
        ],
        "summary": "Clear a reminder's suppression",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}/complete": {
      "post": {
        "tags": [
          "Reminders"
        ],
        "summary": "Complete a reminder with explicit completion semantics (manual / outside record)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteReminderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteReminderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteReminderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}/events": {
      "get": {
        "tags": [
          "Reminders"
        ],
        "summary": "Get the lifecycle event history (timeline) for a reminder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemEventListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemEventListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemEventListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}/debug": {
      "get": {
        "tags": [
          "Reminders"
        ],
        "summary": "The \"Why this reminder?\" debugger view: rule (current + as-emitted),\ntrigger, timeline, and computed conflicts (PAW-624)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderDebugDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderDebugDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderDebugDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}/relink": {
      "post": {
        "tags": [
          "Reminders"
        ],
        "summary": "Link (or re-link) a reminder to a rule so it participates in\nreconciliation and auto-satisfaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelinkReminderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RelinkReminderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RelinkReminderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Reminders/{id}/merge": {
      "post": {
        "tags": [
          "Reminders"
        ],
        "summary": "Fold a duplicate reminder into this one; the duplicate is removed with\nMerged history on both sides",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeReminderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeReminderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MergeReminderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Reports": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "List available reports with their parameter schemas.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReportDescriptor"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReportDescriptor"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReportDescriptor"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Reports/{key}/render": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Render a report. Remaining query parameters (period, mode, …) are passed to the\nreport's data provider; its descriptor documents which ones it understands.",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "Report key from the catalog, e.g. \"bi-full\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "pdf | csv | json.",
            "schema": {
              "type": "string",
              "default": "json"
            }
          },
          {
            "name": "table",
            "in": "query",
            "description": "CSV only: render a single table block by key instead of the whole document.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actions",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "auto"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDocument"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDocument"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDocument"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/RetailItems": {
      "get": {
        "tags": [
          "RetailItems"
        ],
        "summary": "Get a paginated list of retail items with optional filters",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "description": "Filter by item category",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "description": "Filter by vendor ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lowStockOnly",
            "in": "query",
            "description": "Only return items with low stock",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term for item name or SKU",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "RetailItems"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRetailItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRetailItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRetailItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/RetailItems/{id}": {
      "get": {
        "tags": [
          "RetailItems"
        ],
        "summary": "Get a specific retail item by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The retail item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "RetailItems"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRetailItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRetailItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRetailItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "RetailItems"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/RetailItems/barcode/{barcode}": {
      "get": {
        "tags": [
          "RetailItems"
        ],
        "summary": "Get a retail item by its barcode",
        "parameters": [
          {
            "name": "barcode",
            "in": "path",
            "description": "The barcode to search for",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/RetailItems/{id}/adjust": {
      "post": {
        "tags": [
          "RetailItems"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustRetailInventoryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustRetailInventoryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustRetailInventoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/RetailItems/{id}/receive": {
      "post": {
        "tags": [
          "RetailItems"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiveRetailInventoryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiveRetailInventoryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiveRetailInventoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/RetailItems/{id}/transfer": {
      "post": {
        "tags": [
          "RetailItems"
        ],
        "summary": "Transfer inventory between locations",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The retail item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Transfer details",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRetailInventoryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRetailInventoryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRetailInventoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailItemDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/RetailItems/{id}/locations": {
      "get": {
        "tags": [
          "RetailItems"
        ],
        "summary": "Get location quantities for a retail item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The retail item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RetailItemLocationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RetailItemLocationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RetailItemLocationDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/RetailItems/{id}/transactions": {
      "get": {
        "tags": [
          "RetailItems"
        ],
        "summary": "Get transaction history for a retail item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The retail item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetailInventoryTransactionListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailInventoryTransactionListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailInventoryTransactionListResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Roles": {
      "get": {
        "tags": [
          "Roles"
        ],
        "summary": "Get all roles",
        "responses": {
          "200": {
            "description": "List of all roles",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RoleResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RoleResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RoleResponseDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Roles"
        ],
        "summary": "Create a new role",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Roles/{id}": {
      "get": {
        "tags": [
          "Roles"
        ],
        "summary": "Get role by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The role ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Roles"
        ],
        "summary": "Update an existing role",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Roles"
        ],
        "summary": "Delete a role",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Roles/permissions": {
      "get": {
        "tags": [
          "Roles"
        ],
        "summary": "Get available permission groups",
        "responses": {
          "200": {
            "description": "List of all available permission groups",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PermissionGroupDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PermissionGroupDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PermissionGroupDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/RoomDayAssignments": {
      "get": {
        "tags": [
          "RoomDayAssignments"
        ],
        "summary": "Gets room day assignments for a specific date, optionally filtered by location.",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "The date to get assignments for (format: YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Optional filter by location ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RoomDayAssignmentListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomDayAssignmentListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomDayAssignmentListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "RoomDayAssignments"
        ],
        "summary": "Creates a new room day assignment.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoomDayAssignmentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoomDayAssignmentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoomDayAssignmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RoomDayAssignmentResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomDayAssignmentResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoomDayAssignmentResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/RoomDayAssignments/{id}": {
      "delete": {
        "tags": [
          "RoomDayAssignments"
        ],
        "summary": "Deletes a room day assignment by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/rx/governance/previous-details": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Get previous dispense details for auto-fill. Tries same patient first, falls back to any patient.",
        "parameters": [
          {
            "name": "inventoryItemId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PreviousDispenseDetailsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviousDispenseDetailsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviousDispenseDetailsDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Get prescriptions with governance data",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "take",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceListResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Get a single prescription with events",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "RxGovernance"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrescriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrescriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrescriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/route": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Route prescription to fulfillment method",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoutePrescriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RoutePrescriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RoutePrescriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/dispense": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Mark prescription as dispensed — a governance-status flip only, for confirming an\nEXTERNAL fulfillment (same-day delivery / online pharmacy / print-retail) was handed\noff. Moves no stock. In-house prescriptions must use `dispense-inventory`, which\nruns the real dispense engine; this endpoint rejects them so a status-only call can't\nfake an in-house dispense (no decrement, no DEA entry, no estimate-line stamp).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DispensePrescriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DispensePrescriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DispensePrescriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/dispense-inventory": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Dispense from inventory and update governance status in one operation.\nFor in-house routed prescriptions only.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseFromInventoryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseFromInventoryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DispenseFromInventoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/nudge": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Send client follow-up notification",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NudgeClientDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/NudgeClientDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NudgeClientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/close": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Close/archive prescription",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClosePrescriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ClosePrescriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ClosePrescriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/print-label": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Generate and queue an Rx label for printing",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PrintRxLabelRequestDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PrintRxLabelRequestDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PrintRxLabelRequestDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrintLabelResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintLabelResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintLabelResultDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/label-pdf": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Render an Rx label as a PDF for browser viewing / \"Save as PDF\" (no print job queued).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/stats": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Get dashboard KPIs",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxStatsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxStatsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxStatsDto"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/settings": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Get Rx governance settings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceSettingsDto"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Update Rx governance settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRxGovernanceSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRxGovernanceSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRxGovernanceSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/by-transaction/{transactionId}": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Look up a prescription by its inventory transaction ID",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/instructions": {
      "patch": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Update prescription instructions (dosage, frequency, duration, instructions).",
        "description": "Deprecated. Use `PATCH /rx/governance/{id}` (the full prescription edit\nendpoint) instead — it accepts the same fields plus the rest of the editable\nsurface, and wires through the DEA guardrail and amendment workflow. Kept\nin place for one release while any remaining external callers migrate.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrescriptionInstructionsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrescriptionInstructionsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrescriptionInstructionsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxGovernanceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/correct-dispense": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Full prescription edit. Pre-Dispensed prescriptions are updated in place;\nDispensed prescriptions require a `reason` and the change is recorded\nas an amendment. DEA-tracked field changes on a controlled substance are\nblocked — caller must cancel-and-recreate instead.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CorrectDispenseDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CorrectDispenseDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CorrectDispenseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CorrectDispenseResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorrectDispenseResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorrectDispenseResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/{id}/amendments": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "List amendments for a prescription (newest first).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrescriptionAmendmentDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrescriptionAmendmentDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrescriptionAmendmentDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/protocols": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "List all protocols",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Create a new protocol",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRxProtocolDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRxProtocolDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRxProtocolDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/protocols/{id}": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Get a single protocol by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Update a protocol",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRxProtocolDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRxProtocolDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRxProtocolDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Delete a protocol",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/protocols/match": {
      "get": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Get the matching protocol for a medication",
        "parameters": [
          {
            "name": "medicationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RxProtocolDto"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/post-dispense-prescription": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Create a prescription for an already-dispensed transaction (post-dispense flow)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostDispensePrescriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostDispensePrescriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostDispensePrescriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/rx/governance/request": {
      "post": {
        "tags": [
          "RxGovernance"
        ],
        "summary": "Create a new medication request (prescription or OTC). This is the compound\nwalk-up operation: capture, approve, and dispense are applied in one call, each\nstep gated by the caller's permissions (design §4). A front-desk caller with only\nthe Inventory permission stops at Requested; a provider's submit collapses to\ntoday's one-step flow.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMedicationRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMedicationRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMedicationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationRequestResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Pharmacies": {
      "get": {
        "tags": [
          "Pharmacies"
        ],
        "summary": "List available pharmacies",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Pharmacies"
        ],
        "summary": "Create a new pharmacy",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePharmacyDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePharmacyDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePharmacyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Pharmacies/{id}": {
      "get": {
        "tags": [
          "Pharmacies"
        ],
        "summary": "Get a pharmacy by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Pharmacies"
        ],
        "summary": "Update an existing pharmacy",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePharmacyDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePharmacyDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePharmacyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PharmacyDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pharmacies"
        ],
        "summary": "Soft-delete (deactivate) a pharmacy. The row is retained so historical prescriptions still\nresolve their pharmacy; it is simply dropped from the active list.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/reports/saved": {
      "get": {
        "tags": [
          "SavedReports"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SavedReportDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SavedReportDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SavedReportDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SavedReports"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveReportRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveReportRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SaveReportRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SavedReportDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedReportDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/reports/saved/{id}": {
      "put": {
        "tags": [
          "SavedReports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveReportRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveReportRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SaveReportRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SavedReportDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedReportDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "SavedReports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/reports/saved/{id}/render": {
      "get": {
        "tags": [
          "SavedReports"
        ],
        "summary": "Render a saved report. Stored parameters are the base; query parameters override\nthem (so a saved YTD report can be previewed as MTD without editing it).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "json"
            }
          },
          {
            "name": "table",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actions",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "auto"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDocument"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDocument"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDocument"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ScheduleItems": {
      "get": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Get a paginated and filtered list of schedule items",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter by schedule item type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Filter by location ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assignedToId",
            "in": "query",
            "description": "Filter by assigned user ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "excludeAppointments",
            "in": "query",
            "description": "Exclude appointment-linked items",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of schedule items",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Create a new standalone schedule item (non-appointment)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduleItemRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduleItemRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduleItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/ScheduleItems/{id}": {
      "get": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Get a single schedule item by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The schedule item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Update an existing schedule item",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleItemRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleItemRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Delete a schedule item (only if not linked to an appointment)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ScheduleItems/check-conflicts": {
      "post": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Check for schedule conflicts before creating/updating an item.\nAlways returns 200 with conflict details in the response body.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckScheduleConflictsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckScheduleConflictsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CheckScheduleConflictsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleConflictCheckResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleConflictCheckResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleConflictCheckResponse"
                }
              }
            }
          }
        }
      }
    },
    "/ScheduleItems/{id}/instance": {
      "put": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Update a single instance of a recurring schedule item.\nCreates an exception record that overrides the specific occurrence.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleInstanceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleInstanceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleInstanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Delete a single instance of a recurring schedule item.\nCreates a cancellation exception for the specific occurrence.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "originalStartTime",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ScheduleItems/{id}/series": {
      "put": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Update a recurring series (affects the master item and all future occurrences).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleSeriesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleSeriesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduleSeriesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleItemResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ScheduleItems"
        ],
        "summary": "Delete an entire recurring series and all its exceptions.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ServiceCatalog": {
      "get": {
        "tags": [
          "ServiceCatalog"
        ],
        "summary": "Get all service catalog items",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of service catalog items",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ServiceCatalog"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceCatalogItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceCatalogItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceCatalogItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              }
            }
          }
        }
      }
    },
    "/ServiceCatalog/{id}": {
      "get": {
        "tags": [
          "ServiceCatalog"
        ],
        "summary": "Get a specific service catalog item by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The service catalog item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ServiceCatalog"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceCatalogItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceCatalogItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceCatalogItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogItemDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ServiceCatalog"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Shifts": {
      "get": {
        "tags": [
          "Shifts"
        ],
        "summary": "Get a paginated and filtered list of shifts",
        "parameters": [
          {
            "name": "UserId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "LocationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ShiftDateFrom",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ShiftDateTo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "CancelByBefore",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "CancelByAfter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "HasIncome",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Query",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortOrder",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of shifts",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Shifts"
        ],
        "summary": "Create a new shift",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Shifts/{id}": {
      "get": {
        "tags": [
          "Shifts"
        ],
        "summary": "Get a single shift by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The shift ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Shifts"
        ],
        "summary": "Update an existing shift",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateShiftDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateShiftDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateShiftDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Shifts"
        ],
        "summary": "Delete a shift by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ShiftSwaps": {
      "get": {
        "tags": [
          "ShiftSwaps"
        ],
        "summary": "Get a paginated and filtered list of shift swap requests",
        "parameters": [
          {
            "name": "ShiftId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "FromUserId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ToUserId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ShiftSwapStatus"
            }
          },
          {
            "name": "IsOpenPool",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "CreatedAfter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "CreatedBefore",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Query",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortOrder",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ShiftSwaps"
        ],
        "summary": "Create a new shift swap request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftSwapDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftSwapDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftSwapDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ShiftSwaps/{id}": {
      "get": {
        "tags": [
          "ShiftSwaps"
        ],
        "summary": "Get a single shift swap request by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ShiftSwaps"
        ],
        "summary": "Cancel a shift swap request",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ShiftSwaps/{id}/accept": {
      "post": {
        "tags": [
          "ShiftSwaps"
        ],
        "summary": "Accept a shift swap request",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ShiftSwaps/{id}/decline": {
      "post": {
        "tags": [
          "ShiftSwaps"
        ],
        "summary": "Decline a shift swap request (peer declines direct request)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ShiftSwaps/{id}/approve": {
      "post": {
        "tags": [
          "ShiftSwaps"
        ],
        "summary": "Manager approves a shift swap awaiting approval (performs the actual shift reassignment)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ShiftSwaps/{id}/reject": {
      "post": {
        "tags": [
          "ShiftSwaps"
        ],
        "summary": "Manager rejects a shift swap awaiting approval",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/SlotConfigurations": {
      "get": {
        "tags": [
          "SlotConfigurations"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SlotConfigurations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSlotConfigurationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSlotConfigurationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSlotConfigurationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/SlotConfigurations/{id}": {
      "get": {
        "tags": [
          "SlotConfigurations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "SlotConfigurations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSlotConfigurationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSlotConfigurationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSlotConfigurationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "SlotConfigurations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/SlotConfigurations/effective": {
      "get": {
        "tags": [
          "SlotConfigurations"
        ],
        "parameters": [
          {
            "name": "locationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotConfigurationResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/sms-consent/check": {
      "get": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Check if SMS consent exists for a phone number",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "query",
            "description": "The phone number to check",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentStatusDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/sms-consent/{id}": {
      "get": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Get SMS consent by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The SMS consent ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/sms-consent/client/{clientId}": {
      "get": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Get all SMS consents for a client",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "description": "The client ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of SMS consents for the client",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SmsConsentDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SmsConsentDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SmsConsentDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sms-consent": {
      "post": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Record SMS consent (authenticated - for staff-assisted opt-in)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordSmsConsentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordSmsConsentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RecordSmsConsentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              }
            }
          }
        }
      }
    },
    "/sms-consent/generate-link": {
      "post": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Generate a magic link for SMS consent collection",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSmsConsentLinkRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSmsConsentLinkRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSmsConsentLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentLinkResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentLinkResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentLinkResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sms-consent/send-consent-email": {
      "post": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Generate a magic link and send it via email to the client",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendSmsConsentEmailRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendSmsConsentEmailRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendSmsConsentEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentLinkResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentLinkResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentLinkResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sms-consent/{id}/revoke": {
      "post": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Revoke SMS consent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeConsentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeConsentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeConsentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/sms-consent/settings": {
      "get": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Get SMS consent settings for tenant",
        "responses": {
          "200": {
            "description": "The SMS consent settings for the tenant",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "SmsConsent"
        ],
        "summary": "Update SMS consent settings for tenant",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsConsentSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsConsentSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SmsConsentSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              }
            }
          }
        }
      }
    },
    "/Species": {
      "get": {
        "tags": [
          "Species"
        ],
        "summary": "Get all species",
        "responses": {
          "200": {
            "description": "List of all species sorted by display order",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Species"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSpeciesDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSpeciesDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSpeciesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              }
            }
          }
        }
      }
    },
    "/Species/{id}": {
      "get": {
        "tags": [
          "Species"
        ],
        "summary": "Get a species by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The species ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Species"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSpeciesDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSpeciesDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSpeciesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeciesDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Species"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Subscriptions": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Subscriptions/{id}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDetailDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubscriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubscriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubscriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              }
            }
          }
        }
      }
    },
    "/Subscriptions/{id}/pause": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseSubscriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseSubscriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PauseSubscriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              }
            }
          }
        }
      }
    },
    "/Subscriptions/{id}/resume": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              }
            }
          }
        }
      }
    },
    "/Subscriptions/{id}/cancel": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionDto"
                }
              }
            }
          }
        }
      }
    },
    "/Subscriptions/{id}/charge-now": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChargeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChargeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChargeDto"
                }
              }
            }
          }
        }
      }
    },
    "/SurgicalRecords": {
      "post": {
        "tags": [
          "SurgicalRecords"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurgicalRecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurgicalRecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurgicalRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/SurgicalRecords/appointment/{appointmentId}": {
      "get": {
        "tags": [
          "SurgicalRecords"
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/SurgicalRecords/{id}": {
      "patch": {
        "tags": [
          "SurgicalRecords"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurgicalRecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurgicalRecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurgicalRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/SurgicalRecords/{id}/events": {
      "post": {
        "tags": [
          "SurgicalRecords"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurgicalTimelineEventRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurgicalTimelineEventRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurgicalTimelineEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalTimelineEventDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalTimelineEventDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalTimelineEventDto"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/SurgicalRecords/{id}/events/{eventId}": {
      "put": {
        "tags": [
          "SurgicalRecords"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurgicalTimelineEventRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurgicalTimelineEventRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurgicalTimelineEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalTimelineEventDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalTimelineEventDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalTimelineEventDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "SurgicalRecords"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/SurgicalRecords/{id}/finalize": {
      "post": {
        "tags": [
          "SurgicalRecords"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/FinalizeSurgicalRecordRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/FinalizeSurgicalRecordRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/FinalizeSurgicalRecordRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/SurgicalRecords/{id}/reopen": {
      "post": {
        "tags": [
          "SurgicalRecords"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReopenSurgicalRecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReopenSurgicalRecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReopenSurgicalRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgicalRecordResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tag-assignments": {
      "get": {
        "tags": [
          "TagAssignments"
        ],
        "parameters": [
          {
            "name": "entityType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "TagAssignments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTagAssignmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTagAssignmentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTagAssignmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tag-assignments/by-tag/{tagId}": {
      "get": {
        "tags": [
          "TagAssignments"
        ],
        "parameters": [
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagAssignmentListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/tag-assignments/{assignmentId}": {
      "delete": {
        "tags": [
          "TagAssignments"
        ],
        "parameters": [
          {
            "name": "assignmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "parameters": [
          {
            "name": "entityKind",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TagListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Tags"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTagRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTagRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTagRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/tags/{id}": {
      "get": {
        "tags": [
          "Tags"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Tags"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTagRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTagRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTagRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Tags"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/telnyx-call-control": {
      "post": {
        "tags": [
          "TelnyxCallControl"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/templates/formats": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Physical output format specs (page size, margins, typography). The web\neditor derives its canvas sizing from these so the editor, the preview,\nand the printed output all share one definition.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateFormatSpecDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateFormatSpecDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateFormatSpecDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/templates/variables": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "The backend-owned template variable catalog: every {{token}} the render\npipeline knows, with label, description, applicable template types, and\nthe sample value previews use. The editor's variable picker and\nautocomplete derive from this.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Optional filter to variables applicable to one template type (e.g. \"labels\")",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateVariableDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateVariableDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateVariableDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/templates/render-preview": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Renders (possibly unsaved) editor sections through the real production\npipeline — sample data, regional compliance blocks, QuestPDF — and\nreturns one PNG per page. More than one page on a fixed-size label\nformat means the content overflows the label.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderTemplatePreviewRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderTemplatePreviewRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RenderTemplatePreviewRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePreviewResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePreviewResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePreviewResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/templates": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Gets all templates for the current tenant.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Optional filter by template type. Types with a render path: \"discharge\",\n\"labels\", \"vaccine-certificate\", \"questionnaire-invitation\",\n\"questionnaire-reminder\". (\"automation\", \"rdvm\" and \"clinical\" are retired —\nrows may still exist but nothing reads them.)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of templates",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Creates a new template.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/templates/{id}": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Gets a specific template by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The template ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Templates"
        ],
        "summary": "Updates an existing template.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTemplateDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTemplateDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Templates"
        ],
        "summary": "Deletes a template.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/templates/default": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Gets the default template for the current tenant.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/templates/{id}/set-default": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Sets a template as the default for the current tenant.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/knowledge-documents": {
      "get": {
        "tags": [
          "TenantKnowledge"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "TenantKnowledge"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantKnowledgeDocumentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantKnowledgeDocumentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantKnowledgeDocumentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                }
              }
            }
          }
        }
      }
    },
    "/knowledge-documents/{id}": {
      "put": {
        "tags": [
          "TenantKnowledge"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantKnowledgeDocumentDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantKnowledgeDocumentDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantKnowledgeDocumentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantKnowledgeDocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "TenantKnowledge"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/TimeEntries": {
      "get": {
        "tags": [
          "TimeEntries"
        ],
        "summary": "Get a paginated and filtered list of time entries",
        "parameters": [
          {
            "name": "UserId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "DateFrom",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "DateTo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "HasLunch",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "MinHours",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "MaxHours",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          {
            "name": "Query",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Week",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Month",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Year",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "SortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortOrder",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of time entries",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "TimeEntries"
        ],
        "summary": "Create a new time entry",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTimeEntryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTimeEntryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTimeEntryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/TimeEntries/{id}": {
      "get": {
        "tags": [
          "TimeEntries"
        ],
        "summary": "Get a single time entry by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The time entry ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "TimeEntries"
        ],
        "summary": "Update an existing time entry",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTimeEntryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTimeEntryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTimeEntryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "TimeEntries"
        ],
        "summary": "Delete a time entry by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/public/transparency/clinics/{clinicId}/overview": {
      "get": {
        "tags": [
          "Transparency"
        ],
        "parameters": [
          {
            "name": "clinicId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyOverviewDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyOverviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyOverviewDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/transparency/clinics/{clinicId}/pricing": {
      "get": {
        "tags": [
          "Transparency"
        ],
        "parameters": [
          {
            "name": "clinicId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPricingDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPricingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPricingDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/transparency/clinics/{clinicId}/policies": {
      "get": {
        "tags": [
          "Transparency"
        ],
        "parameters": [
          {
            "name": "clinicId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPoliciesDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPoliciesDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransparencyPoliciesDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get a paginated and filtered list of users",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search query for user name or email",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userType",
            "in": "query",
            "description": "Filter by user type",
            "schema": {
              "$ref": "#/components/schemas/UserType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of users",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create a new user in Firebase and the database",
        "requestBody": {
          "description": "User creation request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Created user profile",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Users/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get the current authenticated user's profile",
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Users/me/record-login": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Record a login for the current user (updates LastLoginAt)",
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/Users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get a user by ID (admin/authorized access)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User ID (Firebase UID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update an existing user's profile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User ID (Firebase UID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated user profile",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Soft delete a user (marks as inactive)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User ID (Firebase UID) to delete",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "No content on success"
          }
        }
      }
    },
    "/Users/invite": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Invite a new user via email (user sets their own password)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/Users/reconciliation": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Diff Firebase Auth against this tenant's user table, in both directions.\nRead-only — it reports drift, it does not repair it. See ITE-515.",
        "responses": {
          "200": {
            "description": "Counts plus the specific accounts and rows that disagree",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserReconciliationReport"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserReconciliationReport"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserReconciliationReport"
                }
              }
            }
          }
        }
      }
    },
    "/Users/orphaned-accounts/{firebaseUid}/release": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Release an orphaned Firebase account — one holding an email with no active user row —\nso the address can be invited again. Replaces deleting it by hand in the Firebase\nconsole (ITE-515).",
        "parameters": [
          {
            "name": "firebaseUid",
            "in": "path",
            "description": "The orphaned account's UID, as reported by `GET /users/reconciliation`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Optional email, recorded on the audit event.",
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ReleaseOrphanedAccountRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ReleaseOrphanedAccountRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ReleaseOrphanedAccountRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Users/primary-providers": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get primary providers sorted by display order (for schedule team view)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserResponseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Users/prescribers": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get prescribers (users whose role can prescribe) sorted by display order.\nPopulates the Prescribing DVM dropdown on medication request flows.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserResponseDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Users/{id}/resend-invite": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Resend invite email to a user",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/Vaccinations/by-patient/{patientId}": {
      "get": {
        "tags": [
          "Vaccinations"
        ],
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccinationRecordDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccinationRecordDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccinationRecordDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations/by-appointment/{appointmentId}": {
      "get": {
        "tags": [
          "Vaccinations"
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccinationRecordDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccinationRecordDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccinationRecordDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations/schedule/{patientId}": {
      "get": {
        "tags": [
          "Vaccinations"
        ],
        "summary": "The computed vaccine schedule for a patient: core requirements for their species plus other\nvaccines on file, each with last dose, next due, and standing — the explanation behind the\npatient's VaccinationStatus badge (ITE-685).",
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PatientVaccineScheduleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientVaccineScheduleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientVaccineScheduleDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations/exemptions": {
      "post": {
        "tags": [
          "Vaccinations"
        ],
        "summary": "Skip a vaccine for medical reasons (ITE-688): a per-patient exemption with a required\nreason. The requirement reads Skipped in the schedule and stops counting against the\npatient's vaccination status.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccineExemptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccineExemptionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccineExemptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineExemptionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineExemptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineExemptionDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations/exemptions/{id}": {
      "delete": {
        "tags": [
          "Vaccinations"
        ],
        "summary": "Undo a skip. Idempotent; the exemption row stays for audit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineExemptionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineExemptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineExemptionDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations/rabies-duration": {
      "get": {
        "tags": [
          "Vaccinations"
        ],
        "summary": "Suggest the effective rabies duration (1 vs 3 years) for a dose at point-of-care.",
        "parameters": [
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vaccineTypeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "administeredDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesDurationSuggestionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesDurationSuggestionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RabiesDurationSuggestionDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations/next-dose": {
      "get": {
        "tags": [
          "Vaccinations"
        ],
        "summary": "Suggest the schedule stage and next-due date for a dose being administered — which dose of\nthe series this is, and when the next one is due (generalizes the rabies 1-vs-3-year rule).",
        "parameters": [
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vaccineTypeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "administeredDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NextDoseSuggestionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextDoseSuggestionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextDoseSuggestionDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations/{id}": {
      "get": {
        "tags": [
          "Vaccinations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Vaccinations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVaccinationRecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVaccinationRecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVaccinationRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Vaccinations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations": {
      "post": {
        "tags": [
          "Vaccinations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccinationRecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccinationRecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccinationRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Vaccinations/{id}/void": {
      "post": {
        "tags": [
          "Vaccinations"
        ],
        "summary": "Retract a dose without erasing it — the record stays on the chart, struck through, and stops\ncounting as a valid administration. Prefer this over DELETE whenever the dose was really\nrecorded and is being reversed; DELETE remains for removing a row that should never have existed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidVaccinationRecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidVaccinationRecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VoidVaccinationRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccinationRecordDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-administration": {
      "post": {
        "tags": [
          "VaccineAdministration"
        ],
        "summary": "Administer a vaccine dose — wraps dispense + VaccinationRecord enrichment + optional temp-lot + WorkTask.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdministerVaccineRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdministerVaccineRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdministerVaccineRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineAdministrationResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineAdministrationResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineAdministrationResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-administration/lots/{tempLotId}/resolve": {
      "post": {
        "tags": [
          "VaccineAdministration"
        ],
        "summary": "Resolve a temporary lot by swapping its references to a real lot (existing or inline-created).\nAuto-completes the follow-up WorkTask.",
        "parameters": [
          {
            "name": "tempLotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveTempLotRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveTempLotRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveTempLotRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveTempLotResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveTempLotResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveTempLotResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-administration/unresolved-lots": {
      "get": {
        "tags": [
          "VaccineAdministration"
        ],
        "summary": "List vaccination records whose underlying lot is an unresolved temporary placeholder.\nDrives the chronicle patient-header pill.",
        "parameters": [
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UnresolvedVaccineLotsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnresolvedVaccineLotsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnresolvedVaccineLotsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-certificate-records": {
      "post": {
        "tags": [
          "VaccineCertificateRecords"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueVaccineCertificateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueVaccineCertificateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IssueVaccineCertificateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-certificate-records/{id}": {
      "get": {
        "tags": [
          "VaccineCertificateRecords"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-certificate-records/{id}/pdf": {
      "get": {
        "tags": [
          "VaccineCertificateRecords"
        ],
        "summary": "Renders the issued certificate to a PDF from its frozen snapshot.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-certificate-records/by-vaccination/{vaccinationRecordId}": {
      "get": {
        "tags": [
          "VaccineCertificateRecords"
        ],
        "parameters": [
          {
            "name": "vaccinationRecordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccineCertificateDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccineCertificateDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaccineCertificateDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-certificate-records/by-vaccination/{vaccinationRecordId}/current": {
      "get": {
        "tags": [
          "VaccineCertificateRecords"
        ],
        "parameters": [
          {
            "name": "vaccinationRecordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-certificate-records/{id}/revoke": {
      "post": {
        "tags": [
          "VaccineCertificateRecords"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeVaccineCertificateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeVaccineCertificateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeVaccineCertificateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineCertificateDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-certificates/print": {
      "post": {
        "tags": [
          "VaccineCertificates"
        ],
        "summary": "Generate a batch vaccine certificate PDF and create a print job.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintVaccineCertificateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintVaccineCertificateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PrintVaccineCertificateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintJobResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-certificates/download": {
      "get": {
        "tags": [
          "VaccineCertificates"
        ],
        "summary": "Download a batch vaccine certificate PDF for browser viewing.",
        "parameters": [
          {
            "name": "patientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appointmentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "certifyingUserId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-types": {
      "get": {
        "tags": [
          "VaccineTypes"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "VaccineTypes"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccineTypeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccineTypeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVaccineTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vaccine-types/{id}": {
      "get": {
        "tags": [
          "VaccineTypes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "VaccineTypes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVaccineTypeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVaccineTypeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVaccineTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaccineTypeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "VaccineTypes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Vendors": {
      "get": {
        "tags": [
          "Vendors"
        ],
        "summary": "Get all vendors with optional active filter",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status (default: true)",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of vendors",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VendorListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Vendors"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVendorDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVendorDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVendorDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              }
            }
          }
        }
      }
    },
    "/Vendors/{id}": {
      "get": {
        "tags": [
          "Vendors"
        ],
        "summary": "Get a vendor by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The vendor ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Vendors"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVendorDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVendorDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVendorDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Vendors"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Vendors/{id}/restore": {
      "post": {
        "tags": [
          "Vendors"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/patients/{patientId}/Vitals": {
      "get": {
        "tags": [
          "Vitals"
        ],
        "summary": "Get recent vital measurements for a patient.",
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "description": "The patient ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results (default: 20)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of vital measurements for the patient",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VitalMeasurementDetailDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VitalMeasurementDetailDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VitalMeasurementDetailDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Vitals"
        ],
        "summary": "Record a new vital measurement for a patient.\nTriggers VitalsOutOfRange automation if the value is outside normal range.",
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordVitalRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordVitalRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RecordVitalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecordVitalResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordVitalResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordVitalResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/vital-types": {
      "get": {
        "tags": [
          "VitalTypes"
        ],
        "summary": "List vital measurement types. Active-only by default (clinical pickers / the exam\ntemplate palette); pass `includeInactive=true` for the management surface.",
        "parameters": [
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VitalTypeDetailDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VitalTypeDetailDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VitalTypeDetailDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "VitalTypes"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVitalTypeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVitalTypeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVitalTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vital-types/{id}": {
      "get": {
        "tags": [
          "VitalTypes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "VitalTypes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVitalTypeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVitalTypeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVitalTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeDetailDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "VitalTypes"
        ],
        "summary": "Hard-delete a vital type. Blocked for built-in types, for any type with recorded\nmeasurements, and for any type an exam template binds — deactivate (PUT isActive=false)\ninstead.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/vital-types/{id}/usage": {
      "get": {
        "tags": [
          "VitalTypes"
        ],
        "summary": "What depends on this vital type. The settings surface reads this before offering a\ndestructive action so the admin sees \"used by 2 exam templates (QA Preop, Dental COHAT)\"\n*before* clicking, rather than a 409 after.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeUsageDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeUsageDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VitalTypeUsageDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/chat/ai": {
      "post": {
        "tags": [
          "WidgetChatbot"
        ],
        "summary": "Send a message to B.O.N.D. AI assistant",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BondChatMessageRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BondChatMessageRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BondChatMessageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BondChatResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BondChatResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BondChatResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/chat/ai/{sessionId}": {
      "get": {
        "tags": [
          "WidgetChatbot"
        ],
        "summary": "Get the current conversation state for a session",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BondConversationStateResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BondConversationStateResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BondConversationStateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/chat/ai/escalate": {
      "post": {
        "tags": [
          "WidgetChatbot"
        ],
        "summary": "Explicitly request to be connected with a human staff member",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BondEscalationApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BondEscalationApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BondEscalationApiRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BondEscalationResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BondEscalationResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BondEscalationResult"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/chat/ai/status": {
      "get": {
        "tags": [
          "WidgetChatbot"
        ],
        "summary": "Check if B.O.N.D. is enabled for a clinic",
        "parameters": [
          {
            "name": "clinicId",
            "in": "query",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BondStatusResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BondStatusResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BondStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/clinics/{clinicId}/config": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Get widget configuration for a clinic",
        "parameters": [
          {
            "name": "clinicId",
            "in": "path",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetConfigDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetConfigDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetConfigDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/clinics/{clinicId}/appointment-types": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "The appointment types a client may self-book for this clinic (ITE-430) — the same list\ncarried in the widget config's BookingPolicy, for surfaces that don't load the config.",
        "parameters": [
          {
            "name": "clinicId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WidgetAppointmentTypeDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WidgetAppointmentTypeDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WidgetAppointmentTypeDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/sessions": {
      "post": {
        "tags": [
          "Widget"
        ],
        "summary": "Create a new widget session (anonymous)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetSessionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetSessionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSessionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSessionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSessionDto"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/clients/lookup": {
      "post": {
        "tags": [
          "Widget"
        ],
        "summary": "Lookup a client by email or phone (for existing client booking flow)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientLookupRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientLookupRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ClientLookupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientLookupResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientLookupResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientLookupResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/clinics/{clinicId}/slots": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Get available appointment slots for a date",
        "parameters": [
          {
            "name": "clinicId",
            "in": "path",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "The date to get slots for",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "appointmentType",
            "in": "query",
            "description": "Optional filter by appointment type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Optional filter by location",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appointmentTypeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available appointment slots",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetAvailableSlotsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAvailableSlotsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAvailableSlotsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/appointments": {
      "post": {
        "tags": [
          "Widget"
        ],
        "summary": "Create an appointment booking (anonymous with client info)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetAppointmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetAppointmentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetAppointmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetAppointmentResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetAppointmentResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetAppointmentResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/chat/messages": {
      "post": {
        "tags": [
          "Widget"
        ],
        "summary": "Send a chat message (anonymous)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendChatMessageRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendChatMessageRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendChatMessageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetChatMessageDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetChatMessageDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetChatMessageDto"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/chat/sessions/{sessionId}/messages": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Get chat messages for a session",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "The session ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetChatMessagesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetChatMessagesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetChatMessagesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/auth/send-verification": {
      "post": {
        "tags": [
          "Widget"
        ],
        "summary": "Send verification email to client",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendVerificationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SendVerificationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SendVerificationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SendVerificationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendVerificationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendVerificationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/auth/verify": {
      "post": {
        "tags": [
          "Widget"
        ],
        "summary": "Verify code from email",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyTokenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyTokenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyTokenResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyTokenResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyTokenResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/portal/session": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Get portal session status (is user verified?)",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSessionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSessionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSessionDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/portal/records": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Get patient records (requires verified session)",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "description": "Optional filter by patient ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetPatientRecordsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPatientRecordsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPatientRecordsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/portal/billing": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Get billing information (requires verified session)",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetBillingResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBillingResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBillingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/clients": {
      "post": {
        "tags": [
          "Widget"
        ],
        "summary": "Create a new client (and optionally patient) from widget",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetClientRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetClientRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetClientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWidgetClientResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWidgetClientResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWidgetClientResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/portal/dashboard": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Get portal dashboard data (requires verified session)",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "description": "The session ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PortalDashboardResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalDashboardResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalDashboardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/sms-consent/check": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Check if SMS consent exists for a phone number",
        "parameters": [
          {
            "name": "phone",
            "in": "query",
            "description": "The phone number to check",
            "required": true,
            "schema": {
              "maxLength": 20,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentStatusDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/sms-consent/settings": {
      "get": {
        "tags": [
          "Widget"
        ],
        "summary": "Get SMS consent settings for a clinic (brand name, use cases)",
        "parameters": [
          {
            "name": "clinicId",
            "in": "query",
            "description": "The clinic ID",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentSettingsDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/public/widget/sms-consent": {
      "post": {
        "tags": [
          "Widget"
        ],
        "summary": "Submit SMS consent from widget",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetSmsConsentSubmitRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetSmsConsentSubmitRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetSmsConsentSubmitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsConsentDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/work-item-rules": {
      "get": {
        "tags": [
          "WorkItemRules"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "WorkItemRules"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkItemRuleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkItemRuleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkItemRuleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/work-item-rules/{id}": {
      "get": {
        "tags": [
          "WorkItemRules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "WorkItemRules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkItemRuleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkItemRuleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkItemRuleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/work-item-rules/{id}/versions": {
      "get": {
        "tags": [
          "WorkItemRules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleVersionListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleVersionListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRuleVersionListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/WorkTasks": {
      "get": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Get all work tasks with optional filtering",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by task status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lifecycle",
            "in": "query",
            "description": "`open` (Open + InProgress) or `closed` (Completed + Cancelled). ANDed with\nstatus. Callers that only want actionable work should send this —\nwithout it, finished history competes for the page with the work they asked for.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Filter by task category",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "priority",
            "in": "query",
            "description": "Filter by task priority",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assignedToId",
            "in": "query",
            "description": "Filter by assigned user ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "unassignedOnly",
            "in": "query",
            "description": "Return only tasks nobody owns — the triage pool. Overrides assignedToId,\nsince \"unassigned\" cannot be expressed as a user ID.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "patientId",
            "in": "query",
            "description": "Filter by patient ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of records to skip",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "Page size. Defaults to int WorkTaskService.DefaultTake and is capped at\nint WorkTaskService.MaxTake; `totalCount` is always the unpaginated total.",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of work tasks",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskListResponseDto"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Create a new work task",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkTaskDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkTaskDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkTaskDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              }
            }
          }
        }
      }
    },
    "/WorkTasks/stats": {
      "get": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Get work task stats (counts by status)",
        "responses": {
          "200": {
            "description": "Statistics including counts by status",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskStatsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskStatsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskStatsDto"
                }
              }
            }
          }
        }
      }
    },
    "/WorkTasks/my-tasks": {
      "get": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Get tasks assigned to the current user",
        "responses": {
          "200": {
            "description": "List of tasks assigned to the current user",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkTaskDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkTaskDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkTaskDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/WorkTasks/{id}": {
      "get": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Get a specific work task by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The work task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Update a work task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkTaskDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkTaskDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkTaskDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Delete a work task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/WorkTasks/{id}/status": {
      "patch": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Update work task status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkTaskStatusDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkTaskStatusDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkTaskStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              }
            }
          }
        }
      }
    },
    "/WorkTasks/{id}/complete": {
      "post": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Mark a work task as complete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CompleteWorkTaskRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CompleteWorkTaskRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CompleteWorkTaskRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              }
            }
          }
        }
      }
    },
    "/WorkTasks/{id}/events": {
      "get": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Get the lifecycle event history (timeline) for a work task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemEventListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemEventListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemEventListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/WorkTasks/{id}/notes": {
      "get": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Get notes for a work task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The work task ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of notes for the work task",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkTaskNoteDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkTaskNoteDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkTaskNoteDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Add a note to a work task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkTaskNoteDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkTaskNoteDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkTaskNoteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskNoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskNoteDto"
                }
              }
            }
          }
        }
      }
    },
    "/WorkTasks/{id}/notes/{noteId}": {
      "delete": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Delete a note from a work task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptEstimateRequest": {
        "type": "object",
        "properties": {
          "selectedTier": {
            "type": "string"
          },
          "consentMethod": {
            "type": "string",
            "description": "How consent was captured. \"InApp\" (tap-accept) or \"Signature\" (+ signature fields)."
          },
          "signatureData": {
            "type": [
              "null",
              "string"
            ],
            "description": "Base64-encoded PNG of the signature (required when ConsentMethod=Signature)."
          },
          "signedName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Typed name the signer provided (required when ConsentMethod=Signature)."
          }
        },
        "description": "Record the client's acceptance of a presented plan WITHOUT converting it to an\ninvoice. Used by the in-visit /chronicle present flow: the client approves the plan\n(consent + optional signature + chosen tier) up front; the bill is produced later by\nconvert-to-invoice once services are performed. Mirrors ConvertToInvoiceRequest\nminus the conversion."
      },
      "AccountStatus": {
        "type": "integer"
      },
      "ActiveWithdrawalDto": {
        "type": "object",
        "properties": {
          "productName": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "\"meat\" or \"milk\""
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "treatmentId": {
            "type": "string"
          }
        }
      },
      "AddAppointmentTypeDefaultServiceRequest": {
        "type": "object",
        "properties": {
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "For adding a procedure - the ServiceCatalogItem ID"
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "For adding an inventory item - the InventoryItem ID"
          },
          "defaultQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Default quantity (default 1)",
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Display order in the list",
            "format": "int32"
          }
        },
        "description": "Request to add a default service to an appointment type"
      },
      "AddDispensedToInvoiceDto": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "overridePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AddEstimateItemRequest": {
        "type": "object",
        "properties": {
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "billableItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "A BillableItem (\"Charge\") — a priced bundle that fans out to its components on perform."
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Working quantity. Defaults to 1.",
            "format": "double"
          },
          "qtyMode": {
            "type": "string"
          },
          "qtyLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyMed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Optional unit-price override; resolved from the catalog/inventory item when null.",
            "format": "double"
          },
          "isTaxable": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "markedForBilling": {
            "type": "boolean"
          }
        },
        "description": "Add a single line to an estimate. Exactly one source FK must be set."
      },
      "AddGroupCodeToInvoiceDto": {
        "type": "object",
        "properties": {
          "groupCodeId": {
            "type": "string"
          },
          "quantityMultiplier": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Request body for expanding a group code onto an estimate."
      },
      "AddLotContainerDto": {
        "type": "object",
        "properties": {
          "containerCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Ad-hoc add a physical container to an existing lot at dispense time (ITE-157) — e.g.\nretrofitting a container onto a legacy lot that has none. When decimal? AddLotContainerDto.Quantity is\nnull it defaults to the lot's untracked remainder (lot total minus existing containers)."
      },
      "AddPatientContactRequest": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "relationshipType": {
            "$ref": "#/components/schemas/ContactRelationshipType"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Permission flag names to grant (e.g. `[\"PickUpPatient\"]`). Empty grants none."
          }
        },
        "description": "Request to add a non-primary contact (co-owner, emergency contact, etc.) to a patient."
      },
      "AddPurchaseOrderItemDto": {
        "type": "object",
        "properties": {
          "inventoryItemId": {
            "type": "string"
          },
          "quantityOrdered": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "AdjustInventoryDto": {
        "required": [
          "locationId"
        ],
        "type": "object",
        "properties": {
          "lotId": {
            "type": [
              "null",
              "string"
            ]
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical container the adjustment applies to (container code, or row id for\ncode-less non-controlled containers). Required when the lot is split across\nmultiple active containers — for controlled substances the DEA Correction\nlands on a per-(book, container) ledger; for non-controlled lots it keeps\nlot == sum(containers) reconciled (ITE-275)."
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "reason": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": "string",
            "description": "Required location ID for tracking where the adjustment applies."
          },
          "createDefaultLot": {
            "type": "boolean",
            "description": "Set to true to confirm creation of a default lot when no active lot exists.\nIf false and no lot exists, returns a 409 Conflict asking for confirmation."
          }
        }
      },
      "AdjustLotQuantityDto": {
        "required": [
          "locationId"
        ],
        "type": "object",
        "properties": {
          "newQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": "string"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical container the adjustment applies to (container code, or row id for\ncode-less containers) — required for any lot split across multiple active\ncontainers. For controlled lots it is carried into the approval request."
          }
        }
      },
      "AdjustRetailInventoryDto": {
        "type": "object",
        "properties": {
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdministerVaccineRequest": {
        "required": [
          "inventoryItemId",
          "patientId",
          "quantity",
          "locationId",
          "route",
          "site"
        ],
        "type": "object",
        "properties": {
          "inventoryItemId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lotId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Existing lot id when the clinician picks from stock. Mutually exclusive with InlineLotPayload? AdministerVaccineRequest.InlineLot and bool AdministerVaccineRequest.UseTemporaryLot."
          },
          "inlineLot": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Full lot details when creating a new real lot inline at admin time. All three fields required.",
                "$ref": "#/components/schemas/InlineLotPayload"
              }
            ]
          },
          "useTemporaryLot": {
            "type": "boolean",
            "description": "When true, creates a temporary placeholder lot and follow-up WorkTask."
          },
          "locationId": {
            "type": "string"
          },
          "route": {
            "type": "string",
            "description": "Route of administration: \"SC\" | \"IM\" | \"IN\" | \"IV\" | \"Oral\" | \"Topical\" | \"Other\"."
          },
          "site": {
            "type": "string",
            "description": "Injection / administration site: \"RF\" | \"LF\" | \"RR\" | \"LR\" | \"IN\" | \"SQ\" | \"Other\"."
          },
          "administeredById": {
            "type": [
              "null",
              "string"
            ],
            "description": "Staff member who physically gave the injection (often a tech). Defaults to caller when omitted."
          },
          "doctorOfRecordId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The DVM of record for this dose — who a certificate names by default. Null = accept the\nserver default (the appointment's assigned provider, when provider-flagged). Set\nbool AdministerVaccineRequest.NoDoctorOfRecord to force \"no doctor\" despite an appointment default."
          },
          "noDoctorOfRecord": {
            "type": "boolean",
            "description": "True = explicitly no doctor of record; suppresses the appointment default."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Explicit expiration / due date for the resulting vaccination record. For rabies this is the\nvet-certified effective due date — 1 year for a first/primary dose (even with a 3-year-labeled\nproduct), the product's labeled duration for a booster. When omitted, the dispense auto-create\nfalls back to the vaccine type's labeled duration (unchanged behavior for non-rabies vaccines).",
            "format": "date-time"
          },
          "vaccineExpirationDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "The physical vaccine <b>vial/lot expiration</b> date (distinct from the next-due\nDateTime? AdministerVaccineRequest.ExpirationDate). Populated from the selected/inline inventory lot in the UI and\neditable as a manual override for clinics not using inventory. When omitted, the server pulls\nit from the linked inventory lot. Persisted on the vaccination record and frozen onto the\nrabies certificate at issuance.",
            "format": "date-time"
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Attaches the resulting InventoryTransaction to this estimate in the same request."
          },
          "estimateLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the administration is performing an existing estimate line (the in-visit Treatment\nPlan flow), the resulting transaction is linked to THIS line and the line is marked\nPerformed — and the dispense skips the POS draft-estimate attach. This makes the vaccine\ndispense once: without it the line was performed (and dispensed) a second time afterwards,\nproducing duplicate vaccination records + reminders."
          }
        },
        "description": "Request from the VaccineAdministrationModal. Wraps dispense-from-inventory + augments with\nroute/site/explicit administered-by and handles the three lot-picker modes (existing, inline\nnew, temporary)."
      },
      "AiDerivedMetricsDto": {
        "type": "object",
        "properties": {
          "estimatedWordsGenerated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Estimated words generated: SOAP×450 + Discharge×800 + Intent response chars/5",
            "format": "int32"
          },
          "estimatedMinutesSaved": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Estimated minutes saved using conservative estimates:\nSOAP×8 + Discharge×15 + Intent×0.5 + Automation×2",
            "format": "int32"
          },
          "totalAiTasks": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Total AI tasks: Sum of all operations",
            "format": "int32"
          },
          "documentsDrafted": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Documents drafted: SOAP + Discharge",
            "format": "int32"
          },
          "fteEquivalent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "FTE equivalent based on time saved (assuming 8hr workday)",
            "format": "double"
          },
          "laborValueSaved": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Estimated labor value saved (FTE × avg hourly rate × hours)",
            "format": "double"
          }
        },
        "description": "Derived marketing metrics (calculated from raw counts)"
      },
      "AiFeatureBreakdownDto": {
        "type": "object",
        "properties": {
          "feature": {
            "type": "string"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "timeSavedMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Per-feature breakdown"
      },
      "AiImpactMetricsDto": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "rawCounts": {
            "description": "Raw counts from tracked data",
            "$ref": "#/components/schemas/AiRawCountsDto"
          },
          "derivedMetrics": {
            "description": "Derived \"marketing-friendly\" metrics",
            "$ref": "#/components/schemas/AiDerivedMetricsDto"
          },
          "byFeature": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AiFeatureBreakdownDto"
            },
            "description": "Breakdown by AI feature"
          },
          "quality": {
            "description": "Quality metrics",
            "$ref": "#/components/schemas/AiQualityMetricsDto"
          }
        }
      },
      "AiModelConfigDto": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "description": "AI provider: \"openai\" or \"anthropic\""
          },
          "modelId": {
            "type": "string",
            "description": "Model identifier (e.g., \"claude-sonnet-4-6\", \"gpt-5.4-mini\"). Empty = use the\ninfra-configured default. Model ids live in the ModelCatalog config, not hardcoded."
          }
        },
        "description": "Configuration for an AI model (provider + model ID)"
      },
      "AiQualityMetricsDto": {
        "type": "object",
        "properties": {
          "overallSuccessRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Weighted success rate across all features",
            "format": "double"
          },
          "intentCompletionRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Intent completion rate (completed / total)",
            "format": "double"
          },
          "avgIntentResponseTimeMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Average intent response time in milliseconds",
            "format": "int32"
          }
        },
        "description": "Quality and success metrics"
      },
      "AiRawCountsDto": {
        "type": "object",
        "properties": {
          "soapNotesGenerated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "dischargeDocsGenerated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "intentInteractions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "automationRuns": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "agentMessages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Real counts from database"
      },
      "AiSettingsDto": {
        "type": "object",
        "properties": {
          "patientSummariesEnabled": {
            "type": "boolean"
          },
          "chartNotesGenerationEnabled": {
            "type": "boolean"
          },
          "defaultSummaryTemplate": {
            "type": "string"
          },
          "displayAiLabels": {
            "type": "boolean"
          },
          "displayConfidenceScores": {
            "type": "boolean"
          },
          "aiEmailResponsesEnabled": {
            "type": "boolean"
          },
          "publicPortalChatbotEnabled": {
            "type": "boolean"
          },
          "chatbotPersona": {
            "type": "string"
          },
          "aiLabAnalysisEnabled": {
            "type": "boolean"
          },
          "aiRadiologyAnalysisEnabled": {
            "type": "boolean"
          },
          "anonymizeForAiProcessing": {
            "type": "boolean"
          },
          "shareAnonymizedDataGlobalMcp": {
            "type": "boolean"
          },
          "requireDoctorReviewForAi": {
            "type": "boolean"
          },
          "ga4ClarityEnabled": {
            "type": "boolean"
          },
          "triageModel": {
            "$ref": "#/components/schemas/AiModelConfigDto"
          },
          "assistantModel": {
            "$ref": "#/components/schemas/AiModelConfigDto"
          },
          "vipModel": {
            "$ref": "#/components/schemas/AiModelConfigDto"
          },
          "soapNotesModel": {
            "$ref": "#/components/schemas/AiModelConfigDto"
          },
          "dischargeDocsModel": {
            "$ref": "#/components/schemas/AiModelConfigDto"
          },
          "widgetChatbot": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WidgetChatbotConfigDto"
              }
            ]
          }
        },
        "description": "AI feature settings"
      },
      "AmendReferenceIntervalsDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional shared justification recorded against every correction in this batch. Optional on\npurpose (see `LabResultAmendment.Reason`) — demanding prose for routine corrections\nonly trains staff to type a placeholder."
          },
          "amendments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferenceIntervalAmendmentDto"
            }
          }
        },
        "description": "             Corrects the reference interval on one or more results of a single unfinalized order, and\n             re-derives their flags (ITE-499).\n\n             Deliberately a batch even when the caller is fixing one row. The reported case is a whole CBC\nrun against the wrong species profile, where every analyte on the panel needs the same\ntreatment; forcing 25 sequential calls would mean 25 chances to half-finish and leave a panel\ninterpreted against two different species at once. One call, one transaction, one recomputed\norder status."
      },
      "ApiKeyListItem": {
        "required": [
          "keyHash",
          "keyPrefix",
          "name",
          "status",
          "scopes",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "keyHash": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ApiKeyRecord": {
        "type": "object",
        "properties": {
          "keyHash": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "keyPrefix": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastUsedFromIp": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowedIpAddresses": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "AppInviteResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "deepLink": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "clientEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicName": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AppliedDiscountDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "discountPolicyId": {
            "type": "string"
          },
          "invoiceLineItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "discountCode": {
            "type": "string"
          },
          "discountName": {
            "type": "string"
          },
          "discountType": {
            "type": "string"
          },
          "discountValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "calculatedAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "appliedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "appliedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AppliedPriceRuleDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "priceRuleId": {
            "type": "string"
          },
          "invoiceLineItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "ruleName": {
            "type": "string"
          },
          "ruleType": {
            "type": "string"
          },
          "calculatedAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "evaluatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Audit record of a price rule that produced a discount on an estimate."
      },
      "ApplyDiscountDto": {
        "type": "object",
        "properties": {
          "discountCodeId": {
            "type": "string"
          },
          "lineItemId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AppointmentDetailDto": {
        "type": "object",
        "properties": {
          "vitalMeasurements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VitalMeasurementSummaryDto"
            }
          },
          "forms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FormSummaryDto"
            }
          },
          "id": {
            "type": "string"
          },
          "scheduleItemId": {
            "type": "string"
          },
          "scheduleItem": {
            "$ref": "#/components/schemas/ScheduleItemDto"
          },
          "clientId": {
            "type": "string"
          },
          "client": {
            "$ref": "#/components/schemas/ClientSummaryDto"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set on patient-scoped appointments. Null on group visits — see string? AppointmentResponseDto.PatientGroupId."
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PatientSummaryDto"
              }
            ]
          },
          "patientGroupId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set on group-visit appointment types (litter / herd). Mutually exclusive with string? AppointmentResponseDto.PatientId."
          },
          "patientGroup": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AppointmentPatientGroupSummaryDto"
              }
            ]
          },
          "reasonForVisit": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "recordingId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "isTravelAppointment": {
            "type": "boolean"
          },
          "travelDestinationAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDestinationPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDistanceMeters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelIsRoundTrip": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "travelFeeAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "travelAccessNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresSurgeryRoom": {
            "type": "boolean",
            "description": "Whether this appointment type requires a surgery room."
          },
          "isEmergencySurgeryConversion": {
            "type": "boolean",
            "description": "Whether this appointment was converted from a regular exam to emergency surgery."
          },
          "appointmentTypeDefaultFlowId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Chronicle workflow id sourced from this appointment's\n<see cref=\"!:AppointmentType\" />. Null falls back to `appointment-default`\nat the chronicle. Denormalized at read time so the chronicle doesn't need\na second appointment-type lookup."
          },
          "appointmentTypeExamTemplateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Exam template id sourced from this appointment's <see cref=\"!:AppointmentType\" />\n(PAW-741). Resolution at the chronicle exam step: this value, else the\nprovider's personal default, else the standard 7-system view. Denormalized\nat read time so the chronicle doesn't need a second appointment-type lookup."
          },
          "appointmentTypeAutoGenerateSoap": {
            "type": "boolean",
            "description": "Auto-start SOAP generation when the treatment plan is converted to an\ninvoice (PAW-675). Denormalized from the appointment type; true when\nthe appointment has no type (the platform default is on)."
          },
          "appointmentTypeAutoGenerateDischarge": {
            "type": "boolean",
            "description": "Auto-start discharge generation when the SOAP note is approved (PAW-675).\nDenormalized from the appointment type; true when the appointment has\nno type (the platform default is on)."
          }
        },
        "description": "Detailed appointment response with vitals and forms"
      },
      "AppointmentListItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "scheduleItemId": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Patient or group ID — populated from whichever side of the polymorphic appointment is set."
          },
          "patientGroupId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "clientName": {
            "type": "string"
          },
          "patientName": {
            "type": "string",
            "description": "For group visits this is the group name + type (e.g. \"Bella's June litter (Litter)\")."
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "vaccinationStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "subjectKind": {
            "type": "string",
            "description": "\"Patient\" or \"Group\" — lets the schedule UI render a group icon instead of a paw."
          },
          "reasonForVisit": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ],
            "description": "Free-text appointment notes. Surfaced in the patient's visit-history card so visits\n            with notes but no structured record (e.g. imported history) aren't shown empty."
          },
          "status": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Schedule item's location id — lets the UI default a room picker to the current room."
          },
          "assignedTo": {
            "type": [
              "null",
              "string"
            ]
          },
          "isCompassionCare": {
            "type": "boolean",
            "description": "True when this appointment's type is flagged as compassion / euthanasia / end-of-life care."
          },
          "patientAlerts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "patientTreatmentAcceptanceRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Read-only lifetime treatment-acceptance rate (0-100) for the patient, or null when the\npatient has no decided services (or this is a group visit). Surfaced on the EMR visit list.",
            "format": "double"
          }
        },
        "description": "Lightweight appointment item for lists"
      },
      "AppointmentListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentListItemDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Paginated appointment list response"
      },
      "AppointmentPatientGroupSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "groupType": {
            "type": "string",
            "description": "\"Litter\" or \"Herd\"."
          },
          "speciesName": {
            "type": [
              "null",
              "string"
            ]
          },
          "headCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "memberCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Lightweight group summary for embedding in appointment responses."
      },
      "AppointmentResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "scheduleItemId": {
            "type": "string"
          },
          "scheduleItem": {
            "$ref": "#/components/schemas/ScheduleItemDto"
          },
          "clientId": {
            "type": "string"
          },
          "client": {
            "$ref": "#/components/schemas/ClientSummaryDto"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set on patient-scoped appointments. Null on group visits — see string? AppointmentResponseDto.PatientGroupId."
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PatientSummaryDto"
              }
            ]
          },
          "patientGroupId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set on group-visit appointment types (litter / herd). Mutually exclusive with string? AppointmentResponseDto.PatientId."
          },
          "patientGroup": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AppointmentPatientGroupSummaryDto"
              }
            ]
          },
          "reasonForVisit": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "recordingId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "isTravelAppointment": {
            "type": "boolean"
          },
          "travelDestinationAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDestinationPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDistanceMeters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelIsRoundTrip": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "travelFeeAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "travelAccessNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresSurgeryRoom": {
            "type": "boolean",
            "description": "Whether this appointment type requires a surgery room."
          },
          "isEmergencySurgeryConversion": {
            "type": "boolean",
            "description": "Whether this appointment was converted from a regular exam to emergency surgery."
          },
          "appointmentTypeDefaultFlowId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Chronicle workflow id sourced from this appointment's\n<see cref=\"!:AppointmentType\" />. Null falls back to `appointment-default`\nat the chronicle. Denormalized at read time so the chronicle doesn't need\na second appointment-type lookup."
          },
          "appointmentTypeExamTemplateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Exam template id sourced from this appointment's <see cref=\"!:AppointmentType\" />\n(PAW-741). Resolution at the chronicle exam step: this value, else the\nprovider's personal default, else the standard 7-system view. Denormalized\nat read time so the chronicle doesn't need a second appointment-type lookup."
          },
          "appointmentTypeAutoGenerateSoap": {
            "type": "boolean",
            "description": "Auto-start SOAP generation when the treatment plan is converted to an\ninvoice (PAW-675). Denormalized from the appointment type; true when\nthe appointment has no type (the platform default is on)."
          },
          "appointmentTypeAutoGenerateDischarge": {
            "type": "boolean",
            "description": "Auto-start discharge generation when the SOAP note is approved (PAW-675).\nDenormalized from the appointment type; true when the appointment has\nno type (the platform default is on)."
          }
        },
        "description": "Full appointment response with all related data"
      },
      "AppointmentSummaryForScheduleDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PatientSummaryDto"
              }
            ]
          },
          "patientGroupId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientGroup": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PatientGroupSummaryForScheduleDto"
              }
            ]
          },
          "clientId": {
            "type": "string"
          },
          "client": {
            "$ref": "#/components/schemas/ClientSummaryDto"
          },
          "status": {
            "type": "string"
          },
          "confirmationStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "Client confirmation state (\"Unconfirmed\" | \"Confirmed\" | \"Declined\" |\n\"RescheduleRequested\"). Null when no confirmation was ever requested —\nthe schedule renders nothing in that case."
          },
          "reasonForVisit": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AppointmentTypeSummaryDto"
              }
            ]
          },
          "isTravelAppointment": {
            "type": "boolean",
            "description": "Travel/mobile visit details. These are the only copy of the destination a\nconsumer of a schedule item ever sees: ITE-283 added a Mobile visit panel to\nthe view modal, a travel section to Edit and a destination line to Reschedule,\nbut every one of them gates on bool AppointmentSummaryForScheduleDto.IsTravelAppointment — which this\nsummary never carried, so all three were unreachable in production even though\nthe TypeScript type advertised the fields. Anything added here must also be\nmapped in ScheduleItemService.MapToResponseDto; the FE type is not a contract."
          },
          "travelDestinationAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDestinationPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDistanceMeters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelIsRoundTrip": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "travelFeeAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "travelAccessNotes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Lightweight appointment summary for embedding in schedule item responses.\nPolymorphic on subject: per-patient appointments populate Patient/PatientId;\ngroup-visit appointments (litter/herd) populate PatientGroup/PatientGroupId.\nExactly one of (PatientId, PatientGroupId) is set, per the appointments_subject_chk\nDB constraint."
      },
      "AppointmentTypeDefaultServiceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "appointmentTypeId": {
            "type": "string"
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceType": {
            "type": "string"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "defaultQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Default service configuration for an appointment type"
      },
      "AppointmentTypeDefaultServicesListDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentTypeDefaultServiceDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Response for listing default services on an appointment type"
      },
      "AppointmentTypeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferBeforeMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferAfterMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "requiresSurgeryRoom": {
            "type": "boolean"
          },
          "isGroupVisit": {
            "type": "boolean"
          },
          "isCompassionCare": {
            "type": "boolean"
          },
          "allowOnlineBooking": {
            "type": "boolean",
            "description": "Whether clients may self-book this type online (ITE-430)."
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "acuity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Default triage acuity (1–10) used when this type lands in CareQueue. Null\nmeans no default and the entry will use the queue's neutral baseline.",
            "format": "int32"
          },
          "defaultFlowId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Id of the chronicle workflow to start when an appointment of this type\nis opened. Null falls back to the entity default (`appointment-default`)."
          },
          "examTemplateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Id of the exam template the chronicle exam step renders for this type\n(PAW-741). Overrides the provider's personal default; null falls through\nto that default, then to the standard 7-system view."
          },
          "noteFormat": {
            "type": [
              "null",
              "string"
            ],
            "description": "Generated-note format for visits of this type (PAW-744). Null = standard\nfour-section SOAP note. Ids come from the code-defined\nSoapNoteFormats registry (e.g. \"quick-visit\")."
          },
          "autoGenerateSoap": {
            "type": "boolean",
            "description": "Auto-start SOAP generation when the treatment plan is converted to an invoice (PAW-675)."
          },
          "autoGenerateDischarge": {
            "type": "boolean",
            "description": "Auto-start discharge generation when the SOAP note is approved (PAW-675)."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "locationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Location IDs that can accommodate this appointment type (Location Intents)."
          },
          "journeyTemplates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JourneyMilestoneTemplateDto"
            },
            "description": "Journey milestone templates for this appointment type."
          },
          "defaultServices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentTypeDefaultServiceDto"
            },
            "description": "Default services for this appointment type."
          }
        }
      },
      "AppointmentTypeListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentTypeDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AppointmentTypeSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Lightweight appointment type summary for embedding in schedule item responses"
      },
      "ApproveMedicationRequestDto": {
        "type": "object",
        "properties": {
          "useRefill": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Renewal approval mode (design §7). True = \"use a refill\": increments\nRefillsUsed on the prior Rx and reuses it — no new legal record, no SIG.\nFalse/absent on a renewal = \"new prescription\" (the normal create path,\nkeeping the renewal link). 409 when the prior Rx is inactive, expired,\nexhausted, or DEA Schedule II."
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Prescribing DVM. Defaults to the approving caller."
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Resolves a free-text capture to a real item (required if capture had none)."
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Overrides the captured quantity when the doctor adjusts it.",
            "format": "double"
          },
          "fulfillmentMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "pharmacyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ],
            "description": "SIG — required for Rx approval."
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "medicationCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Escape hatch from one-estimate-per-request: put the billable line on this\nexisting live estimate instead of a fresh standalone draft (e.g. adding a\nmed to an estimate about to be presented, or the visit's estimate)."
          },
          "isCascade": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "cascadeReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "antimicrobialUseType": {
            "type": [
              "null",
              "string"
            ]
          },
          "antimicrobialJustification": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicalAssessmentPerformed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "physicalExamPerformed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "physicalExamJustification": {
            "type": [
              "null",
              "string"
            ]
          },
          "repeatCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "withdrawalPeriod": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Provider approval. For Rx this is where the Prescription is authored, so it\ncarries the prescribing fields the compound DTO carries at creation today."
      },
      "ApproveReferralRequest": {
        "type": "object",
        "properties": {
          "existingClientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional: Link to existing client instead of creating new"
          },
          "existingPatientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional: Link to existing patient instead of creating new"
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required: The appointment type for the scheduled appointment"
          }
        }
      },
      "ApproveRequestDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AssignPatientToRoomRequest": {
        "required": [
          "roomId"
        ],
        "type": "object",
        "properties": {
          "roomId": {
            "type": "string"
          }
        },
        "description": "Request to assign a patient to a room"
      },
      "AssignRabiesTagRequest": {
        "type": "object",
        "properties": {
          "rabiesTagBatchId": {
            "type": [
              "null",
              "string"
            ]
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "outsideTagNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccinationRecordId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "countyTagNumber": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Assign a tag to a vaccination event. Provide EITHER a batch tag (string? AssignRabiesTagRequest.RabiesTagBatchId\nwith optional long? AssignRabiesTagRequest.Sequence — omit to take the suggested next) OR an\nstring? AssignRabiesTagRequest.OutsideTagNumber for a manual/outside tag."
      },
      "AuthOnlyResultDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "token": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaymentTokenSummaryDto"
              }
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          },
          "authorizationCode": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Result of an auth-only transaction for card enrollment."
      },
      "AvailableSlotDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BatchCloseResponseDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "confirmationCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateOpened": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "netAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "refundCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "refundTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "salesCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "salesTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "settlementStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Response from closing a payment processor batch."
      },
      "BatchImportItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "drugForm": {
            "type": [
              "null",
              "string"
            ]
          },
          "strength": {
            "type": [
              "null",
              "string"
            ]
          },
          "ndc": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackLots": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "lot": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BatchImportLotDto"
              }
            ]
          }
        }
      },
      "BatchImportItemResultDto": {
        "type": "object",
        "properties": {
          "rowIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "itemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BatchImportLotDto": {
        "type": "object",
        "properties": {
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "manufacturer": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical container identifier. Required when importing stock for a\ncontrolled substance — the DEA Received entry lands on a per-container ledger."
          }
        },
        "description": "DTO for unbilled patient items (dispensed medications not yet on an invoice)"
      },
      "BatchImportRequestDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BatchImportItemDto"
            }
          },
          "skipDuplicates": {
            "type": "boolean"
          },
          "addStockToExisting": {
            "type": "boolean",
            "description": "When true, a row whose name matches an existing item adds its quantity as a new\nlot on that item (instead of being skipped). Only stock is added; the existing\nitem's own fields are not modified."
          },
          "defaultCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultLocationId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BatchImportResultDto": {
        "type": "object",
        "properties": {
          "created": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stocked": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "skipped": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "failed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BatchImportItemResultDto"
            }
          }
        }
      },
      "BillableItemAvailabilityDto": {
        "type": "object",
        "properties": {
          "billableItemId": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The line quantity the required amounts were computed against.",
            "format": "double"
          },
          "isAvailable": {
            "type": "boolean",
            "description": "True only when every inventory component has enough stock."
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BillableItemComponentAvailabilityDto"
            }
          }
        }
      },
      "BillableItemComponentAvailabilityDto": {
        "type": "object",
        "properties": {
          "componentId": {
            "type": "string"
          },
          "inventoryItemId": {
            "type": "string"
          },
          "itemName": {
            "type": "string"
          },
          "trackLots": {
            "type": "boolean",
            "description": "When false, stock is not gated and the component is always available."
          },
          "required": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "QuantityMultiplier × line quantity.",
            "format": "double"
          },
          "available": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Sum of active lots' QuantityOnHand for the component's item.",
            "format": "double"
          },
          "isAvailable": {
            "type": "boolean"
          },
          "shortBy": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "How far short of decimal BillableItemComponentAvailabilityDto.Required stock is (0 when available or ungated).",
            "format": "double"
          }
        }
      },
      "BillableItemComponentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "billableItemId": {
            "type": "string"
          },
          "componentType": {
            "type": "string",
            "description": "One of: \"Inventory\", \"Retail\", \"ServiceCatalog\". Always \"Inventory\" in v1."
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantityMultiplier": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isDefault": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "itemName": {
            "type": "string",
            "description": "Flattened name from the referenced inventory item."
          },
          "itemCode": {
            "type": "string",
            "description": "Flattened code/SKU from the referenced inventory item."
          },
          "category": {
            "type": [
              "null",
              "string"
            ],
            "description": "Referenced inventory item's category (e.g. \"Vaccine\"). Lets the dispense\nmodal require route/site for vaccine components."
          }
        }
      },
      "BillableItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "basePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "componentCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BillableItemComponentDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BillableItemListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BillableItemDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "BlindRefundResultDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "authorizationCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "cardType": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastFour": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Result of a blind (standalone) terminal refund."
      },
      "BondChatMessageRequest": {
        "required": [
          "sessionId",
          "clinicId",
          "message"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "message": {
            "maxLength": 10000,
            "minLength": 0,
            "type": "string"
          },
          "verifiedClientId": {
            "maxLength": 200,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BondChatResponse": {
        "required": [
          "messageId",
          "message",
          "status"
        ],
        "type": "object",
        "properties": {
          "messageId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "urgencyLevel": {
            "type": [
              "null",
              "string"
            ]
          },
          "escalationReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "options": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/BondOption"
            }
          },
          "turnNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "BondConversationStateResponse": {
        "required": [
          "sessionId",
          "clinicId",
          "mode"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "turnCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isEscalated": {
            "type": "boolean"
          },
          "escalatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "escalationReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "messageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "BondEscalationApiRequest": {
        "required": [
          "sessionId",
          "clinicId"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "reason": {
            "maxLength": 500,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BondEscalationResult": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "conversationSummary": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BondOption": {
        "required": [
          "label",
          "value"
        ],
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "BondStatusResponse": {
        "required": [
          "clinicId"
        ],
        "type": "object",
        "properties": {
          "clinicId": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "BookableTypesGate": {
        "required": [
          "pass",
          "source",
          "types"
        ],
        "type": "object",
        "properties": {
          "pass": {
            "type": "boolean"
          },
          "source": {
            "type": "string"
          },
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReadinessTypeInfo"
            }
          }
        }
      },
      "BookingReadinessReport": {
        "required": [
          "ready",
          "bookableTypes",
          "locations",
          "typeRooms",
          "hours",
          "window",
          "providerAvailability"
        ],
        "type": "object",
        "properties": {
          "ready": {
            "type": "boolean"
          },
          "firstFailure": {
            "type": [
              "null",
              "string"
            ]
          },
          "bookableTypes": {
            "$ref": "#/components/schemas/BookableTypesGate"
          },
          "locations": {
            "$ref": "#/components/schemas/LocationsGate"
          },
          "typeRooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TypeRoomsGate"
            }
          },
          "hours": {
            "$ref": "#/components/schemas/HoursGate"
          },
          "window": {
            "$ref": "#/components/schemas/WindowGate"
          },
          "providerAvailability": {
            "$ref": "#/components/schemas/ProviderAvailabilityGate"
          },
          "day": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DayPreviewGate"
              }
            ]
          }
        }
      },
      "BreedDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "speciesId": {
            "type": "string"
          },
          "speciesName": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BreedListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BreedDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "BulkClientExportRequest": {
        "type": "object",
        "properties": {
          "clientIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "options": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClientRecordExportOptions"
              }
            ]
          }
        }
      },
      "BulkExportRequest": {
        "type": "object",
        "properties": {
          "patientIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of patient IDs to export"
          },
          "options": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Export options controlling which sections to include",
                "$ref": "#/components/schemas/PatientRecordExportOptions"
              }
            ]
          }
        },
        "description": "Request body for bulk patient export"
      },
      "BulkUpdateCaseMilestonesRequest": {
        "required": [
          "milestones"
        ],
        "type": "object",
        "properties": {
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaseMilestoneUpdate"
            }
          }
        },
        "description": "Request for bulk updating multiple case milestones (reordering/status changes)"
      },
      "BulkUpdateMilestonesRequest": {
        "required": [
          "milestones"
        ],
        "type": "object",
        "properties": {
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MilestoneUpdate"
            }
          }
        },
        "description": "Request for bulk updating multiple milestones (reordering/status changes)"
      },
      "BusinessMetricsResponseDtoOfAiImpactMetricsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AiImpactMetricsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfCommunicationsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CommunicationsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfCompensationExclusionsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompensationExclusionsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfCompensationSettingDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompensationSettingDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfDashboardSummaryDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DashboardSummaryDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfDeferredServicesBreakdownDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DeferredServicesBreakdownDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfDvmDiagnosisDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DvmDiagnosisDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfDvmProductionDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DvmProductionDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfEBITDASummaryDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EBITDASummaryDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfFinancialDetailsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FinancialDetailsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfInventoryHealthDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InventoryHealthDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfKPISummaryDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/KPISummaryDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfLaborBreakdownChartDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LaborBreakdownChartDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfLaborEfficiencyDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LaborEfficiencyDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfListOfCompensationSettingDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CompensationSettingDto"
            }
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfListOfDailyGoalMetricDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/DailyGoalMetricDto"
            }
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfListOfDeferredServiceItemDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/DeferredServiceItemDto"
            }
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfListOfDvmSignalDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/DvmSignalDto"
            }
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfListOfMentorListEntryDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/MentorListEntryDto"
            }
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfListOfMentorTimelineEntryDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/MentorTimelineEntryDto"
            }
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfMenteePerformanceDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MenteePerformanceDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfMentorSummaryDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MentorSummaryDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfNormalizedPerformanceDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NormalizedPerformanceDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfPatientFunnelDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PatientFunnelDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfPatientTransactionsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PatientTransactionsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfPnLDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PnLDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfPresenceDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PresenceDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfProcedureCategoryRankingsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProcedureCategoryRankingsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfProviderRankingsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProviderRankingsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfScheduleHeatmapDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScheduleHeatmapDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfTopRevenueItemsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TopRevenueItemsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfTrendsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TrendsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessMetricsResponseDtoOfVarianceAlertsDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VarianceAlertsDto"
              }
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CallHistoryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "callerNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "callerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "destinationNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "answerTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "duration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hangupCause": {
            "type": [
              "null",
              "string"
            ]
          },
          "recordingUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "extensionName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CallHistoryResponse": {
        "type": "object",
        "properties": {
          "calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallHistoryDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CancelAppointmentRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request body for cancelling an appointment"
      },
      "CancelMedicationRequestDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "CancelSubscriptionDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CaptureMedicationRequestDto": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The requested med, when the capturer could identify it."
          },
          "freeTextMedication": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"She called it the white pills\" — must be resolved before approval."
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": [
              "null",
              "string"
            ],
            "description": "staff | phone | client-app. Defaults to phone (the multi-day lane's main source)."
          },
          "fulfillmentMethod": {
            "type": [
              "null",
              "string"
            ],
            "description": "Suggested fulfillment; the approving provider decides."
          },
          "renewalOfPrescriptionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Prior Rx this request renews, when captured from medication history (Phase 3 UI)."
          },
          "suggestedProviderId": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedDosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedFrequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedDuration": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedInstructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedRefillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Front-desk capture (\"Requested\"). Deliberately lean: no SIG, no provider, no\nbilling intent — those belong to approval. The item may be unresolved\n(string? CaptureMedicationRequestDto.FreeTextMedication) at this stage."
      },
      "CareQueueEntryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique queue entry id (mirrors AppointmentId for v1)."
          },
          "appointmentId": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": "string"
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "acuity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Triage acuity 1–10. Higher = more urgent.",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "description": "\"triaged\" | \"waiting\" | \"roomed\"."
          },
          "etaRangeMinutes": {
            "type": "string",
            "description": "Display range, e.g. \"10–15\". Computed from provider state."
          },
          "enteredAt": {
            "type": "string",
            "description": "ISO timestamp when the entry was added (check-in time for v1).",
            "format": "date-time"
          },
          "issue": {
            "type": "string",
            "description": "Reason for visit / presenting issue."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ],
            "description": "Free-form triage notes."
          },
          "queuePosition": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Persisted manual ordering; lower = earlier in queue.",
            "format": "int32"
          }
        },
        "description": "A single waiting patient in CareQueue. Backed by an Appointment in\nCheckedIn status with no current room assignment."
      },
      "CareQueueEventDto": {
        "type": "object",
        "properties": {
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "type": "string",
            "description": "Dotted event type, e.g. \"queue.entry.acuity_updated\"."
          },
          "msg": {
            "type": "string"
          },
          "critical": {
            "type": "boolean"
          }
        },
        "description": "Audit trail / live-update line. Surfaced in the System Event Log drawer\nand intended to map to SignalR events the frontend has already received."
      },
      "CareQueueProviderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "Display role, e.g. \"DVM (Surgery)\", \"LVT\"."
          },
          "status": {
            "type": "string",
            "description": "\"critical\" | \"busy\" | \"available\"."
          },
          "complexity": {
            "type": "string",
            "description": "\"High\" | \"Med\" | \"Low\" | \"None\"."
          },
          "interruptibility": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "0–100. How interruptible the provider is right now.",
            "format": "int32"
          },
          "timeToCapacity": {
            "type": "string",
            "description": "Display string, e.g. \"~10–15m\" or \"Immediate\" or \"Unknown\"."
          },
          "currentCases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Display labels for active cases (patient + reason)."
          }
        },
        "description": "A provider's current state from CareQueue's perspective — used to derive\nqueue ETAs and to surface to the team where attention is concentrated."
      },
      "CareQueueReorderRequest": {
        "type": "object",
        "properties": {
          "orderedAppointmentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "AppointmentIds in the desired order (top of queue first).\nServer persists `queue_position` from the index."
          }
        },
        "description": "Request body for PATCH /carequeue/reorder. Provides the full target order."
      },
      "CareQueueStateDto": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CareQueueEntryDto"
            }
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CareQueueProviderDto"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CareQueueEventDto"
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Complete CareQueue state — the FIFO triage queue board state for a clinic\non a given day. Sits upstream of the Flowboard: once a patient is roomed,\nthey leave CareQueue and appear on the Flowboard. See ITE-58."
      },
      "CaseMilestoneResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "caseId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/MilestoneStatus"
          },
          "type": {
            "$ref": "#/components/schemas/CaseMilestoneType"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Response DTO for case milestone"
      },
      "CaseMilestoneType": {
        "type": "integer"
      },
      "CaseMilestoneUpdate": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MilestoneStatus"
              }
            ]
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        },
        "description": "Individual case milestone update within a bulk update operation"
      },
      "CaseResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "diagnosisType": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/CaseStatus"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "planData": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaseMilestoneResponseDto"
            }
          }
        },
        "description": "Response DTO for case"
      },
      "CaseStatus": {
        "type": "integer"
      },
      "CategoryRollupDto": {
        "required": [
          "category",
          "recent"
        ],
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "blocking": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "warnings": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "recent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComplianceEventSummaryDto"
            }
          }
        }
      },
      "ChargeTakeHomeComponentDto": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "description": "The dispense transaction to attach the prescription to."
          },
          "inventoryItemId": {
            "type": "string"
          },
          "itemName": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Quantity dispensed for this component (absolute, positive).",
            "format": "double"
          },
          "sigFilled": {
            "type": "boolean",
            "description": "True once a PrescriptionItem (the SIG/label) has been filled for this transaction."
          }
        }
      },
      "ChatExportEmailResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "recipientEmail": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Result of a chat export email operation"
      },
      "ChatExportMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "A single message in the chat export"
      },
      "ChecklistOverrideDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          },
          "userId": {
            "type": [
              "null",
              "string"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Audit record of an override: reason, user, timestamp."
      },
      "CheckScheduleConflictsRequest": {
        "required": [
          "locationId",
          "startTime",
          "endTime"
        ],
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "isRecurring": {
            "type": "boolean"
          },
          "recurrencePattern": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecurrencePatternDto"
              }
            ]
          },
          "excludeScheduleItemId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to check for schedule conflicts before creating/updating"
      },
      "ClientAppSettingsDto": {
        "type": "object",
        "properties": {
          "savedPaymentMethodsAllowed": {
            "type": "boolean"
          },
          "useCardOnFileAllowed": {
            "type": "boolean"
          },
          "sendInvoicesToApp": {
            "type": "boolean"
          },
          "preAuthRequired": {
            "type": "boolean"
          },
          "endOfVisitPaymentsAllowed": {
            "type": "boolean"
          },
          "clientAppNotes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Client app payment and feature settings"
      },
      "ClientFeedbackSettingsDto": {
        "type": "object",
        "properties": {
          "npsEnabled": {
            "type": "boolean"
          },
          "googlePlaceId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Client feedback / NPS survey configuration (PAW-469)."
      },
      "ClientListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ClientLookupRequest": {
        "required": [
          "sessionId",
          "clinicId"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string",
            "description": "The widget session — must have completed OTP for the email being looked up (ITE-434)."
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "email": {
            "maxLength": 254,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "maxLength": 20,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ClientLookupResponse": {
        "type": "object",
        "properties": {
          "found": {
            "type": "boolean"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "patients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientSummaryDto"
            }
          }
        }
      },
      "ClientRecordExportOptions": {
        "type": "object",
        "properties": {
          "includeContactInfo": {
            "type": "boolean",
            "description": "Include contact information (name, email, phone, address)"
          },
          "includeEmergencyContact": {
            "type": "boolean",
            "description": "Include emergency contact details"
          },
          "includeCommunicationPreferences": {
            "type": "boolean",
            "description": "Include communication preferences"
          },
          "includePatients": {
            "type": "boolean",
            "description": "Include list of associated patients"
          },
          "includeAppointmentHistory": {
            "type": "boolean",
            "description": "Include appointment history"
          },
          "includePaymentHistory": {
            "type": "boolean",
            "description": "Include payment/billing history"
          }
        },
        "description": "Options controlling which sections to include in the client record export"
      },
      "ClientResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "ISO 3166-1 alpha-2 country code (e.g. \"US\", \"GB\"). Defaults to clinic's region if null."
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "accountStatus": {
            "$ref": "#/components/schemas/AccountStatus"
          },
          "emergencyContact": {
            "$ref": "#/components/schemas/EmergencyContactDto"
          },
          "secondaryEmergencyContact": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SecondaryEmergencyContactDto"
              }
            ]
          },
          "communicationPreferences": {
            "$ref": "#/components/schemas/CommunicationPreferencesDto"
          },
          "preferredLanguage": {
            "type": [
              "null",
              "string"
            ]
          },
          "referralSource": {
            "type": [
              "null",
              "string"
            ],
            "description": "Marketing attribution — \"how did you hear about us\". Staff/client entered."
          },
          "createdVia": {
            "type": [
              "null",
              "string"
            ],
            "description": "Read-only provenance — the channel that created the record (ITE-419)."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ClientSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ClinicCategoryBreakdownDto": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "revenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "leakage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ClinicConfigDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "financial": {
            "$ref": "#/components/schemas/FinancialSettingsDto"
          },
          "communications": {
            "$ref": "#/components/schemas/CommunicationsSettingsDto"
          },
          "inventory": {
            "$ref": "#/components/schemas/InventorySettingsDto"
          },
          "diagnostics": {
            "$ref": "#/components/schemas/DiagnosticsSettingsDto"
          },
          "ai": {
            "$ref": "#/components/schemas/AiSettingsDto"
          },
          "compliance": {
            "$ref": "#/components/schemas/ComplianceSettingsDto"
          },
          "clientApp": {
            "$ref": "#/components/schemas/ClientAppSettingsDto"
          },
          "region": {
            "$ref": "#/components/schemas/RegionSettingsDto"
          },
          "transparencyPage": {
            "$ref": "#/components/schemas/TransparencyPageSettingsDto"
          },
          "erx": {
            "$ref": "#/components/schemas/ErxSettingsDto"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Full clinic configuration response (all domains)"
      },
      "ClinicIdentitySettingsDto": {
        "type": "object",
        "properties": {
          "ownershipType": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Independent\" | \"Corporate\" | \"Group\" | null."
          },
          "parentOrganization": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownershipStatement": {
            "type": [
              "null",
              "string"
            ]
          },
          "vatRegistrationNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "VAT registration number — legally required on UK invoices."
          }
        },
        "description": "Clinic identity disclosure block for CMA compliance."
      },
      "ClinicSettingsDto": {
        "type": "object",
        "properties": {
          "companyId": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "clinicAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicAboutNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultAppointmentDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "schedulingPolicy": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "description": "The clinic's IANA zone. Never null — server-side formatters (email, SMS,\nvoice, PDFs, labels) have no sane way to degrade and must not fall\nthrough to UTC, so an unconfigured tenant reads back as Eastern.\nCheck bool ClinicSettingsDto.TimezoneConfigured before trusting it as the\nclinic's actual location."
          },
          "timezoneConfigured": {
            "type": "boolean",
            "description": "False when the tenant has no stored timezone and string ClinicSettingsDto.Timezone\nis therefore the Eastern placeholder rather than a real setting. The web\napp uses this to prefer the workstation's own zone: rendering a Pacific\nclinic's day in Eastern is what produced ITE-337."
          },
          "defaultWeeklyHours": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LocationHoursEntryDto"
            }
          },
          "travel": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TravelSettingsDto"
              }
            ]
          },
          "schedulingPreferences": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SchedulingPreferencesDto"
              }
            ]
          },
          "metrics": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MetricsSettingsDto"
              }
            ]
          },
          "billingStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "Billing/contract state: \"Trial\", \"Active\", \"Suspended\", or empty for legacy records\n(treated as \"Active\"). Drives GDPR consent banner visibility post-login."
          }
        }
      },
      "ClockingActionResponseDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClockStatusResponseDto"
              }
            ]
          }
        },
        "description": "Response DTO for clocking actions"
      },
      "ClockInRequestDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request DTO for clock in"
      },
      "ClockOutRequestDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request DTO for clock out"
      },
      "ClockStatusResponseDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "clockInTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lunchStartTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "elapsedMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "currentEntry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TimeEntryResponseDto"
              }
            ]
          },
          "requiresTimeTracking": {
            "type": "boolean"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          }
        },
        "description": "Response DTO for clock status"
      },
      "CloseOutDayDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CloseOutResultDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "closedAt": {
            "type": "string",
            "format": "date-time"
          },
          "closedBy": {
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/ReconciliationSummaryDto"
          }
        }
      },
      "ClosePrescriptionDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CommunicationPreferencesDto": {
        "type": "object",
        "properties": {
          "preferredMethod": {
            "$ref": "#/components/schemas/ContactMethod"
          },
          "allowAppointmentReminders": {
            "type": "boolean"
          },
          "allowEmailMarketing": {
            "type": "boolean"
          },
          "allowPhoneCalls": {
            "type": "boolean"
          },
          "allowSmsMarketing": {
            "type": "boolean"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CommunicationsDto": {
        "type": "object",
        "properties": {
          "calls": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "emails": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalOutbound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "period": {
            "type": "string"
          }
        }
      },
      "CommunicationsSettingsDto": {
        "type": "object",
        "properties": {
          "preHistoryFormsEnabled": {
            "type": "boolean"
          },
          "formSendCadence": {
            "type": "string"
          },
          "smsEnabled": {
            "type": "boolean"
          },
          "defaultCallerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultEmailFooter": {
            "type": [
              "null",
              "string"
            ]
          },
          "lowStockAlertsEnabled": {
            "type": "boolean"
          },
          "newClientNotificationsEnabled": {
            "type": "boolean"
          },
          "coldChainBreachAlertEnabled": {
            "type": "boolean"
          },
          "equipmentFailureAlertEnabled": {
            "type": "boolean"
          },
          "telnyxPhoneNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "telnyxApiKeyArn": {
            "type": [
              "null",
              "string"
            ]
          },
          "smsConsentEnabled": {
            "type": "boolean"
          },
          "smsConsentBrandName": {
            "type": [
              "null",
              "string"
            ]
          },
          "smsConsentUseCases": {
            "type": "string"
          }
        },
        "description": "Communications and messaging settings"
      },
      "CompensationExclusionsDto": {
        "type": "object",
        "properties": {
          "clinic": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderExclusionsDto"
            }
          }
        },
        "description": "Service-mix buckets excluded from production-pay revenue. Clinic-wide buckets apply to\nevery provider; per-provider buckets are additive on top of the clinic-wide set."
      },
      "CompensationSettingDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "annualSalary": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "productionPercentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "productionThreshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "standardAnnualHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "effectiveFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "effectiveUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "compensationThresholdOverridePercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isConfigured": {
            "type": "boolean"
          }
        }
      },
      "CompleteAppointmentRequest": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request body for completing an appointment"
      },
      "CompleteIntakeFlowRequest": {
        "required": [
          "flowKey"
        ],
        "type": "object",
        "properties": {
          "flowKey": {
            "type": "string"
          }
        },
        "description": "Request DTO for completing an intake flow"
      },
      "CompleteReminderRequest": {
        "type": "object",
        "properties": {
          "completionType": {
            "$ref": "#/components/schemas/ReminderCompletionType"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to complete a reminder with explicit completion semantics"
      },
      "CompleteWorkTaskRequest": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "outcome": {
            "type": [
              "null",
              "string"
            ],
            "description": "Structured contact result (PAW-625): \"Reached\" | \"LeftVoicemail\" | \"NoAnswer\" | … .\nRequired when completing a Callback task; optional for other categories."
          }
        }
      },
      "ComplianceDashboardDto": {
        "required": [
          "range",
          "headline",
          "categories"
        ],
        "type": "object",
        "properties": {
          "range": {
            "$ref": "#/components/schemas/DateRangeDto"
          },
          "headline": {
            "$ref": "#/components/schemas/HeadlineMetricsDto"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategoryRollupDto"
            }
          }
        },
        "description": "Top-level payload returned by `GET /compliance/dashboard`. Closes\nPAW-426 §6 — every section here is computed from the unified\n`compliance_events` table, plus settings/catalog reads for the\n\"is this configured?\" booleans."
      },
      "ComplianceEventSummaryDto": {
        "required": [
          "id",
          "category",
          "eventCode",
          "severity",
          "entityType",
          "entityId",
          "region",
          "occurredAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "eventCode": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "entityType": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "sourceTable": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "actorUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "actorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "resultCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "region": {
            "type": "string"
          },
          "metadataJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Row-level summary of one event. Intentionally thin — the dashboard uses\n`SourceTable` + `SourceId` to drill into the rich-shape silo\n(consent modal, DEA book, prescription detail, etc.)."
      },
      "ComplianceSettingsDto": {
        "type": "object",
        "properties": {
          "hipaaCompliance": {
            "type": "boolean"
          },
          "dataRetentionPolicy": {
            "type": "string"
          },
          "notificationRetentionDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Days in-app notifications are kept before the retention sweep deletes them (ITE-347).\n0 = use the sweep's configured default; negative = disable the sweep for this tenant.\nNull on PATCH = leave the stored value unchanged (the endpoint replaces the whole\nCompliance section, so omitting this must not reset the override).",
            "format": "int32"
          },
          "clinicIdentity": {
            "description": "Clinic identity disclosure (ownership type, parent organization, statement).\nOwnershipType is required for UK tenants.",
            "$ref": "#/components/schemas/ClinicIdentitySettingsDto"
          },
          "publicPricingEnabled": {
            "type": "boolean"
          },
          "rxTransparencyEnabled": {
            "type": "boolean"
          },
          "estimateBeforeTreatmentEnabled": {
            "type": "boolean"
          },
          "requireUsdaNumberForRabiesCertificates": {
            "type": "boolean"
          },
          "promptNextDueAtAdministration": {
            "type": "boolean",
            "description": "Show the computed next-due date — editable — while administering a vaccine (ITE-632).\nDefaults true so a payload from an older client that omits the key doesn't switch it off."
          },
          "controlledDrugRegisterEnabled": {
            "type": "boolean"
          },
          "antimicrobialStewardshipEnabled": {
            "type": "boolean"
          },
          "cascadeWorkflowEnabled": {
            "type": "boolean"
          },
          "vcprEnforcementEnabled": {
            "type": "boolean"
          }
        },
        "description": "Compliance and data retention settings"
      },
      "ConflictResolutionDto": {
        "required": [
          "occurrenceDate",
          "action"
        ],
        "type": "object",
        "properties": {
          "occurrenceDate": {
            "type": "string",
            "description": "Date of the proposed occurrence with a conflict",
            "format": "date-time"
          },
          "action": {
            "type": "string",
            "description": "\"skip\" to skip the new item's occurrence, \"replace\" to cancel the conflicting item"
          },
          "conflictingItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID of the conflicting item to replace (when Action is \"replace\")"
          },
          "conflictingOriginalStartTime": {
            "type": [
              "null",
              "string"
            ],
            "description": "Original start time of the conflicting recurring instance (for creating cancellation exceptions)",
            "format": "date-time"
          }
        },
        "description": "Resolution instruction for a specific conflicting occurrence"
      },
      "ConsentDocumentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "questionnaireResponseId": {
            "type": "string"
          },
          "questionnaireId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "signedAt": {
            "type": "string",
            "format": "date-time"
          },
          "signedBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "questionnaireName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasSignature": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "A signed consent document record. The signature image is deliberately absent —\nonly its presence is exposed (privacy pattern shared with vaccine certificates);\nthe drawn signature appears solely in the rendered PDF."
      },
      "ContactMethod": {
        "type": "integer"
      },
      "ContactRelationshipType": {
        "type": "integer",
        "description": "Describes who a contact (Client) is in relation to a specific patient.\nOne contact per patient is the `PrimaryOwner`; all others are additional\nrelationships (co-owners, agents, emergency contacts, etc.).\nStored as text on `patient_contacts.relationship_type`."
      },
      "ContactVerificationMethod": {
        "type": "integer",
        "description": "How a patient contact's identity was verified by clinic staff.\nStored as text on `patient_contacts.verification_method`."
      },
      "ContainerStateDto": {
        "type": "object",
        "properties": {
          "containerId": {
            "type": "string"
          },
          "containerStatus": {
            "type": "string"
          },
          "currentBalance": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "lastEntry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAEntryDto"
              }
            ]
          }
        }
      },
      "ConvertReadinessBlockerDto": {
        "type": "object",
        "properties": {
          "lineId": {
            "type": "string",
            "description": "The estimate line that isn't ready (jump-to-line target on the UI)."
          },
          "name": {
            "type": "string",
            "description": "Human-readable line description."
          },
          "reason": {
            "type": "string",
            "description": "ConvertReadinessReasons code: LINE_PENDING | SIG_REQUIRED."
          }
        }
      },
      "ConvertReadinessDto": {
        "type": "object",
        "properties": {
          "isReady": {
            "type": "boolean"
          },
          "blockers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConvertReadinessBlockerDto"
            }
          }
        },
        "description": "Convert-to-invoice readiness for an appointment estimate. Converting is the last step\nbefore payment, so the bill should only be produced once every line is resolved\n(Performed/Declined) and every take-home label is filled. Standalone (no-appointment)\nestimates are always ready — the quote itself becomes the bill."
      },
      "ConvertToInvoiceRequest": {
        "type": "object",
        "properties": {
          "selectedTier": {
            "type": "string"
          },
          "consentMethod": {
            "type": "string",
            "description": "How consent was captured for this acceptance. Defaults to \"InApp\" (tap-accept,\nno signature). Send \"Signature\" together with string? ConvertToInvoiceRequest.SignatureData and\nstring? ConvertToInvoiceRequest.SignedName to record a drawn-signature acceptance."
          },
          "signatureData": {
            "type": [
              "null",
              "string"
            ],
            "description": "Base64-encoded PNG of the signature (required when ConsentMethod=Signature)."
          },
          "signedName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Typed name the signer provided (required when ConsentMethod=Signature)."
          },
          "overrideReadiness": {
            "type": "boolean",
            "description": "Bypass the convert-readiness gate even when lines are unresolved or take-home labels\nare outstanding. Requires a non-empty string? ConvertToInvoiceRequest.OverrideReason. Billing-permission\ngated (the controller requires Billing) and recorded on the consent timeline as a\nConsentEventType.ConvertReadinessOverridden event."
          },
          "overrideReason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Why the readiness gate was overridden (required when OverrideReadiness=true)."
          },
          "replaceExistingInvoice": {
            "type": "boolean",
            "description": "Confirm replacing the appointment's existing (unpaid) invoice. An appointment can hold\nonly one live invoice (`estimates.appointment_id` is uniquely indexed). When one\nalready exists, convert returns `409 INVOICE_ALREADY_EXISTS`; re-send with this set\nto archive the old bill (it becomes InvoiceStatus.Superseded, keeping\nits lines as a record) and create the new one. A paid/partially-paid existing invoice is\nnever replaced — that returns `409 INVOICE_PAID` and must be refunded/voided first."
          }
        }
      },
      "CorrectDispenseDto": {
        "type": "object",
        "properties": {
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The quantity that should have been dispensed.",
            "format": "double"
          },
          "reason": {
            "type": "string",
            "description": "Why the original figure was wrong. Required — this is a controlled correction."
          },
          "lotId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Lot to re-dispense from. Empty defaults to the lot the original dispense drew from\n(lot-tracked items), so the printed label keeps its lot number and expiry."
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "billingDisposition": {
            "type": [
              "null",
              "string"
            ],
            "description": "How to treat the bill when the dispense is on an invoice that holds money.\nAbsent (default): the correction is refused with `invoice_has_payment` and the\nremedy is refund → correct → re-bill. `\"leaveAsCharged\"`: perform the correction\n(stock, DEA, Rx — the records with legal weight) and leave the paid invoice exactly\nas charged, recording the divergence on the bill's audit trail and line note\n(ITE-680). Record truth only — never a price change. Requires\nstring? CorrectDispenseDto.BillingReason and the Billing permission, and is rejected when the\nbill holds no money (the normal revert/void flows apply there)."
          },
          "billingReason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Why the bill is deliberately left as charged. Required with string? CorrectDispenseDto.BillingDisposition."
          }
        },
        "description": "Correct the quantity of an already-dispensed prescription: reverse what went out and\ndispense again at the right figure. Distinct from an amendment, which annotates a\nfrozen record and deliberately cannot move stock or money."
      },
      "CorrectDispenseResultDto": {
        "type": "object",
        "properties": {
          "previousQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "newQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The replacement dispense's transaction."
          },
          "dispensesReversed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "billingLeftAsCharged": {
            "type": "boolean",
            "description": "True when the correction ran in records-only mode: the paid invoice was left\nexactly as charged (divergence recorded on its audit trail), while stock, DEA\nand the prescription were corrected (ITE-680)."
          }
        }
      },
      "CreateAchPaymentDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "routingNumber": {
            "type": "string"
          },
          "accountNumber": {
            "type": "string"
          },
          "accountType": {
            "type": "string"
          },
          "accountHolderName": {
            "type": "string"
          },
          "checkNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "idempotencyKey": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional client-generated idempotency key. Replaying the request with the same\nkey returns the already-recorded payment instead of submitting a new debit."
          }
        }
      },
      "CreateApiKeyRequestDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Human-readable name for the API key."
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional description of what this key is used for."
          },
          "scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Scopes to grant. Defaults to [\"read\", \"write\"] if not specified."
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional expiration date.",
            "format": "date-time"
          },
          "allowedIpAddresses": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Optional IP allowlist. If set, only requests from these IPs are allowed."
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Additional metadata."
          }
        },
        "description": "Request DTO for creating an API key.\nTenantId is taken from the route parameter."
      },
      "CreateApiKeyResponse": {
        "required": [
          "apiKey",
          "keyHash",
          "keyPrefix",
          "tenantId",
          "name",
          "scopes",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "apiKey": {
            "type": "string"
          },
          "keyHash": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateAppointmentRequest": {
        "required": [
          "clientId",
          "reasonForVisit",
          "title",
          "startTime",
          "endTime",
          "type",
          "locationId"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Patient under care. Required for normal patient-scoped appointments;\nmust be null for group-visit appointment types (those provide\nstring? CreateAppointmentRequest.PatientGroupId instead). The service-layer validates\nbased on the chosen AppointmentType's IsGroupVisit flag."
          },
          "patientGroupId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Patient group under care for litter / herd appointment types. Mutually\nexclusive with string? CreateAppointmentRequest.PatientId; the appointments_subject_chk\nCHECK constraint enforces exactly-one at the DB level."
          },
          "reasonForVisit": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The type of appointment (e.g., Wellness Exam, Dental Cleaning)."
          },
          "title": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduleCustomAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isTravelAppointment": {
            "type": "boolean"
          },
          "travelDestinationAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDestinationPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDistanceMeters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelIsRoundTrip": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "travelFeeAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "travelAccessNotes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to create a new appointment (includes schedule item)"
      },
      "CreateAppointmentTypeDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferBeforeMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferAfterMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresSurgeryRoom": {
            "type": "boolean"
          },
          "isGroupVisit": {
            "type": "boolean"
          },
          "isCompassionCare": {
            "type": "boolean"
          },
          "allowOnlineBooking": {
            "type": "boolean",
            "description": "Whether clients may self-book this type online (ITE-430)."
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "acuity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Default triage acuity (1–10) used when this type lands in CareQueue.",
            "format": "int32"
          },
          "defaultFlowId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Chronicle workflow id to start when an appointment of this type is opened."
          },
          "examTemplateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Exam template the chronicle exam step renders for this type (PAW-741).\nOverrides each provider's personal default. Omit/empty = no override."
          },
          "noteFormat": {
            "type": [
              "null",
              "string"
            ],
            "description": "Generated-note format for visits of this type (PAW-744). Must be a known\nSoapNoteFormats id. Omit/empty = standard SOAP note."
          },
          "autoGenerateSoap": {
            "type": "boolean",
            "description": "Auto-start SOAP generation when the treatment plan is converted to an invoice (PAW-675).\nDefaults on when omitted."
          },
          "autoGenerateDischarge": {
            "type": "boolean",
            "description": "Auto-start discharge generation when the SOAP note is approved (PAW-675).\nDefaults on when omitted."
          },
          "locationIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Location IDs that can accommodate this appointment type (Location Intents)."
          },
          "journeyTemplates": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateJourneyMilestoneTemplateRequest"
            },
            "description": "Journey milestone templates to create for this appointment type."
          },
          "defaultServices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateDefaultServiceInput"
            },
            "description": "Default services to create for this appointment type."
          }
        }
      },
      "CreateAuthOnlyDto": {
        "required": [
          "clientId"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Auth amount. Use 0.00 for card validation only (requires zip code).",
            "format": "double"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "zip": {
            "type": [
              "null",
              "string"
            ],
            "description": "Billing zip code - required for $0.00 auth card validation."
          },
          "terminalName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional named terminal to send the auth to."
          }
        },
        "description": "Request to add a card on file via terminal auth-only transaction."
      },
      "CreateBillableItemComponentDto": {
        "type": "object",
        "properties": {
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "componentType": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional; defaults to \"Inventory\" (the only supported type in v1)."
          },
          "quantityMultiplier": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isDefault": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateBillableItemDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "basePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateBillableItemComponentDto"
            }
          }
        }
      },
      "CreateBlindRefundDto": {
        "type": "object",
        "properties": {
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "The refund amount.",
            "format": "double"
          },
          "referenceNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Reference number for tracking (optional)."
          },
          "reason": {
            "type": "string",
            "description": "Reason for the refund."
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional client ID if the refund is associated with a client."
          },
          "terminalName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional named terminal to send the refund to."
          }
        },
        "description": "Request for a blind (standalone) terminal refund.\nThis refund is not tied to a previous transaction - customer presents card at terminal."
      },
      "CreateBreedDto": {
        "type": "object",
        "properties": {
          "speciesId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateCardOnFilePaymentDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "paymentTokenId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "idempotencyKey": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional client-generated idempotency key. Replaying the request with the same\nkey returns the already-recorded payment instead of charging again."
          }
        }
      },
      "CreateCaseMilestoneRequest": {
        "required": [
          "name",
          "type",
          "orderIndex"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/CaseMilestoneType"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to create a new case milestone"
      },
      "CreateCaseRequest": {
        "required": [
          "patientId",
          "clientId",
          "diagnosisType"
        ],
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "diagnosisType": {
            "type": "string"
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to create a new case"
      },
      "CreateCashPaymentDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "cashReceived": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateCheckPaymentDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "checkNumber": {
            "type": "string"
          },
          "routingNumberMasked": {
            "type": [
              "null",
              "string"
            ]
          },
          "accountNumberMasked": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateClientDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "accountStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "preferredContactMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowAppointmentReminders": {
            "type": "boolean"
          },
          "allowEmailMarketing": {
            "type": "boolean"
          },
          "allowPhoneCalls": {
            "type": "boolean"
          },
          "allowSmsMarketing": {
            "type": "boolean"
          },
          "communicationNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "emergencyContactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "emergencyContactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "emergencyContactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "emergencyContactRelationship": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryEmergencyContactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryEmergencyContactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryEmergencyContactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryEmergencyContactRelationship": {
            "type": [
              "null",
              "string"
            ]
          },
          "preferredLanguage": {
            "type": [
              "null",
              "string"
            ]
          },
          "referralSource": {
            "type": [
              "null",
              "string"
            ],
            "description": "Marketing attribution — \"how did you hear about us\"."
          },
          "createdVia": {
            "type": [
              "null",
              "string"
            ],
            "description": "Provenance, for system callers that create clients on a client's behalf\n(widget booking, record import). Leave null for staff-entered clients."
          }
        }
      },
      "CreateDEABookDto": {
        "type": "object",
        "properties": {
          "drugName": {
            "type": "string"
          },
          "drugNdc": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateDEAEntryDto": {
        "type": "object",
        "properties": {
          "containerId": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "containerStatus": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "correctedEntryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "collectorName": {
            "type": [
              "null",
              "string"
            ],
            "description": "UK CDR: name of the person who collected the dispensed CD."
          },
          "collectorIdChecked": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "UK CDR: whether collector photo ID was verified."
          },
          "entryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CreateDefaultServiceInput": {
        "type": "object",
        "properties": {
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Input for creating a default service on an appointment type."
      },
      "CreateDiscountCodeDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "applyTo": {
            "type": "string"
          },
          "discountType": {
            "type": "string"
          },
          "discountValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "scope": {
            "type": "string"
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validTo": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maxUsageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreateEstimateDto": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateEstimateLineItemDto"
            }
          }
        }
      },
      "CreateEstimateLineItemDto": {
        "type": "object",
        "properties": {
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "billableItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyMode": {
            "type": "string"
          },
          "qtyLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyMed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateExamTemplateRequest": {
        "required": [
          "name",
          "schema"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "schema": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateExpenseDto": {
        "type": "object",
        "properties": {
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "category": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceNumber": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateFormDraftRequest": {
        "required": [
          "formType",
          "flowType",
          "flowKey",
          "title",
          "formData"
        ],
        "type": "object",
        "properties": {
          "formType": {
            "type": "string"
          },
          "flowType": {
            "type": [
              "null",
              "string"
            ]
          },
          "flowKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "formData": {
            "type": "string"
          },
          "isValid": {
            "type": "boolean",
            "default": false
          }
        },
        "description": "Request DTO for creating a new form draft"
      },
      "CreateGroupCodeDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "priceMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "fixedKitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "longDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRecurring": {
            "type": "boolean"
          },
          "recurringFrequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "billingDayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxBillingCycles": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateGroupCodeItemDto"
            }
          }
        }
      },
      "CreateGroupCodeItemDto": {
        "type": "object",
        "properties": {
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isRequired": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "minQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "noteOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "discountPercentOverride": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "priceOverrideKind": {
            "type": [
              "null",
              "string"
            ],
            "description": "One of: \"None\", \"Free\", \"FixedPrice\", \"AmountOff\", \"PercentOff\".\n            Defaults to \"None\" when omitted."
          },
          "priceOverrideValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreateGroupSoapNoteRequest": {
        "type": "object",
        "properties": {
          "subjective": {
            "type": "string"
          },
          "objective": {
            "type": "string"
          },
          "assessment": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "cohortLabel": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateGroupTreatmentRequest": {
        "type": "object",
        "properties": {
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "FK to a stocked inventory item. Mutually exclusive with ServiceCatalogItemId."
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "FK to a service-catalog item (e.g. exam fee). Mutually exclusive with InventoryItemId."
          },
          "quantityUsed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Quantity drawn from inventory. Required when InventoryItemId is set; ignored otherwise.\nOne InventoryTransaction (decrement) is written when this is &gt; 0.",
            "format": "double"
          },
          "dose": {
            "type": [
              "null",
              "string"
            ]
          },
          "route": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "numberTreated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cohortLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "meatWithdrawalEndDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "milkWithdrawalEndDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateHerdDetailsDto": {
        "type": "object",
        "properties": {
          "productionType": {
            "type": "string"
          },
          "farmName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateInventoryItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultSig": {
            "type": [
              "null",
              "string"
            ],
            "description": "Default prescription instructions (SIG) for rx-required items. See PAW-671."
          },
          "compoundFormula": {
            "type": [
              "null",
              "string"
            ],
            "description": "Compounding formula / preparation details for compounded items. See PAW-671."
          },
          "category": {
            "type": "string"
          },
          "vaccineTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorItemNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "drugForm": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitOfMeasure": {
            "type": [
              "null",
              "string"
            ],
            "description": "Per-item dispensing-unit label override (e.g. \"dose\", \"applicator\").\nNull = derive the label from DrugForm (ITE-390)."
          },
          "strength": {
            "type": [
              "null",
              "string"
            ]
          },
          "ndc": {
            "type": [
              "null",
              "string"
            ]
          },
          "isCompounded": {
            "type": "boolean"
          },
          "rxRequired": {
            "type": "boolean"
          },
          "allowedSpeciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "vcprRequiredDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxDispenseQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "deaBookId": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ]
          },
          "controlledSubstanceSchedule": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "distributionCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "cascadeEligible": {
            "type": "boolean"
          },
          "isAntimicrobial": {
            "type": "boolean"
          },
          "antimicrobialType": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresUnderCare": {
            "type": "boolean"
          },
          "requiresPhysicalExam": {
            "type": "boolean"
          },
          "foodProducing": {
            "type": "boolean"
          },
          "requiresWithdrawalPeriod": {
            "type": "boolean"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "pricePolicy": {
            "type": "string"
          },
          "markupPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "mapPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitsPerContainer": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackLots": {
            "type": "boolean"
          },
          "storageRequirements": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "parQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "reorderPoint": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreateInventoryLocationDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationType": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateInventoryLotDto": {
        "required": [
          "locationId"
        ],
        "type": "object",
        "properties": {
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "manufacturedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "manufacturer": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "receivedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "locationId": {
            "type": "string"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "containers": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ReceiveOrderContainerDto"
            },
            "description": "Physical containers this lot is made of (ITE-157). When present and non-empty, the lot\nis created with one row per container and decimal CreateInventoryLotDto.Quantity / string? CreateInventoryLotDto.ContainerId\nare ignored (quantity = sum of the containers). Controlled substances require a code on\nevery container. When null/empty, the single-container behavior is unchanged. Reuses the\nreceive flow's container shape (code + quantity)."
          }
        }
      },
      "CreateInvoiceDto": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerMode": {
            "type": "string"
          },
          "invoiceProviderId": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateInvoiceLineItemDto"
            }
          }
        }
      },
      "CreateInvoiceLineItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Existing line-item id, sent on update so the line is reconciled in place\n(id + any linked inventory transactions preserved) instead of being\ndropped and recreated. Null/empty for a brand-new line."
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "billableItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Source BillableItem (\"Charge\") when this line was added from the charge catalog."
          },
          "inventoryTransactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": "string"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "groupCodeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupCodeName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateJourneyMilestoneRequest": {
        "required": [
          "name",
          "type",
          "orderIndex"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/MilestoneType"
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MilestoneStatus"
              }
            ]
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimatedDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Request to create a new journey milestone"
      },
      "CreateJourneyMilestoneTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/MilestoneType"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimatedDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateLabNoteDto": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          }
        }
      },
      "CreateLabOrderDto": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": "string"
          },
          "testType": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "accessionNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "collectedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          },
          "labPanelId": {
            "type": [
              "null",
              "string"
            ]
          },
          "results": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateLabResultDto"
            }
          }
        }
      },
      "CreateLabPanelDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "testType": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "tests": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateLabPanelTestDto"
            }
          }
        }
      },
      "CreateLabPanelTestDto": {
        "type": "object",
        "properties": {
          "testName": {
            "type": "string"
          },
          "testCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceRange": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "referenceHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateLabResultDto": {
        "type": "object",
        "properties": {
          "testName": {
            "type": "string"
          },
          "testCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "value": {
            "type": "string"
          },
          "numericValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceRange": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "referenceHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "flag": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "comment": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateLitterDetailsDto": {
        "type": "object",
        "properties": {
          "damPatientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "damText": {
            "type": [
              "null",
              "string"
            ]
          },
          "sireText": {
            "type": [
              "null",
              "string"
            ]
          },
          "whelpDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "litterSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateLocationClosureDto": {
        "required": [
          "locationId",
          "closureDate"
        ],
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string"
          },
          "closureDate": {
            "type": "string"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request DTO for creating a location closure."
      },
      "CreateLocationDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isVehicle": {
            "type": "boolean"
          },
          "isPersonalVehicle": {
            "type": "boolean"
          },
          "allowOnlineBooking": {
            "type": "boolean"
          },
          "allowOverbooking": {
            "type": "boolean"
          },
          "allowedSpeciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreateLogoRequest": {
        "required": [
          "name",
          "fileName",
          "mimeType"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "fileSizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "description": {
            "maxLength": 500,
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          }
        },
        "description": "Request to create a new logo entry and get presigned upload URL"
      },
      "CreateLogoResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "uploadUrl": {
            "type": "string",
            "description": "Presigned URL for uploading the logo directly to S3"
          },
          "s3Key": {
            "type": "string",
            "description": "S3 object key where the logo will be stored"
          },
          "uploadExpiresAt": {
            "type": "string",
            "description": "When the upload URL expires",
            "format": "date-time"
          }
        },
        "description": "Response after creating a logo entry, includes presigned upload URL"
      },
      "CreateMarkAsPaidPaymentDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "markAsPaidType": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateMedicationRequestDto": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "inventoryItemId": {
            "type": "string"
          },
          "medicationCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isOtc": {
            "type": "boolean"
          },
          "fulfillmentMethod": {
            "type": "string"
          },
          "pharmacyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When supplied, the created dispense transaction is also attached to this\nestimate as an InvoiceLineItem in the same request. Used by the inline\npayments flow so dispense + bill land together."
          },
          "estimateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Billing target for a clinic-dispensed (in-house / same-day) request. When set, the\nrequest's billable line is added to this existing estimate. Mutually exclusive with\nbool CreateMedicationRequestDto.CreateNewEstimate. Ignored for external (online-pharmacy / print-retail)\nrequests, which are non-billable."
          },
          "createNewEstimate": {
            "type": "boolean",
            "description": "When true (and no string? CreateMedicationRequestDto.EstimateId), the request's billable line goes onto a new\nstandalone draft estimate for the patient instead of the patient's current open draft."
          },
          "isCascade": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "cascadeReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "antimicrobialUseType": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Therapeutic\" | \"Prophylactic\" | \"Metaphylactic\". Required when the medication is antimicrobial."
          },
          "antimicrobialJustification": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicalAssessmentPerformed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "physicalExamPerformed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "physicalExamJustification": {
            "type": [
              "null",
              "string"
            ]
          },
          "repeatCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "withdrawalPeriod": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required for food-producing species. Free-form label text\n(e.g., \"Meat: 28 days; Milk: 7 days\")."
          },
          "collectorName": {
            "type": [
              "null",
              "string"
            ],
            "description": "UK CDR collector name (Schedule 2–5 controlled drugs)."
          },
          "collectorIdChecked": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "UK CDR: was the collector's photo ID verified?"
          }
        }
      },
      "CreateMemberExceptionRequest": {
        "type": "object",
        "properties": {
          "patientGroupMemberId": {
            "type": "string"
          },
          "exceptionNote": {
            "type": "string"
          },
          "differentTreatment": {
            "type": "boolean"
          },
          "followUpNeeded": {
            "type": "boolean"
          }
        }
      },
      "CreateOutsideMedicationDto": {
        "required": [
          "medicationName"
        ],
        "type": "object",
        "properties": {
          "medicationName": {
            "type": "string"
          },
          "quantity": {
            "type": [
              "null",
              "string"
            ]
          },
          "sig": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ],
            "description": "One of: Requested, Filled, Cancelled. Defaults to Requested."
          },
          "requestedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Payload for recording a new external medication request on a patient."
      },
      "CreatePartnerDto": {
        "type": "object",
        "properties": {
          "clinicName": {
            "type": "string"
          },
          "contactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "specialties": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreatePatientDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The patient's name"
          },
          "species": {
            "type": "string",
            "description": "The species name. Must match a valid species from GET /species endpoint.",
            "example": "Dog"
          },
          "breed": {
            "type": "string",
            "description": "The breed name (free text)",
            "example": "Golden Retriever"
          },
          "clientId": {
            "type": "string"
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isEstimatedAge": {
            "type": "boolean"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "microchipNo": {
            "type": [
              "null",
              "string"
            ]
          },
          "fixed": {
            "type": "boolean"
          },
          "sex": {
            "type": "string"
          },
          "vaccinationStatus": {
            "type": "string"
          },
          "lastVaccinationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "previousVet": {
            "type": [
              "null",
              "string"
            ]
          },
          "previousVetPhone": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request body for creating a new patient"
      },
      "CreatePatientGroupDto": {
        "type": "object",
        "properties": {
          "groupType": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "speciesId": {
            "type": "string"
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "headCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "litterDetails": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CreateLitterDetailsDto"
              }
            ]
          },
          "herdDetails": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CreateHerdDetailsDto"
              }
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePatientGroupMemberDto"
            },
            "description": "Optional initial member rows. For litters this is the typical use case.\nFor herds, only exception animals are usually rowed at creation time."
          }
        }
      },
      "CreatePatientGroupMemberDto": {
        "type": "object",
        "properties": {
          "tagOrIdentifier": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "sex": {
            "type": [
              "null",
              "string"
            ]
          },
          "colorMarkings": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isException": {
            "type": "boolean"
          }
        }
      },
      "CreatePatientMassMeasurementRequest": {
        "required": [
          "length",
          "width",
          "height"
        ],
        "type": "object",
        "properties": {
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreatePatientMassRequest": {
        "required": [
          "x",
          "y",
          "view"
        ],
        "type": "object",
        "properties": {
          "x": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "y": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "view": {
            "type": "string"
          },
          "zone": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "shape": {
            "type": "string"
          },
          "mobility": {
            "type": "string"
          },
          "consistency": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "initialLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "initialWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "initialHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreatePatientProblemDto": {
        "type": "object",
        "properties": {
          "diagnosisTermId": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "bodySystem": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "confidence": {
            "type": [
              "null",
              "string"
            ]
          },
          "chronicity": {
            "type": [
              "null",
              "string"
            ]
          },
          "severity": {
            "type": [
              "null",
              "string"
            ]
          },
          "onsetDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "resolvedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceSoapNoteId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreatePaymentTokenDto": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "expirationMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "expirationYear": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cardholderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "nickname": {
            "type": [
              "null",
              "string"
            ]
          },
          "tokenDescription": {
            "type": "string"
          },
          "billingZipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "setAsDefault": {
            "type": "boolean"
          }
        }
      },
      "CreatePharmacyDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "type": [
              "null",
              "string"
            ]
          },
          "portalUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreatePostDispensePrescriptionDto": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "providerId": {
            "type": "string"
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "fulfillmentMethod": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreatePrinterDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          }
        }
      },
      "CreatePrintJobFromSourceDto": {
        "type": "object",
        "properties": {
          "sourceType": {
            "type": "string"
          },
          "sourceId": {
            "type": "string"
          },
          "printerName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "CreatePtoRequestDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional: Create PTO for a specific user (manager use). If not provided, uses current user."
          },
          "type": {
            "$ref": "#/components/schemas/PtoRequestType"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "totalHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "autoApprove": {
            "type": "boolean",
            "description": "Optional: If true, automatically approve the PTO request (manager use)"
          }
        }
      },
      "CreatePublicPriceListEntryDto": {
        "type": "object",
        "properties": {
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupCodeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "nameOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "descriptionOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "categoryLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayMode": {
            "type": "string",
            "description": "\"flat\" or \"range\". Defaults to \"flat\"."
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "minPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreatePurchaseOrderDto": {
        "type": "object",
        "properties": {
          "vendorId": {
            "type": "string"
          },
          "expectedDeliveryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "externalOrderNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreatePurchaseOrderFromImportDto": {
        "type": "object",
        "properties": {
          "vendorId": {
            "type": "string"
          },
          "existingPurchaseOrderId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When set, append lines to this existing PO instead of creating a new one.\nThe PO must belong to string CreatePurchaseOrderFromImportDto.VendorId and be in a status that still\naccepts new lines (Draft / Sent / Backordered)."
          },
          "externalOrderNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "orderDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "markReceived": {
            "type": "boolean",
            "description": "If true, the PO is sent + received in the same transaction so stock and\ninventory transactions land immediately. Lot # / expiration are left null\nand filled in later via the regular receive UI."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatePurchaseOrderFromImportLineDto"
            }
          }
        },
        "description": "Request to create (or extend) a purchase order from a parsed vendor-invoice import.\nLines are pre-resolved client-side to <see cref=\"!:InventoryItem\" /> ids."
      },
      "CreatePurchaseOrderFromImportLineDto": {
        "type": "object",
        "properties": {
          "inventoryItemId": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreateQiEventDto": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isAnonymous": {
            "type": "boolean"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "medicationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "staffMemberId": {
            "type": [
              "null",
              "string"
            ]
          },
          "staffMemberName": {
            "type": [
              "null",
              "string"
            ]
          },
          "roomName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateQiEventNoteDto": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          }
        }
      },
      "CreateQuestionnaireLinkRequest": {
        "required": [
          "responseId"
        ],
        "type": "object",
        "properties": {
          "responseId": {
            "type": "string"
          },
          "expirationHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxUses": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to create a new link"
      },
      "CreateQuestionnaireRequest": {
        "required": [
          "name",
          "type",
          "schema"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "$ref": "#/components/schemas/QuestionnaireType"
          },
          "isTemplate": {
            "type": "boolean"
          },
          "schema": {
            "type": "string"
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to create a new questionnaire"
      },
      "CreateQuestionnaireResponseRequest": {
        "required": [
          "questionnaireId"
        ],
        "type": "object",
        "properties": {
          "questionnaireId": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "responses": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to create a new response (start filling out a questionnaire)"
      },
      "CreateRabiesTagBatchRequest": {
        "required": [
          "name",
          "startSequence",
          "endSequence"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": [
              "null",
              "string"
            ]
          },
          "year": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "startSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "endSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "padWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Zero-pad width for display. Defaults to the digit count of long CreateRabiesTagBatchRequest.EndSequence when omitted.",
            "format": "int32"
          },
          "tagType": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryLocationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateRdvmReferralRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialty": {
            "type": "string"
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "doctorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reasonForReferral": {
            "type": "string"
          },
          "clinicalNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "urgency": {
            "type": "string"
          },
          "preferredDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "preferredTime": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateRdvmSessionRequest": {
        "type": "object",
        "properties": {
          "clinicId": {
            "type": "string"
          }
        }
      },
      "CreateRecurringExpenseDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "category": {
            "type": "string"
          },
          "frequency": {
            "$ref": "#/components/schemas/ExpenseFrequency"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "dayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "dayOfWeek": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DayOfWeek"
              }
            ]
          }
        }
      },
      "CreateReferralDto": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "toPartnerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "referringVetName": {
            "type": [
              "null",
              "string"
            ]
          },
          "referringVetEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "referringClinicName": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialty": {
            "type": "string"
          },
          "urgency": {
            "type": "string"
          },
          "reasonForReferral": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicalNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "diagnosisCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduledDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "assignedVetId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateReferralMessageDto": {
        "type": "object",
        "properties": {
          "referralId": {
            "type": "string"
          },
          "threadId": {
            "type": [
              "null",
              "string"
            ]
          },
          "subject": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "attachmentIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreateReminderRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "$ref": "#/components/schemas/ReminderCategory"
          },
          "origin": {
            "$ref": "#/components/schemas/ReminderOrigin"
          },
          "dueDate": {
            "type": "string",
            "format": "date-time"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "object"
            ]
          }
        },
        "description": "Request to create a new reminder"
      },
      "CreateRetailItemDto": {
        "type": "object",
        "properties": {
          "sku": {
            "type": "string"
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": "string"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "cost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "quantityOnHand": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "reorderPoint": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lowStockThreshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitOfMeasure": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackTransactions": {
            "type": "boolean"
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorProductCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "brand": {
            "type": [
              "null",
              "string"
            ]
          },
          "size": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateRoleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "minStaff": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxStaff": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isPrimaryProvider": {
            "type": "boolean"
          },
          "canPrescribe": {
            "type": "boolean"
          },
          "requiresTimeTracking": {
            "type": "boolean"
          }
        }
      },
      "CreateRoomDayAssignmentDto": {
        "required": [
          "locationId",
          "userId",
          "assignmentDate"
        ],
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "assignmentDate": {
            "type": "string"
          }
        },
        "description": "Request DTO for creating a room day assignment."
      },
      "CreateRxProtocolDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "scope": {
            "type": "string"
          },
          "scopeMedicationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopeMedicationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopeCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "inHouseAllowed": {
            "type": "boolean"
          },
          "sameDayAllowed": {
            "type": "boolean"
          },
          "onlinePharmacyAllowed": {
            "type": "boolean"
          },
          "printRetailAllowed": {
            "type": "boolean"
          },
          "requireDoseCheck": {
            "type": "boolean"
          },
          "requireInteractionCheck": {
            "type": "boolean"
          },
          "requireAllergyCheck": {
            "type": "boolean"
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateScheduleItemRequest": {
        "required": [
          "title",
          "startTime",
          "endTime",
          "type",
          "locationId"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRecurring": {
            "type": "boolean"
          },
          "recurrencePattern": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecurrencePatternDto"
              }
            ]
          },
          "conflictResolutions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ConflictResolutionDto"
            },
            "description": "Conflict resolutions provided after a conflict check.\nEach entry specifies how to handle a specific conflicting occurrence."
          }
        },
        "description": "Request to create a new standalone schedule item (non-appointment)"
      },
      "CreateServiceCatalogItemDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "basePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateShiftDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactInfo": {
            "type": [
              "null",
              "string"
            ]
          },
          "shiftDate": {
            "type": "string"
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "endTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "income": {
            "type": [
              "null",
              "string"
            ]
          },
          "cancelBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateShiftSwapDto": {
        "type": "object",
        "properties": {
          "shiftId": {
            "type": "string"
          },
          "toUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateSlotConfigurationDto": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultSlotDurationMinutes": {
            "maximum": 480,
            "minimum": 5,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minAdvanceBookingHours": {
            "maximum": 8760,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxAdvanceBookingDays": {
            "maximum": 730,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferBetweenAppointments": {
            "maximum": 240,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minCancellationNoticeHours": {
            "maximum": 8760,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "defaultWidgetAppointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateSpeciesDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateSubscriptionDto": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupCodeId": {
            "type": "string"
          },
          "paymentTokenId": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "consentText": {
            "type": "string",
            "description": "Snapshot of the agreement text shown to the client at signup."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateSurgicalRecordRequest": {
        "required": [
          "appointmentId",
          "patientId"
        ],
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "procedureName": {
            "type": "string"
          }
        }
      },
      "CreateSurgicalTimelineEventRequest": {
        "required": [
          "title",
          "type"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "details": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPinned": {
            "type": "boolean"
          }
        }
      },
      "CreateTagAssignmentRequest": {
        "type": "object",
        "properties": {
          "tagId": {
            "type": "string"
          },
          "entityType": {
            "type": "string",
            "description": "\"Patient\", \"Client\", \"Appointment\", \"Invoice\", \"Visit\"."
          },
          "entityId": {
            "type": "string"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateTagRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "icon": {
            "type": [
              "null",
              "string"
            ]
          },
          "entityKinds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "origin": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Manual\" (default) or \"Automatic\"."
          },
          "severity": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional severity (\"Low\"/\"Normal\"/\"High\"/\"Critical\"). A severity-bearing\n            tag is the successor to a Medical/Client alert and renders with alert prominence."
          }
        }
      },
      "CreateTemplateDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "headerContent": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy field - use Sections instead for new templates."
          },
          "footerContent": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy field - use Sections instead for new templates."
          },
          "sections": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TemplateSectionDto"
            },
            "description": "Block-based content sections."
          },
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailSubject": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailBody": {
            "type": [
              "null",
              "string"
            ]
          },
          "smsBody": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          }
        },
        "description": "Request DTO for creating a template."
      },
      "CreateTenantKnowledgeDocumentDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "sourceType": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "type": "string"
          },
          "diagnosisKeys": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPublished": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "CreateTerminalPaymentDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "saveCard": {
            "type": "boolean"
          },
          "bypassDuplicateCheck": {
            "type": "boolean",
            "description": "When true, generates a unique check-field to bypass duplicate transaction detection.\nUse this to force a new charge when a previous transaction was detected as duplicate."
          },
          "terminalName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional named terminal to send the payment to (e.g. \"front-desk\").\nWhen null, uses the legacy single terminal key."
          },
          "idempotencyKey": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional client-generated idempotency key. Replaying the request with the same\nkey returns the already-recorded payment instead of charging again."
          }
        }
      },
      "CreateText2PayDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "phoneNumber": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateTimeEntryDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": [
              "null",
              "string"
            ]
          },
          "date": {
            "type": "string"
          },
          "timeIn": {
            "type": "string",
            "format": "date-time"
          },
          "timeOut": {
            "type": "string",
            "format": "date-time"
          },
          "lunchIn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lunchOut": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateUserRequest": {
        "required": [
          "email",
          "password",
          "firstName",
          "lastName"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "minLength": 6,
            "type": "string"
          },
          "firstName": {
            "maxLength": 100,
            "type": "string"
          },
          "lastName": {
            "maxLength": 100,
            "type": "string"
          },
          "displayName": {
            "maxLength": 200,
            "type": [
              "null",
              "string"
            ]
          },
          "roleId": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorshipDurationDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "deaNumber": {
            "maxLength": 50,
            "type": [
              "null",
              "string"
            ]
          },
          "licenseNumber": {
            "maxLength": 100,
            "type": [
              "null",
              "string"
            ]
          },
          "licenseState": {
            "maxLength": 2,
            "type": [
              "null",
              "string"
            ]
          },
          "usdaNumber": {
            "maxLength": 50,
            "type": [
              "null",
              "string"
            ]
          },
          "deaLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "stateLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "usdaLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CreateVaccinationRecordRequest": {
        "required": [
          "patientId",
          "vaccineTypeId",
          "administeredDate"
        ],
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccineTypeId": {
            "type": "string"
          },
          "administeredDate": {
            "type": "string",
            "format": "date-time"
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "vaccineExpirationDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical vaccine vial/lot expiration date (distinct from the next-due DateTime? CreateVaccinationRecordRequest.ExpirationDate).",
            "format": "date-time"
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "manufacturer": {
            "type": [
              "null",
              "string"
            ]
          },
          "route": {
            "type": [
              "null",
              "string"
            ]
          },
          "site": {
            "type": [
              "null",
              "string"
            ]
          },
          "administeredById": {
            "type": [
              "null",
              "string"
            ],
            "description": "Who physically gave the injection. Null = not recorded / external — never defaulted to the caller (PR #858)."
          },
          "doctorOfRecordId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The DVM of record for this dose. Null = resolve the default: the appointment's assigned\nprovider when string? CreateVaccinationRecordRequest.AppointmentId is set and that user is provider-flagged, else\nnone. Set bool CreateVaccinationRecordRequest.NoDoctorOfRecord to force \"no doctor\" despite an appointment\ndefault. The two \"unset\" meanings are deliberately separate fields — an empty string is\nnever a sentinel here (see the PR #858 \"\"-collision)."
          },
          "noDoctorOfRecord": {
            "type": "boolean",
            "description": "True = explicitly no doctor of record (external dose); suppresses the appointment default."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryTransactionId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to create a new vaccination record"
      },
      "CreateVaccineExemptionRequest": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "vaccineTypeId": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "description": "The medical reason — required."
          }
        },
        "description": "Create a per-patient medical exemption for one vaccine type (ITE-688)."
      },
      "CreateVaccineTypeRequest": {
        "required": [
          "code",
          "name",
          "species"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "species": {
            "type": "string"
          },
          "durationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isCore": {
            "type": "boolean"
          },
          "isRabies": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "reminderThresholdDays": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "scheduleStages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/VaccineScheduleStageDto"
            }
          },
          "repeatFinalDose": {
            "type": "boolean",
            "description": "Defaults to true (final dose repeats as the ongoing booster)."
          },
          "restartIfLapsedAfterDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CreateVendorDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "addressLine1": {
            "type": [
              "null",
              "string"
            ]
          },
          "addressLine2": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "country": {
            "type": [
              "null",
              "string"
            ]
          },
          "accountNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateVitalTypeRequest": {
        "required": [
          "code",
          "label",
          "dataType"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "dataType": {
            "type": "string"
          },
          "minValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "CreateWidgetAppointmentRequest": {
        "required": [
          "sessionId",
          "clinicId",
          "slotId",
          "clientInfo",
          "patientInfo"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "slotId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "appointmentTypeId": {
            "maxLength": 200,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "The chosen online-bookable appointment type (ITE-430). Optional: null resolves to the\nclinic's default (or its only bookable type). Must be in the bookable set, else 400."
          },
          "clientInfo": {
            "$ref": "#/components/schemas/WidgetClientInfoDto"
          },
          "patientInfo": {
            "$ref": "#/components/schemas/WidgetPatientInfoDto"
          },
          "reason": {
            "maxLength": 500,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "maxLength": 10000,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateWidgetClientRequest": {
        "required": [
          "sessionId",
          "clinicId",
          "name",
          "email",
          "phone"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "name": {
            "maxLength": 500,
            "minLength": 0,
            "type": "string"
          },
          "email": {
            "maxLength": 254,
            "minLength": 0,
            "type": "string"
          },
          "phone": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string"
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CreateWidgetPatientDto"
              }
            ]
          },
          "referralSource": {
            "maxLength": 200,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "\"How did you hear about us\" (ITE-413). This is the registration endpoint the booking\nwizard actually calls before it books, so it is the primary capture point — the same field\non WidgetClientInfoDto covers surfaces that book without registering first.\nWritten to `Client.ReferralSource` on create only; never overwrites a returning\nclient's answer. Free text, usually one of\nIReadOnlyList&lt;string&gt; ReferralSourceOptions.Presets."
          },
          "smsConsentGranted": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "10DLC SMS consent opt-in from registration form"
          }
        }
      },
      "CreateWidgetClientResponse": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "isNewClient": {
            "type": "boolean"
          },
          "isNewPatient": {
            "type": "boolean"
          }
        }
      },
      "CreateWidgetPatientDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 500,
            "minLength": 0,
            "type": "string"
          },
          "species": {
            "maxLength": 500,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "maxLength": 500,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateWidgetSessionRequest": {
        "required": [
          "clinicId"
        ],
        "type": "object",
        "properties": {
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          }
        }
      },
      "CreateWorkItemRuleItemMapRequest": {
        "type": "object",
        "properties": {
          "billableItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccineTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateWorkItemRuleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "kind": {
            "type": "string",
            "description": "WorkItemRuleKind name (e.g. \"Exam\", \"Wellness\", \"Custom\")."
          },
          "emitType": {
            "type": "string",
            "description": "WorkItemType name; only \"Reminder\" is supported today."
          },
          "emitReminderCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "emitTaskCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "emitTaskPriority": {
            "type": [
              "null",
              "string"
            ]
          },
          "titleTemplate": {
            "type": [
              "null",
              "string"
            ]
          },
          "descriptionTemplate": {
            "type": [
              "null",
              "string"
            ]
          },
          "triggerEventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "e.g. [\"ServicePerformed\"] or [\"ServiceDeclined\"]."
          },
          "speciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "requiredTagIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "excludedTagIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "triggerTagId": {
            "type": [
              "null",
              "string"
            ]
          },
          "minAgeMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxAgeMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "cadenceOffsetsDays": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "recurrenceIntervalMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "autoSatisfyOnTrigger": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "itemMaps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateWorkItemRuleItemMapRequest"
            }
          }
        }
      },
      "CreateWorkTaskDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          },
          "dueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityType": {
            "type": [
              "null",
              "string"
            ]
          },
          "entityId": {
            "type": [
              "null",
              "string"
            ]
          },
          "callbackType": {
            "type": [
              "null",
              "string"
            ]
          },
          "promisedById": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateWorkTaskNoteDto": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          }
        }
      },
      "CredentialsStatusDto": {
        "type": "object",
        "properties": {
          "isConfigured": {
            "type": "boolean"
          },
          "hasTerminalKey": {
            "type": "boolean"
          },
          "hasPayLinkKey": {
            "type": "boolean"
          },
          "terminalKeyPreview": {
            "type": [
              "null",
              "string"
            ]
          },
          "payLinkKeyPreview": {
            "type": [
              "null",
              "string"
            ]
          },
          "terminals": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TerminalStatusDto"
            }
          }
        }
      },
      "DailyGoalMetricDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "goal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unit": {
            "type": "string"
          }
        }
      },
      "DashboardSummaryDto": {
        "type": "object",
        "properties": {
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SummaryMetricDto"
            }
          }
        }
      },
      "DateRangeDto": {
        "required": [
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DayOfWeek": {
        "type": "integer"
      },
      "DayPreviewGate": {
        "required": [
          "date",
          "timezone",
          "withinWindow",
          "openRoomNames",
          "closuresOnDate",
          "slots"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "resolvedTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "resolvedTypeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "withinWindow": {
            "type": "boolean"
          },
          "openRoomNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "closuresOnDate": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SlotPreview"
            }
          },
          "emptyReason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DEABookDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "drugName": {
            "type": "string"
          },
          "drugNdc": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "deactivatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "deactivationReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          }
        }
      },
      "DEABookListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DEABookDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "DEABookSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "drugName": {
            "type": "string"
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DeactivateDEABookDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        },
        "description": "Body for deactivating a DEA book. Reason is required."
      },
      "DEAEntryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "deaBookId": {
            "type": "string"
          },
          "containerId": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "balance": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "containerStatus": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAPatientSummaryDto"
              }
            ]
          },
          "userId": {
            "type": "string"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "witnessUser": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "correctedEntryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "collectorName": {
            "type": [
              "null",
              "string"
            ],
            "description": "UK CDR: name of the person who collected the dispensed CD."
          },
          "collectorIdChecked": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "UK CDR: whether collector photo ID was verified."
          },
          "quantityWordsAndFigures": {
            "type": [
              "null",
              "string"
            ],
            "description": "UK CDR: quantity rendered in words + figures (CD Sched 2/3)."
          },
          "entryDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DEAEntryListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DEAEntryDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "DEAPatientSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "species": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DEAUserSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          }
        }
      },
      "DeclineEstimateItemRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DeclineEstimateRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Free-form reason shown on the audit timeline."
          },
          "consentMethod": {
            "type": "string",
            "description": "Defaults to \"InApp\". Same enum as accept."
          }
        }
      },
      "DeferredServiceBucketDto": {
        "type": "object",
        "properties": {
          "serviceKey": {
            "type": "string",
            "description": "Stable key for drill-down: the ServiceCatalogItemId or InventoryItemId (or \"unspecified\")."
          },
          "serviceName": {
            "type": "string"
          },
          "serviceType": {
            "type": [
              "null",
              "string"
            ]
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "percentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Share of all deferred services in the period (0-100).",
            "format": "double"
          }
        }
      },
      "DeferredServiceItemDto": {
        "type": "object",
        "properties": {
          "serviceId": {
            "type": "string"
          },
          "appointmentId": {
            "type": "string"
          },
          "appointmentDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "patientId": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "serviceName": {
            "type": "string"
          },
          "serviceType": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Procedure\", \"Inventory\", or \"Unknown\"."
          },
          "lineTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "declinedReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "declinedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        },
        "description": "A single deferred (client-declined) service line with its appointment context. Shared shape\nbetween the patient-detail list and the BI drill-down."
      },
      "DeferredServicesBreakdownDto": {
        "type": "object",
        "properties": {
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeferredServiceBucketDto"
            }
          },
          "totalDeferred": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Clinic-wide breakdown of deferred services grouped by the individual service, weighted by\nfrequency, over a period."
      },
      "DeletePriceRuleResponseDto": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string"
          }
        },
        "description": "Response from DELETE /pricerules/{id}. `Outcome` is \"deactivated\" when\nthe rule was active (now soft-deleted) and \"hardDeleted\" when the rule was\nalready inactive (now permanently removed along with its audit rows)."
      },
      "DeliveryMethod": {
        "type": "integer"
      },
      "DenyMedicationRequestDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "DiagnosisTermDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "speciesCode": {
            "type": "string"
          },
          "bodySystem": {
            "type": "string"
          },
          "cui": {
            "type": [
              "null",
              "string"
            ]
          },
          "snomedId": {
            "type": [
              "null",
              "string"
            ]
          },
          "venomCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DiagnosisTermListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosisTermDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "DiagnosticsSettingsDto": {
        "type": "object",
        "properties": {
          "courierCutoffTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "autoAttachLabResults": {
            "type": "boolean"
          },
          "dicomAeTitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "dicomIp": {
            "type": [
              "null",
              "string"
            ]
          },
          "dicomPort": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "imagingRetentionPolicy": {
            "type": "string"
          },
          "autoRouteImages": {
            "type": "boolean"
          },
          "teleradiologyVetRad": {
            "type": "boolean"
          },
          "teleradiologyStatRad": {
            "type": "boolean"
          },
          "autoSubmitStudies": {
            "type": "boolean"
          },
          "autoSyncWithRecords": {
            "type": "boolean"
          },
          "calibrationAlertsEnabled": {
            "type": "boolean"
          },
          "scoutDistressDetection": {
            "type": "boolean"
          },
          "scoutPulseCheck": {
            "type": "boolean"
          },
          "tempMonitoringEnabled": {
            "type": "boolean"
          },
          "fridgeFreezerSensors": {
            "type": "boolean"
          },
          "pawsTvEnabled": {
            "type": "boolean"
          },
          "pawsTvDefaultChannel": {
            "type": [
              "null",
              "string"
            ]
          },
          "criticalLabResultAlerts": {
            "type": "boolean"
          },
          "statCaseResultAlerts": {
            "type": "boolean"
          },
          "equipmentCalibrationAlerts": {
            "type": "boolean"
          }
        },
        "description": "Diagnostics and equipment settings"
      },
      "DischargeChecklistDto": {
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": "string"
          },
          "required": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DischargeChecklistItemDto"
            },
            "description": "Items that must be resolved or overridden before discharge."
          },
          "recommended": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DischargeChecklistItemDto"
            },
            "description": "Items worth attention but not blocking (warning-only)."
          },
          "completed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DischargeChecklistItemDto"
            },
            "description": "Items that passed — shown for reassurance, not action."
          },
          "pending": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DischargeChecklistItemDto"
            },
            "description": "Items whose subject doesn't exist yet (no invoice created, no vaccines\nadministered, no SOAP plan...). Never block completion; rendered as\nupcoming rather than green so the live rail doesn't claim success\nbefore the work has happened (PAW-675)."
          },
          "evaluatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "hasBlockingItems": {
            "type": "boolean",
            "description": "True when at least one required item is still unresolved (status == \"missing\").\nWhen true the discharge/completion gate should block until resolved or overridden."
          },
          "isEuthanasiaVisit": {
            "type": "boolean",
            "description": "True when the visit is detected as a euthanasia/end-of-life visit (ITE-323).\nThe discharge tab uses this to default generation off and show the\n\"Generate anyway\" affordance instead."
          },
          "euthanasiaSignal": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable reason for the euthanasia detection, when detected."
          }
        },
        "description": "Result of evaluating the \"Missing Before Discharge\" safety checklist for an\nappointment (PAW-628). Items are grouped by how they gate discharge so the UI\ncan render three sections: required, recommended, and already-completed."
      },
      "DischargeChecklistItemDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "description": "medical | financial | communication | inventory"
          },
          "status": {
            "type": "string",
            "description": "missing | complete | overridden | pending"
          },
          "severity": {
            "type": "string",
            "description": "required | warning"
          },
          "title": {
            "type": "string"
          },
          "explanation": {
            "type": "string"
          },
          "actionLabel": {
            "type": [
              "null",
              "string"
            ],
            "description": "Label for the direct-action button, e.g. \"Finalize invoice\". Null when no action applies."
          },
          "actionTarget": {
            "type": [
              "null",
              "string"
            ],
            "description": "Frontend deep-link hint for the action button, e.g. \"invoice\", \"dispense\",\n\"schedule\". The chronicle UI maps these to the relevant tab/route."
          },
          "canOverride": {
            "type": "boolean",
            "description": "Whether the current user is permitted to override this item."
          },
          "override": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Populated when the item has been overridden (status == \"overridden\").",
                "$ref": "#/components/schemas/ChecklistOverrideDto"
              }
            ]
          }
        },
        "description": "A single checklist line. string DischargeChecklistItemDto.Key is the stable identifier used for\noverrides and persistence; it maps 1:1 to an `IDischargeCheck`."
      },
      "DischargeDocumentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "appointmentId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "instructions": {
            "type": "string"
          },
          "medications": {
            "type": [
              "null",
              "string"
            ]
          },
          "followUp": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "dischargedBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "dischargedAt": {
            "type": "string",
            "format": "date-time"
          },
          "aiGenerated": {
            "type": "boolean"
          },
          "aiConfidence": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DiscountCodeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "applyTo": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "discountType": {
            "type": "string"
          },
          "discountValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "scope": {
            "type": "string"
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validTo": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maxUsageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "usageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DiscountCodeListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscountCodeDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "DiscountValidationResultDto": {
        "type": "object",
        "properties": {
          "isValid": {
            "type": "boolean"
          },
          "errorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "errorMessage": {
            "type": [
              "null",
              "string"
            ]
          },
          "calculatedDiscount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "applicableTo": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DispenseDisposition": {
        "type": "integer"
      },
      "DispensedItemDto": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "inventoryItemId": {
            "type": "string"
          },
          "itemName": {
            "type": "string"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "calculatedPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "pricePolicy": {
            "type": "string"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionDate": {
            "type": "string",
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "markedForBilling": {
            "type": "boolean",
            "description": "Whether this item is marked for billing (should appear on invoice).\nUser-controlled toggle for samples, comped items, etc."
          },
          "isOnInvoice": {
            "type": "boolean",
            "description": "Whether this item has already been added to an invoice (InvoiceLineItem exists)."
          },
          "invoiceLineItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "dispenseType": {
            "type": "string",
            "description": "Type of dispense: InHouse (administered now) or Prescription (take-home)."
          },
          "prescriptionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "refillsRemaining": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The appointment this dispense is tied to, if any. Null for walk-in/OTC dispenses\nmade outside an appointment context."
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Canonical shape for a dispensed inventory item. Used for both appointment-scoped\n(\"what was dispensed during this appointment?\") and patient-scoped (\"what has been\ndispensed for this patient that isn't on an invoice yet?\") queries."
      },
      "DispensedLotDto": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "lotId": {
            "type": "string"
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "newLotBalance": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "deaEntryId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DispenseFromInventoryDto": {
        "type": "object",
        "properties": {
          "lotId": {
            "type": "string"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ITE-157: explicit container within the lot; null for auto (open-first)."
          },
          "locationId": {
            "type": "string"
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When supplied, the dispense transaction is also attached to this estimate\nas an InvoiceLineItem in the same request cycle."
          },
          "collectorName": {
            "type": [
              "null",
              "string"
            ],
            "description": "UK CDR: collector name for Schedule 2–5 dispenses."
          },
          "collectorIdChecked": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "UK CDR: photo ID verification flag."
          }
        }
      },
      "DispenseItemDto": {
        "required": [
          "locationId"
        ],
        "type": "object",
        "properties": {
          "lotId": {
            "type": [
              "null",
              "string"
            ]
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Explicit physical container to draw from within the resolved lot (ITE-157). When\nnull, the engine auto-selects: an already-opened container first, then the oldest\nsealed one. Ignored for lots that have no container rows (legacy)."
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": "string",
            "description": "Storage location the inventory is being dispensed from.\nRequired for accurate location tracking."
          },
          "dispenseType": {
            "type": "string",
            "description": "Type of dispense: InHouse (administered now) or Prescription (take-home).\nDefaults to InHouse."
          },
          "disposition": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Explicit, surface-independent dispense disposition (in-house / take-home label\nnow / take-home label later). When set, the engine normalizes it into\nstring DispenseItemDto.DispenseType + bool DispenseItemDto.DeferRxDetails at the top of the\npipeline, replacing the per-entry-point flag defaults. Null = legacy mode\n(honor `DispenseType`/`DeferRxDetails` as sent).",
                "$ref": "#/components/schemas/DispenseDisposition"
              }
            ]
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "prescriptionItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When set, links this dispense to an existing prescription item\ninstead of creating a new prescription. Used by Rx Governance dispense flow."
          },
          "deferRxDetails": {
            "type": "boolean",
            "description": "When true, this is a take-home dispense whose prescription record is\ncreated (or deliberately deferred) <em>after</em> the dispense, rather\nthan inline. Used by the appointment \"Take Home\" flow, where the\ninventory is dispensed first and the Rx label is filled out afterward\nvia `CreatePostDispensePrescriptionAsync`. When set, the dispense\nvalidator skips the dosage/frequency requirement and the prescription\nlinker does not create an inline Rx for a Prescription dispense."
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When set, the dispense and the matching InvoiceLineItem are created in the same\nunit of work. Callers with an active estimate should provide this to avoid the\n\"dispensed but floating\" state. Leave null to create the transaction only."
          },
          "targetInvoiceLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When set, links this dispense to a PRE-EXISTING <see cref=\"!:InvoiceLineItem\" />\n(e.g. a BillableItem \"Charge\" line being fulfilled): the transaction's\n`InvoiceLineItemId` is stamped to this value WITHOUT creating a new\nline or auto-creating a draft estimate. Used by the fan-out orchestrator so\nall N component transactions attach to the one charge line. Takes precedence\nover string? DispenseItemDto.InvoiceId when both are set."
          },
          "invoiceOverridePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Optional price override applied to the auto-created InvoiceLineItem. Ignored\nwhen string? DispenseItemDto.InvoiceId is null.",
            "format": "double"
          },
          "targetEstimateLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When set, the dispense fulfills this PRE-EXISTING Pending estimate line\n(stamping the transaction and marking it Performed) instead of pooling onto\nwhatever draft estimate is open. Used by the MedicationRequest lifecycle,\nwhere the request's quote line is created at approval and the pickup dispense\nmust land on that exact line. Falls through to the normal attach path when\nthe line is missing or no longer Pending."
          },
          "markedForBilling": {
            "type": "boolean",
            "description": "When true, the resulting <see cref=\"!:InventoryTransaction\" /> is flagged\n`MarkedForBilling = true` so the unbilled-items flow surfaces it\nfor invoicing. Used by the appointment-close dispense path; default\nfalse for the direct dispense path which writes its own line items."
          },
          "skipInvoiceAttach": {
            "type": "boolean",
            "description": "When true, the dispense side effects skip the auto-attach-to-Invoice step\nentirely (no explicit-invoice attach, no draft-Invoice find/create). Used by\nthe in-visit appointment perform path, where the billing link lives on the\nestimate line (`EstimateLineItem.InventoryTransactionId`) and no Invoice\nexists until the staff explicitly converts. Ignored when an explicit\nstring? DispenseItemDto.InvoiceId or string? DispenseItemDto.TargetInvoiceLineItemId is supplied."
          },
          "overrideValidation": {
            "type": "boolean",
            "description": "When true, bypasses VCPR and quantity validation checks."
          },
          "overrideReason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required when overrideValidation is true. Reason for the override."
          },
          "collectorName": {
            "type": [
              "null",
              "string"
            ],
            "description": "UK CDR (Misuse of Drugs Regs) — name of the person collecting the\ndispensed Schedule 2–5 controlled drug. Required by\n<see cref=\"!:IRegionalPrescribingRules.RequireCollectorRecord\" />; ignored\nin US dispenses."
          },
          "collectorIdChecked": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "UK CDR best practice — confirmation that the collector's photo ID was\nverified before handing over the drug. Required alongside\nstring? DispenseItemDto.CollectorName on UK CD dispenses."
          }
        }
      },
      "DispenseMedicationRequestDto": {
        "type": "object",
        "properties": {
          "lotId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Confirmed quantity at dispense; defaults to the approved quantity.",
            "format": "double"
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Witness for controlled-substance dispenses. Required by the dispense\nengine (non-overridable) whenever the item has a DEA book."
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical container to draw from (controlled items, ITE-157)."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "collectorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "collectorIdChecked": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "description": "Dispense an Approved request from inventory (pickup)."
      },
      "DispensePrescriptionDto": {
        "type": "object",
        "properties": {
          "batchNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DispenseResultDto": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "invoiceLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when the dispense was made against an open estimate and the caller supplied\nstring? DispenseItemDto.InvoiceId. The caller can append the line item to\nits local state directly from this response instead of refetching."
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The estimate the dispense was attached to — the caller-supplied one, or one\nauto-created/resolved server-side when none was provided. Lets a caller with no\nestimate of its own adopt the server's estimate rather than failing to reconcile."
          },
          "estimateLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when a patient-scoped POS / non-appointment dispense landed on a draft\nEstimate line (the single billing path). The line awaits an explicit\nconvert-to-invoice. Mutually exclusive with string? DispenseResultDto.InvoiceLineItemId."
          },
          "estimateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The draft Estimate the dispense was stamped onto (found or created for the\npatient). Lets the caller adopt the server's estimate without refetching."
          },
          "deaEntryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantityDispensed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lotId": {
            "type": "string"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "newLotBalance": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseType": {
            "type": "string"
          },
          "prescriptionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "prescriptionItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "lots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DispensedLotDto"
            },
            "description": "Per-lot breakdown of the dispense. Single-lot dispenses produce one\nentry; auto-allocated dispenses spanning multiple lots produce one\nentry per lot, in FEFO order. The top-level string DispenseResultDto.TransactionId,\nstring DispenseResultDto.LotId, string? DispenseResultDto.DEAEntryId, string? DispenseResultDto.ContainerId,\nand decimal DispenseResultDto.NewLotBalance fields mirror List&lt;DispensedLotDto&gt; DispenseResultDto.Lots[0] for\nback-compat with single-lot callers."
          }
        }
      },
      "DispenseValidationIssueDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "canOverride": {
            "type": "boolean"
          },
          "appliesAt": {
            "type": "string",
            "description": "When this issue applies. \"Preflight\" issues block the request-creation\nstep (species, VCPR, qty, dosage/freq). \"Dispense\" issues only apply at\nphysical dispense time — witness, collector — and the preflight UI\nshould ignore them since they're captured on a later screen."
          }
        }
      },
      "DispenseValidationResultDto": {
        "type": "object",
        "properties": {
          "isValid": {
            "type": "boolean"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DispenseValidationIssueDto"
            }
          }
        }
      },
      "DvmCompensationDto": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "annualSalary": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "productionPercentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "salaryCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "productionPay": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalCompensation": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "compPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "margin": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "profitPerHour": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "compensationThresholdOverridePercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Per-vet override of the clinic-level comp-% warning threshold. Null = use clinic default.",
            "format": "double"
          },
          "excludedBuckets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Service-mix buckets excluded from this provider's production-pay revenue base (PAW-578)."
          },
          "productionExcludedRevenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Revenue stripped out of the production-pay calculation by List&lt;string&gt; DvmCompensationDto.ExcludedBuckets.",
            "format": "double"
          }
        }
      },
      "DvmDiagnosisDto": {
        "type": "object",
        "properties": {
          "providerId": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "diagnosis": {
            "type": "string"
          },
          "isLlmGenerated": {
            "type": "boolean"
          },
          "generatedAt": {
            "type": "string"
          }
        },
        "description": "AI root-cause diagnosis for one provider's drill-down on the DVM Production tab\n(PAW-576). bool DvmDiagnosisDto.IsLlmGenerated is false when the deterministic\nrule-based fallback was used (LLM call failed or returned nothing)."
      },
      "DvmProductionClinicDto": {
        "type": "object",
        "properties": {
          "revenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "visits": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "revPerHour": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "visitsPerHour": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "avgVisitValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "revenueChangePct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "revPerHourChangePct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "avgVisitValueChangePct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "revenueSparkline": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          "revPerHourSparkline": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          "avgVisitValueSparkline": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          "totalCompensation": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalMargin": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "profitPerHour": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "avgCompPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalCompensationChangePct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalMarginChangePct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "marginSparkline": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          "compPercentSparkline": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          },
          "discountLeakage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountLeakPct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "serviceMix": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceMixCategoryDto"
            }
          },
          "categoryBreakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClinicCategoryBreakdownDto"
            }
          },
          "revenueForecast": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForecastPointDto"
            }
          }
        }
      },
      "DvmProductionDto": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "clinic": {
            "$ref": "#/components/schemas/DvmProductionClinicDto"
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DvmProductionProviderDto"
            }
          },
          "signals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DvmSignalDto"
            }
          }
        }
      },
      "DvmProductionProviderDto": {
        "type": "object",
        "properties": {
          "providerId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "revenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "hours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "visits": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "revPerHour": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "visitsPerHour": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "avgVisitValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "diagPenetrationPct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "status": {
            "type": "string"
          },
          "compensation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DvmCompensationDto"
              }
            ]
          },
          "discountLeakage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountLeakPct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "serviceMix": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceMixCategoryDto"
            }
          }
        }
      },
      "DvmSignalActionDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "actionType": {
            "type": "string",
            "description": "\"coachProvider\" | \"tightenDiscounts\"."
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Primary call-to-action for a signal. The backend emits an action type + payload;\nthe frontend owns the route it maps to."
      },
      "DvmSignalDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "\"leak\" | \"highComp\" | \"lowRph\" | \"highYield\"."
          },
          "severity": {
            "type": "string",
            "description": "\"high\" | \"medium\" | \"low\" — drives ordering and card colour."
          },
          "title": {
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Plain-text, fully formatted server-side."
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "action": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DvmSignalActionDto"
              }
            ]
          }
        },
        "description": "A severity-weighted, actionable signal on the DVM Production tab (PAW-579).\nDerived live from the clinic + provider rows — not persisted."
      },
      "EBITDASummaryDto": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "ebitda": {
            "$ref": "#/components/schemas/EBITDAValuesDto"
          },
          "margin": {
            "$ref": "#/components/schemas/MarginValuesDto"
          },
          "revenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "operatingExpenses": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "trend": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EBITDATrendPointDto"
            }
          }
        }
      },
      "EBITDATrendPointDto": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string"
          },
          "ebitda": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "margin": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "EBITDAValuesDto": {
        "type": "object",
        "properties": {
          "current": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "previous": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "change": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "changeDirection": {
            "type": "string"
          }
        }
      },
      "EdgePrinterMappingDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "printerName": {
            "type": "string"
          },
          "cupsQueueName": {
            "type": "string"
          }
        }
      },
      "EdgePrinterMappingEntryDto": {
        "type": "object",
        "properties": {
          "printerName": {
            "type": "string"
          },
          "cupsQueueName": {
            "type": "string"
          }
        }
      },
      "EdgePrintJobDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "printerName": {
            "type": "string"
          },
          "documentUrl": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "pageWidthMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "float"
          },
          "pageHeightMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "float"
          }
        }
      },
      "EmailEstimateToClientRequest": {
        "type": "object",
        "properties": {
          "recipientEmail": {
            "type": [
              "null",
              "string"
            ],
            "description": "Overrides the client's email on file when provided."
          },
          "message": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email body; a default message is used when omitted."
          },
          "subject": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email subject; defaults to \"Estimate {number} for {patient}\"."
          }
        },
        "description": "Request to email the estimate PDF to the client via the communications inbox."
      },
      "EmailEstimateToClientResponse": {
        "required": [
          "sentTo"
        ],
        "type": "object",
        "properties": {
          "sentTo": {
            "type": "string",
            "description": "The address the estimate was sent to."
          },
          "threadId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The communications thread the message landed in (for deep-linking /chat)."
          }
        }
      },
      "EmailSendResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "recipientEmail": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EmergencyContactDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "relationship": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EmissionSource": {
        "type": "integer",
        "description": "What kind of producer created a machine- or human-generated work item\n(Reminder or WorkTask). Structured replacement for the provenance that used\nto live only in `Reminder.CustomAttributes`. ReminderOrigin\nis kept for API compatibility; this is the authoritative answer to\n\"what created this?\"."
      },
      "EntityTagHeaderValue": {
        "type": "object",
        "properties": {
          "tag": {
            "$ref": "#/components/schemas/StringSegment"
          },
          "isWeak": {
            "type": "boolean"
          }
        }
      },
      "ErxMedicationDto": {
        "type": "object",
        "properties": {
          "ndcCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "brandName": {
            "type": [
              "null",
              "string"
            ]
          },
          "drugClass": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Human\" | \"Vet\" per the vendor catalog."
          },
          "quantityUomCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "packageSize": {
            "type": [
              "null",
              "string"
            ]
          },
          "packageSizeUom": {
            "type": [
              "null",
              "string"
            ]
          },
          "labeler": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ],
            "description": "Vendor DEA schedule text, e.g. \"0-Not scheduled under Federal Law\"."
          },
          "isControlled": {
            "type": "boolean",
            "description": "True for any federally scheduled drug — the send path refuses these."
          }
        },
        "description": "A medication from the vendor's NDC catalog, shaped for the send modal."
      },
      "ErxPharmacyDto": {
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "address1": {
            "type": [
              "null",
              "string"
            ]
          },
          "address2": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zip": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "ncpdp": {
            "type": [
              "null",
              "string"
            ]
          },
          "npi": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "A pharmacy from the vendor's NCPDP/NPI directory, shaped for the send modal."
      },
      "ErxProviderDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "licenseNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "licenseState": {
            "type": [
              "null",
              "string"
            ]
          },
          "missingRequirements": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What blocks registration, e.g. \"license\". Empty when registrable."
          },
          "registered": {
            "type": "boolean"
          },
          "verificationStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "not_started | pending | verified | failed | unknown. Null when not registered."
          },
          "verificationUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "registeredAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "verifiedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastPolledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "One provider row in the eRx roster: eligibility + registration + verification state."
      },
      "ErxProviderRosterDto": {
        "type": "object",
        "properties": {
          "configured": {
            "type": "boolean",
            "description": "Platform credentials present (env config) — false on envs without the key."
          },
          "enabled": {
            "type": "boolean",
            "description": "The per-clinic ErxSettings.VetHubRxEnabled gate."
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErxProviderDto"
            }
          }
        },
        "description": "The eRx provider roster plus the integration state the settings UI needs."
      },
      "ErxSettingsDto": {
        "type": "object",
        "properties": {
          "vetHubRxEnabled": {
            "type": "boolean"
          }
        },
        "description": "External e-prescribing (VetHubRx) settings — the per-clinic gate only. Platform\ncredentials are environment configuration and never appear in this DTO."
      },
      "EstimateConsentEventDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "estimateId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "consentMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "tierSelected": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasSignature": {
            "type": "boolean",
            "description": "Whether this event has a drawn signature (without returning the base64 payload)."
          },
          "signatureData": {
            "type": [
              "null",
              "string"
            ],
            "description": "Base64 PNG. Only populated on the detail view to keep list payloads small."
          },
          "signedName": {
            "type": [
              "null",
              "string"
            ]
          },
          "capturedByUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "capturedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EstimateConsentEventListResponseDto": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EstimateConsentEventDto"
            }
          }
        }
      },
      "EstimateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "estimateNumber": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "selectedTier": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EstimateLineItemDto"
            }
          }
        }
      },
      "EstimateLineItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "billableItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Source BillableItem (\"Charge\") id when this line is a charge."
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyMode": {
            "type": "string"
          },
          "qtyLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyMed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Working quantity (tier collapses into this; execution dispenses it).",
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "serviceType": {
            "type": "string",
            "description": "\"Procedure\" | \"Inventory\" | \"Retail\" — derived from the source FK."
          },
          "inventoryItemCategory": {
            "type": [
              "null",
              "string"
            ],
            "description": "InventoryItemCategory (\"Vaccine\", \"Medication\", …) for an inventory-backed line; routes the perform flow (e.g. vaccine administration)."
          },
          "executionStatus": {
            "type": "string",
            "description": "Pending | Performed | Declined."
          },
          "disposition": {
            "type": [
              "null",
              "string"
            ],
            "description": "Persisted dispense disposition: InHouse | TakeHomeLabelNow | TakeHomeLabelLater (null for non-dispensing lines)."
          },
          "requiresSig": {
            "type": "boolean",
            "description": "True when this performed take-home line still needs its SIG / medication details filled\n(blocks convert). Drives the per-line \"Fill instructions\" affordance. In-house lines are\nnever required."
          },
          "markedForBilling": {
            "type": "boolean"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Flat per-dispense fee on the line (once per unique inventory item on the estimate).",
            "format": "double"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Snapshotted lot cost for a dispensed inventory line.",
            "format": "double"
          },
          "inventoryTransactionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set once an inventory line is dispensed in-visit. The void reversal anchors on this."
          },
          "performedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "performedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "performedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "declinedReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "declinedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isControlledSubstance": {
            "type": "boolean",
            "description": "True for a controlled-substance inventory line (gates the void-reason requirement)."
          },
          "lineTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Computed line total: (UnitPrice × Quantity) + DispenseFee.",
            "format": "double"
          }
        }
      },
      "EstimateListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EstimateSummaryDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "EstimateSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "estimateNumber": {
            "type": "string"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The estimate's patient, if any (null for client-only/POS estimates). Client-scoped\nlists (the client record page) need it to label rows and hand off to payments."
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "selectedTier": {
            "type": [
              "null",
              "string"
            ]
          },
          "itemCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Sum of the lines' (UnitPrice × Quantity) + DispenseFee. For the linkable-estimate picker.",
            "format": "double"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The appointment this estimate is tied to, if any (null for standalone/POS estimates)."
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The invoice this estimate was converted into, if any. Non-null = already converted."
          },
          "invoiceStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "Status of the converted invoice (string? EstimateSummaryDto.InvoiceStatus as a string), or null if not\nconverted. Lets the estimates list surface real payment state (\"Paid\" / \"Partially Paid\" /\n\"Combined\") instead of a flat \"Invoiced\" once an invoice exists."
          },
          "invoiceNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable number of the converted invoice, or null if not converted."
          },
          "invoiceItemCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Line count of the converted invoice, or null if not converted. The bill can differ from the\nquote — dispenses and additions at billing time land on the invoice only — so converted rows\nmust not present the estimate's own ItemCount/Total as the bill's.",
            "format": "int32"
          },
          "invoiceTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Grand total of the converted invoice (its TotalAmount), or null if not converted.",
            "format": "double"
          },
          "mergedIntoInvoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When this estimate's invoice was combined into another bill, the successor combined invoice's\nid. Null unless the invoice is Superseded via a merge. Grouping key for the nested combined view."
          },
          "mergedIntoInvoiceNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable number of the combined (successor) invoice, for the nested parent header."
          },
          "mergedIntoInvoiceStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "Status of the combined (successor) invoice, for the nested parent's badge."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ExamEmissionFieldResult": {
        "required": [
          "fieldId",
          "status"
        ],
        "type": "object",
        "properties": {
          "fieldId": {
            "type": "string",
            "description": "Empty string for template-level problems (e.g. pinned version unavailable)."
          },
          "status": {
            "type": "string",
            "description": "\"emitted\" | \"frozen\" | \"error\"."
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ExamTemplateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "schema": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Provider-built exam template that replaces the default 7-system anatomical view in the\nchronicle exam tab. Schema mirrors the questionnaire schema shape so the same form-builder\nUI can edit both."
      },
      "ExamTemplateListItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ExamTemplateListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExamTemplateListItemDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ExamTemplateRefDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "description": "Enough of an exam template to name it in a warning and link to it."
      },
      "ExpenseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "category": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "$ref": "#/components/schemas/ExpenseSource"
          },
          "sourceReferenceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "recurringExpenseId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ExpenseFrequency": {
        "type": "integer",
        "description": "Frequency for recurring expenses."
      },
      "ExpenseListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ExpenseSource": {
        "type": "integer",
        "description": "Source of an expense record for auto-population deduplication."
      },
      "ExpenseSummaryDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "cogs": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "labor": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "opEx": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "byCategory": {
            "type": "object",
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          }
        }
      },
      "FeaturebaseChangelogEntryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Featurebase's entry id — stable, used as the React key."
          },
          "title": {
            "type": "string"
          },
          "markdown": {
            "type": "string",
            "description": "Entry body as Markdown, rendered client-side."
          },
          "publishedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Publish date. Null when Featurebase returned an unparseable/missing date.",
            "format": "date-time"
          },
          "category": {
            "type": [
              "null",
              "string"
            ],
            "description": "First category name as authored in the dashboard (e.g. \"New\", \"Fix\"). Freeform —\nthe web app maps it to a badge and falls back to a neutral one for unknown values."
          },
          "url": {
            "type": [
              "null",
              "string"
            ],
            "description": "Permalink to the entry on the public changelog portal."
          }
        },
        "description": "One published changelog entry, normalized from the Featurebase REST API for the home\npage's Release Notes panel (ITE-212)."
      },
      "FeaturebaseChangelogResponseDto": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeaturebaseChangelogEntryDto"
            }
          },
          "configured": {
            "type": "boolean",
            "description": "False when no API key is configured. The panel treats this as \"nothing to show yet\"\nrather than an error."
          }
        },
        "description": "Response for `GET /featurebase/changelog`."
      },
      "FeatureFlagsResponseDto": {
        "required": [
          "flags"
        ],
        "type": "object",
        "properties": {
          "flags": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "FileContentResult": {
        "type": "object",
        "properties": {
          "fileContents": {
            "type": "string",
            "format": "byte"
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          }
        }
      },
      "FileResult": {
        "type": "object",
        "properties": {
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          }
        }
      },
      "FinalizeSurgicalRecordRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional note recorded on the finalization row. Nothing needs explaining\nwhen a chart is signed off at the end of a procedure."
          }
        }
      },
      "FinancialDetailsDto": {
        "type": "object",
        "properties": {
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FinancialMetricDto"
            }
          }
        }
      },
      "FinancialMetricDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "indent": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "parent": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "FinancialSettingsDto": {
        "type": "object",
        "properties": {
          "stateTaxRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "countyTaxRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "cityTaxRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quickAddServiceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "xplorPayEnabled": {
            "type": "boolean"
          },
          "xplorPayTestMode": {
            "type": "boolean"
          },
          "xplorPayCredentialsConfigured": {
            "type": "boolean",
            "description": "Whether XplorPay credentials are stored in AWS Secrets Manager.\nUse /integrations/credentials/xplorpay endpoints to manage."
          },
          "xplorPayTerminalApiKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "xplorPayPayLinkApiKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "markAsPaidTypes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "passProcessingFeesToClient": {
            "type": "boolean"
          },
          "depositAccount": {
            "type": [
              "null",
              "string"
            ]
          },
          "accountingMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "vatStandardRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "vatReducedRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountStackingMode": {
            "type": "string",
            "description": "How the price rule engine resolves multiple discounts hitting the same\nline (or the order): \"best-wins\" keeps only the largest, \"stack\" sums\nthem. An individual rule may override this via `PriceRule.StackingOverride`."
          },
          "paymentMethodNotices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PaymentMethodNoticeDto"
            },
            "description": "Admin-authored notices shown when a given payment method is used at checkout.\nKeyed by surface (e.g. `payment.check`) so the model can extend beyond\npayment methods later without a migration."
          }
        },
        "description": "Financial and pricing settings"
      },
      "FlowboardAlertDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "level": {
            "type": "string"
          }
        },
        "description": "Alert/warning displayed on patient card"
      },
      "FlowboardMilestoneDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/MilestoneType"
          },
          "status": {
            "$ref": "#/components/schemas/MilestoneStatus"
          },
          "startedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "estimatedDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "actualDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Milestone progress for a flowboard visit"
      },
      "FlowboardRoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "currentVisit": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FlowboardVisitDto"
              }
            ]
          },
          "nextUp": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowboardVisitDto"
            }
          }
        },
        "description": "Room/location on the flowboard with current occupant and queue"
      },
      "FlowboardStaffDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": "string"
          }
        },
        "description": "Staff member assigned to a flowboard visit"
      },
      "FlowboardStateDto": {
        "type": "object",
        "properties": {
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowboardRoomDto"
            }
          },
          "waitingList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowboardVisitDto"
            }
          },
          "dischargedList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowboardVisitDto"
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Complete flowboard state including all rooms, waiting list, and discharged patients"
      },
      "FlowboardVisitDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "appointmentId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "profilePhotoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "clientPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "reasonForVisit": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentTypeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedStaff": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowboardStaffDto"
            }
          },
          "checkInTime": {
            "type": "string",
            "format": "date-time"
          },
          "examStartTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "treatmentStartTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "dischargedTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "currentRoomId": {
            "type": [
              "null",
              "string"
            ]
          },
          "currentRoomName": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextUpRoomId": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextUpQueuedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowboardAlertDto"
            }
          },
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowboardMilestoneDto"
            }
          },
          "progressPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "A patient visit on the flowboard, derived from appointment and milestone data"
      },
      "FlowCompletionResultDto": {
        "required": [
          "success",
          "clientId",
          "patientId",
          "errorMessage"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "errorMessage": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Result DTO for flow completion operations"
      },
      "ForecastPointDto": {
        "type": "object",
        "properties": {
          "weekStart": {
            "type": "string",
            "format": "date"
          },
          "projectedRevenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "projectedRevPerHour": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "bookedHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isFallback": {
            "type": "boolean",
            "description": "True when the week had no forward bookings and fell back to trailing-average hours."
          }
        },
        "description": "One projected week on the Rev &amp; Forecast trend (PAW-577). Revenue is booked\nschedule hours × the clinic's trailing rev/hour, or the trailing-average weekly\nhours when the week has no forward bookings (bool ForecastPointDto.IsFallback)."
      },
      "FormDraftListResponseDto": {
        "required": [
          "data",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FormDraftResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Response DTO for a list of form drafts with pagination"
      },
      "FormDraftResponseDto": {
        "required": [
          "id",
          "formType",
          "flowType",
          "flowKey",
          "title",
          "formData",
          "isValid",
          "createdBy",
          "lastEditedBy",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "formType": {
            "type": "string"
          },
          "flowType": {
            "type": [
              "null",
              "string"
            ]
          },
          "flowKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "formData": {
            "type": "string"
          },
          "isValid": {
            "type": "boolean"
          },
          "createdBy": {
            "$ref": "#/components/schemas/UserSummaryDto"
          },
          "lastEditedBy": {
            "$ref": "#/components/schemas/UserSummaryDto"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Response DTO for a single form draft"
      },
      "FormSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "formType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Form summary"
      },
      "FulfillComponentDto": {
        "type": "object",
        "properties": {
          "componentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The BillableItemComponent this resolution applies to."
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Alternative match key when componentId is not supplied."
          },
          "skip": {
            "type": "boolean",
            "description": "POS override (1c-3): omit this default component from the fulfillment —\nnothing is dispensed for it. Requires `ComponentOverrideReason`."
          },
          "substituteInventoryItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "POS override (1c-3): dispense this inventory item in place of the default\ncomponent's item (same quantity). Requires `ComponentOverrideReason`."
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Explicit quantity. Required for ad-hoc `AdditionalComponents`. For a\ncatalog (default or substituted) component it is OPTIONAL and overrides the\ncomputed `QuantityMultiplier × line qty` — e.g. the patient used more\nor less than the bundle's default. Must be &gt; 0 (use bool FulfillComponentDto.Skip to\nremove a component). A quantity that differs from the default counts as an\noverride and requires `ComponentOverrideReason`. A charge is\nfixed-price, so this only changes the stock consumed, never the bill.",
            "format": "double"
          },
          "lotId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Explicit lot; empty/omitted ⇒ FEFO auto-allocation."
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Storage location to decrement; omitted ⇒ no per-location decrement."
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "dispenseType": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"InHouse\" (default) or \"Prescription\". Legacy; prefer string? FulfillComponentDto.Disposition."
          },
          "disposition": {
            "type": [
              "null",
              "string"
            ],
            "description": "Per-component dispense disposition: \"InHouse\" (administered now, no script),\n\"TakeHomeLabelNow\" (take-home, fill the Rx label now), or \"TakeHomeLabelLater\"\n(take-home, stock moves now, label filled afterward — blocks convert until filled).\nWhen omitted the charge's line-level default applies (back-compat). The engine\nderives DispenseType + DeferRxDetails from this, so the SIG fields below are\nrequired only for \"TakeHomeLabelNow\"."
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "collectorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "collectorIdChecked": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "overrideValidation": {
            "type": "boolean"
          },
          "overrideReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "route": {
            "type": [
              "null",
              "string"
            ],
            "description": "Vaccine administration route (e.g. \"Subcutaneous\"). Required when this\ncomponent is a vaccine — the dispense stamps it onto the auto-created\nVaccinationRecord, mirroring the standalone vaccine-administration flow."
          },
          "site": {
            "type": [
              "null",
              "string"
            ],
            "description": "Vaccine administration site (e.g. \"Left foreleg\"). Required for vaccine components."
          }
        }
      },
      "FunnelStageDto": {
        "type": "object",
        "properties": {
          "stage": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "percent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "GenerateSmsConsentLinkRequest": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "expirationHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Request to generate a magic link for SMS consent"
      },
      "GetAvailableSlotsResponse": {
        "type": "object",
        "properties": {
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailableSlotDto"
            }
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GetBillingResponse": {
        "type": "object",
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceDto"
            }
          },
          "totalBalance": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "GetChatMessagesResponse": {
        "type": "object",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetChatMessageDto"
            }
          }
        }
      },
      "GetPatientRecordsResponse": {
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientRecordDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "GetRdvmAppointmentTypesResponse": {
        "type": "object",
        "properties": {
          "appointmentTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmAppointmentTypeDto"
            }
          }
        }
      },
      "GetRdvmReferralMessagesResponse": {
        "type": "object",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmReferralMessageDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "GetRdvmReferralsResponse": {
        "type": "object",
        "properties": {
          "referrals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmReferralDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "GetRdvmSlotsResponse": {
        "type": "object",
        "properties": {
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmSlotDto"
            }
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GetRdvmSpeciesResponse": {
        "type": "object",
        "properties": {
          "species": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmSpeciesDto"
            }
          }
        }
      },
      "GroupCodeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "priceMode": {
            "type": "string",
            "description": "\"None\" | \"FixedPrice\" | \"PercentDiscount\" | \"FlatDiscount\"."
          },
          "fixedKitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "longDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRecurring": {
            "type": "boolean"
          },
          "recurringFrequency": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Weekly\" | \"BiWeekly\" | \"Monthly\" | \"Quarterly\" | \"Annually\". Null when not recurring."
          },
          "billingDayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxBillingCycles": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "itemCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupCodeItemDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GroupCodeItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "groupCodeId": {
            "type": "string"
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isRequired": {
            "type": "boolean"
          },
          "minQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "noteOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "discountPercentOverride": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Legacy per-item discount % override (0-100). Superseded by\n            `PriceOverrideKind`/`PriceOverrideValue`.",
            "format": "double"
          },
          "priceOverrideKind": {
            "type": "string",
            "description": "One of: \"None\", \"Free\", \"FixedPrice\", \"AmountOff\", \"PercentOff\"."
          },
          "priceOverrideValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Dollars for FixedPrice/AmountOff, percent (0-100) for PercentOff,\n            null for None/Free.",
            "format": "double"
          },
          "itemType": {
            "type": "string",
            "description": "Flattened item type: \"service\", \"retail\", or \"inventory\""
          },
          "itemCode": {
            "type": "string",
            "description": "Flattened code from the referenced item"
          },
          "itemDescription": {
            "type": "string",
            "description": "Flattened description/name from the referenced item"
          },
          "itemPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Flattened price from the referenced item",
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean",
            "description": "Whether the referenced item is taxable"
          }
        }
      },
      "GroupCodeListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupCodeDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "GroupSoapNoteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "subjective": {
            "type": "string"
          },
          "objective": {
            "type": "string"
          },
          "assessment": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "cohortLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "format": {
            "type": "string",
            "description": "Note-format discriminator (PAW-744). A group visit's AI-generated note\ncomes from the same generation path as a patient visit's, so it inherits\nthe appointment type's note format — including single-section formats,\nwhose whole body lives in `Subjective`. The editor needs this to\navoid labelling that body \"Subjective\" beside three empty boxes."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "exceptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberExceptionDto"
            }
          }
        }
      },
      "GroupTreatmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "dose": {
            "type": [
              "null",
              "string"
            ]
          },
          "route": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "numberTreated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cohortLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantityUsed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "inventoryTransactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "meatWithdrawalEndDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "milkWithdrawalEndDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdById": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GroupVisitDto": {
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": "string"
          },
          "patientGroupId": {
            "type": "string"
          },
          "groupName": {
            "type": "string"
          },
          "groupType": {
            "type": "string"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "reasonForVisit": {
            "type": [
              "null",
              "string"
            ]
          },
          "soapNotes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupSoapNoteDto"
            }
          },
          "treatments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupTreatmentDto"
            }
          },
          "activeWithdrawals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActiveWithdrawalDto"
            }
          }
        }
      },
      "GuardrailChecksDto": {
        "type": "object",
        "properties": {
          "dose": {
            "type": "boolean"
          },
          "interaction": {
            "type": "boolean"
          },
          "allergy": {
            "type": "boolean"
          }
        }
      },
      "HeadlineMetricsDto": {
        "type": "object",
        "properties": {
          "estimateBeforeTreatmentRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Plans that converted to estimates / (converted + bypassed).",
            "format": "double"
          },
          "consentRecordedRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Plans accepted / plans created.",
            "format": "double"
          },
          "rxTransparencyRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Labels rendered with Right-to-Shop notice / total Rx transparency events (≈100% when flag on).",
            "format": "double"
          },
          "antimicrobialJustifiedRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Antimicrobial Rx with non-empty justification / antimicrobial Rx total.",
            "format": "double"
          },
          "cascadeReasonRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Cascade Rx with non-empty reason / cascade Rx total.",
            "format": "double"
          },
          "ownershipDisclosureComplete": {
            "type": "boolean",
            "description": "Settings booleans — always computable from clinic state, not events."
          },
          "publicPricingComplete": {
            "type": "boolean"
          },
          "cdRegisterVarianceCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Count of `dea.correction` / `ukcdr.correction` events in range.",
            "format": "int32"
          },
          "totalEventCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Cross-cutting summary — useful for the top stat tiles.",
            "format": "int32"
          },
          "blockingEventCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "warningEventCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Headline rates and configuration flags. Rates are `null`\nwhen the denominator is zero so the UI can render a dash instead of \"0%\"."
      },
      "HeatmapDataPointDto": {
        "type": "object",
        "properties": {
          "day": {
            "type": "string"
          },
          "hour": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "HerdDetailsDto": {
        "type": "object",
        "properties": {
          "productionType": {
            "type": "string"
          },
          "farmName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "HomeAgainCredentialsDto": {
        "type": "object",
        "properties": {
          "clinicAccountNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorClinicId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "HomeAgainCredentialsStatusDto": {
        "type": "object",
        "properties": {
          "isConfigured": {
            "type": "boolean"
          },
          "clinicAccountNumber": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "HomeAgainEnrollRequest": {
        "type": "object",
        "properties": {
          "microchipNumber": {
            "type": "string"
          },
          "ownerFirstName": {
            "type": "string"
          },
          "ownerLastName": {
            "type": "string"
          },
          "ownerAddressLine1": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerAddressLine2": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerCity": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerStateAbbr": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerPostalCode": {
            "type": "string"
          },
          "ownerTelephone": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerAltTelephone": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerMobilePhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "altOwnerFirstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "altOwnerLastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "altOwnerTelePhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "petName": {
            "type": "string"
          },
          "petSpecies": {
            "type": "string"
          },
          "breedName": {
            "type": [
              "null",
              "string"
            ]
          },
          "additionalBreedName": {
            "type": [
              "null",
              "string"
            ]
          },
          "petGender": {
            "type": [
              "null",
              "string"
            ]
          },
          "petColorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryColor": {
            "type": [
              "null",
              "string"
            ]
          },
          "petSpayNeuter": {
            "type": [
              "null",
              "string"
            ]
          },
          "petWeight": {
            "type": [
              "null",
              "string"
            ]
          },
          "petDOB": {
            "type": [
              "null",
              "string"
            ]
          },
          "petRabiesTag": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionType": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "HomeAgainEnrollResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "results": {
            "type": [
              "null",
              "string"
            ]
          },
          "microchipNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "errorMessage": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "HoursGate": {
        "required": [
          "pass",
          "clinicDefaultsConfigured",
          "rooms",
          "upcomingClosures"
        ],
        "type": "object",
        "properties": {
          "pass": {
            "type": "boolean"
          },
          "clinicDefaultsConfigured": {
            "type": "boolean"
          },
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoomHoursInfo"
            }
          },
          "upcomingClosures": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "ImportHistoricalAppointmentRequest": {
        "required": [
          "clientId",
          "patientId",
          "reasonForVisit",
          "startTime",
          "endTime"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "patientId": {
            "type": "string",
            "description": "Patient under care. Historical import is patient-scoped only — group\n            visits are not supported (appointments_subject_chk keeps exactly one subject)."
          },
          "reasonForVisit": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ],
            "description": "Visit notes from record extraction. Lands on Appointment.Notes so it\n            surfaces in the patient's visit history."
          },
          "clinicalNarrative": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional SOAP narrative extracted for this visit (already provider-prefixed). When present,\nthe import creates an AI-generated SOAP note linked to the appointment so the narrative shows\nin the visit-history SOAP tab. Created here — in the same request/context as the appointment —\nrather than from the Orchestrate confirm flow, whose shared DbContext can carry a failed,\nstill-tracked entity that a later SaveChanges would re-attempt (PAWTHOSX-BACKEND-7M)."
          },
          "startTime": {
            "type": "string",
            "description": "Historical visit start (UTC). Must be in the past.",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "description": "Historical visit end (UTC). Must be after StartTime and in the past.",
            "format": "date-time"
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "Schedule item title. Defaults to ReasonForVisit when omitted."
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional appointment type. Group-visit types are rejected."
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "             Request to import a single historical (already-occurred) visit as a Completed\n             appointment (ITE-260, parent ITE-218 — AI patient record import).\n\n             Differences from CreateAppointmentRequest:\n             * Status lands as Completed, never Scheduled.\n* StartTime/EndTime must be in the past; overlapping imports are expected\n             (batch-importing years of history) so the schedule-conflict check is skipped.\n* No LocationId — the backing schedule item is created location-less, which\n             both exempts it from the schedule_items_no_location_overlap EXCLUDE constraint\n             and keeps it off room-scoped calendar views. Historical records rarely map to\n             a current exam room anyway.\n* The schedule item is stamped CreatedBySource = \"import\" for traceability."
      },
      "InlineLotPayload": {
        "required": [
          "lotNumber",
          "manufacturer",
          "expirationDate"
        ],
        "type": "object",
        "properties": {
          "lotNumber": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "expirationDate": {
            "type": "string",
            "format": "date-time"
          },
          "manufacturedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "InventoryApprovalDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "approvalType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InventoryItemSummaryDto"
              }
            ]
          },
          "requestData": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          },
          "approvedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "rejectionReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InventoryApprovalListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryApprovalDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "InventoryHealthDto": {
        "type": "object",
        "properties": {
          "stockLevelPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "targetPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "itemsBelowReorder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "itemsExpiringSoon": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "InventoryItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultSig": {
            "type": [
              "null",
              "string"
            ],
            "description": "Default prescription instructions (SIG) for rx-required items. See PAW-671."
          },
          "compoundFormula": {
            "type": [
              "null",
              "string"
            ],
            "description": "Compounding formula / preparation details for compounded items. See PAW-671."
          },
          "category": {
            "type": "string"
          },
          "vaccineTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VendorSummaryDto"
              }
            ]
          },
          "vendorItemNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "drugForm": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitOfMeasure": {
            "type": [
              "null",
              "string"
            ],
            "description": "Per-item dispensing-unit label override (e.g. \"dose\", \"applicator\").\nNull = derive the label from DrugForm (ITE-390)."
          },
          "strength": {
            "type": [
              "null",
              "string"
            ]
          },
          "ndc": {
            "type": [
              "null",
              "string"
            ]
          },
          "isCompounded": {
            "type": "boolean"
          },
          "rxRequired": {
            "type": "boolean"
          },
          "allowedSpeciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "vcprRequiredDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxDispenseQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "deaBookId": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaBook": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEABookSummaryDto"
              }
            ]
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ]
          },
          "controlledSubstanceSchedule": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "requiresWitness": {
            "type": "boolean",
            "description": "Server-computed: does dispensing this item require a witness on submit?\nMirrors the predicate in DispenseValidator so UI gating stays in lockstep\nwith backend validation."
          },
          "distributionCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "cascadeEligible": {
            "type": "boolean"
          },
          "isAntimicrobial": {
            "type": "boolean"
          },
          "antimicrobialType": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresUnderCare": {
            "type": "boolean"
          },
          "requiresPhysicalExam": {
            "type": "boolean"
          },
          "foodProducing": {
            "type": "boolean"
          },
          "requiresWithdrawalPeriod": {
            "type": "boolean"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "pricePolicy": {
            "type": "string"
          },
          "markupPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "mapPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitsPerContainer": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Dispensing units per container (e.g. 30 tablets per bottle). Display and\nconversion aid only — never enters price math.",
            "format": "double"
          },
          "sellingPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Indicative per-unit selling price derived from the price policy and the\nmost-recent lot cost (or catalog UnitCost). Lets the item-lookup dropdown\nshow a real price instead of $0 for cost-based or empty-UnitPrice items.\nThe amount actually charged is recomputed at dispense from the specific\nlot, so treat this as an estimate. Null when no price can be inferred.",
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackLots": {
            "type": "boolean"
          },
          "storageRequirements": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "parQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "reorderPoint": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalOnHand": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "activeLotCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "earliestExpiration": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InventoryItemListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryItemDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "InventoryItemSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": "string"
          },
          "trackLots": {
            "type": "boolean"
          },
          "totalOnHand": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "reorderPoint": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "InventoryLocationDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationType": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InventoryLocationListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryLocationDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "InventoryLotContainerDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "inventoryLotId": {
            "type": "string"
          },
          "containerCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryLocationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantityOnHand": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "status": {
            "type": "string"
          },
          "openedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "deaDestroyed": {
            "type": "boolean",
            "description": "True when this container has been destroyed in the DEA log (its controlled ledger is\nclosed). Such a container is read-only on the inventory side — any correction must be\nrecorded from the controlled-substances (DEA) log. Derived live from the ledger, not\nstored on the container row."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "A single physical container of a lot (bottle, vial, ...). A lot's quantity is the\nsum of its active containers; quantity, location, and DEA open/sealed status are\ntracked per container. See ITE-157."
      },
      "InventoryLotDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "inventoryItemId": {
            "type": "string"
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "manufacturedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "manufacturer": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantityOnHand": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "originalQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isActive": {
            "type": "boolean"
          },
          "receivedDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InventoryLotLocationDto": {
        "type": "object",
        "properties": {
          "inventoryLotId": {
            "type": "string"
          },
          "inventoryLocationId": {
            "type": "string"
          },
          "locationName": {
            "type": "string"
          },
          "locationCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "InventoryLotSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "InventorySettingsDto": {
        "type": "object",
        "properties": {
          "defaultItemMarkup": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "expiryTrackingEnabled": {
            "type": "boolean"
          },
          "parLevelMedications": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "parLevelVaccines": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "parLevelSupplies": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "parLevelFood": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "valuationMethod": {
            "type": "string"
          },
          "defaultVendor": {
            "type": [
              "null",
              "string"
            ]
          },
          "preferredShippingMethod": {
            "type": "string"
          },
          "vendorAccountId": {
            "type": [
              "null",
              "string"
            ]
          },
          "backorderSubstitutionsEnabled": {
            "type": "boolean"
          },
          "vetcoveEnabled": {
            "type": "boolean"
          },
          "vetcoveApiKeyArn": {
            "type": [
              "null",
              "string"
            ]
          },
          "covetrusEnabled": {
            "type": "boolean"
          },
          "covetrusApiKeyArn": {
            "type": [
              "null",
              "string"
            ]
          },
          "transmissionMethod": {
            "type": "string"
          },
          "defaultOnlinePharmacy": {
            "type": "string"
          },
          "clientPharmacyOverridesAllowed": {
            "type": "boolean"
          },
          "defaultDispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "autoAttachDispenseToInvoice": {
            "type": "boolean",
            "description": "When true, a dispense made outside an appointment context finds or creates a\ndraft estimate for the patient today and attaches the line item automatically,\nso dispenses never float unbilled. Existing tenants default to `false` via\nthe migration; new tenants opt in through the clinic settings UI."
          },
          "defaultDispenseUnit": {
            "type": "string"
          },
          "genericSubstitutionAllowed": {
            "type": "boolean"
          },
          "showDispenseFeesSeparately": {
            "type": "boolean"
          },
          "labelBranding": {
            "type": [
              "null",
              "string"
            ]
          },
          "multiLanguageLabelsEnabled": {
            "type": "boolean"
          },
          "autoLogDeaRegister": {
            "type": "boolean"
          },
          "mfaForControlledRx": {
            "type": "boolean"
          },
          "barcodeScanBeforeDispense": {
            "type": "boolean"
          },
          "refrigeratedMedSensors": {
            "type": "boolean"
          },
          "enforceVcprCheck": {
            "type": "boolean"
          },
          "vcprRequiredDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxDispenseQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "automatedCountsEnabled": {
            "type": "boolean"
          },
          "countFrequency": {
            "type": "string"
          },
          "salesVelocityReportEnabled": {
            "type": "boolean"
          }
        },
        "description": "Inventory and pharmacy settings"
      },
      "InventoryTransactionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "inventoryItemId": {
            "type": "string"
          },
          "inventoryItem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InventoryItemSummaryDto"
              }
            ]
          },
          "inventoryLotId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryLot": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InventoryLotSummaryDto"
              }
            ]
          },
          "transactionType": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "balanceAfter": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAPatientSummaryDto"
              }
            ]
          },
          "userId": {
            "type": "string"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "witnessUser": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaEntryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "warning": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "InviteUserRequest": {
        "required": [
          "email",
          "firstName",
          "lastName"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "firstName": {
            "maxLength": 100,
            "type": "string"
          },
          "lastName": {
            "maxLength": 100,
            "type": "string"
          },
          "displayName": {
            "maxLength": 200,
            "type": [
              "null",
              "string"
            ]
          },
          "roleId": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorshipDurationDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "deaNumber": {
            "maxLength": 50,
            "type": [
              "null",
              "string"
            ]
          },
          "licenseNumber": {
            "maxLength": 100,
            "type": [
              "null",
              "string"
            ]
          },
          "licenseState": {
            "maxLength": 2,
            "type": [
              "null",
              "string"
            ]
          },
          "usdaNumber": {
            "maxLength": 50,
            "type": [
              "null",
              "string"
            ]
          },
          "deaLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "stateLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "usdaLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "InvoiceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerMode": {
            "type": "string"
          },
          "invoiceProviderId": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceProvider": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "amountPaid": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Money the clinic is actually holding on this bill — `PaymentLedger.TotalPaid`\n(originals positive, refund rows negative). Zero for a bill refunded to net zero and\nfor one carrying only pending or failed attempts. This is what gates void / revert /\ndelete server-side; the UI reads it so it can't drift from the guard. Note that\n`Status` is a stored column and can disagree — this is the money truth.",
            "format": "double"
          },
          "hasUnresolvedPayment": {
            "type": "boolean",
            "description": "A payment here is still open: either an unconfirmed gateway outcome\n(`RequiresReview` — the card MAY have been charged) or a gateway-accepted debit\nthat hasn't settled yet (a Pending ACH with a TransactionId — money in flight). An\nunpaid Text2Pay link is NOT open; it holds nothing. Deliberately excluded from\ndecimal InvoiceDto.AmountPaid so it never inflates a balance, but it still blocks\nvoid / revert / delete until the settlement sweep or a human resolves it."
          },
          "hasSourceEstimate": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether an estimate row points at this invoice (Estimates.InvoiceId == Id), i.e. the\nbill was converted from an estimate and revert-to-estimate has somewhere to go. False\nfor a bill built directly in the Payments panel — revert would 409 NO_SOURCE_ESTIMATE,\nso the UI hides the control and leaves void as the exit. Null when the endpoint didn't\ncompute it (only fulfillment-mapped responses do, e.g. GET /invoices/{id}); treat null\nas unknown, never as \"no\"."
          },
          "subTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxableSubTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxMode": {
            "type": "string",
            "description": "\"us-sales-tax\" or \"vat\" — snapshot at estimate creation."
          },
          "discountTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "orderDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "ruleOrderDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Order-level discount produced by the price rule engine (separate from discount codes).",
            "format": "double"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "mergedIntoInvoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when this invoice was merged into a new combined invoice (it is then\nSuperseded): the id of the successor bill."
          },
          "mergedIntoInvoiceNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable number of the successor combined invoice this one was merged into\n(set only on a Superseded source). Lets the UI link forward without a second fetch."
          },
          "mergedFromInvoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MergedInvoiceRefDto"
            },
            "description": "The source invoices this combined bill was assembled from (empty for a normal\ninvoice). Drives the \"Combined from …\" provenance shown on the merged invoice."
          },
          "signatureData": {
            "type": [
              "null",
              "string"
            ]
          },
          "signedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "issuedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the bill was issued (Draft → Unpaid) and its totals frozen.\n            Null for Drafts and legacy invoices issued before the issue boundary.",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemDto"
            }
          },
          "appliedDiscounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppliedDiscountDto"
            }
          },
          "appliedPriceRules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppliedPriceRuleDto"
            },
            "description": "Audit records of price rules that produced discounts on this estimate."
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InvoiceLineItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RetailItemSummaryDto"
              }
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "billableItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Source BillableItem (\"Charge\") when this line was added from the charge catalog."
          },
          "billableItemName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Display name of the source BillableItem (snapshot, response-only)."
          },
          "isFulfilled": {
            "type": "boolean",
            "description": "True when a BillableItem charge line has been fulfilled — its inventory\ncomponents dispensed (derived from linked transactions, response-only)."
          },
          "inventoryTransactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": "string"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "appliedDiscountPolicyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appliedDiscountCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "ruleDiscount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Discount produced by the price rule engine (separate from the manual `Discount`).",
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lineTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "lineTaxAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "groupCodeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Kit this line came from, when emitted via GroupCode expansion."
          },
          "groupCodeName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Snapshot of the kit's display name at time of add."
          }
        }
      },
      "InvoiceListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceSummaryDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "InvoicePaymentSummaryDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalPaid": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "balanceDue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "What is still collectable on this bill. Always 0 for a terminal invoice (Void, or\nSuperseded by a payment-time merge): the write paths refuse those, so reporting a\nnon-zero figure advertises a payment that can only fail (ITE-326). The obligation\non a merged source lives on its successor — see bool InvoicePaymentSummaryDto.IsPayable.",
            "format": "double"
          },
          "isPayable": {
            "type": "boolean",
            "description": "False when the invoice's status refuses payment (Void / Superseded). Lets a client\ndistinguish \"nothing left to collect because it's paid\" from \"this bill can't take\nmoney at all\" — both of which read as `balanceDue == 0`."
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentSummaryDto"
            }
          }
        }
      },
      "InvoiceSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The invoice's patient, if any (null for client-only/POS bills)."
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "sourceEstimateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The estimate this invoice was converted from, or null for ad-hoc bills created\ndirectly (payments panel Invoices tab). The Estimates &amp; Invoices panels use it to\navoid double-listing bills already represented by their estimate row."
          },
          "mergedIntoInvoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "When this invoice was combined into another bill, the successor combined invoice's\nid (the invoice is then Superseded). Grouping key for the nested combined view."
          },
          "mergedIntoInvoiceNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-readable number of the combined (successor) invoice."
          },
          "mergedIntoInvoiceStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "Status of the combined (successor) invoice."
          },
          "orderDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Order-level discount-code amount on this invoice (0 when none). Surfaced on the\nsummary so the Combine Invoices modal can warn that a source carries one and offer\nto carry it onto the merged bill. Excludes rule-engine order discounts.",
            "format": "double"
          },
          "itemCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IssueVaccineCertificateRequest": {
        "required": [
          "vaccinationRecordId"
        ],
        "type": "object",
        "properties": {
          "vaccinationRecordId": {
            "type": "string"
          },
          "rabiesTagId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional assigned rabies tag id (rabies-tag domain lands later)."
          },
          "rabiesTagNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional human-readable rabies tag number to freeze onto the certificate."
          },
          "certifyingUserId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The veterinarian certifying this certificate — chosen by the user at issuance (the\nadministering staff member may be a tech/RVT and must not appear as the certifying DVM).\nWhen absent, issuance falls back to the record's administering user."
          }
        },
        "description": "Request to issue (write) a vaccine certificate record for a vaccination event.\nThe snapshot is built server-side from current data — callers never supply printed values."
      },
      "JourneyMilestoneResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "appointmentId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/MilestoneStatus"
          },
          "type": {
            "$ref": "#/components/schemas/MilestoneType"
          },
          "startedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceTemplateId": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimatedDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "actualDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Response DTO for journey milestone"
      },
      "JourneyMilestoneTemplateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "appointmentTypeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/MilestoneType"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimatedDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "KioskClockRequestDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "pin": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request DTO for kiosk clock in/out"
      },
      "KioskUserDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "hasPin": {
            "type": "boolean"
          },
          "currentStatus": {
            "type": "string"
          }
        },
        "description": "Response DTO for kiosk user lookup"
      },
      "KPIMetricDto": {
        "type": "object",
        "properties": {
          "today": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "mtd": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "change": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "KPISummaryDto": {
        "type": "object",
        "properties": {
          "revenue": {
            "$ref": "#/components/schemas/KPIMetricDto"
          },
          "patients": {
            "$ref": "#/components/schemas/KPIMetricDto"
          },
          "avgTransaction": {
            "$ref": "#/components/schemas/KPIMetricDto"
          }
        }
      },
      "LabNoteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "labOrderId": {
            "type": "string"
          },
          "authorId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Null for a system-generated note, which has no human author (ITE-550)."
          },
          "authorName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Always populated — \"System\" when there is no author. Never blank."
          },
          "content": {
            "type": "string"
          },
          "isSystemGenerated": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LaborBreakdownChartDto": {
        "type": "object",
        "properties": {
          "weeks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LaborWeekDto"
            }
          }
        }
      },
      "LaborBreakdownDto": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string"
          },
          "hours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "cost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "revenueGenerated": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "efficiency": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "LabOrderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LabPatientSummaryDto"
              }
            ]
          },
          "orderedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "orderedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LabUserSummaryDto"
              }
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": "string"
          },
          "testType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "resultStatus": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "externalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "performingLabName": {
            "type": [
              "null",
              "string"
            ],
            "description": "The laboratory behind the Greywind hub that actually ran this, and its id (ITE-552).\nNull when the order did not come through Greywind, or when the partner directory had not\nbeen mirrored when the result landed — the sync backfills the name in that case."
          },
          "externalPartnerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "submissionUnconfirmedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when the submission's outcome was never confirmed with the laboratory (ITE-494) — the\norder may or may not be live there, and it must never be resubmitted on a guess.",
            "format": "date-time"
          },
          "submissionIssue": {
            "type": [
              "null",
              "string"
            ]
          },
          "sampleArrivedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the laboratory confirmed the sample arrived (ITE-494). Null if they have not.",
            "format": "date-time"
          },
          "accessionNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "collectedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "resultsReceivedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "reviewedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "reviewedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LabUserSummaryDto"
              }
            ]
          },
          "reviewedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "summary": {
            "type": [
              "null",
              "string"
            ]
          },
          "reportUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "type": "string"
          },
          "labPanelId": {
            "type": [
              "null",
              "string"
            ]
          },
          "submissionGroupId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Groups sibling orders created by one external submission (ITE-493). Null for manual orders."
          },
          "manifestFileId": {
            "type": [
              "null",
              "string"
            ],
            "description": "PatientFile id of the stored requisition manifest, when the order went to an external lab."
          },
          "requiresPartnerAction": {
            "type": "boolean",
            "description": "True while the order still needs partner-hosted pages completed before it is really placed."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabResultDto"
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabNoteDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LabOrderListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabOrderDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LaborEfficiencyDto": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "revenuePerLaborHour": {
            "$ref": "#/components/schemas/RevenuePerHourDto"
          },
          "laborBreakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LaborBreakdownDto"
            }
          },
          "totalLaborHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalLaborCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "laborCostPercentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "trend": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LaborTrendPointDto"
            }
          }
        }
      },
      "LaborTrendPointDto": {
        "type": "object",
        "properties": {
          "week": {
            "type": "string"
          },
          "revenuePerHour": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "LaborWeekDto": {
        "type": "object",
        "properties": {
          "week": {
            "type": "string"
          },
          "admin": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "tech": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "dvm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "costPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "LabPanelDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "testType": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "tests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabPanelTestDto"
            }
          }
        }
      },
      "LabPanelListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabPanelDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LabPanelTestDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "labPanelId": {
            "type": "string"
          },
          "testName": {
            "type": "string"
          },
          "testCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceRange": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "referenceHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LabPatientSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LabQueue": {
        "type": "integer",
        "description": "             The lab work queues, as a thing the <b>server</b> can select (ITE-638).\n\n             These four already existed — as client-side slices of every lab order in the tenant. The\nUserhub panel fetched `GET /labs` unfiltered and unpaged so all four rails could share one\ncache entry, then narrowed in the browser. That scales with a clinic's entire lab history\nrather than with the size of the queue, which is why one 200-order import made the screen slow\nenough that Courtney kept it open in a second window.The tasks queries hit this first and solved it the same way — lifecycle: \"open\" and\nunassignedOnly exist so the server does the narrowing. This is the lab equivalent."
      },
      "LabQueueCountsDto": {
        "type": "object",
        "properties": {
          "review": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "flagged": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "flaggedCritical": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many of int LabQueueCountsDto.Flagged are Critical. The flagged badge turns red on this —\nasking the flagged <i>page</i> \"is anything critical\" misses a critical older than a\npage of newer abnormals, and a badge that stays amber over a live critical is the queue\nhiding the one thing it exists to surface.",
            "format": "int32"
          },
          "awaitingResults": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "reviewed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "How many orders each queue holds. One round trip, no rows."
      },
      "LabResultAmendmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "originalReferenceLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "originalReferenceHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "originalReferenceRange": {
            "type": [
              "null",
              "string"
            ]
          },
          "amendedReferenceLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "amendedReferenceHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "amendedReferenceRange": {
            "type": [
              "null",
              "string"
            ]
          },
          "originalFlag": {
            "type": [
              "null",
              "string"
            ],
            "description": "Flag name before the correction, or null when none was ever asserted."
          },
          "amendedFlag": {
            "type": [
              "null",
              "string"
            ],
            "description": "Flag name after re-derivation, or null when the corrected interval implies none."
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "amendedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "amendedByName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Always populated — \"System\" when there is no human author, so the trail cannot render as a\nblank that reads like a missing record."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "One correction of a result's reference interval, and the flag it moved (ITE-499)."
      },
      "LabResultDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "labOrderId": {
            "type": "string"
          },
          "testName": {
            "type": "string"
          },
          "testCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "value": {
            "type": "string"
          },
          "numericValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceRange": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "referenceHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "flag": {
            "type": [
              "null",
              "string"
            ],
            "description": "The flag name, or null when none was reported and none could be derived (ITE-548). Clients\nmust render null as its own state — not as a badge in either direction."
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "comment": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "supersededAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "             Set when a later report replaced this value (ITE-492). Null means this is the value that\n             currently stands.\n\n             Superseded rows are returned rather than filtered out on purpose: a clinician who acted on\nthe original needs to see that it changed, not just the new number appearing as if it had\nalways been there.",
            "format": "date-time"
          },
          "supersededByResultId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The result that replaced this one, when superseded."
          },
          "referenceIntervalAmendedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "             Set when a clinician corrected this result's reference interval (ITE-499). Null means the\n             interval is still exactly what the laboratory or analyzer sent.\n\n             Clients must surface this. A value flagged against a corrected interval is a different\nclinical claim from one flagged against the lab's own, and a reader who cannot tell the two\napart cannot judge how much to trust the flag.",
            "format": "date-time"
          },
          "amendments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabResultAmendmentDto"
            },
            "description": "The correction trail, oldest first. Empty for the overwhelming majority of results."
          }
        }
      },
      "LabStatsDto": {
        "type": "object",
        "properties": {
          "pendingCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inProgressCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pendingReviewCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "criticalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "completedTodayCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LabUserSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LineRuleDiscountDto": {
        "type": "object",
        "properties": {
          "localId": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "LinkAppointmentRequest": {
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": "string"
          }
        },
        "description": "Link a pre-existing open estimate to an appointment (chronicle Services tab)."
      },
      "LitterDetailsDto": {
        "type": "object",
        "properties": {
          "damPatientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "damPatientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "damText": {
            "type": [
              "null",
              "string"
            ]
          },
          "sireText": {
            "type": [
              "null",
              "string"
            ]
          },
          "whelpDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "litterSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LocationClosureListResponseDto": {
        "type": "object",
        "properties": {
          "closures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationClosureResponseDto"
            }
          }
        },
        "description": "Response DTO for a list of location closures."
      },
      "LocationClosureResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "closureDate": {
            "type": "string"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Response DTO for a location closure."
      },
      "LocationHoursEntryDto": {
        "type": "object",
        "properties": {
          "dayOfWeek": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "openTime": {
            "type": "string"
          },
          "closeTime": {
            "type": "string"
          },
          "isOpen": {
            "type": "boolean"
          }
        }
      },
      "LocationHoursResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "dayOfWeek": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "openTime": {
            "type": "string"
          },
          "closeTime": {
            "type": "string"
          },
          "isOpen": {
            "type": "boolean"
          }
        }
      },
      "LocationListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LocationResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "isVehicle": {
            "type": "boolean"
          },
          "isPersonalVehicle": {
            "type": "boolean"
          },
          "allowOnlineBooking": {
            "type": "boolean"
          },
          "allowOverbooking": {
            "type": "boolean"
          },
          "allowedSpeciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Species IDs allowed at this location. If empty/null, all species are allowed."
          }
        }
      },
      "LocationsGate": {
        "required": [
          "pass",
          "totalCount",
          "stages",
          "survivingRooms"
        ],
        "type": "object",
        "properties": {
          "pass": {
            "type": "boolean"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StageCount"
            }
          },
          "survivingRooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReadinessRoomInfo"
            }
          }
        }
      },
      "LocationSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "isVehicle": {
            "type": "boolean"
          },
          "isPersonalVehicle": {
            "type": "boolean"
          }
        }
      },
      "LogoListResponseDto": {
        "type": "object",
        "properties": {
          "logos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogoResponseDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Response containing a list of logos"
      },
      "LogoResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "fileSizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "isDefault": {
            "type": "boolean"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "type": "string",
            "description": "Presigned URL for accessing the logo (expires after ~60 minutes)"
          },
          "uploadedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Response DTO for a logo from the library"
      },
      "LunchEndRequestDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request DTO for lunch end"
      },
      "LunchStartRequestDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request DTO for lunch start"
      },
      "MangoCredentialsStatusDto": {
        "type": "object",
        "properties": {
          "isConfigured": {
            "type": "boolean"
          },
          "hasUserApiCredentials": {
            "type": "boolean"
          }
        }
      },
      "MangoVoiceCredentialsDto": {
        "type": "object",
        "properties": {
          "ident1": {
            "type": [
              "null",
              "string"
            ]
          },
          "ident2": {
            "type": [
              "null",
              "string"
            ]
          },
          "ident3": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Mango Voice API credentials. The API key from Mango is a single string\nwith three parts separated by \"/\" - split before sending."
      },
      "MarginValuesDto": {
        "type": "object",
        "properties": {
          "current": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "previous": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "change": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "changeDirection": {
            "type": "string"
          }
        }
      },
      "MarkDeceasedRequest": {
        "required": [
          "deceasedDate"
        ],
        "type": "object",
        "properties": {
          "deceasedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "MedicationRequestDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "medicationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "freeTextMedication": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestedQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": "string"
          },
          "isOtc": {
            "type": "boolean"
          },
          "fulfillmentMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "billingState": {
            "type": "string",
            "description": "Derived: none | quoted | quote_removed | unbilled | invoiced | paid.\n\"unbilled\" is the \"Ready to bill\" worklist predicate."
          },
          "requestedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "approvedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "approvedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "approvedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "deniedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "deniedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "denialReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "cancelledById": {
            "type": [
              "null",
              "string"
            ]
          },
          "cancelledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "cancelReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "dispensedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "prescriptionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "prescriptionItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimateId": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimateLineItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "renewalOfPrescriptionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "renewalContext": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Populated when this is a renewal request — the approve dialog's context:\nthe prior Rx's refill counters and whether \"use a refill\" is available.",
                "$ref": "#/components/schemas/MedicationRequestRenewalContextDto"
              }
            ]
          },
          "suggestedProviderId": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedDosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedFrequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedDuration": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedInstructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "suggestedRefillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "A medication request with its links and DERIVED billing state\n(design §5.4 — never stored, always computed from the link chain)."
      },
      "MedicationRequestRenewalContextDto": {
        "type": "object",
        "properties": {
          "medicationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "prescriptionStatus": {
            "type": "string"
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "refillsUsed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "refillsRemaining": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastDispensedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "refillEligible": {
            "type": "boolean",
            "description": "True when \"use a refill\" may be chosen at approval."
          },
          "refillBlockedReason": {
            "type": [
              "null",
              "string"
            ],
            "description": "rx_not_active | schedule_ii | refills_exhausted | rx_expired."
          }
        },
        "description": "Prior-prescription context for a renewal request (design §7): what the doctor\nsees on the approve screen, with server-evaluated refill eligibility."
      },
      "MedicationRequestResultDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "prescriptionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "invoiceLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Populated when the request supplied string? CreateMedicationRequestDto.InvoiceId\nand an estimate line item was created in the same call."
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The estimate the dispense was attached to — either the one the caller supplied\nor one auto-created/resolved server-side. Lets a client that had no estimate of\nits own adopt the server's estimate instead of failing to reconcile the line."
          },
          "estimateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The estimate the request's billable line was placed on at creation (in-house / same-day\nrequests). Null for external (non-billable) requests."
          },
          "estimateLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The Pending estimate line created for this request at creation, if any."
          },
          "medicationRequestId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The lifecycle MedicationRequest recorded for this operation. The compound\nendpoint applies capture → approve → dispense as far as the caller's\npermissions allow; string? MedicationRequestResultDto.RequestStatus says where it stopped."
          },
          "requestStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "Lifecycle status after this call: requested | approved | dispensed."
          }
        }
      },
      "MemberExceptionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "soapNoteId": {
            "type": "string"
          },
          "patientGroupMemberId": {
            "type": "string"
          },
          "memberDisplayName": {
            "type": "string"
          },
          "exceptionNote": {
            "type": "string"
          },
          "differentTreatment": {
            "type": "boolean"
          },
          "followUpNeeded": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MenteePerformanceDto": {
        "type": "object",
        "properties": {
          "menteeId": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "periodStart": {
            "type": "string",
            "format": "date-time"
          },
          "periodEnd": {
            "type": "string",
            "format": "date-time"
          },
          "avgNpsScore": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Average NPS score (0-10) over the period. Null when no responses landed.",
            "format": "double"
          },
          "npsResponseCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "soapNotesCompleted": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "SOAP notes the mentee authored that are in Completed status.",
            "format": "int32"
          },
          "soapNotesApproved": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Subset of completed that the mentee approved (vs. left in review).",
            "format": "int32"
          },
          "avgInvoiceValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Average invoice value across Paid/Invoiced estimates attributed to the mentee.",
            "format": "double"
          },
          "invoiceCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalRevenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "MenteeSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorshipStartDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "mentorshipDurationDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "mentorshipEndDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "StartDate + DurationDays. Null if either is unset.",
            "format": "date-time"
          },
          "daysRemaining": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Days between today and MentorshipEndDate. Negative if expired. Null if no end date.",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean",
            "description": "Today is between start and end (inclusive of start, exclusive of end)."
          }
        }
      },
      "MentorListEntryDto": {
        "type": "object",
        "properties": {
          "mentorId": {
            "type": "string"
          },
          "mentorName": {
            "type": "string"
          },
          "activeMenteeCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalMenteeCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "MentorSummaryDto": {
        "type": "object",
        "properties": {
          "mentorId": {
            "type": "string"
          },
          "mentorName": {
            "type": "string"
          },
          "mentees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MenteeSummaryDto"
            }
          }
        }
      },
      "MentorTimelineEntryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "$ref": "#/components/schemas/MentorTimelineKind"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "menteeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The mentee the event is about, when applicable."
          },
          "menteeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "soapNoteId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The SOAP note the event is about, when applicable."
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MentorTimelineKind": {
        "type": "integer"
      },
      "MergedInvoiceRefDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Lightweight reference to a source/successor invoice in a merge relationship."
      },
      "MergeInvoicesRequestDto": {
        "type": "object",
        "properties": {
          "invoiceIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "carryOrderDiscountFromInvoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional: the id of one of the merged source invoices whose order-level discount\ncode should be carried onto the combined bill (recalculated against the merged\nsubtotal). Null carries no order-level discount forward. Only one is supported —\nprecise per-source distribution across lines is a follow-up."
          }
        },
        "description": "Request body for POST /invoices/merge — payment-time combination of two or\nmore open, unpaid invoices belonging to the same client into one new invoice."
      },
      "MergeReminderRequest": {
        "type": "object",
        "properties": {
          "duplicateReminderId": {
            "type": "string",
            "description": "The duplicate to fold into this reminder; it is removed with Merged history on both sides."
          }
        }
      },
      "MetricsSettingsDto": {
        "type": "object",
        "properties": {
          "compensationThresholdPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Comp-percent threshold above which a provider's status flips to \"warning\".\nDefault 35. Per-vet override available on `VeterinarianCompensation`.",
            "format": "double"
          }
        },
        "description": "Tunable thresholds for the BI / DVM Production reports. Currently exposes the\n\"high compensation\" warning trigger; additional thresholds (low rev/hr, leakage)\nwill hang here as they get pulled out of hardcoded service code."
      },
      "MilestoneStatus": {
        "type": "integer"
      },
      "MilestoneType": {
        "type": "integer"
      },
      "MilestoneUpdate": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MilestoneStatus"
              }
            ]
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        },
        "description": "Individual milestone update within a bulk update operation"
      },
      "NextAvailableTagDto": {
        "type": "object",
        "properties": {
          "rabiesTagBatchId": {
            "type": [
              "null",
              "string"
            ]
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "tagNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "exhausted": {
            "type": "boolean"
          }
        },
        "description": "The suggested next available tag for a batch, or a flag that the pool is exhausted."
      },
      "NextDoseSuggestionDto": {
        "type": "object",
        "properties": {
          "vaccineTypeId": {
            "type": "string"
          },
          "hasSchedule": {
            "type": "boolean",
            "description": "False when the type has no explicit schedule and isn't rabies — plain single-duration behavior."
          },
          "stageSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "1-based stage this dose resolves to (1 = first dose or series restart).",
            "format": "int32"
          },
          "stageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stageLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "isSeriesRestart": {
            "type": "boolean",
            "description": "True when prior doses exist but lapsed beyond the grace window, so the series restarts."
          },
          "isSeriesComplete": {
            "type": "boolean",
            "description": "True when this dose is the last of a non-repeating schedule: nothing further is due, so\nthere is no suggested interval, duration, or next-due date (and no reminders)."
          },
          "isRabies": {
            "type": "boolean"
          },
          "suggestedIntervalDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Next dose due this many days after administration (series), else null.",
            "format": "int32"
          },
          "suggestedIntervalMaxDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Upper bound of the recommended window (display only).",
            "format": "int32"
          },
          "suggestedDurationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Validity this dose confers in months (expiry-driven), else null.",
            "format": "int32"
          },
          "labeledDurationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The product's labeled (maximum) duration in months.",
            "format": "int32"
          },
          "durationOptionsMonths": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "Distinct certifiable durations for the override UI (e.g. [12, 36] for rabies)."
          },
          "suggestedNextDueDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Server-computed next-due date from the given administration date (the FE default).\nNull when bool NextDoseSuggestionDto.IsSeriesComplete — nothing further is due.",
            "format": "date-time"
          }
        },
        "description": "Point-of-care suggestion for the dose being administered: which schedule stage it is, and when\nthe NEXT dose is due. Exactly one of int? NextDoseSuggestionDto.SuggestedIntervalDays (series dose coming up,\ne.g. \"lepto dose 2 in 21 days\") or int? NextDoseSuggestionDto.SuggestedDurationMonths (expiry-driven booster)\nis set — or neither, when bool NextDoseSuggestionDto.IsSeriesComplete says this dose ends the course.\nGeneralizes the rabies 1-vs-3-year rule (ITE-162) to any vaccine schedule."
      },
      "NormalizedMetricDto": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "rawMetric": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "staffHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "efficiency": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "NormalizedPerformanceDto": {
        "type": "object",
        "properties": {
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NormalizedMetricDto"
            }
          }
        }
      },
      "NoShowAppointmentRequest": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request body for marking appointment as no-show"
      },
      "NpsCategory": {
        "type": "integer"
      },
      "NpsInsightsDto": {
        "type": "object",
        "properties": {
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "promoters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "neutrals": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detractors": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "npsScore": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "projectedRetentionPct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unresolvedRiskUsd": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "trend": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NpsTrendPoint"
            }
          },
          "topPositiveThemes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "topFrictionThemes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "description": "Aggregate insights for the BI dashboard widget header + analytics tabs."
      },
      "NpsPublicSurveyDto": {
        "type": "object",
        "properties": {
          "clinicName": {
            "type": "string"
          },
          "clientFirstName": {
            "type": "string"
          },
          "petName": {
            "type": "string"
          },
          "alreadySubmitted": {
            "type": "boolean",
            "description": "True once the survey has been submitted; the page should show a thank-you state."
          }
        },
        "description": "Payload returned to the public NPS survey page (no auth, token-validated)."
      },
      "NpsResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "appointmentId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "petName": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/NpsResponseStatus"
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "category": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NpsCategory"
              }
            ]
          },
          "comment": {
            "type": [
              "null",
              "string"
            ]
          },
          "canContact": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "aiTag": {
            "type": [
              "null",
              "string"
            ]
          },
          "internalNote": {
            "type": [
              "null",
              "string"
            ]
          },
          "resolved": {
            "type": "boolean"
          },
          "resolvedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          },
          "respondedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "t12mSpend": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Trailing-twelve-month spend for the client (for the Action Queue's revenue-at-risk view).",
            "format": "double"
          }
        },
        "description": "Per-response DTO for the BI inbox / action queue."
      },
      "NpsResponseStatus": {
        "type": "integer",
        "description": "Lifecycle status of an NPS survey response."
      },
      "NpsSubmitDto": {
        "type": "object",
        "properties": {
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "0-10 NPS score.",
            "format": "int32"
          },
          "comment": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional free-text comment (passive/detractor branches)."
          },
          "canContact": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Detractor branch: did the client agree to be contacted?"
          }
        },
        "description": "Submission body POSTed by the public NPS survey page."
      },
      "NpsSubmitResultDto": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "googleReviewUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Response from the public NPS submit endpoint. When score &gt;= 9 and a Place ID is configured,\nGoogleReviewUrl is populated so the form can redirect the promoter to leave a review."
      },
      "NpsTrendPoint": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "nps": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "One point on the NPS trend chart."
      },
      "NudgeClientDto": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string"
          },
          "template": {
            "type": [
              "null",
              "string"
            ]
          },
          "customMessage": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OrphanedFirebaseAccount": {
        "required": [
          "uid",
          "email",
          "kind",
          "disabled",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "uid": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/OrphanKind"
          },
          "disabled": {
            "type": "boolean"
          },
          "createdAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        },
        "description": "A Firebase account with no active user row. This is the class that blocks re-invites."
      },
      "OrphanKind": {
        "type": "integer",
        "description": "Why a Firebase account has no active user row. The distinction matters for triage:\na soft-deleted row explains the account (a delete whose Firebase half failed), while\nno row at all means we cannot say where it came from."
      },
      "OutsideMedicationDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "medicationName": {
            "type": "string"
          },
          "quantity": {
            "type": [
              "null",
              "string"
            ]
          },
          "sig": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string",
            "description": "One of: Requested, Filled, Cancelled, Sending, Sent, Failed (the last three are eRx-only)."
          },
          "requestedDate": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "filledAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When staff confirmed the pharmacy filled it. Set/cleared by the status endpoint.",
            "format": "date-time"
          },
          "filledByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "erx": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Present only for clinic-transmitted (eRx) records; null for client-reported ones.",
                "$ref": "#/components/schemas/OutsideMedicationErxDto"
              }
            ]
          }
        },
        "description": "Patient-facing view of an out-of-band external medication request (tracking only —\nno inventory or Rx governance involvement)."
      },
      "OutsideMedicationErxDto": {
        "type": "object",
        "properties": {
          "vendor": {
            "type": "string"
          },
          "providerUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "ndcCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantityUomCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "daysSupply": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "refills": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pharmacyDirectoryId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pharmacySnapshot": {
            "type": [
              "null",
              "string"
            ],
            "description": "Raw pharmacy snapshot JSON captured at send time (name/address/ncpdp/npi)."
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "sentAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "result": {
            "type": [
              "null",
              "string"
            ],
            "description": "Webhook result JSON (response + normalized status). Never the NCPDP xml."
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          },
          "medicationRequestId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Read-side e-prescribing detail for an OutsideMedication row (design §3)."
      },
      "OutstandingInvoiceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalPaid": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Completed (incl. partially/fully refunded) payments recorded against the bill.",
            "format": "double"
          },
          "balance": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "One row of the clinic-wide open-invoice (AR) list: an invoice still awaiting money\n(Draft, Unpaid, or PartiallyPaid) with who owes it and how much is left."
      },
      "OverrideChecklistItemRequest": {
        "type": "object",
        "properties": {
          "itemKey": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "description": "Request to override a single required checklist item."
      },
      "PartnerDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "clinicName": {
            "type": "string"
          },
          "contactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "specialties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "ISO 3166-1 alpha-2 country code (e.g. \"US\", \"GB\"). Defaults to clinic's region if null."
          },
          "isActive": {
            "type": "boolean"
          },
          "canViewRecords": {
            "type": "boolean"
          },
          "canSendRecords": {
            "type": "boolean"
          },
          "canScheduleReferrals": {
            "type": "boolean"
          },
          "canMessage": {
            "type": "boolean"
          },
          "canViewBilling": {
            "type": "boolean"
          },
          "canExportData": {
            "type": "boolean"
          },
          "totalCases": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "averageTurnaroundDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PartnerListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PartnerSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "clinicName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "PatientActivityResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "activityType": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "relatedEntityType": {
            "type": [
              "null",
              "string"
            ]
          },
          "relatedEntityId": {
            "type": [
              "null",
              "string"
            ]
          },
          "performedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isSystemGenerated": {
            "type": "boolean"
          },
          "activityDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PatientActivityTimelineDto": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "activities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientActivityResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PatientContactDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "client": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClientSummaryDto"
              }
            ]
          },
          "relationshipType": {
            "$ref": "#/components/schemas/ContactRelationshipType"
          },
          "isPrimary": {
            "type": "boolean"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The set permission flags by name (e.g. `\"ApproveTreatment\"`). Exposed as a list\nrather than the raw ContactPermissions bitmask so clients can check\nindividual permissions without bit math."
          },
          "verificationMethod": {
            "$ref": "#/components/schemas/ContactVerificationMethod"
          },
          "verifiedByUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "verifiedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "verificationNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "A contact (person, backed by a `Client`) related to a specific patient, with a\nrelationship type and per-patient authorization. Part of the patient↔client relationship\nlayer (PAW-626). Read-only in Phase 1 — nothing writes these through the API yet."
      },
      "PatientFunnelDto": {
        "type": "object",
        "properties": {
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FunnelStageDto"
            }
          }
        }
      },
      "PatientGroupDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupType": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "speciesId": {
            "type": "string"
          },
          "speciesName": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "headCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "litterDetails": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LitterDetailsDto"
              }
            ]
          },
          "herdDetails": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/HerdDetailsDto"
              }
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientGroupMemberDto"
            }
          }
        }
      },
      "PatientGroupListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientGroupSummaryDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PatientGroupMemberDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "tagOrIdentifier": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "sex": {
            "type": [
              "null",
              "string"
            ]
          },
          "colorMarkings": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isException": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "PatientGroupSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupType": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "speciesId": {
            "type": "string"
          },
          "speciesName": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "headCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "memberCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PatientGroupSummaryForScheduleDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "groupType": {
            "type": "string",
            "description": "\"Litter\" or \"Herd\"."
          },
          "speciesName": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Lightweight group summary for embedding in schedule item responses when\nthe appointment is group-bound (litter / herd visit)."
      },
      "PatientListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PatientMassMeasurementDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "measuredAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PatientMassResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "number": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "x": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "y": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "view": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "zone": {
            "type": "string"
          },
          "firstObserved": {
            "type": "string",
            "format": "date-time"
          },
          "shape": {
            "type": "string"
          },
          "mobility": {
            "type": "string"
          },
          "consistency": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "measurements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientMassMeasurementDto"
            }
          }
        }
      },
      "PatientMedicationDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Where the medication came from, NOT its legal drug class: `\"prescription\"`\n            for a take-home script, `\"otc\"` for a dose administered in-house outside a script\n            (`DispenseType.InHouse` with no `PrescriptionItemId`). A controlled or\n            Rx-required drug given during a visit lands in the `\"otc\"` bucket and that is\n            correct — read bool PatientMedicationDto.RxRequired and int? PatientMedicationDto.ControlledSubstanceSchedule\n            for drug class (ITE-627)."
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The dispensable inventory item — lets the \"request refill\" affordance capture without a search."
          },
          "medicationName": {
            "type": "string"
          },
          "strength": {
            "type": [
              "null",
              "string"
            ]
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ],
            "description": "The prescriber's written directions (the SIG). When populated it is the whole\n            instruction and supersedes the structured Dosage/Frequency/Duration fields — the same\n            precedence the printed label uses (`RxLabelVariableBuilder.BuildSig`), so the chart\n            and the label can't disagree about how the drug was prescribed."
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "refillsRemaining": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "prescribedDate": {
            "type": "string",
            "format": "date-time"
          },
          "prescribedBy": {
            "type": "string"
          },
          "lastFilledDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "fulfillmentMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The estimate (treatment plan) this request's billable line sits on, if any.\n            Null for external-pharmacy scripts and other non-billable requests."
          },
          "estimateNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human-facing number of the linked estimate (e.g. \"EST-1042\")."
          },
          "estimateStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "Status of the linked estimate (Draft/Presented/Accepted/Declined)."
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The invoice the linked estimate was converted into, if any. Non-null = already invoiced."
          },
          "rxRequired": {
            "type": "boolean",
            "description": "Drug class from the inventory item: does dispensing it require a prescription?\n            Orthogonal to string PatientMedicationDto.Type — an Rx-required drug is routinely administered in-house.\n            False when the medication has no linked inventory item (external scripts)."
          },
          "controlledSubstanceSchedule": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Unified numeric controlled-substance schedule (1–5), null when not controlled.\n            This is the region-agnostic field — populated for both US and UK — unlike the legacy\n            Roman-numeral `DeaSchedule`, which is null on UK items.",
            "format": "int32"
          },
          "distributionCategory": {
            "type": [
              "null",
              "string"
            ],
            "description": "UK Veterinary Medicines Regulations distribution category (\"POM_V\", \"POM_VPS\",\n            \"NFA_VPS\", \"AVM_GSL\"); null on US medications. Carried for en-GB, where it — not\n            bool PatientMedicationDto.RxRequired — is the meaningful Rx/OTC distinction."
          }
        }
      },
      "PatientMedicationsResponseDto": {
        "type": "object",
        "properties": {
          "prescriptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientMedicationDto"
            }
          },
          "otcDispenses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientMedicationDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PatientProblemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "diagnosisTermId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Soft reference to reference_data.diagnosis_terms; null for free-text problems."
          },
          "name": {
            "type": "string",
            "description": "Snapshotted display name (coded term name at time of selection, or free text)."
          },
          "bodySystem": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "confidence": {
            "type": "string"
          },
          "chronicity": {
            "type": [
              "null",
              "string"
            ]
          },
          "severity": {
            "type": [
              "null",
              "string"
            ]
          },
          "onsetDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "resolvedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceSoapNoteId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PatientRecordDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PatientRecordExportOptions": {
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional appointment ID to filter export to a specific visit.\nWhen null, exports the full patient record across all appointments."
          },
          "includeMedicalHistory": {
            "type": "boolean",
            "description": "Include medical history and warnings section"
          },
          "includeSoapNotes": {
            "type": "boolean",
            "description": "Include SOAP notes section"
          },
          "includeMedications": {
            "type": "boolean",
            "description": "Include medications section"
          },
          "includeRdvmRecords": {
            "type": "boolean",
            "description": "Include RDVM records/referrals"
          },
          "includeTransactionHistory": {
            "type": "boolean",
            "description": "Include transaction/payment history"
          },
          "includeDischargeRecords": {
            "type": "boolean",
            "description": "Include discharge records"
          },
          "includeLabResults": {
            "type": "boolean",
            "description": "Include lab results with original PDFs"
          },
          "includeVaccinations": {
            "type": "boolean",
            "description": "Include vaccination history"
          },
          "includeReminders": {
            "type": "boolean",
            "description": "Include reminders (full-record exports only)"
          }
        },
        "description": "Options controlling which sections to include in the patient record export"
      },
      "PatientResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique patient identifier"
          },
          "name": {
            "type": "string",
            "description": "The patient's name"
          },
          "species": {
            "type": "string",
            "description": "The species name. References a species from GET /species endpoint.",
            "example": "Dog"
          },
          "speciesId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The species ID for programmatic lookups (e.g., location species restrictions)."
          },
          "breed": {
            "type": "string",
            "description": "The breed name",
            "example": "Golden Retriever"
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isEstimatedAge": {
            "type": "boolean"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "microchipNo": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": "string"
          },
          "client": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClientSummaryDto"
              }
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "fixed": {
            "type": "boolean"
          },
          "sex": {
            "$ref": "#/components/schemas/Sex"
          },
          "vaccinationStatus": {
            "$ref": "#/components/schemas/VaccinationStatus"
          },
          "lastVaccinationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "previousVet": {
            "type": [
              "null",
              "string"
            ]
          },
          "previousVetPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagAssignmentDto"
            },
            "description": "Smart Tag assignments on this patient. Populated on list responses so the UI can\nsurface tags (incl. severity-bearing alert tags) per row without an N+1 fetch; the\nsingle-patient detail page fetches tags directly via the tag-assignments endpoint."
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientContactDto"
            },
            "description": "Contacts (people) related to this patient with their relationship type and per-patient\npermissions. Populated on the single-patient read (GET /patients/{id}); empty on list\nresponses. The primary owner is also reflected in string PatientResponseDto.ClientId / ClientSummaryDto? PatientResponseDto.Client."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastVisitDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "hasActiveAppointments": {
            "type": "boolean"
          },
          "isDeceased": {
            "type": "boolean",
            "description": "Whether the patient is deceased"
          },
          "deceasedDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Date the patient was marked as deceased",
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the patient is active (not transferred, discharged, etc.)"
          },
          "profilePhotoUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "Presigned URL (~60min) for the patient's profile photo, or null if none is set.\nBacked by the PatientFile flagged with IsProfilePhoto."
          },
          "treatmentAcceptanceRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Read-only treatment-acceptance rate (0-100) over the patient's entire history: the share of\ndecided recommended services that were performed rather than client-declined. Null when the\npatient has no decided services. Clinical compliance, not regulatory.",
            "format": "double"
          },
          "treatmentAcceptanceRateRecent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Read-only treatment-acceptance rate (0-100) over the trailing 12 months. Null when the\npatient has no decided services in that window.",
            "format": "double"
          },
          "deferredServiceCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Lifetime count of deferred (client-declined) services for this patient.",
            "format": "int32"
          }
        },
        "description": "Full patient details response"
      },
      "PatientSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique patient identifier"
          },
          "name": {
            "type": "string",
            "description": "The patient's name"
          },
          "species": {
            "type": "string",
            "description": "The species name. References a species from GET /species endpoint.",
            "example": "Cat"
          },
          "speciesId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The species ID for programmatic lookups."
          },
          "breed": {
            "type": "string",
            "description": "The breed name",
            "example": "Siamese"
          },
          "sex": {
            "type": "string",
            "description": "The patient's sex",
            "example": "Male"
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "description": "Date of birth, if known",
            "format": "date-time"
          },
          "isEstimatedAge": {
            "type": "boolean"
          },
          "fixed": {
            "type": "boolean",
            "description": "Whether the patient is spayed/neutered"
          },
          "treatmentAcceptanceRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Lightweight patient summary for lists and references"
      },
      "PatientTransactionRowDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Formatted date (e.g., \"Jan 24, 2026\")"
          },
          "id": {
            "type": "string",
            "description": "Invoice/Invoice ID (e.g., \"EST-1024\")"
          },
          "invoiceId": {
            "type": "string",
            "description": "Database estimate ID (UUID) for API calls"
          },
          "client": {
            "type": "string",
            "description": "Client name"
          },
          "patient": {
            "type": "string",
            "description": "Patient name"
          },
          "desc": {
            "type": "string",
            "description": "Description (primary service or summary)"
          },
          "provider": {
            "type": "string",
            "description": "Provider name"
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Provider user ID for editing"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Amount billed — the invoice total. NOT what was collected; see\ndecimal PatientTransactionRowDto.AmountCollected. A refunded bill keeps its full invoice total here.",
            "format": "double"
          },
          "amountCollected": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Amount actually collected against this invoice, net of refunds (PaymentLedger).\nDiffers from decimal PatientTransactionRowDto.Amount whenever a bill is unpaid, part-paid, or refunded.\nSumming decimal PatientTransactionRowDto.Amount to report \"revenue\" overstates it — sum this instead.",
            "format": "double"
          },
          "status": {
            "type": "string",
            "description": "Payment status derived from the payment ledger:\n\"Paid\", \"Partial\", \"Refunded\", \"Pending\", \"Failed\"."
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Linked appointment ID (null when the estimate has no appointment — e.g. retail/boarding)"
          }
        },
        "description": "Individual patient transaction row"
      },
      "PatientTransactionsDto": {
        "type": "object",
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientTransactionRowDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Recent patient transactions for the master grid"
      },
      "PatientVaccineScheduleDto": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "species": {
            "type": "string",
            "description": "Species the requirement set was built from (the patient's species code)."
          },
          "overallStatus": {
            "description": "What the core entries roll up to — Exempt when staff set the clinical exemption (the\nentries are still returned so the chart stays informative).",
            "$ref": "#/components/schemas/VaccinationStatus"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientVaccineScheduleEntryDto"
            }
          }
        },
        "description": "The computed vaccine schedule for one patient (ITE-685): one entry per core requirement for\nthe patient's species (rabies collapsed to a single requirement any rabies product satisfies),\nplus informational entries for other vaccines the patient has doses of. The stored\n`Patient.VaccinationStatus` — and therefore the patient header badge — is folded from the\nSAME core entries, so this is the badge's explanation, not a parallel derivation."
      },
      "PatientVaccineScheduleEntryDto": {
        "type": "object",
        "properties": {
          "vaccineTypeId": {
            "type": "string",
            "description": "The requirement's vaccine type. For the rabies entry the satisfying dose may be a different rabies product — see string? PatientVaccineScheduleEntryDto.LastDoseVaccineName."
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isCore": {
            "type": "boolean"
          },
          "isRabies": {
            "type": "boolean"
          },
          "countsTowardStatus": {
            "type": "boolean",
            "description": "True for the core-requirement entries the patient badge is folded from; false for informational rows."
          },
          "isSpeciesMismatch": {
            "type": "boolean",
            "description": "The vaccine's type is for a different species than the patient (a data-entry error — ITE-684)."
          },
          "status": {
            "$ref": "#/components/schemas/VaccineScheduleEntryStatus"
          },
          "lastDoseDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastDoseRecordId": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastDoseVaccineName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Product actually given for the last dose (differs from string PatientVaccineScheduleEntryDto.Name when a rabies requirement was met by another rabies product)."
          },
          "nextDueDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "When protection lapses / the next dose is due. Null = open-ended (no expiration and no duration to age against).",
            "format": "date-time"
          },
          "exemptionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when VaccineScheduleEntryStatus PatientVaccineScheduleEntryDto.Status is Skipped: the active exemption behind it (ITE-688)."
          },
          "skipReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "skippedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "skippedByName": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "One vaccine's standing within a patient's computed schedule."
      },
      "PatientVitalMeasurementDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "takenAt": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "takenBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VitalTakenByDto"
              }
            ]
          },
          "extractedByAI": {
            "type": "boolean"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PauseSubscriptionDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PaymentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "paymentNumber": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentTokenId": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentToken": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaymentTokenSummaryDto"
              }
            ]
          },
          "paymentMethod": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "status": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "authorizationCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "cashReceived": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "changeDue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "markAsPaidType": {
            "type": [
              "null",
              "string"
            ]
          },
          "checkNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "routingNumberMasked": {
            "type": [
              "null",
              "string"
            ]
          },
          "accountNumberMasked": {
            "type": [
              "null",
              "string"
            ]
          },
          "text2PayPhoneNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "text2PayLinkSentAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "refundedAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "originalPaymentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "refunds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PaymentSummaryDto"
            }
          },
          "processedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "processedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "cardEntryMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "applicationLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "maskedPan": {
            "type": [
              "null",
              "string"
            ]
          },
          "cardType": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastFour": {
            "type": [
              "null",
              "string"
            ]
          },
          "emvAid": {
            "type": [
              "null",
              "string"
            ]
          },
          "emvTvr": {
            "type": [
              "null",
              "string"
            ]
          },
          "emvIad": {
            "type": [
              "null",
              "string"
            ]
          },
          "emvTsi": {
            "type": [
              "null",
              "string"
            ]
          },
          "cvmMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "pinVerified": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "surchargeAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "baseAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "tipAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "cashbackAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "cashDiscountApplied": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "cashDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "transactionType": {
            "type": [
              "null",
              "string"
            ]
          },
          "terminalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "terminalName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Named terminal slug used for this transaction (e.g., \"front-desk\")."
          },
          "isDuplicateTransaction": {
            "type": "boolean",
            "description": "Whether this is a duplicate transaction that was previously approved.\nWhen true, no new charge was processed - this references a prior transaction."
          }
        }
      },
      "PaymentListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentSummaryDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PaymentMethodNoticeDto": {
        "type": "object",
        "properties": {
          "surfaceKey": {
            "type": "string",
            "description": "Keyed surface, e.g. `payment.check`."
          },
          "text": {
            "type": "string",
            "description": "The notice text shown to staff."
          },
          "severity": {
            "type": "string",
            "description": "Severity (\"Low\" | \"Normal\" | \"High\" | \"Critical\")."
          }
        },
        "description": "A single admin-authored notice bound to a keyed UI surface (currently payment methods)."
      },
      "PaymentMethodSummaryDto": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PaymentSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "paymentNumber": {
            "type": "string"
          },
          "paymentMethod": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "status": {
            "type": "string"
          },
          "refundedAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "cashReceived": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "changeDue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "PaymentTokenDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "expirationMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "expirationYear": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isDefault": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "cardholderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "nickname": {
            "type": [
              "null",
              "string"
            ]
          },
          "billingZipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaymentTokenListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentTokenSummaryDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PaymentTokenSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "expirationMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "expirationYear": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isDefault": {
            "type": "boolean"
          },
          "nickname": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PerformEstimateItemRequest": {
        "type": "object",
        "properties": {
          "dispenseType": {
            "type": [
              "null",
              "string"
            ],
            "description": "InHouse (administered now) or Prescription (take-home). Defaults to InHouse."
          },
          "disposition": {
            "type": [
              "null",
              "string"
            ],
            "description": "Explicit dispense disposition (InHouse | TakeHomeLabelNow | TakeHomeLabelLater). When\nsupplied it is persisted on the line and drives the convert gate (take-home requires the\nSIG filled; in-house never blocks). Falls back to a mapping from string? PerformEstimateItemRequest.DispenseType\nwhen omitted."
          },
          "overrideValidation": {
            "type": "boolean"
          },
          "overrideReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "lotId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ITE-157: the confirmed lot/container for a plain inventory line (null = FEFO/auto)."
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "witnessUserId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Real witness for a controlled-substance dispense — replaces the appointment\nself-witness when supplied."
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FulfillComponentDto"
            },
            "description": "Charge (BillableItem) component override (design §2.3). When the performed\nline is a charge, these mirror FulfillBillableItemDto: each\ndefault component may be kept, substituted, skipped, or dispensed at a\ndifferent `quantity`; ad-hoc components may be added. Empty for a plain\ninventory line or a charge dispensed at its catalog defaults."
          },
          "additionalComponents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FulfillComponentDto"
            },
            "description": "Ad-hoc components dispensed alongside the charge's catalog defaults."
          },
          "componentOverrideReason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required when the charge's dispensed component set deviates from the catalog\ndefault (skip / substitute / quantity change / addition)."
          }
        }
      },
      "PermissionGroupDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          }
        }
      },
      "PharmacyDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "PharmacyListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PharmacyDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PhoneSystemSettingsDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "vendor": {
            "type": "string"
          },
          "mangoCredentialsConfigured": {
            "type": "boolean",
            "description": "Whether Mango Voice credentials are stored in AWS Secrets Manager.\nUse POST /integrations/credentials/mango-voice to configure."
          },
          "telnyxCredentialsConfigured": {
            "type": "boolean",
            "description": "Whether Telnyx WebRTC credentials are stored in AWS Secrets Manager.\nUse POST /integrations/credentials/telnyx to configure."
          },
          "defaultCallerId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PnLDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PnLItemDto"
            }
          },
          "netIncome": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "period": {
            "type": "string"
          }
        }
      },
      "PnLItemDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "type": {
            "type": "string"
          },
          "percent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "trend": {
            "type": [
              "null",
              "string"
            ]
          },
          "spark": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "double"
            }
          }
        }
      },
      "PopulateEstimateDefaultsResponse": {
        "type": "object",
        "properties": {
          "itemsAdded": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EstimateLineItemDto"
            }
          }
        },
        "description": "Result of seeding an estimate's lines from its appointment type's default services."
      },
      "PortalDashboardResponse": {
        "type": "object",
        "properties": {
          "upcomingAppointments": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "unreadMessages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nextAppointment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpcomingAppointmentDto"
              }
            ]
          }
        }
      },
      "PortalSessionDto": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "isVerified": {
            "type": "boolean"
          },
          "verifiedClientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "verifiedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "verificationExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "PrescribingRulesResponseDto": {
        "type": "object",
        "properties": {
          "region": {
            "type": "string",
            "description": "\"US\" | \"GB\" | \"NI\" — resolved from the clinic's region code."
          },
          "regionCode": {
            "type": "string"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleDescriptorDto"
            }
          }
        },
        "description": "Response for `GET /clinic-config/prescribing-rules`. Lists every rule\nthe clinic's current region enforces (or warns on). Intended for the\nGovernance Preview settings page."
      },
      "PrescriptionAmendmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "prescriptionId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "originalContent": {
            "type": "string"
          },
          "amendedContent": {
            "type": "string"
          },
          "createdById": {
            "type": "string"
          },
          "createdByDisplayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PresenceDto": {
        "type": "object",
        "properties": {
          "automationsRun": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "vipReferences": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pawsQueries": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "triageAssessments": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notesTranscribed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "carePlans": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "discharges": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rxChecked": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rxLogged": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "timeSavedHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "PresentEstimateRequest": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional audit note (e.g. \"presented in exam room 2\")."
          }
        }
      },
      "PreviewLineItemDto": {
        "type": "object",
        "properties": {
          "localId": {
            "type": "string",
            "description": "Caller-supplied id used to map results back. Not persisted."
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "groupCodeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PreviewPriceRulesRequestDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreviewLineItemDto"
            }
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Estimate's client, used to resolve customer-tag rule gating in preview.\nOptional — when absent, client-tag-gated rules are simply not previewed."
          }
        },
        "description": "Request body for `POST /invoices/preview-rules`. The client sends its\nproposed line items; the server runs the engine over them without\npersisting and returns the per-line + order-level rule discounts."
      },
      "PreviewPriceRulesResponseDto": {
        "type": "object",
        "properties": {
          "lineRuleDiscounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LineRuleDiscountDto"
            }
          },
          "ruleOrderDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "PreviousDispenseDetailsDto": {
        "type": "object",
        "properties": {
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "wasForSamePatient": {
            "type": "boolean"
          },
          "prescribedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "PreviousOwnerDisposition": {
        "type": "integer",
        "description": "What to do with the existing primary owner when ownership of a patient is transferred to a\nnew client (PAW-659)."
      },
      "PreviousTravelDestinationDto": {
        "type": "object",
        "properties": {
          "found": {
            "type": "boolean",
            "description": "Whether a previous travel destination was found"
          },
          "address": {
            "type": [
              "null",
              "string"
            ],
            "description": "The destination address from the previous travel appointment"
          },
          "placeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The Google Place ID of the destination"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The appointment ID of the previous travel appointment"
          },
          "previousAppointmentEndTime": {
            "type": [
              "null",
              "string"
            ],
            "description": "End time of the previous appointment (for calculating travel window)",
            "format": "date-time"
          }
        },
        "description": "Response for getting the previous travel destination for chaining travel appointments"
      },
      "PriceRuleActivityRowDto": {
        "type": "object",
        "properties": {
          "priceRuleId": {
            "type": "string"
          },
          "ruleName": {
            "type": "string"
          },
          "ruleType": {
            "type": "string"
          },
          "timesFired": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lastFiredAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        },
        "description": "One row of aggregated price-rule activity: how many times a rule fired on\npaid estimates, how much discount it produced in total, and when it last\nfired. Returned by `GET /pricerules/activity`."
      },
      "PriceRuleDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "ruleType": {
            "type": "string",
            "description": "One of: BuyXGetYFree, BuyXGetYPercentOff, SpendThreshold, QuantityTier."
          },
          "scope": {
            "type": "string",
            "description": "One of: GroupCode, Global."
          },
          "groupCodeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validTo": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maxUsageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "usageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "stackingOverride": {
            "type": [
              "null",
              "string"
            ],
            "description": "One of: BestWins, Stack, or null to inherit the tenant setting."
          },
          "payload": {
            "$ref": "#/components/schemas/PriceRulePayloadDto"
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceRuleTargetDto"
            }
          },
          "clientTagIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Customer-tag ids that gate this rule. Empty = applies to any client; when\nnon-empty the rule fires only for clients carrying at least one of them."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "API representation of a price rule."
      },
      "PriceRuleListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceRuleDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PriceRulePayloadDto": {
        "type": "object",
        "properties": {
          "buyQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "getQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "getDiscountPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "thresholdAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountType": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Percentage\" or \"Fixed\" (SpendThreshold only)."
          },
          "discountValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "tiers": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PriceRuleTierDto"
            }
          }
        },
        "description": "Typed parameters for a price rule; relevant fields depend on RuleType."
      },
      "PriceRuleTargetDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "targetKind": {
            "type": "string",
            "description": "One of: CatalogItem, Category, GroupCodeMembership, AnyLineItem, InventoryItemTag."
          },
          "role": {
            "type": "string",
            "description": "One of: Qualifying, Reward."
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "retailItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "tagId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when TargetKind is InventoryItemTag — the inventory-item Smart Tag id."
          }
        }
      },
      "PriceRuleTierDto": {
        "type": "object",
        "properties": {
          "minQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "PrinterDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PrintJobResultDto": {
        "type": "object",
        "properties": {
          "printJobId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "PrintLabelResultDto": {
        "type": "object",
        "properties": {
          "printJobId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "PrintRxLabelRequestDto": {
        "type": "object",
        "properties": {
          "printerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "templateId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PrintTestLabelRequestDto": {
        "type": "object",
        "properties": {
          "printerName": {
            "type": "string"
          },
          "format": {
            "type": [
              "null",
              "string"
            ],
            "description": "Which label stock to test against. Null falls back to the bottle label, matching\nTemplateFormatSpec.For — a test print should produce something rather than 400."
          }
        }
      },
      "PrintVaccineCertificateRequest": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "printerName": {
            "type": "string"
          },
          "certifyingUserId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The veterinarian certifying any certificates issued on demand by this print."
          }
        }
      },
      "Priority": {
        "type": "integer"
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProcedureCategoryRankDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Category name (e.g., \"Vaccines\", \"Labs\", \"Dentistry\")"
          },
          "value": {
            "type": "string",
            "description": "Formatted revenue value (e.g., \"$12,400\")"
          },
          "revenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Raw revenue amount for calculations",
            "format": "double"
          },
          "percentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Percentage relative to the top category (0-100)",
            "format": "double"
          }
        },
        "description": "Individual procedure category with revenue data"
      },
      "ProcedureCategoryRankingsDto": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProcedureCategoryRankDto"
            }
          },
          "period": {
            "type": "string"
          },
          "totalRevenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Revenue rankings by procedure/service category"
      },
      "PromoteMemberRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Defaults to the member's display name; required by Patient.Name."
          },
          "breed": {
            "type": [
              "null",
              "string"
            ],
            "description": "Defaults to the group's breed."
          },
          "sex": {
            "type": [
              "null",
              "string"
            ],
            "description": "Defaults to the member's sex; falls back to Unknown."
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "description": "Defaults to the member's date of birth.",
            "format": "date-time"
          },
          "isEstimatedAge": {
            "type": "boolean"
          },
          "color": {
            "type": [
              "null",
              "string"
            ],
            "description": "Defaults to the member's color markings."
          },
          "microchipNo": {
            "type": [
              "null",
              "string"
            ]
          },
          "fixed": {
            "type": "boolean"
          },
          "vaccinationStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "Patient.VaccinationStatus — defaults to \"Unknown\"."
          }
        }
      },
      "PromoteMemberResponse": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "memberId": {
            "type": "string"
          },
          "member": {
            "$ref": "#/components/schemas/PatientGroupMemberDto"
          }
        }
      },
      "ProviderAvailabilityGate": {
        "required": [
          "rowCount",
          "providersWithRows"
        ],
        "type": "object",
        "properties": {
          "rowCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "providersWithRows": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ProviderExclusionsDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "buckets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ProviderRankDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "change": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ProviderRankingsDto": {
        "type": "object",
        "properties": {
          "rankings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderRankDto"
            }
          },
          "period": {
            "type": "string"
          }
        }
      },
      "PtoRequestListResponseDto": {
        "type": "object",
        "properties": {
          "ptoRequests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PtoRequestResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pendingCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "approvedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "deniedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PtoRequestResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "type": {
            "$ref": "#/components/schemas/PtoRequestType"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "totalHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/PtoRequestStatus"
          },
          "reviewedByUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reviewedByUser": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "reviewedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "reviewNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PtoRequestStatus": {
        "type": "integer"
      },
      "PtoRequestType": {
        "type": "integer"
      },
      "PublicPriceListEntryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupCodeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceType": {
            "type": "string",
            "description": "\"service\", \"inventory\", or \"kit\" — derived from which FK is set."
          },
          "resolvedName": {
            "type": "string",
            "description": "Resolved display name. Prefers string? PublicPriceListEntryDto.NameOverride; falls back to the source record."
          },
          "sourceName": {
            "type": "string",
            "description": "Fallback source name (for the settings UI to show alongside the override)."
          },
          "sourcePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Source record's current base price, for reference in the editor.",
            "format": "double"
          },
          "nameOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "descriptionOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "categoryLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayMode": {
            "type": "string",
            "description": "\"flat\" or \"range\"."
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "minPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Entry on the curated public pricing page. Exactly one of\nstring? PublicPriceListEntryDto.ServiceCatalogItemId, string? PublicPriceListEntryDto.InventoryItemId, or\nstring? PublicPriceListEntryDto.GroupCodeId is set."
      },
      "PublicPriceListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicPriceListEntryDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PublicQuestionnaireDto": {
        "type": "object",
        "properties": {
          "responseId": {
            "type": "string"
          },
          "questionnaire": {
            "$ref": "#/components/schemas/QuestionnaireDto"
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentInfo": {
            "type": [
              "null",
              "string"
            ]
          },
          "existingResponses": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Public questionnaire access via token"
      },
      "PublicSmsConsentDto": {
        "type": "object",
        "properties": {
          "linkId": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "brandName": {
            "type": "string"
          },
          "useCases": {
            "type": "string"
          },
          "consentText": {
            "type": "string"
          },
          "consentVersion": {
            "type": "string"
          },
          "alreadyConsented": {
            "type": "boolean"
          }
        },
        "description": "Public SMS consent form data retrieved by token"
      },
      "PurchaseOrderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "orderNumber": {
            "type": "string"
          },
          "vendorId": {
            "type": "string"
          },
          "vendor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VendorSummaryDto"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "orderDate": {
            "type": "string",
            "format": "date-time"
          },
          "expectedDeliveryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "receivedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "subTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "shippingAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "externalOrderNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackingNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          },
          "approvedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DEAUserSummaryDto"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseOrderItemDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PurchaseOrderItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "purchaseOrderId": {
            "type": "string"
          },
          "inventoryItemId": {
            "type": "string"
          },
          "inventoryItem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InventoryItemSummaryDto"
              }
            ]
          },
          "quantityOrdered": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantityReceived": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantityBackordered": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lineTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PurchaseOrderListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseOrderDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "QiEventDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isAnonymous": {
            "type": "boolean"
          },
          "reporterId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reporterName": {
            "type": [
              "null",
              "string"
            ]
          },
          "reporter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QiEventUserSummaryDto"
              }
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QiEventPatientSummaryDto"
              }
            ]
          },
          "medicationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "staffMemberId": {
            "type": [
              "null",
              "string"
            ]
          },
          "staffMemberName": {
            "type": [
              "null",
              "string"
            ]
          },
          "staffMember": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QiEventUserSummaryDto"
              }
            ]
          },
          "roomName": {
            "type": [
              "null",
              "string"
            ]
          },
          "resolvedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "resolvedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "resolvedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QiEventUserSummaryDto"
              }
            ]
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QiEventNoteDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "QiEventListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QiEventDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "QiEventNoteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "qiEventId": {
            "type": "string"
          },
          "authorId": {
            "type": "string"
          },
          "authorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "QiEventPatientSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "QiEventStatsDto": {
        "type": "object",
        "properties": {
          "openCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inReviewCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "resolvedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "QiEventUserSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "QuestionnaireDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "$ref": "#/components/schemas/QuestionnaireType"
          },
          "status": {
            "$ref": "#/components/schemas/QuestionnaireStatus"
          },
          "isTemplate": {
            "type": "boolean"
          },
          "schema": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Full questionnaire response"
      },
      "QuestionnaireLinkResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "maxUses": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Response when creating a link (includes full URL)"
      },
      "QuestionnaireListItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "$ref": "#/components/schemas/QuestionnaireType"
          },
          "status": {
            "$ref": "#/components/schemas/QuestionnaireStatus"
          },
          "isTemplate": {
            "type": "boolean"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "automationCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Number of active and inactive automation rules referencing this form.\nPopulated by the list endpoint via a join on automation_questionnaire_refs.",
            "format": "int32"
          }
        },
        "description": "Lightweight questionnaire item for lists"
      },
      "QuestionnaireListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionnaireListItemDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Paginated questionnaire list response"
      },
      "QuestionnaireResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "questionnaireId": {
            "type": "string"
          },
          "questionnaire": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QuestionnaireListItemDto"
              }
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PatientSummaryDto"
              }
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "client": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClientSummaryDto"
              }
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "responses": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/QuestionnaireResponseStatus"
          },
          "submittedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "submittedBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "linkExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Latest expiry among the response's public links. Lets read surfaces derive\n\"Sent, awaiting\" (InProgress, unexpired) vs \"Expired\" (InProgress, expired).",
            "format": "date-time"
          },
          "linkFirstViewedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Earliest first-view among the response's public links (null = never opened).\nLets read surfaces distinguish \"Sent, awaiting\" from \"Opened, awaiting\".",
            "format": "date-time"
          }
        },
        "description": "Full questionnaire response (submission) DTO"
      },
      "QuestionnaireResponseListItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "questionnaireId": {
            "type": "string"
          },
          "questionnaireName": {
            "type": "string"
          },
          "questionnaireType": {
            "$ref": "#/components/schemas/QuestionnaireType"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/QuestionnaireResponseStatus"
          },
          "submittedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "linkExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Latest expiry among the response's public links. Lets read surfaces derive\n\"Sent, awaiting\" (InProgress, unexpired) vs \"Expired\" (InProgress, expired).",
            "format": "date-time"
          },
          "linkFirstViewedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Earliest first-view among the response's public links (null = never opened).\nLets read surfaces distinguish \"Sent, awaiting\" from \"Opened, awaiting\".",
            "format": "date-time"
          }
        },
        "description": "Lightweight response item for lists"
      },
      "QuestionnaireResponseListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionnaireResponseListItemDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Paginated response list response"
      },
      "QuestionnaireResponseStatus": {
        "type": "integer"
      },
      "QuestionnaireSendResultDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "responseId": {
            "type": [
              "null",
              "string"
            ]
          },
          "linkId": {
            "type": [
              "null",
              "string"
            ]
          },
          "errorMessage": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Result of sending a questionnaire."
      },
      "QuestionnaireStatus": {
        "type": "integer"
      },
      "QuestionnaireType": {
        "type": "integer"
      },
      "QuestionnaireUsedByItemDto": {
        "type": "object",
        "properties": {
          "automationId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "isSystemDefault": {
            "type": "boolean"
          }
        },
        "description": "Item returned by GET /questionnaires/{id}/used-by — describes one automation referencing the form."
      },
      "QuestionnaireValidationInfoDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/QuestionnaireStatus"
          },
          "type": {
            "$ref": "#/components/schemas/QuestionnaireType"
          }
        },
        "description": "Minimal projection used for cross-service validation (e.g., orphan-check on automation save)."
      },
      "QueueForRoomRequest": {
        "required": [
          "roomId"
        ],
        "type": "object",
        "properties": {
          "roomId": {
            "type": "string"
          }
        },
        "description": "Request to queue a patient in a room's Next Up list"
      },
      "RabiesDurationSuggestionDto": {
        "type": "object",
        "properties": {
          "isRabies": {
            "type": "boolean"
          },
          "isFirstRabies": {
            "type": "boolean"
          },
          "labeledDurationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The product's labeled (maximum) duration — 12 or 36 months.",
            "format": "int32"
          },
          "suggestedDurationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The recommended effective duration for THIS dose (12 for a first dose, else labeled).",
            "format": "int32"
          }
        },
        "description": "Suggested duration of immunity for a rabies vaccination at point-of-care. Duration is a property\nof the administration, not the product: a first/primary rabies dose is recognized for 1 year even\nwith a 3-year-labeled product; boosters get the product's labeled duration. See ITE-162.\nLegacy shape — superseded by NextDoseSuggestionDto, which generalizes this to any\nvaccine schedule; the rabies endpoint now delegates to the same stage-resolution logic."
      },
      "RabiesTagBatchDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": [
              "null",
              "string"
            ]
          },
          "year": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "startSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "endSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "padWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "tagType": {
            "type": "string"
          },
          "inventoryLocationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "nextCursor": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "availableCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Count of tags in the range that are still available (range size minus materialized rows).",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "A rabies tag batch (county-issued range) with derived availability info."
      },
      "RabiesTagDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "rabiesTagBatchId": {
            "type": [
              "null",
              "string"
            ]
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "tagNumber": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "vaccinationRecordId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "isOutsideTag": {
            "type": "boolean"
          },
          "countyTagNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "replacedByTagId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "A materialized rabies tag (only assigned/voided/lost/replaced/outside tags exist as rows)."
      },
      "RdvmAccessRequestDto": {
        "type": "object",
        "properties": {
          "accessId": {
            "type": "string"
          },
          "rdvmId": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "practiceName": {
            "type": "string"
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "licenseNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "approvalStatus": {
            "type": "string"
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "canSubmitReferrals": {
            "type": "boolean"
          },
          "canViewRecords": {
            "type": "boolean"
          },
          "canSendMessages": {
            "type": "boolean"
          },
          "canUseTriage": {
            "type": "boolean"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RdvmAppointmentTypeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RdvmApprovalResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "RdvmDocumentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "referralId": {
            "type": "string"
          },
          "documentType": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileSizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "mimeType": {
            "type": [
              "null",
              "string"
            ]
          },
          "uploadedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "uploadedAt": {
            "type": "string",
            "format": "date-time"
          },
          "isSent": {
            "type": "boolean"
          },
          "sentAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "source": {
            "type": "string"
          },
          "canDelete": {
            "type": "boolean"
          }
        }
      },
      "RdvmDocumentListResponse": {
        "type": "object",
        "properties": {
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmDocumentDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "canExport": {
            "type": "boolean"
          }
        }
      },
      "RdvmExportRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "includeMedicalHistory": {
            "type": "boolean"
          },
          "includeSoapNotes": {
            "type": "boolean"
          },
          "includeMedications": {
            "type": "boolean"
          },
          "includeDischargeRecords": {
            "type": "boolean"
          },
          "includeLabs": {
            "type": "boolean"
          },
          "includeImaging": {
            "type": "boolean"
          },
          "dateFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "dateTo": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "RdvmPortalSessionDto": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "isVerified": {
            "type": "boolean"
          },
          "verifiedRdvmId": {
            "type": [
              "null",
              "string"
            ]
          },
          "rdvmName": {
            "type": [
              "null",
              "string"
            ]
          },
          "practiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "approvalStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Approved\", \"Pending\", \"Rejected\""
          },
          "verifiedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "verificationExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "canSubmitReferrals": {
            "type": "boolean"
          },
          "canViewRecords": {
            "type": "boolean"
          },
          "canSendMessages": {
            "type": "boolean"
          },
          "canUseTriage": {
            "type": "boolean"
          }
        }
      },
      "RdvmReferralDetailDto": {
        "type": "object",
        "properties": {
          "clinicalNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "completedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmReferralMessageDto"
            }
          },
          "id": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialty": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "urgency": {
            "type": "string"
          },
          "reasonForReferral": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedDoctorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduledDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "referralDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "unreadMessages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "threadId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Communication thread ID for unified inbox integration"
          }
        }
      },
      "RdvmReferralDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialty": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "urgency": {
            "type": "string"
          },
          "reasonForReferral": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedDoctorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduledDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "referralDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "unreadMessages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "threadId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Communication thread ID for unified inbox integration"
          }
        }
      },
      "RdvmReferralMessageDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "senderName": {
            "type": "string"
          },
          "senderType": {
            "type": "string"
          },
          "isRead": {
            "type": "boolean"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RdvmRegistrationResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "rdvmId": {
            "type": [
              "null",
              "string"
            ]
          },
          "maskedEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresApproval": {
            "type": "boolean",
            "description": "True if the clinic requires manual approval for new RDVMs"
          }
        }
      },
      "RdvmSessionDto": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RdvmSlotDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RdvmSpeciesDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RdvmTriageHistoryResponse": {
        "type": "object",
        "properties": {
          "threadId": {
            "type": "string"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmTriageMessage"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RdvmTriageMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RdvmUserListResponse": {
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RdvmAccessRequestDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pendingCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "approvedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rejectedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RdvmVerifyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          },
          "rdvmId": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "practiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "approvalStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"Approved\", \"Pending\", \"Rejected\""
          }
        }
      },
      "ReactivateDEABookDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Body for reactivating a DEA book. Reason is optional but recorded when present."
      },
      "ReadinessRoomInfo": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ReadinessTypeInfo": {
        "required": [
          "id",
          "name",
          "isDefault"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          }
        }
      },
      "ReceiveOrderContainerDto": {
        "type": "object",
        "properties": {
          "containerCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Human / DEA identifier for this container (required for controlled substances)."
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ReceiveOrderDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReceiveOrderItemDto"
            }
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReceiveOrderItemDto": {
        "type": "object",
        "properties": {
          "purchaseOrderItemId": {
            "type": "string"
          },
          "quantityReceived": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Storage location the received stock is placed in. Falls back to the tenant's default\nlocation when null/empty. Assigned to the lot (InventoryLotLocation) and to every\ncontainer created for the received lot."
          },
          "containers": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ReceiveOrderContainerDto"
            },
            "description": "Physical containers this lot arrived in (ITE-157). When present and non-empty, the lot\nis created with one row per container and the received quantity is the sum of their\nquantities (the top-level decimal ReceiveOrderItemDto.QuantityReceived / string? ReceiveOrderItemDto.ContainerId are\nignored). For controlled substances each container gets its own DEA `Received`\nledger entry. When null/empty, the single-container behavior is unchanged."
          }
        }
      },
      "ReceiveRetailInventoryDto": {
        "type": "object",
        "properties": {
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceNumber": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReconciliationSummaryDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "totalCollected": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "transactionCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "byMethod": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PaymentMethodSummaryDto"
            }
          },
          "isClosed": {
            "type": "boolean"
          },
          "closedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "closedBy": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RecordingDetailDto": {
        "required": [
          "id",
          "patientName",
          "status",
          "recordingStatus"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": "string"
          },
          "summary": {
            "type": [
              "null",
              "string"
            ]
          },
          "fullTranscript": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "recordingStatus": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "attendingDvmId": {
            "type": [
              "null",
              "string"
            ]
          },
          "attendingDvmName": {
            "type": [
              "null",
              "string"
            ]
          },
          "scribeUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "scribeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalDuration": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "aiConfidence": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "userId": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasAudio": {
            "type": "boolean"
          },
          "examDataJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "customExamTemplateId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customExamTemplateVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "customExamResponseJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "orderedTestsJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "cachedSuggestionsJson": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Full recording details for editing in chronicle page"
      },
      "RecordingListItemDto": {
        "required": [
          "id",
          "patientName",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": "string"
          },
          "summary": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "attendingDvmName": {
            "type": [
              "null",
              "string"
            ]
          },
          "scribeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Recording/Transcript list item for chronicle page"
      },
      "RecordingListResponse": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordingListItemDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Recording list response with pagination"
      },
      "RecordSmsConsentRequest": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "consentGranted": {
            "type": "boolean"
          },
          "consentSource": {
            "type": "string"
          },
          "sessionId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to record SMS consent"
      },
      "RecordVitalRequest": {
        "required": [
          "vitalTypeCode"
        ],
        "type": "object",
        "properties": {
          "vitalTypeCode": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Numeric reading. Required for Numeric/Scale/Boolean vital types; must be absent\nfor Text types. Nullable since ITE-329 (previously `required double`) —\nexactly one of double? RecordVitalRequest.Value / string? RecordVitalRequest.ValueText is set per request.",
            "format": "double"
          },
          "valueText": {
            "type": [
              "null",
              "string"
            ],
            "description": "Text reading (\"Bright\", \"pale pink\"). Required for Text vital types."
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "takenById": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RecordVitalResponse": {
        "required": [
          "id",
          "patientId",
          "vitalTypeCode",
          "vitalTypeLabel",
          "value",
          "unit",
          "takenAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "vitalTypeCode": {
            "type": "string"
          },
          "vitalTypeLabel": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Numeric reading; null for Text vital readings (see string? RecordVitalResponse.ValueText).",
            "format": "double"
          },
          "valueText": {
            "type": [
              "null",
              "string"
            ],
            "description": "Text reading; null for numeric readings."
          },
          "unit": {
            "type": "string"
          },
          "takenAt": {
            "type": "string",
            "format": "date-time"
          },
          "thresholdAlert": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VitalThresholdAlertDto"
              }
            ]
          }
        }
      },
      "RecurrencePatternDto": {
        "required": [
          "frequency",
          "endType"
        ],
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "description": "DAILY, WEEKLY, or MONTHLY"
          },
          "interval": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Interval between occurrences (e.g., 2 = every 2 weeks)",
            "format": "int32"
          },
          "daysOfWeek": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Days of week for weekly recurrence (MO, TU, WE, TH, FR, SA, SU)"
          },
          "dayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Day of month for monthly recurrence (1-31)",
            "format": "int32"
          },
          "endType": {
            "type": "string",
            "description": "End type: never, on_date, or after_count"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "End date when EndType is on_date",
            "format": "date-time"
          },
          "endAfterCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Number of occurrences when EndType is after_count",
            "format": "int32"
          }
        },
        "description": "Pattern for recurring schedule items"
      },
      "RecurringExpenseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "category": {
            "type": "string"
          },
          "frequency": {
            "$ref": "#/components/schemas/ExpenseFrequency"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "dayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "dayOfWeek": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DayOfWeek"
              }
            ]
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RecurringExpenseListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecurringExpenseDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ReferenceIntervalAmendmentDto": {
        "type": "object",
        "properties": {
          "resultId": {
            "type": "string"
          },
          "referenceLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The corrected lower bound. Null clears it, which is a legitimate correction — an interval\nthat never applied to this patient is better absent than wrong. A cleared bound makes the\nflag underivable, so the result becomes \"not reported\" rather than being asserted normal.",
            "format": "double"
          },
          "referenceHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "referenceRange": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional display override. Left null the server renders the bounds itself, which is what\nthe caller wants unless it is reproducing a laboratory's own wording."
          }
        }
      },
      "ReferralDocumentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "referralId": {
            "type": "string"
          },
          "documentType": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileSizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "mimeType": {
            "type": [
              "null",
              "string"
            ]
          },
          "uploadedById": {
            "type": "string"
          },
          "uploadedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReferralUserSummaryDto"
              }
            ]
          },
          "uploadedAt": {
            "type": "string",
            "format": "date-time"
          },
          "isSent": {
            "type": "boolean"
          },
          "sentAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReferralDocumentListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferralDocumentDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ReferralDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReferralPatientSummaryDto"
              }
            ]
          },
          "fromPartnerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "fromPartner": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PartnerSummaryDto"
              }
            ]
          },
          "toPartnerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "toPartner": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PartnerSummaryDto"
              }
            ]
          },
          "referringVetName": {
            "type": [
              "null",
              "string"
            ]
          },
          "referringVetEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "referringClinicName": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialty": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "urgency": {
            "type": "string"
          },
          "reasonForReferral": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicalNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "diagnosisCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "referralDate": {
            "type": "string",
            "format": "date-time"
          },
          "scheduledDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "completedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "assignedVetId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedVet": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReferralUserSummaryDto"
              }
            ]
          },
          "documentCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "unreadMessageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "pendingPatientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "pendingSpecies": {
            "type": [
              "null",
              "string"
            ]
          },
          "pendingBreed": {
            "type": [
              "null",
              "string"
            ]
          },
          "pendingOwnerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "pendingOwnerPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "pendingOwnerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduleItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "threadId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReferralListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferralDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ReferralMessageDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "referralId": {
            "type": "string"
          },
          "threadId": {
            "type": [
              "null",
              "string"
            ]
          },
          "senderId": {
            "type": "string"
          },
          "senderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "senderClinic": {
            "type": [
              "null",
              "string"
            ]
          },
          "subject": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "isRead": {
            "type": "boolean"
          },
          "readAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          },
          "attachmentIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReferralMessageListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferralMessageDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "unreadCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ReferralPatientSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReferralStatsDto": {
        "type": "object",
        "properties": {
          "pendingCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "scheduledCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inProgressCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "completedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "unreadMessageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalActivePartners": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ReferralUserSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RefundPaymentDto": {
        "type": "object",
        "properties": {
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "RegionSettingsDto": {
        "type": "object",
        "properties": {
          "regionCode": {
            "type": "string",
            "description": "BCP 47 locale code: \"en-US\" or \"en-GB\""
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 currency code: \"USD\" or \"GBP\""
          },
          "weightSystem": {
            "type": "string",
            "description": "Weight system: \"imperial\" (lbs) or \"metric\" (kg)"
          },
          "temperatureSystem": {
            "type": "string",
            "description": "Temperature system: \"fahrenheit\" or \"celsius\""
          },
          "distanceSystem": {
            "type": "string",
            "description": "Distance system: \"miles\" or \"kilometers\""
          }
        },
        "description": "Region and locale settings for internationalization"
      },
      "RegisterErxProviderRequestDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "address1": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "description": "Register a vet with the e-prescribing vendor. Practice address/phone are supplied\nexplicitly (the DynamoDB clinic profile stores address as one free-text string, and\nthe vendor's provider directory validates structured fields) — the UI prefills them\nfrom the clinic profile for the admin to confirm."
      },
      "RegisterRdvmRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "practiceName": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "licenseNumber": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RejectRdvmRequest": {
        "type": "object",
        "properties": {
          "accessId": {
            "type": "string"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RejectReferralRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional: Reason for rejection"
          }
        }
      },
      "RejectRequestDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "ReleaseOrphanedAccountRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Body for releasing an orphaned Firebase account. The email is optional and used only for\nthe audit record — the account is identified by the UID in the route, never by this value."
      },
      "RelinkReminderRequest": {
        "type": "object",
        "properties": {
          "ruleId": {
            "type": "string"
          }
        }
      },
      "ReminderCategory": {
        "type": "integer"
      },
      "ReminderCompletionType": {
        "type": "integer"
      },
      "ReminderConflictDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Stable machine key, e.g. \"rule-inactive\", \"possible-duplicate\"."
          },
          "severity": {
            "type": "string",
            "description": "\"Warning\" or \"Info\"."
          },
          "message": {
            "type": "string"
          },
          "relatedReminderId": {
            "type": [
              "null",
              "string"
            ],
            "description": "For duplicate conflicts: the other reminder involved."
          }
        }
      },
      "ReminderDebugDto": {
        "type": "object",
        "properties": {
          "reminder": {
            "$ref": "#/components/schemas/ReminderResponseDto"
          },
          "rule": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The rule as it is today; null for manual/unlinked reminders or deleted rules.",
                "$ref": "#/components/schemas/WorkItemRuleDto"
              }
            ]
          },
          "ruleSnapshot": {
            "type": [
              "null",
              "object"
            ],
            "description": "The rule as it was when this reminder was emitted (version snapshot)."
          },
          "ruleChangedSinceEmission": {
            "type": "boolean"
          },
          "trigger": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderTriggerInfoDto"
              }
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkItemEventDto"
            }
          },
          "conflicts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReminderConflictDto"
            }
          }
        },
        "description": "Composed \"Why this reminder?\" payload (PAW-624): the reminder, the rule\nthat produced it (current + the version pinned at emission), the trigger,\nthe lifecycle timeline, and computed conflicts."
      },
      "ReminderListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReminderResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Response containing a list of reminders with pagination"
      },
      "ReminderOrigin": {
        "type": "integer"
      },
      "ReminderResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "$ref": "#/components/schemas/ReminderCategory"
          },
          "origin": {
            "$ref": "#/components/schemas/ReminderOrigin"
          },
          "dueDate": {
            "type": "string",
            "format": "date-time"
          },
          "snoozeUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "isCompleted": {
            "type": "boolean"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "object"
            ]
          },
          "emissionSource": {
            "$ref": "#/components/schemas/EmissionSource"
          },
          "generatedByRuleId": {
            "type": [
              "null",
              "string"
            ]
          },
          "generatedByRuleVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "triggerEventType": {
            "type": [
              "null",
              "string"
            ]
          },
          "triggerEntityType": {
            "type": [
              "null",
              "string"
            ]
          },
          "triggerEntityId": {
            "type": [
              "null",
              "string"
            ]
          },
          "suppressedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "suppressedByUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "suppressedReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "completionType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderCompletionType"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/ReminderStatus"
          }
        },
        "description": "Response DTO for reminder"
      },
      "ReminderStatus": {
        "type": "integer"
      },
      "ReminderTriggerInfoDto": {
        "type": "object",
        "properties": {
          "entityType": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "eventType": {
            "type": [
              "null",
              "string"
            ]
          },
          "exists": {
            "type": "boolean",
            "description": "False when the trigger entity has since been deleted."
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Clinic-language one-liner, e.g. \"Rabies vaccination recorded 2026-06-03\"."
          }
        }
      },
      "RenderTemplatePreviewRequestDto": {
        "type": "object",
        "properties": {
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateSectionDto"
            }
          },
          "format": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical output format, e.g. \"bottle-label\". Null falls back to the default."
          },
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "Template type, e.g. \"labels\". For labels the preview includes the\nregion-mandated compliance blocks appended at print time."
          }
        },
        "description": "Request to render a live preview of (possibly unsaved) template editor\nstate through the real production render pipeline."
      },
      "ReopenSurgicalRecordRequest": {
        "required": [
          "reason"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Why the frozen chart is being unfrozen. Required — this is the action a\nreviewer will question, and unlike a routine timestamp nudge it is rare\nenough that demanding prose does not train staff to type a placeholder."
          }
        }
      },
      "ReorderPublicPriceListDto": {
        "type": "object",
        "properties": {
          "orderedIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Entry IDs in desired display order (index 0 = first)."
          }
        }
      },
      "ReplaceRabiesTagRequest": {
        "required": [
          "reason"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          },
          "rabiesTagBatchId": {
            "type": [
              "null",
              "string"
            ]
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "outsideTagNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "countyTagNumber": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Replace a lost/damaged tag. The old tag is marked Lost/Replaced (with Reason)\nand chained to a freshly assigned replacement described the same way as an assignment."
      },
      "ReportAccent": {
        "enum": [
          "Blue",
          "Green",
          "Orange",
          "Teal",
          "Purple",
          "Grey"
        ],
        "description": "Section accent palette — fixed set so PDF and web stay consistent."
      },
      "ReportAction": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "owner": {
            "type": [
              "null",
              "string"
            ]
          },
          "due": {
            "type": [
              "null",
              "string"
            ]
          },
          "rationale": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReportAlign": {
        "enum": [
          "Left",
          "Right",
          "Center",
          null
        ]
      },
      "ReportBlock": {
        "required": [
          "kind"
        ],
        "type": "object",
        "anyOf": [
          {
            "$ref": "#/components/schemas/ReportBlockStatCardsBlock"
          },
          {
            "$ref": "#/components/schemas/ReportBlockTableBlock"
          },
          {
            "$ref": "#/components/schemas/ReportBlockActionsBlock"
          },
          {
            "$ref": "#/components/schemas/ReportBlockNoteBlock"
          }
        ],
        "discriminator": {
          "propertyName": "kind",
          "mapping": {
            "statCards": "#/components/schemas/ReportBlockStatCardsBlock",
            "table": "#/components/schemas/ReportBlockTableBlock",
            "actions": "#/components/schemas/ReportBlockActionsBlock",
            "note": "#/components/schemas/ReportBlockNoteBlock"
          }
        }
      },
      "ReportBlockActionsBlock": {
        "properties": {
          "kind": {
            "enum": [
              "actions"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportAction"
            }
          },
          "targets": {
            "$ref": "#/components/schemas/ReportOutputs"
          }
        }
      },
      "ReportBlockNoteBlock": {
        "properties": {
          "kind": {
            "enum": [
              "note"
            ],
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "tone": {
            "$ref": "#/components/schemas/ReportNoteTone"
          },
          "targets": {
            "$ref": "#/components/schemas/ReportOutputs"
          }
        }
      },
      "ReportBlockStatCardsBlock": {
        "properties": {
          "kind": {
            "enum": [
              "statCards"
            ],
            "type": "string"
          },
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportStatCard"
            }
          },
          "targets": {
            "$ref": "#/components/schemas/ReportOutputs"
          }
        }
      },
      "ReportBlockTableBlock": {
        "properties": {
          "kind": {
            "enum": [
              "table"
            ],
            "type": "string"
          },
          "key": {
            "type": "string",
            "description": "Stable key used to address this table in CSV exports (?table=pnl)."
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "subtitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportColumn"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportRow"
            }
          },
          "pdfRowLimit": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Cap rows in the PDF rendering only; CSV/JSON always carry all rows.",
            "format": "int32"
          },
          "dense": {
            "type": "boolean",
            "description": "Smaller font / tighter padding in PDF (dense ledgers like transactions)."
          },
          "csvIncludeStyleColumns": {
            "type": "boolean",
            "description": "Append row style + indent as trailing CSV columns (hierarchical ledgers)."
          },
          "targets": {
            "$ref": "#/components/schemas/ReportOutputs"
          }
        }
      },
      "ReportColumn": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ReportValueType"
          },
          "relativeWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Relative width weight (QuestPDF RelativeColumn). Ignored when FixedWidth set.",
            "format": "float"
          },
          "fixedWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "float"
          },
          "align": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReportAlign"
              }
            ]
          },
          "targets": {
            "description": "Per-column output targeting — e.g. an ID column that belongs in CSV but\n    would waste width in the PDF.",
            "$ref": "#/components/schemas/ReportOutputs"
          }
        }
      },
      "ReportDescriptor": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "fileSlug": {
            "type": "string",
            "description": "Filename stem for downloads, e.g. \"BI-Report\"."
          },
          "audience": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Intended readers, e.g. [\"Owner\", \"Practice Manager\"]."
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportParameterDescriptor"
            }
          }
        },
        "description": "Catalog metadata for a report in the report engine (ITE-219/221) — what\nGET /reports returns and what the AI modify-report tool validates against.\nShared between Business.API (which owns the data providers and rendering)\nand Orchestrate (whose report tool reads/writes SavedReport rows)."
      },
      "ReportDocument": {
        "type": "object",
        "properties": {
          "header": {
            "$ref": "#/components/schemas/ReportHeader"
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportSection"
            }
          }
        },
        "description": "Renderer-neutral report document (ITE-219). Providers build one of these from\nmetrics queries; the PDF/CSV renderers and the web viewer consume it. Values stay\nraw and typed — display formatting (whole dollars, \"23 min\", \"No data yet\") lives\nexclusively in ReportValueFormatter per the v4 export\nspec (docs/reporting-spec-v4/)."
      },
      "ReportEntityKind": {
        "enum": [
          "None",
          "Client",
          "Patient"
        ],
        "description": "Record kinds a report cell can link to. Only kinds the web view knows how to route\nbelong here — add one alongside its case in ReportDocumentView, never ahead of it."
      },
      "ReportHeader": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "subtitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicName": {
            "type": "string"
          },
          "periodLabel": {
            "type": "string",
            "description": "Human period label, e.g. \"Month to Date\"."
          },
          "generatedAt": {
            "type": "string",
            "description": "Pre-formatted generation timestamp, e.g. \"July 5, 2026 at 8:14 PM\"."
          }
        }
      },
      "ReportNoteTone": {
        "enum": [
          "Info",
          "Warning",
          "Rule"
        ]
      },
      "ReportOutputs": {
        "type": "string",
        "description": "Which outputs a block appears in. Lets a provider ship e.g. a CSV-only\n    KPI table alongside the stat cards that render the same data in PDF/web."
      },
      "ReportParameterDescriptor": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "\"select\" | \"string\" | \"number\" — drives the parameter form and tool validation."
          },
          "default": {
            "type": [
              "null",
              "string"
            ]
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ReportRow": {
        "type": "object",
        "properties": {
          "cells": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ReportValue"
            }
          },
          "style": {
            "$ref": "#/components/schemas/ReportRowStyle"
          },
          "indent": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Hierarchy depth for ledger-style tables; renders as left padding.",
            "format": "int32"
          }
        }
      },
      "ReportRowStyle": {
        "enum": [
          "Normal",
          "Header",
          "Total"
        ]
      },
      "ReportSection": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "accent": {
            "$ref": "#/components/schemas/ReportAccent"
          },
          "pageBreakAfter": {
            "type": "boolean",
            "description": "Start a new PDF page after this section (ignored by CSV/web)."
          },
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportBlock"
            }
          }
        }
      },
      "ReportStatCard": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "value": {
            "$ref": "#/components/schemas/ReportValue"
          },
          "caption": {
            "type": [
              "null",
              "string"
            ],
            "description": "Small line under the label, e.g. \"+12.1%\" or \"$23 saved\"."
          },
          "captionTone": {
            "$ref": "#/components/schemas/ReportTone"
          }
        }
      },
      "ReportTone": {
        "enum": [
          "Neutral",
          "Positive",
          "Negative"
        ]
      },
      "ReportValue": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ReportValueType"
          },
          "number": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/ReportValueState"
          },
          "tone": {
            "description": "Optional semantic coloring (green/red in PDF and web).",
            "$ref": "#/components/schemas/ReportTone"
          },
          "decimals": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Decimal places for Percent values (0 or 1 per the v4 spec). Default 1.",
            "format": "int32"
          },
          "entityKind": {
            "description": "Optional record this cell names, so the web view can render it as a deep link\ninstead of inert text. Purely additive: PDF and CSV go through\n`ReportValueFormatter.Format`, which reads Type/Number/Text/State only.",
            "$ref": "#/components/schemas/ReportEntityKind"
          },
          "entityId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Id of the linked record; null whenever ReportEntityKind ReportValue.EntityKind is None."
          }
        },
        "description": "A single typed cell/card value. Exactly one of decimal? ReportValue.Number / string? ReportValue.Text\ncarries the payload depending on ReportValueType ReportValue.Type; ReportValueState ReportValue.State overrides both\n(\"No data yet\" / \"Not configured\" are states, never fake zeros)."
      },
      "ReportValueState": {
        "enum": [
          "Normal",
          "NoDataYet",
          "NotConfigured"
        ]
      },
      "ReportValueType": {
        "enum": [
          "Text",
          "CurrencySummary",
          "CurrencyExact",
          "Percent",
          "Count",
          "Duration",
          "Status",
          "Date",
          "Trend"
        ]
      },
      "ResolvePtoRequestDto": {
        "type": "object",
        "properties": {
          "approved": {
            "type": "boolean"
          },
          "reviewNotes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ResolveTempLotRequest": {
        "type": "object",
        "properties": {
          "lotId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Existing real lot id if the clinician picks one. Mutually exclusive with InlineLotPayload? ResolveTempLotRequest.InlineLot."
          },
          "inlineLot": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Inline-create a new real lot to replace the temp one. Mutually exclusive with string? ResolveTempLotRequest.LotId.",
                "$ref": "#/components/schemas/InlineLotPayload"
              }
            ]
          }
        }
      },
      "ResolveTempLotResult": {
        "required": [
          "tempLotId",
          "resolvedByLotId",
          "vaccinationRecordsUpdated",
          "transactionsUpdated"
        ],
        "type": "object",
        "properties": {
          "tempLotId": {
            "type": "string"
          },
          "resolvedByLotId": {
            "type": "string"
          },
          "vaccinationRecordsUpdated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "transactionsUpdated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "workTaskId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RetailInventoryTransactionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "retailItemId": {
            "type": "string"
          },
          "retailItemName": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionType": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantityAfter": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "performedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "transactionDate": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RetailInventoryTransactionListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetailInventoryTransactionDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RetailItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": "string"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "cost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "quantityOnHand": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "reorderPoint": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "lowStockThreshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitOfMeasure": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackTransactions": {
            "type": "boolean"
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorProductCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "brand": {
            "type": [
              "null",
              "string"
            ]
          },
          "size": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RetailItemListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetailItemSummaryDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RetailItemLocationDto": {
        "type": "object",
        "properties": {
          "retailItemId": {
            "type": "string"
          },
          "inventoryLocationId": {
            "type": "string"
          },
          "locationName": {
            "type": "string"
          },
          "locationCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "RetailItemSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": "string"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "quantityOnHand": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isLowStock": {
            "type": "boolean"
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RevenueItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Item name (e.g., \"Apoquel 16mg\", \"Dental Cleaning Level 1\")"
          },
          "category": {
            "type": "string",
            "description": "Category (e.g., \"Pharmacy\", \"Services\", \"Vaccines\")"
          },
          "revenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Total revenue from this item in the period",
            "format": "double"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Total quantity sold/administered (supports decimal for liquid medications)",
            "format": "double"
          },
          "trend": {
            "type": "string",
            "description": "Trend compared to previous period: \"up\", \"down\", \"flat\""
          },
          "status": {
            "type": "string",
            "description": "Status for inventory items: \"In Stock\", \"Low\", \"Reorder\"\nStatus for services: \"Active\""
          }
        },
        "description": "Individual revenue item (service or product)"
      },
      "RevenuePerHourDto": {
        "type": "object",
        "properties": {
          "current": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "target": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "percentOfTarget": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ReversePaymentDto": {
        "type": "object",
        "properties": {
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "reason": {
            "type": "string"
          }
        },
        "description": "Request to reverse a payment (void or refund).\nThe system will automatically try void first for unsettled transactions,\nthen fall back to refund for settled transactions."
      },
      "ReversePaymentResultDto": {
        "type": "object",
        "properties": {
          "payment": {
            "$ref": "#/components/schemas/PaymentDto"
          },
          "method": {
            "type": "string",
            "description": "The method used to reverse the payment: \"Voided\" or \"Refunded\""
          },
          "message": {
            "type": "string",
            "description": "Human-readable message explaining the reversal"
          }
        },
        "description": "Result of a payment reversal operation.\nIndicates whether the payment was voided (unsettled) or refunded (settled)."
      },
      "RevertToEstimateRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Free-form reason shown on the consent/audit timeline."
          }
        },
        "description": "Revert an unpaid invoice back to an editable estimate. Optional audit reason."
      },
      "ReviewLabOrderDto": {
        "type": "object",
        "properties": {
          "resultStatus": {
            "type": [
              "null",
              "string"
            ],
            "description": "             Optional, and normally omitted (ITE-681). Signing off records that a clinician read the\n             result; it does not reclassify it, so the flag is left exactly as the laboratory reported.\n\n             Supply it only to classify an order sitting on PendingReview — nothing could be\nderived there, so the person reading it is the one deciding. On an already-classified order\nit is ignored and logged. \"Reviewed\" is accepted and means \"no change\": every client\nsent it before ITE-681 and an older web build still will during a rollout."
          },
          "summary": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RevokeConsentRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        },
        "description": "Request to revoke SMS consent"
      },
      "RevokeVaccineCertificateRequest": {
        "required": [
          "reason"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        },
        "description": "Request to revoke an issued certificate (no hard delete)."
      },
      "RoleResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isSystemRole": {
            "type": "boolean"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "minStaff": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxStaff": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isPrimaryProvider": {
            "type": "boolean"
          },
          "canPrescribe": {
            "type": "boolean"
          },
          "requiresTimeTracking": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "RoomDayAssignmentListResponseDto": {
        "type": "object",
        "properties": {
          "assignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoomDayAssignmentResponseDto"
            }
          }
        },
        "description": "Response DTO for a list of room day assignments."
      },
      "RoomDayAssignmentResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "assignmentDate": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Response DTO for a room day assignment with user details."
      },
      "RoomHoursInfo": {
        "required": [
          "roomId",
          "roomName",
          "hasOwnHoursRows",
          "openDays"
        ],
        "type": "object",
        "properties": {
          "roomId": {
            "type": "string"
          },
          "roomName": {
            "type": "string"
          },
          "hasOwnHoursRows": {
            "type": "boolean"
          },
          "openDays": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DayOfWeek"
            }
          }
        }
      },
      "RoutePrescriptionDto": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "pharmacyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryLotId": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimatedDeliveryTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "autoPrintLabel": {
            "type": "boolean"
          }
        }
      },
      "RuleDescriptorDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "description": "\"Blocking\" | \"Warning\""
          },
          "category": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "RxAmendmentSummaryDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          },
          "amendedAt": {
            "type": "string",
            "format": "date-time"
          },
          "amendedByDisplayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "amendmentCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "How many amendments this prescription has accumulated.",
            "format": "int32"
          },
          "dispensedDosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "dispensedFrequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "dispensedDuration": {
            "type": [
              "null",
              "string"
            ]
          },
          "dispensedInstructions": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "The latest post-dispense amendment, alongside the directions it superseded.\n\nThe \"as dispensed\" fields are read from that amendment's `OriginalContent`,\nwhich is a snapshot of the PrescriptionItem — and post-dispense the item never\nmutates, so every amendment's OriginalContent describes the same dispensed state.\nThe most recent one is therefore enough; earlier amendments need not be replayed."
      },
      "RxEventDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "actor": {
            "type": "string"
          },
          "data": {
            "type": [
              "null",
              "object"
            ]
          }
        }
      },
      "RxGovernanceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "species": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "medication": {
            "type": "string"
          },
          "medicationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "medicationCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ]
          },
          "strength": {
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "guardrails": {
            "$ref": "#/components/schemas/GuardrailChecksDto"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RxEventDto"
            }
          },
          "routing": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RxRoutingDto"
              }
            ]
          },
          "lastExamDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Patient's last exam date (VCPR - Veterinary-Client-Patient Relationship)"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "prescriptionItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when the dispense-from-inventory call included an InvoiceId and a line\nitem was created atomically with the dispense. Lets clients append the line\nitem locally without refetching."
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The estimate the dispense was attached to — either the one the caller supplied\nor one auto-created/resolved server-side. Lets a client that had no estimate of\nits own adopt the server's estimate instead of failing to reconcile the line."
          },
          "estimateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The draft Estimate the dispense-from-inventory landed on (the single billing\npath — the request's own quote estimate, fulfilled by the dispense). The\npayments panel converts this estimate instead of direct-creating a parallel\nbill (ITE-678). Mutually exclusive with string? RxGovernanceDto.InvoiceLineItemId."
          },
          "estimateLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The Performed estimate line the dispense fulfilled, when string? RxGovernanceDto.EstimateId is set."
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "amendment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Present only when a post-dispense amendment has superseded the dispensed\ndirections. Lets the UI show that the record was amended and what it said when it\nwas dispensed — without which an amended prescription just looks like an ordinary\none whose text was always this.",
                "$ref": "#/components/schemas/RxAmendmentSummaryDto"
              }
            ]
          },
          "prescriberLicenseNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "distributionCategorySnapshot": {
            "type": [
              "null",
              "string"
            ]
          },
          "isCascade": {
            "type": "boolean"
          },
          "cascadeReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "antimicrobialUseType": {
            "type": [
              "null",
              "string"
            ]
          },
          "antimicrobialJustification": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicalAssessmentPerformed": {
            "type": "boolean"
          },
          "physicalExamPerformed": {
            "type": "boolean"
          },
          "physicalExamJustification": {
            "type": [
              "null",
              "string"
            ]
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "description": "ISO date string (YYYY-MM-DD)."
          },
          "repeatCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "withdrawalPeriod": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RxGovernanceListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RxGovernanceDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RxGovernanceSettingsDto": {
        "type": "object",
        "properties": {
          "inHouseEnabled": {
            "type": "boolean"
          },
          "sameDayDeliveryEnabled": {
            "type": "boolean"
          },
          "onlinePharmacyEnabled": {
            "type": "boolean"
          },
          "printRetailEnabled": {
            "type": "boolean"
          },
          "atRiskThresholdDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "requireVetApprovalForControlled": {
            "type": "boolean"
          },
          "clientNudgeEnabled": {
            "type": "boolean"
          },
          "maxNudgesPerPrescription": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nudgeIntervalDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RxProtocolDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "scope": {
            "type": "string"
          },
          "scopeMedicationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopeMedicationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopeCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "inHouseAllowed": {
            "type": "boolean"
          },
          "sameDayAllowed": {
            "type": "boolean"
          },
          "onlinePharmacyAllowed": {
            "type": "boolean"
          },
          "printRetailAllowed": {
            "type": "boolean"
          },
          "requireDoseCheck": {
            "type": "boolean"
          },
          "requireInteractionCheck": {
            "type": "boolean"
          },
          "requireAllergyCheck": {
            "type": "boolean"
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RxProtocolListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RxProtocolDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RxRoutingDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "pharmacyId": {
            "type": [
              "null",
              "string"
            ]
          },
          "pharmacyName": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryLotId": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackingNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimatedDeliveryTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "routedAt": {
            "type": "string",
            "format": "date-time"
          },
          "routedBy": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RxStatsDto": {
        "type": "object",
        "properties": {
          "totalVolume": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "atRiskCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pendingCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "routedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "dispensedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "revenueCapture": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "avgCycleTimeDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SaveCustomExamRequest": {
        "type": "object",
        "properties": {
          "customExamTemplateId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customExamTemplateVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "customExamResponseJson": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Body of the explicit \"Save exam\" action (PAW-740, locked: runtime semantics). Persists the\nnarrative response JSON exactly like the autosave PATCH, then runs the binding interpreter\n— the single semantic commit point. Narrative autosave never interprets."
      },
      "SaveCustomExamResponse": {
        "type": "object",
        "properties": {
          "fieldResults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExamEmissionFieldResult"
            },
            "description": "One entry per bound field the interpreter had something to say about. Binding failures\nnever block the save: the narrative record is persisted regardless, and error fields\nsimply degrade to narrative-with-a-flag."
          }
        }
      },
      "SavedReportDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "baseReportKey": {
            "type": "string"
          },
          "parameters": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "includedTableKeys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isShared": {
            "type": "boolean"
          },
          "scheduleCadence": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduleRecipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isOwner": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SavePriceRuleDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "ruleType": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "groupCodeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validTo": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maxUsageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "stackingOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "payload": {
            "$ref": "#/components/schemas/PriceRulePayloadDto"
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceRuleTargetDto"
            }
          },
          "clientTagIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Customer-tag ids that gate this rule (empty = applies to any client)."
          }
        },
        "description": "Create/update payload for a price rule."
      },
      "SaveReportRequestDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "baseReportKey": {
            "type": "string"
          },
          "parameters": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "includedTableKeys": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "isShared": {
            "type": "boolean"
          },
          "scheduleCadence": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"daily\" | \"weekly\" | \"monthly\" | null/\"none\" for no schedule."
          },
          "scheduleRecipients": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ScheduleConflictCheckResponse": {
        "type": "object",
        "properties": {
          "hasConflicts": {
            "type": "boolean"
          },
          "conflicts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleConflictDto"
            }
          },
          "totalOccurrencesChecked": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Response from the conflict check endpoint"
      },
      "ScheduleConflictDto": {
        "required": [
          "conflictingItemId",
          "conflictingItemTitle",
          "conflictingItemType"
        ],
        "type": "object",
        "properties": {
          "proposedStart": {
            "type": "string",
            "format": "date-time"
          },
          "proposedEnd": {
            "type": "string",
            "format": "date-time"
          },
          "conflictingItemId": {
            "type": "string"
          },
          "conflictingItemTitle": {
            "type": "string"
          },
          "conflictingItemType": {
            "type": "string"
          },
          "conflictingStart": {
            "type": "string",
            "format": "date-time"
          },
          "conflictingEnd": {
            "type": "string",
            "format": "date-time"
          },
          "conflictingIsRecurringInstance": {
            "type": "boolean"
          },
          "conflictingParentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasAppointment": {
            "type": "boolean"
          }
        },
        "description": "Describes a single conflict between a proposed occurrence and an existing item"
      },
      "ScheduleHeatmapDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeatmapDataPointDto"
            }
          },
          "maxValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "period": {
            "type": "string"
          }
        }
      },
      "ScheduleItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "location": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LocationSummaryDto"
              }
            ]
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedTo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Schedule item DTO (embedded in appointments)"
      },
      "ScheduleItemListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleItemResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Paginated schedule item list response"
      },
      "ScheduleItemResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "location": {
            "$ref": "#/components/schemas/LocationSummaryDto"
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedTo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "createdBySource": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasAppointment": {
            "type": "boolean"
          },
          "appointment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AppointmentSummaryForScheduleDto"
              }
            ]
          },
          "isRecurring": {
            "type": "boolean"
          },
          "recurrenceRule": {
            "type": [
              "null",
              "string"
            ]
          },
          "recurrenceEndDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isException": {
            "type": "boolean"
          },
          "parentScheduleItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRecurrenceInstance": {
            "type": "boolean"
          },
          "originalStartTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        },
        "description": "Response DTO for standalone schedule items"
      },
      "SchedulingPreferencesDto": {
        "type": "object",
        "properties": {
          "roomManagementEnabled": {
            "type": "boolean"
          },
          "unassignedLocationId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Scheduling preferences — room management, default views, etc."
      },
      "SecondaryEmergencyContactDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "relationship": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "A client's secondary (backup) emergency contact — free-text, same shape as the primary one\n(PAW-650). Backed by the `SecondaryEmergencyContact*` columns on the client."
      },
      "SendChatEmailRequest": {
        "type": "object",
        "properties": {
          "recipientEmail": {
            "type": "string",
            "description": "Email address to send the conversation to"
          },
          "agentName": {
            "type": "string",
            "description": "Name of the AI agent (e.g., \"TriageAI\", \"P.A.W.S.\")"
          },
          "agentDescription": {
            "type": "string",
            "description": "Description of the agent"
          },
          "agentColor": {
            "type": "string",
            "description": "Color for the agent's messages (hex code)"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatExportMessage"
            },
            "description": "The conversation messages to include"
          }
        },
        "description": "Request body for emailing a chat conversation"
      },
      "SendChatMessageRequest": {
        "required": [
          "sessionId",
          "clinicId",
          "content"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "content": {
            "maxLength": 10000,
            "minLength": 0,
            "type": "string"
          },
          "clientInfo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WidgetClientInfoDto"
              }
            ]
          }
        }
      },
      "SendClientRecordEmailRequest": {
        "type": "object",
        "properties": {
          "recipientEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "options": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClientRecordExportOptions"
              }
            ]
          }
        }
      },
      "SendDEAEmailRequest": {
        "type": "object",
        "properties": {
          "recipientEmail": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email address to send the report to. If not provided, uses the logged-in user's email."
          },
          "managerName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional manager name to include in the report header"
          },
          "fromDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional start date for filtering entries",
            "format": "date-time"
          },
          "toDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional end date for filtering entries",
            "format": "date-time"
          }
        }
      },
      "SendErxPrescriptionRequestDto": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "providerUserId": {
            "type": "string"
          },
          "medication": {
            "description": "The catalog pick. Re-validated server-side against the vendor catalog (controlled-substance block).",
            "$ref": "#/components/schemas/ErxMedicationDto"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "daysSupply": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "refills": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sig": {
            "type": "string",
            "description": "Directions to the client (patient's owner)."
          },
          "notesToPharmacist": {
            "type": [
              "null",
              "string"
            ]
          },
          "weight": {
            "type": [
              "null",
              "string"
            ],
            "description": "Free text with units, e.g. \"12 lbs\". REQUIRED — the pharmacy network rejects sends without it."
          },
          "pharmacy": {
            "description": "The directory pick, snapshotted onto the record at send time.",
            "$ref": "#/components/schemas/ErxPharmacyDto"
          },
          "medicationRequestId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional back-link when this send fulfills an approved MedicationRequest routed to\nan online pharmacy (design §6.4). No state coupling — the request completes its own\nlifecycle; the eRx record just remembers where it came from."
          }
        },
        "description": "POST /erx/prescriptions — send a non-controlled prescription to an outside pharmacy."
      },
      "SendInviteRequest": {
        "required": [
          "method"
        ],
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          }
        }
      },
      "SendPatientRecordEmailRequest": {
        "type": "object",
        "properties": {
          "recipientEmail": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email address to send the report to. If not provided, uses the logged-in user's email."
          },
          "options": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Export options controlling which sections to include",
                "$ref": "#/components/schemas/PatientRecordExportOptions"
              }
            ]
          }
        },
        "description": "Request body for emailing a patient record"
      },
      "SendQuestionnaireRequestDto": {
        "required": [
          "questionnaireId"
        ],
        "type": "object",
        "properties": {
          "questionnaireId": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "deliveryMethod": {
            "$ref": "#/components/schemas/DeliveryMethod"
          },
          "expirationHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Request to send a questionnaire via the unified action system."
      },
      "SendRdvmReferralMessageRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "referralId": {
            "type": "string"
          },
          "content": {
            "type": "string"
          }
        }
      },
      "SendRdvmTriageMessageRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "threadId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "SendRdvmTriageMessageResponse": {
        "type": "object",
        "properties": {
          "threadId": {
            "type": "string"
          },
          "response": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SendRdvmVerificationRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "SendRdvmVerificationResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "maskedEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "needsRegistration": {
            "type": "boolean",
            "description": "True if the RDVM needs to register first (email not found)"
          }
        }
      },
      "SendSmsConsentEmailRequest": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Request to send SMS consent link via email"
      },
      "SendVerificationRequest": {
        "required": [
          "sessionId",
          "clinicId",
          "email"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "email": {
            "maxLength": 254,
            "minLength": 0,
            "type": "string"
          }
        }
      },
      "SendVerificationResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "maskedEmail": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ServiceCatalogItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "basePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ServiceCatalogListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceCatalogItemDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ServiceMixCategoryDto": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "percent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SetClockingPinRequestDto": {
        "type": "object",
        "properties": {
          "currentPin": {
            "type": [
              "null",
              "string"
            ]
          },
          "newPin": {
            "type": "string"
          }
        },
        "description": "Request DTO for setting/updating clocking PIN"
      },
      "Sex": {
        "type": "integer"
      },
      "SharePatientRecordsRequest": {
        "type": "object",
        "properties": {
          "includeMedicalHistory": {
            "type": "boolean"
          },
          "includeSoapNotes": {
            "type": "boolean"
          },
          "includeMedications": {
            "type": "boolean"
          },
          "includeDischargeRecords": {
            "type": "boolean"
          },
          "includeTransactionHistory": {
            "type": "boolean"
          },
          "includeLabs": {
            "type": "boolean"
          },
          "includeImaging": {
            "type": "boolean"
          },
          "dateFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "dateTo": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ShiftListResponseDto": {
        "type": "object",
        "properties": {
          "shifts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShiftResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "upcomingCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "completedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cancelledCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ShiftResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactInfo": {
            "type": [
              "null",
              "string"
            ]
          },
          "shiftDate": {
            "type": "string"
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "endTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "income": {
            "type": [
              "null",
              "string"
            ]
          },
          "cancelBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ShiftStatus"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ShiftStatus": {
        "type": "integer"
      },
      "ShiftSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "shiftDate": {
            "type": "string"
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "endTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "income": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "cancelBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "userId": {
            "type": "string"
          }
        }
      },
      "ShiftSwapListResponseDto": {
        "type": "object",
        "properties": {
          "shiftSwaps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShiftSwapResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pendingCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "acceptedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "declinedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ShiftSwapResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "shiftId": {
            "type": "string"
          },
          "shift": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ShiftSummaryDto"
              }
            ]
          },
          "fromUserId": {
            "type": "string"
          },
          "fromUser": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "toUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "toUser": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ShiftSwapStatus"
          },
          "resolvedByUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "resolvedByUser": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "resolvedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ShiftSwapStatus": {
        "type": "integer"
      },
      "SignInvoiceDto": {
        "type": "object",
        "properties": {
          "signatureData": {
            "type": "string"
          }
        }
      },
      "SlotConfigurationResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultSlotDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minAdvanceBookingHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxAdvanceBookingDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferBetweenAppointments": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minCancellationNoticeHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "defaultWidgetAppointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SlotPreview": {
        "required": [
          "startUtc",
          "endUtc",
          "startLocal",
          "endLocal",
          "locationId",
          "locationName"
        ],
        "type": "object",
        "properties": {
          "startUtc": {
            "type": "string",
            "format": "date-time"
          },
          "endUtc": {
            "type": "string",
            "format": "date-time"
          },
          "startLocal": {
            "type": "string"
          },
          "endLocal": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "locationName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SmsConsentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "consentGranted": {
            "type": "boolean"
          },
          "consentedAt": {
            "type": "string",
            "format": "date-time"
          },
          "consentVersion": {
            "type": "string"
          },
          "consentSource": {
            "type": "string"
          },
          "revokedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Full SMS consent record"
      },
      "SmsConsentLinkResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Response from generating SMS consent link"
      },
      "SmsConsentSettingsDto": {
        "type": "object",
        "properties": {
          "smsConsentEnabled": {
            "type": "boolean"
          },
          "brandName": {
            "type": [
              "null",
              "string"
            ]
          },
          "useCases": {
            "type": "string"
          }
        },
        "description": "SMS consent settings for a tenant"
      },
      "SmsConsentStatusDto": {
        "type": "object",
        "properties": {
          "required": {
            "type": "boolean"
          },
          "hasConsent": {
            "type": "boolean"
          },
          "consentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "consentedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "consentSource": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "SMS consent status for a phone number"
      },
      "SnoozeReminderRequest": {
        "type": "object",
        "properties": {
          "snoozeUntil": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Request to snooze a reminder"
      },
      "SoapAmendmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "soapNoteId": {
            "type": "string"
          },
          "section": {
            "type": [
              "null",
              "string"
            ],
            "description": "Section this amendment corrects, as the uppercase token the frontend's\n`SOAPSection` enum uses (\"SUBJECTIVE\", \"ASSESSMENT\", ...). Null on amendments\nfiled before the section was persisted — render those as unspecified rather than\ndefaulting to a section they may not belong to."
          },
          "originalContent": {
            "type": "string"
          },
          "amendedContent": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SoapNoteUserDto"
              }
            ]
          },
          "createdById": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "DTO for a SOAP note amendment"
      },
      "SoapNoteAppointmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "reasonForVisit": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "SoapNoteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "subjective": {
            "type": "string"
          },
          "objective": {
            "type": "string"
          },
          "assessment": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "format": {
            "type": "string",
            "description": "Note format discriminator (PAW-744). \"soap\" = standard four-section\nnote; \"quick-visit\" = condensed single-section note stored in\nstring SoapNoteDto.Subjective. See SoapNoteFormats."
          },
          "status": {
            "type": "string"
          },
          "createdById": {
            "type": "string"
          },
          "lockedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lockedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "aiGenerated": {
            "type": "boolean"
          },
          "aiConfidence": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "aiFlags": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentRecordingId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SoapNotePatientDto"
              }
            ]
          },
          "appointment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SoapNoteAppointmentDto"
              }
            ]
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SoapNoteUserDto"
              }
            ]
          },
          "lockedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SoapNoteUserDto"
              }
            ]
          },
          "problemCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasAmendments": {
            "type": "boolean"
          },
          "amendments": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SoapAmendmentDto"
            }
          },
          "isEditable": {
            "type": "boolean"
          }
        }
      },
      "SoapNoteFormatInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "description": "Format metadata served to the settings UI's Note Format dropdown."
      },
      "SoapNotePatientDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "species": {
            "type": "string"
          },
          "breed": {
            "type": "string"
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "sex": {
            "type": "string"
          }
        }
      },
      "SoapNoteUserDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          }
        }
      },
      "SpeciesDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SpeciesListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpeciesDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "StageCount": {
        "required": [
          "key",
          "surviving"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "surviving": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "StartGroupVisitRequest": {
        "type": "object",
        "properties": {
          "patientGroupId": {
            "type": "string"
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reasonForVisit": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StartRdvmTriageRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          }
        }
      },
      "StartRdvmTriageResponse": {
        "type": "object",
        "properties": {
          "threadId": {
            "type": "string"
          },
          "welcomeMessage": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StringSegment": {
        "type": "object",
        "properties": {
          "buffer": {
            "type": [
              "null",
              "string"
            ]
          },
          "offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasValue": {
            "type": "boolean"
          }
        }
      },
      "SubmitQuestionnaireResponseRequest": {
        "required": [
          "token",
          "responses"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "responses": {
            "type": "string"
          },
          "submittedBy": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to submit a response via public link"
      },
      "SubmitSmsConsentFromLinkRequest": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "maxLength": 500,
            "minLength": 0,
            "type": "string"
          },
          "consentGranted": {
            "type": "boolean"
          }
        },
        "description": "Request to submit SMS consent from magic link"
      },
      "SubscriptionChargeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "subscriptionId": {
            "type": "string"
          },
          "attemptedAt": {
            "type": "string",
            "format": "date-time"
          },
          "billingPeriodStart": {
            "type": "string",
            "format": "date"
          },
          "billingPeriodEnd": {
            "type": "string",
            "format": "date"
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string",
            "description": "\"Succeeded\" | \"Declined\" | \"TokenExpired\" | \"NoDefaultToken\" | \"ProcessorError\" | \"Skipped\"."
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "processorMessage": {
            "type": [
              "null",
              "string"
            ]
          },
          "retryCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isRetry": {
            "type": "boolean"
          }
        }
      },
      "SubscriptionDetailDto": {
        "type": "object",
        "properties": {
          "recentCharges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionChargeDto"
            }
          },
          "id": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupCodeId": {
            "type": "string"
          },
          "groupCodeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentTokenId": {
            "type": "string"
          },
          "paymentTokenLast4": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentTokenBrand": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string",
            "description": "\"Active\" | \"Paused\" | \"PastDue\" | \"Cancelled\" | \"Completed\"."
          },
          "frequency": {
            "type": "string",
            "description": "\"Weekly\" | \"BiWeekly\" | \"Monthly\" | \"Quarterly\" | \"Annually\"."
          },
          "billingDayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "nextBillingDate": {
            "type": "string",
            "format": "date"
          },
          "lastChargedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "billingCyclesCompleted": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxBillingCycles": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "snapshotAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "consecutiveFailureCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastFailureReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SubscriptionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "groupCodeId": {
            "type": "string"
          },
          "groupCodeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentTokenId": {
            "type": "string"
          },
          "paymentTokenLast4": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentTokenBrand": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string",
            "description": "\"Active\" | \"Paused\" | \"PastDue\" | \"Cancelled\" | \"Completed\"."
          },
          "frequency": {
            "type": "string",
            "description": "\"Weekly\" | \"BiWeekly\" | \"Monthly\" | \"Quarterly\" | \"Annually\"."
          },
          "billingDayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "nextBillingDate": {
            "type": "string",
            "format": "date"
          },
          "lastChargedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "billingCyclesCompleted": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxBillingCycles": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "snapshotAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "consecutiveFailureCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastFailureReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SubscriptionListResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionDto"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SummaryMetricDto": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "trend": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SuppressReminderRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to suppress a reminder (deliberately silence it, distinct from deactivating)"
      },
      "SurgicalRecordFinalizationEventDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "description": "\"finalized\" or \"reopened\"."
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "actorUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "actorUserName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SurgicalRecordResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "appointmentId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "procedureName": {
            "type": "string"
          },
          "surgeonId": {
            "type": [
              "null",
              "string"
            ]
          },
          "procedureStartTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "procedureEndTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "procedureDurationSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "activePhase": {
            "type": "string"
          },
          "anesthesiaDataJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "vitalsSnapshotJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "activeAgentsJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "finalizedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the chart was frozen, or null while it is still being written.",
            "format": "date-time"
          },
          "finalizedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "finalizedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "isFinalized": {
            "type": "boolean",
            "description": "Convenience for the client, which gates every write affordance on this\nrather than re-deriving it from the timestamp. Mirrors `IsEditable`\non the SOAP note DTOs."
          },
          "finalizationEvents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurgicalRecordFinalizationEventDto"
            },
            "description": "Finalize/reopen history, oldest first."
          },
          "timelineEvents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurgicalTimelineEventDto"
            }
          }
        }
      },
      "SurgicalTimelineEventAmendmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "originalOccurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "amendedOccurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "amendedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "amendedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SurgicalTimelineEventDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "surgicalRecordId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "details": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPinned": {
            "type": "boolean"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "amendments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurgicalTimelineEventAmendmentDto"
            },
            "description": "Corrections made to DateTime SurgicalTimelineEventDto.OccurredAt, oldest first. Empty for the\noverwhelming majority of events; a non-empty list is what the UI keys off\nto mark a stamp as edited."
          }
        }
      },
      "TagAssignmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tagId": {
            "type": "string"
          },
          "tagName": {
            "type": "string"
          },
          "tagColor": {
            "type": [
              "null",
              "string"
            ]
          },
          "tagIcon": {
            "type": [
              "null",
              "string"
            ]
          },
          "tagSeverity": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The tag definition's severity, denormalized so chips can render with\n            alert prominence without a second fetch. Null for ordinary (non-alert) tags.",
                "$ref": "#/components/schemas/WarningSeverity"
              }
            ]
          },
          "entityType": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedByUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TagAssignmentListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagAssignmentDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "TagDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "icon": {
            "type": [
              "null",
              "string"
            ]
          },
          "entityKinds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "origin": {
            "$ref": "#/components/schemas/TagOrigin"
          },
          "severity": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WarningSeverity"
              }
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "assignmentCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TagListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "TagOrigin": {
        "type": "integer",
        "description": "How a tag gets applied to entities. Manual tags are hand-picked by staff;\nAutomatic tags are applied by the system (Automation actions, future\nrule-emitted work). Stored as text."
      },
      "TelnyxCredentialsDto": {
        "type": "object",
        "properties": {
          "apiKey": {
            "type": [
              "null",
              "string"
            ],
            "description": "Telnyx v2 API key (optional, for provisioning)"
          },
          "sipUsername": {
            "type": [
              "null",
              "string"
            ],
            "description": "SIP credential connection username (required for WebRTC)"
          },
          "sipPassword": {
            "type": [
              "null",
              "string"
            ],
            "description": "SIP credential connection password (required for WebRTC)"
          },
          "connectionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "TeXML/Credential connection ID"
          },
          "callerIdNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Caller ID phone number (Telnyx DID)"
          },
          "callerIdName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Caller ID name (displayed on outbound calls)"
          }
        },
        "description": "Telnyx WebRTC credentials for browser-based softphone"
      },
      "TelnyxCredentialsStatusDto": {
        "type": "object",
        "properties": {
          "isConfigured": {
            "type": "boolean"
          },
          "hasSipCredentials": {
            "type": "boolean"
          },
          "hasApiKey": {
            "type": "boolean"
          },
          "callerIdNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "callerIdName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TemplateFormatSpecDto": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "widthMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "heightMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "marginTopMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "marginRightMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "marginBottomMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "marginLeftMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "baseFontSizePt": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "lineHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "paragraphSpacingPt": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "fixedSize": {
            "type": "boolean"
          }
        },
        "description": "Physical format spec exposed to the web editor so canvas sizing derives\nfrom the same numbers the PDF renderer uses."
      },
      "TemplateListResponseDto": {
        "type": "object",
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateResponseDto"
            }
          }
        },
        "description": "Response DTO for a list of templates."
      },
      "TemplatePreviewResultDto": {
        "type": "object",
        "properties": {
          "pages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Base64-encoded PNG per rendered page."
          },
          "pageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "widthMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "heightMm": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "dpi": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Server-rendered template preview: one PNG per output page plus the physical\npage dimensions. More than one page on a fixed-size label format means the\ncontent overflows the label."
      },
      "TemplateResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "headerContent": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy field - kept for backward compatibility."
          },
          "footerContent": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy field - kept for backward compatibility."
          },
          "sections": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TemplateSectionDto"
            },
            "description": "Block-based content sections."
          },
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailSubject": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailBody": {
            "type": [
              "null",
              "string"
            ]
          },
          "smsBody": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "unknownVariables": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Set on create/update responses only: {{tokens}} in the saved sections\nthat the render pipeline will not substitute for this template's type\n(typos or variables from another template type). Null when everything\nis known or validation was not run."
          }
        },
        "description": "Response DTO for a template."
      },
      "TemplateSectionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "order": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "columns": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TemplateSectionDto"
            }
          },
          "widthPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Represents a section/block within a template."
      },
      "TemplateVariableDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The token between the braces, e.g. \"patient_name\"."
          },
          "tag": {
            "type": "string",
            "description": "The full insertable token, e.g. \"{{patient_name}}\"."
          },
          "label": {
            "type": "string",
            "description": "Human-readable name shown in the editor's variable picker."
          },
          "description": {
            "type": "string"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Template types whose render path populates this variable. Empty for\nlegacy variables no current render path populates."
          },
          "sampleValue": {
            "type": [
              "null",
              "string"
            ],
            "description": "Realistic value substituted in editor previews."
          }
        },
        "description": "A template variable from the backend-owned catalog: a {{token}} the render\npipeline substitutes with real data at print time. The web editor's\nvariable picker and autocomplete derive from this instead of hardcoded\nfrontend lists."
      },
      "TenantKnowledgeDocumentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "sourceType": {
            "type": "string",
            "description": "\"protocol\" | \"handout\" | \"standalone\"."
          },
          "content": {
            "type": "string"
          },
          "diagnosisKeys": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPublished": {
            "type": "boolean"
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TerminalStatusDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "keyPreview": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TimeEntryDateRange": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        }
      },
      "TimeEntryListResponseDto": {
        "type": "object",
        "properties": {
          "timeEntries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimeEntryResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pendingCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lockedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stats": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TimeEntryStatsDto"
              }
            ]
          }
        }
      },
      "TimeEntryResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "date": {
            "type": "string"
          },
          "timeIn": {
            "type": "string",
            "format": "date-time"
          },
          "timeOut": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lunchIn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lunchOut": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "lunchDuration": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimeEntryStatsDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "totalEntries": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "entriesByStatus": {
            "type": "object",
            "additionalProperties": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "totalHoursWorked": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "averageHoursPerDay": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "averageHoursPerWeek": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalLunchMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "averageLunchDuration": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "earliestStartTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "latestEndTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "mostProductiveDay": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateRange": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TimeEntryDateRange"
              }
            ]
          }
        }
      },
      "ToggleLocationClosureDto": {
        "required": [
          "locationId",
          "closureDate"
        ],
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string"
          },
          "closureDate": {
            "type": "string"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request DTO for toggling a location closure."
      },
      "ToggleLocationClosureResponseDto": {
        "type": "object",
        "properties": {
          "isClosed": {
            "type": "boolean"
          },
          "closure": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LocationClosureResponseDto"
              }
            ]
          }
        },
        "description": "Response DTO for toggle operation."
      },
      "TopRevenueItemsDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RevenueItemDto"
            }
          },
          "period": {
            "type": "string"
          },
          "totalRevenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Top revenue-generating items (services and inventory products)"
      },
      "TransferInventoryDto": {
        "type": "object",
        "properties": {
          "lotId": {
            "type": "string"
          },
          "fromLocationId": {
            "type": "string"
          },
          "toLocationId": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TransferOwnershipRequest": {
        "type": "object",
        "properties": {
          "newClientId": {
            "type": "string"
          },
          "previousOwnerDisposition": {
            "description": "What becomes of the previous owner. Defaults to keeping them as a co-owner so ownership\nhistory isn't silently dropped; pass `Remove` to correct a wrong-client entry.",
            "$ref": "#/components/schemas/PreviousOwnerDisposition"
          }
        },
        "description": "Request to transfer a patient's primary ownership to another client (PAW-659)."
      },
      "TransferRetailInventoryDto": {
        "type": "object",
        "properties": {
          "fromLocationId": {
            "type": "string"
          },
          "toLocationId": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TransparencyOverviewDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "clinicName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownershipType": {
            "type": [
              "null",
              "string"
            ]
          },
          "parentOrganization": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownershipStatement": {
            "type": [
              "null",
              "string"
            ]
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "regionCode": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "taxMode": {
            "type": "string"
          }
        },
        "description": "Payload for the public transparency page hero + clinic metadata."
      },
      "TransparencyPageSettingsDto": {
        "type": "object",
        "properties": {
          "heroImageLogoId": {
            "type": [
              "null",
              "string"
            ]
          },
          "prescriptionPolicy": {
            "type": [
              "null",
              "string"
            ]
          },
          "outOfHoursProviderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "outOfHoursProviderHours": {
            "type": [
              "null",
              "string"
            ]
          },
          "outOfHoursInitialFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "outOfHoursPhone": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Admin-editable settings for the public CMA-style transparency pricing page."
      },
      "TransparencyPoliciesDto": {
        "type": "object",
        "properties": {
          "prescriptionPolicy": {
            "type": [
              "null",
              "string"
            ]
          },
          "outOfHoursProviderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "outOfHoursProviderHours": {
            "type": [
              "null",
              "string"
            ]
          },
          "outOfHoursInitialFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "outOfHoursPhone": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Policy block content (prescription freedom, out-of-hours)."
      },
      "TransparencyPricingCategoryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransparencyPricingItemDto"
            }
          }
        }
      },
      "TransparencyPricingDto": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransparencyPricingCategoryDto"
            }
          }
        },
        "description": "Categorized public pricing for the transparency page."
      },
      "TransparencyPricingItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayMode": {
            "type": "string",
            "description": "\"flat\" or \"range\"."
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Populated when string TransparencyPricingItemDto.DisplayMode is \"flat\".",
            "format": "double"
          },
          "minPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Populated when string TransparencyPricingItemDto.DisplayMode is \"range\".",
            "format": "double"
          },
          "maxPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Populated when string TransparencyPricingItemDto.DisplayMode is \"range\".",
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "description": "\"service\", \"inventory\", or \"kit\"."
          },
          "recurringFrequency": {
            "type": [
              "null",
              "string"
            ],
            "description": "Cadence label when the entry is a recurring kit (e.g., \"Weekly\", \"Monthly\").\nNull for one-time pricing. Drives the \"$X / month\" badge on the public page."
          }
        }
      },
      "TravelAddressConfigDto": {
        "type": "object",
        "properties": {
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "placeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "latitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "longitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Address configuration for travel appointments"
      },
      "TravelFeeConfigDto": {
        "type": "object",
        "properties": {
          "calculationMethod": {
            "type": "string"
          },
          "baseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "perMileRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "flatRateAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TravelFeeTierDto"
            }
          }
        },
        "description": "Fee configuration for travel appointments"
      },
      "TravelFeeTierDto": {
        "type": "object",
        "properties": {
          "maxDistanceMiles": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "feeAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        },
        "description": "Fee tier for tiered travel fee calculation"
      },
      "TravelSettingsDto": {
        "type": "object",
        "properties": {
          "travelAppointmentsEnabled": {
            "type": "boolean"
          },
          "personalVehicleEnabled": {
            "type": "boolean"
          },
          "personalVehicleLocationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultStartingAddress": {
            "$ref": "#/components/schemas/TravelAddressConfigDto"
          },
          "feeConfig": {
            "$ref": "#/components/schemas/TravelFeeConfigDto"
          },
          "defaultRoundTrip": {
            "type": "boolean"
          },
          "maxDistanceMiles": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Travel/mobile appointment settings DTO"
      },
      "TrendPointDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "TrendsDto": {
        "type": "object",
        "properties": {
          "revenue": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendPointDto"
            }
          },
          "appointments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendPointDto"
            }
          }
        }
      },
      "TypeRoomsGate": {
        "required": [
          "typeId",
          "typeName",
          "hasIntents",
          "effectiveRooms",
          "pass"
        ],
        "type": "object",
        "properties": {
          "typeId": {
            "type": "string"
          },
          "typeName": {
            "type": "string"
          },
          "hasIntents": {
            "type": "boolean"
          },
          "effectiveRooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReadinessRoomInfo"
            }
          },
          "pass": {
            "type": "boolean"
          }
        }
      },
      "UnresolvedVaccineLotDto": {
        "required": [
          "vaccinationRecordId",
          "patientId",
          "patientName",
          "vaccineName",
          "tempLotId",
          "tempLotNumber"
        ],
        "type": "object",
        "properties": {
          "vaccinationRecordId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "vaccineName": {
            "type": "string"
          },
          "tempLotId": {
            "type": "string"
          },
          "tempLotNumber": {
            "type": "string"
          },
          "administeredDate": {
            "type": "string",
            "format": "date-time"
          },
          "workTaskId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UnresolvedVaccineLotsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnresolvedVaccineLotDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpcomingAppointmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "time": {
            "type": "string"
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientName": {
            "type": "string"
          }
        }
      },
      "UpdateAppointmentRequest": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reasonForVisit": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "recordingId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "isTravelAppointment": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "travelDestinationAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDestinationPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelStartingPlaceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "travelDistanceMeters": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "travelIsRoundTrip": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "travelFeeAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "travelAccessNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresSurgeryRoom": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Per-appointment override for surgery requirement. Used for emergency surgery conversions."
          }
        },
        "description": "Request to update an existing appointment"
      },
      "UpdateAppointmentTypeDefaultServiceRequest": {
        "type": "object",
        "properties": {
          "defaultQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "description": "Request to update a default service on an appointment type"
      },
      "UpdateAppointmentTypeDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferBeforeMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferAfterMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requiresSurgeryRoom": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isGroupVisit": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isCompassionCare": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "allowOnlineBooking": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether clients may self-book this type online (ITE-430). Null = unchanged."
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "acuity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Default triage acuity (1–10) used when this type lands in CareQueue.",
            "format": "int32"
          },
          "defaultFlowId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Chronicle workflow id. Send an empty string to clear the override; omit\nto leave unchanged. Null is treated as omitted."
          },
          "examTemplateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Exam template override for the chronicle exam step (PAW-741). Send an\nempty string to clear the override; omit to leave unchanged. Null is\ntreated as omitted."
          },
          "noteFormat": {
            "type": [
              "null",
              "string"
            ],
            "description": "Generated-note format (PAW-744). Must be a known\nSoapNoteFormats id. Send an empty string to clear back to\nthe standard SOAP note; omit to leave unchanged. Null is treated as\nomitted."
          },
          "autoGenerateSoap": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Auto-start SOAP generation on treatment-plan-to-invoice conversion (PAW-675). Omit/null = unchanged."
          },
          "autoGenerateDischarge": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Auto-start discharge generation on SOAP approval (PAW-675). Omit/null = unchanged."
          },
          "locationIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Location IDs that can accommodate this appointment type (Location Intents).\nIf provided, replaces all existing location mappings."
          },
          "journeyTemplates": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateJourneyMilestoneTemplateRequest"
            },
            "description": "Journey milestone templates for this appointment type.\nIf provided, replaces all existing templates."
          },
          "defaultServices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateDefaultServiceInput"
            },
            "description": "Default services for this appointment type.\nIf provided, replaces all existing default services."
          }
        }
      },
      "UpdateAppointmentWithScheduleRequest": {
        "type": "object",
        "properties": {
          "appointment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateAppointmentRequest"
              }
            ]
          },
          "scheduleItem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateScheduleItemRequest"
              }
            ]
          }
        },
        "description": "Combined update request for appointment and schedule"
      },
      "UpdateBillableItemDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "basePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "components": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateBillableItemComponentDto"
            },
            "description": "When provided, fully replaces the components list."
          }
        }
      },
      "UpdateBreedDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateCaseMilestoneRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MilestoneStatus"
              }
            ]
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to update an existing case milestone"
      },
      "UpdateCaseRequest": {
        "type": "object",
        "properties": {
          "diagnosisType": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CaseStatus"
              }
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "planData": {
            "type": [
              "null",
              "string"
            ]
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        },
        "description": "Request to update an existing case"
      },
      "UpdateClientDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "phoneNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "clearDateOfBirth": {
            "type": "boolean",
            "description": "Set to true to clear the date of birth (since null can't be distinguished from \"not provided\")"
          },
          "accountStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "preferredContactMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowAppointmentReminders": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "allowEmailMarketing": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "allowPhoneCalls": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "allowSmsMarketing": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "communicationNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "emergencyContactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "emergencyContactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "emergencyContactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "emergencyContactRelationship": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryEmergencyContactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryEmergencyContactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryEmergencyContactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryEmergencyContactRelationship": {
            "type": [
              "null",
              "string"
            ]
          },
          "preferredLanguage": {
            "type": [
              "null",
              "string"
            ]
          },
          "referralSource": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateClinicSettingsRequest": {
        "type": "object",
        "properties": {
          "companyName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicAboutNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultAppointmentDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "schedulingPolicy": {
            "type": [
              "null",
              "string"
            ]
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultWeeklyHours": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LocationHoursEntryDto"
            }
          },
          "travel": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TravelSettingsDto"
              }
            ]
          },
          "schedulingPreferences": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SchedulingPreferencesDto"
              }
            ]
          },
          "metrics": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MetricsSettingsDto"
              }
            ]
          }
        }
      },
      "UpdateDailyGoalDto": {
        "type": "object",
        "properties": {
          "metricName": {
            "type": "string"
          },
          "goalValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "UpdateDiscountCodeDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "applyTo": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "discountType": {
            "type": [
              "null",
              "string"
            ]
          },
          "discountValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "scope": {
            "type": [
              "null",
              "string"
            ]
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validTo": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maxUsageCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxDiscountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "UpdateDispensedItemBillingDto": {
        "type": "object",
        "properties": {
          "markedForBilling": {
            "type": "boolean"
          }
        }
      },
      "UpdateDispensedItemDto": {
        "type": "object",
        "properties": {
          "dispenseType": {
            "type": "string",
            "description": "Type of dispense: InHouse or Prescription"
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "DTO for updating a dispensed item's dispense type and prescription details"
      },
      "UpdateEdgePrinterMappingsDto": {
        "type": "object",
        "properties": {
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EdgePrinterMappingEntryDto"
            }
          }
        }
      },
      "UpdateEstimateItemRequest": {
        "type": "object",
        "properties": {
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "markedForBilling": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "qtyMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "qtyLow": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyMed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "qtyHigh": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "UpdateExamTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "schema": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateExpenseDto": {
        "type": "object",
        "properties": {
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "date": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "referenceNumber": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateFormDraftRequest": {
        "required": [
          "formData",
          "isValid"
        ],
        "type": "object",
        "properties": {
          "formData": {
            "type": "string"
          },
          "isValid": {
            "type": "boolean"
          }
        },
        "description": "Request DTO for updating an existing form draft"
      },
      "UpdateGroupCodeDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "priceMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "fixedKitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "longDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRecurring": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "recurringFrequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "billingDayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxBillingCycles": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateGroupCodeItemDto"
            },
            "description": "When provided, fully replaces the items list."
          }
        }
      },
      "UpdateGroupSoapNoteRequest": {
        "type": "object",
        "properties": {
          "subjective": {
            "type": [
              "null",
              "string"
            ]
          },
          "objective": {
            "type": [
              "null",
              "string"
            ]
          },
          "assessment": {
            "type": [
              "null",
              "string"
            ]
          },
          "plan": {
            "type": [
              "null",
              "string"
            ]
          },
          "cohortLabel": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateHerdDetailsDto": {
        "type": "object",
        "properties": {
          "productionType": {
            "type": [
              "null",
              "string"
            ]
          },
          "farmName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateInventoryItemDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultSig": {
            "type": [
              "null",
              "string"
            ],
            "description": "Default prescription instructions (SIG) for rx-required items. See PAW-671."
          },
          "compoundFormula": {
            "type": [
              "null",
              "string"
            ],
            "description": "Compounding formula / preparation details for compounded items. See PAW-671."
          },
          "category": {
            "type": "string"
          },
          "vaccineTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorItemNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "drugForm": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitOfMeasure": {
            "type": [
              "null",
              "string"
            ],
            "description": "Per-item dispensing-unit label override (e.g. \"dose\", \"applicator\").\nNull = derive the label from DrugForm (ITE-390)."
          },
          "strength": {
            "type": [
              "null",
              "string"
            ]
          },
          "ndc": {
            "type": [
              "null",
              "string"
            ]
          },
          "isCompounded": {
            "type": "boolean"
          },
          "rxRequired": {
            "type": "boolean"
          },
          "allowedSpeciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "vcprRequiredDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxDispenseQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "deaBookId": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaSchedule": {
            "type": [
              "null",
              "string"
            ]
          },
          "controlledSubstanceSchedule": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "distributionCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "cascadeEligible": {
            "type": "boolean"
          },
          "isAntimicrobial": {
            "type": "boolean"
          },
          "antimicrobialType": {
            "type": [
              "null",
              "string"
            ]
          },
          "requiresUnderCare": {
            "type": "boolean"
          },
          "requiresPhysicalExam": {
            "type": "boolean"
          },
          "foodProducing": {
            "type": "boolean"
          },
          "requiresWithdrawalPeriod": {
            "type": "boolean"
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "pricePolicy": {
            "type": "string"
          },
          "markupPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "mapPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "dispenseFee": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitsPerContainer": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": "boolean"
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackLots": {
            "type": "boolean"
          },
          "storageRequirements": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "parQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "reorderPoint": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "UpdateInventoryLocationDto": {
        "type": "object",
        "properties": {
          "isActive": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationType": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateInventoryLotDto": {
        "type": "object",
        "properties": {
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "manufacturedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "manufacturer": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isActive": {
            "type": "boolean"
          },
          "containerId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateInvoiceDto": {
        "type": "object",
        "properties": {
          "providerMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceProviderId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateInvoiceLineItemDto"
            }
          }
        }
      },
      "UpdateInvoiceLineItemDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "discount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateJourneyMilestoneRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MilestoneType"
              }
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MilestoneStatus"
              }
            ]
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "orderIndex": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimatedDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Request to update an existing journey milestone"
      },
      "UpdateLabOrderDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "testType": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "accessionNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "collectedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "resultsReceivedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "summary": {
            "type": [
              "null",
              "string"
            ]
          },
          "reportUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateLabPanelDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "testType": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "tests": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateLabPanelTestDto"
            }
          }
        }
      },
      "UpdateLitterDetailsDto": {
        "type": "object",
        "properties": {
          "damPatientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "damText": {
            "type": [
              "null",
              "string"
            ]
          },
          "sireText": {
            "type": [
              "null",
              "string"
            ]
          },
          "whelpDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "litterSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateLocationDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isVehicle": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isPersonalVehicle": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "allowOnlineBooking": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "allowOverbooking": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "allowedSpeciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpdateLocationHoursDto": {
        "type": "object",
        "properties": {
          "hours": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationHoursEntryDto"
            }
          }
        }
      },
      "UpdateLogoRequest": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "maxLength": 500,
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "description": "Request to update logo metadata"
      },
      "UpdateLotContainerDto": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": [
              "null",
              "string"
            ],
            "description": "New storage location id; omit to leave unchanged."
          },
          "containerCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "New container code; omit to leave unchanged. Rejected once any DEA entry exists\nunder the old or new code — the (book, container) ledger keys on it."
          }
        },
        "description": "Update a container's metadata: storage location, and — while its DEA ledger is still\nempty — its code. Quantity is deliberately absent: stock moves only through the\nadjust/dispense flows so lot == sum(containers) and the DEA ledger stay reconciled."
      },
      "UpdateNpsResponseDto": {
        "type": "object",
        "properties": {
          "internalNote": {
            "type": [
              "null",
              "string"
            ]
          },
          "resolved": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "description": "Body for PATCH /api/nps/responses/{id}."
      },
      "UpdateOutsideMedicationStatusDto": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "One of: Requested, Filled, Cancelled."
          }
        },
        "description": "Payload for the status-transition endpoint (ITE-546). Only the manual statuses are\nvalid targets — the eRx trio (Sending/Sent/Failed) belongs to the send path and\nwebhook. For eRx rows the sole allowed transition is Sent → Filled."
      },
      "UpdatePartnerAccessDto": {
        "type": "object",
        "properties": {
          "canViewRecords": {
            "type": "boolean"
          },
          "canSendRecords": {
            "type": "boolean"
          },
          "canScheduleReferrals": {
            "type": "boolean"
          },
          "canMessage": {
            "type": "boolean"
          },
          "canViewBilling": {
            "type": "boolean"
          },
          "canExportData": {
            "type": "boolean"
          }
        }
      },
      "UpdatePartnerDto": {
        "type": "object",
        "properties": {
          "clinicName": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialties": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "zipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdatePatientDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "clearDateOfBirth": {
            "type": "boolean",
            "description": "Set to true to clear the date of birth (since null can't be distinguished from \"not provided\")"
          },
          "isEstimatedAge": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "microchipNo": {
            "type": [
              "null",
              "string"
            ]
          },
          "fixed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "sex": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccinationStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastVaccinationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "previousVet": {
            "type": [
              "null",
              "string"
            ]
          },
          "previousVetPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDeceased": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the patient is deceased"
          },
          "deceasedDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Date the patient was marked as deceased (set automatically when IsDeceased is set to true)",
            "format": "date-time"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the patient is active"
          }
        }
      },
      "UpdatePatientGroupDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "headCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "litterDetails": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateLitterDetailsDto"
              }
            ]
          },
          "herdDetails": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateHerdDetailsDto"
              }
            ]
          }
        }
      },
      "UpdatePatientGroupMemberDto": {
        "type": "object",
        "properties": {
          "tagOrIdentifier": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "sex": {
            "type": [
              "null",
              "string"
            ]
          },
          "colorMarkings": {
            "type": [
              "null",
              "string"
            ]
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isException": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdatePatientMassMeasurementRequest": {
        "type": "object",
        "properties": {
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "UpdatePatientMassRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "zone": {
            "type": [
              "null",
              "string"
            ]
          },
          "shape": {
            "type": [
              "null",
              "string"
            ]
          },
          "mobility": {
            "type": [
              "null",
              "string"
            ]
          },
          "consistency": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdatePatientProblemDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "confidence": {
            "type": [
              "null",
              "string"
            ]
          },
          "chronicity": {
            "type": [
              "null",
              "string"
            ]
          },
          "severity": {
            "type": [
              "null",
              "string"
            ]
          },
          "onsetDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "resolvedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdatePaymentTokenDto": {
        "type": "object",
        "properties": {
          "nickname": {
            "type": [
              "null",
              "string"
            ]
          },
          "setAsDefault": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdatePrescriptionDto": {
        "type": "object",
        "properties": {
          "medicationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          },
          "refillsAllowed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required for post-Dispensed amendments; ignored otherwise."
          }
        },
        "description": "Full prescription edit payload. Every editable field is nullable — only the\nsupplied properties are applied. When the prescription has already been\ndispensed, string? UpdatePrescriptionDto.Reason is required and the edit lands as a\n`PrescriptionAmendment` rather than mutating the original item."
      },
      "UpdatePrescriptionInstructionsDto": {
        "type": "object",
        "properties": {
          "dosage": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "instructions": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdatePrinterDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdatePrintJobStatusDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdatePtoRequestDto": {
        "type": "object",
        "properties": {
          "type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PtoRequestType"
              }
            ]
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ]
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdatePublicPriceListEntryDto": {
        "type": "object",
        "properties": {
          "nameOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "descriptionOverride": {
            "type": [
              "null",
              "string"
            ]
          },
          "categoryLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "minPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "UpdateQiEventStatusDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateQuestionnaireRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QuestionnaireType"
              }
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QuestionnaireStatus"
              }
            ]
          },
          "isTemplate": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "schema": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to update an existing questionnaire"
      },
      "UpdateQuestionnaireResponseRequest": {
        "type": "object",
        "properties": {
          "responses": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QuestionnaireResponseStatus"
              }
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to update a response (save progress or submit)"
      },
      "UpdateRabiesTagBatchRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Update mutable batch fields. Range/prefix/type/location are immutable once created\n            (changing them would corrupt already-issued tag numbers). Status accepts Active | Inactive."
      },
      "UpdateRdvmUserPermissionsRequest": {
        "type": "object",
        "properties": {
          "canSubmitReferrals": {
            "type": "boolean"
          },
          "canViewRecords": {
            "type": "boolean"
          },
          "canSendMessages": {
            "type": "boolean"
          },
          "canUseTriage": {
            "type": "boolean"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateRecordingRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "summary": {
            "type": [
              "null",
              "string"
            ]
          },
          "fullTranscript": {
            "type": [
              "null",
              "string"
            ]
          },
          "attendingDvmId": {
            "type": [
              "null",
              "string"
            ]
          },
          "scribeUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "examDataJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "customExamTemplateId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customExamTemplateVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "customExamResponseJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "orderedTestsJson": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to update recording metadata"
      },
      "UpdateRecordingStatusRequest": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        },
        "description": "Request to update recording status"
      },
      "UpdateRecurringExpenseDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "frequency": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExpenseFrequency"
              }
            ]
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "vendorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "dayOfMonth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "dayOfWeek": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DayOfWeek"
              }
            ]
          }
        }
      },
      "UpdateReferralDocumentRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateReferralDto": {
        "type": "object",
        "properties": {
          "toPartnerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialty": {
            "type": [
              "null",
              "string"
            ]
          },
          "urgency": {
            "type": [
              "null",
              "string"
            ]
          },
          "reasonForReferral": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicalNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "diagnosisCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduledDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "assignedVetId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateReferralStatusDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "completedDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "UpdateReminderRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderCategory"
              }
            ]
          },
          "dueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isCompleted": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "object"
            ]
          }
        },
        "description": "Request to update an existing reminder"
      },
      "UpdateRetailItemDto": {
        "type": "object",
        "properties": {
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "cost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "reorderPoint": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "lowStockThreshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unitOfMeasure": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackTransactions": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "vendorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vendorProductCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "brand": {
            "type": [
              "null",
              "string"
            ]
          },
          "size": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateRoleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "permissions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "minStaff": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxStaff": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isPrimaryProvider": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "canPrescribe": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requiresTimeTracking": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdateRoomStatusRequest": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        },
        "description": "Request to update room status (Available, Needs Cleaning, Out of Service, etc.)"
      },
      "UpdateRxGovernanceSettingsDto": {
        "type": "object",
        "properties": {
          "inHouseEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "sameDayDeliveryEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "onlinePharmacyEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "printRetailEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "atRiskThresholdDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "requireVetApprovalForControlled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "clientNudgeEnabled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "maxNudgesPerPrescription": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nudgeIntervalDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateRxProtocolDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "scope": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopeMedicationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopeMedicationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopeCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "inHouseAllowed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "sameDayAllowed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "onlinePharmacyAllowed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "printRetailAllowed": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requireDoseCheck": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requireInteractionCheck": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requireAllergyCheck": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdateScheduleInstanceRequest": {
        "required": [
          "originalStartTime"
        ],
        "type": "object",
        "properties": {
          "originalStartTime": {
            "type": "string",
            "format": "date-time"
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "isCancelled": {
            "type": "boolean"
          }
        },
        "description": "Request to update a single instance of a recurring schedule item\nCreates an exception record that overrides the instance"
      },
      "UpdateScheduleItemRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customAttributes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRecurring": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "recurrencePattern": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecurrencePatternDto"
              }
            ]
          }
        },
        "description": "Request to update schedule item"
      },
      "UpdateScheduleSeriesRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "startTimeOfDay": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "recurrencePattern": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecurrencePatternDto"
              }
            ]
          }
        },
        "description": "Request to update a recurring series (affects all future occurrences)"
      },
      "UpdateServiceCatalogItemDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "basePrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isTaxable": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "vatCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateShiftDto": {
        "type": "object",
        "properties": {
          "userId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactInfo": {
            "type": [
              "null",
              "string"
            ]
          },
          "shiftDate": {
            "type": [
              "null",
              "string"
            ]
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "endTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "income": {
            "type": [
              "null",
              "string"
            ]
          },
          "cancelBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateSlotConfigurationDto": {
        "type": "object",
        "properties": {
          "defaultSlotDurationMinutes": {
            "maximum": 480,
            "minimum": 5,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minAdvanceBookingHours": {
            "maximum": 8760,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxAdvanceBookingDays": {
            "maximum": 730,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferBetweenAppointments": {
            "maximum": 240,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minCancellationNoticeHours": {
            "maximum": 8760,
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "defaultWidgetAppointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateSpeciesDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateSpeciesRestrictionsDto": {
        "type": "object",
        "properties": {
          "speciesIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpdateSubscriptionDto": {
        "type": "object",
        "properties": {
          "paymentTokenId": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextBillingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateSurgicalRecordRequest": {
        "type": "object",
        "properties": {
          "activePhase": {
            "type": [
              "null",
              "string"
            ]
          },
          "procedureName": {
            "type": [
              "null",
              "string"
            ]
          },
          "procedureStartTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "procedureEndTime": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "procedureDurationSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "anesthesiaDataJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "vitalsSnapshotJson": {
            "type": [
              "null",
              "string"
            ]
          },
          "activeAgentsJson": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateSurgicalTimelineEventRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "details": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPinned": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "occurredAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Corrected time the step actually happened, UTC. Omit to leave the stamp\nalone. A value that differs from the stored stamp appends a\n`SurgicalTimelineEventAmendment`; it is never a silent overwrite.",
            "format": "date-time"
          },
          "amendmentReason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional justification recorded alongside an DateTime? UpdateSurgicalTimelineEventRequest.OccurredAt correction."
          }
        }
      },
      "UpdateTagRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "icon": {
            "type": [
              "null",
              "string"
            ]
          },
          "entityKinds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "severity": {
            "type": [
              "null",
              "string"
            ],
            "description": "Severity (\"Low\"/\"Normal\"/\"High\"/\"Critical\"); empty string clears it."
          }
        }
      },
      "UpdateTemplateDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "headerContent": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy field - use Sections instead for new templates."
          },
          "footerContent": {
            "type": [
              "null",
              "string"
            ],
            "description": "Legacy field - use Sections instead for new templates."
          },
          "sections": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TemplateSectionDto"
            },
            "description": "Block-based content sections."
          },
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailSubject": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailBody": {
            "type": [
              "null",
              "string"
            ]
          },
          "smsBody": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "description": "Request DTO for updating a template."
      },
      "UpdateTenantKnowledgeDocumentDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceType": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "type": [
              "null",
              "string"
            ]
          },
          "diagnosisKeys": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPublished": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdateTimeEntryDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": [
              "null",
              "string"
            ]
          },
          "timeIn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "timeOut": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lunchIn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lunchOut": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateUnitsPerContainerDto": {
        "type": "object",
        "properties": {
          "unitsPerContainer": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Dispensing units one container holds. Must be greater than zero; null clears it\nback to \"unknown\".",
            "format": "double"
          }
        },
        "description": "Set an item's container size on its own (ITE-314).\n\nExists because PUT /inventory/{id} is a full replace: every caller must send a\ncomplete item, so a caller that only knows the container size — the vendor-invoice\nimporter, which collects it to convert per-container prices — would have to\nhand-build the whole item DTO and would silently blank whatever it missed."
      },
      "UpdateUserRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "maxLength": 100,
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "maxLength": 100,
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "maxLength": 200,
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserType"
              }
            ]
          },
          "roleId": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorshipDurationDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "clearMentor": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "deaNumber": {
            "maxLength": 50,
            "type": [
              "null",
              "string"
            ]
          },
          "licenseNumber": {
            "maxLength": 100,
            "type": [
              "null",
              "string"
            ]
          },
          "licenseState": {
            "maxLength": 2,
            "type": [
              "null",
              "string"
            ]
          },
          "usdaNumber": {
            "maxLength": 50,
            "type": [
              "null",
              "string"
            ]
          },
          "deaLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "stateLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "usdaLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "signatureImage": {
            "type": [
              "null",
              "string"
            ],
            "description": "The provider's stored signature as a `data:image/...;base64,` data URL. Send an empty\nstring to clear the signature, a data URL to set it, or omit to leave unchanged."
          },
          "defaultExamTemplateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Provider's selected default exam template id. Send empty string to clear (use built-in\n7-system view) or omit to leave unchanged."
          }
        }
      },
      "UpdateVaccinationRecordRequest": {
        "type": "object",
        "properties": {
          "vaccineTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "administeredDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "vaccineExpirationDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical vaccine vial/lot expiration date (distinct from the next-due DateTime? UpdateVaccinationRecordRequest.ExpirationDate).",
            "format": "date-time"
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "manufacturer": {
            "type": [
              "null",
              "string"
            ]
          },
          "route": {
            "type": [
              "null",
              "string"
            ]
          },
          "site": {
            "type": [
              "null",
              "string"
            ]
          },
          "administeredById": {
            "type": [
              "null",
              "string"
            ],
            "description": "Reassign who physically gave the dose. Null = leave unchanged; to CLEAR back to \"not recorded / external\", set bool UpdateVaccinationRecordRequest.NoAdministeredBy."
          },
          "noAdministeredBy": {
            "type": "boolean",
            "description": "True = clear the administering staff member to \"not recorded / external\". Wins over string? UpdateVaccinationRecordRequest.AdministeredById."
          },
          "doctorOfRecordId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Reassign the DVM of record. Null = leave unchanged; to CLEAR to \"no doctor\", set bool UpdateVaccinationRecordRequest.NoDoctorOfRecord."
          },
          "noDoctorOfRecord": {
            "type": "boolean",
            "description": "True = clear the doctor of record (dose certifies unsigned). Wins over string? UpdateVaccinationRecordRequest.DoctorOfRecordId."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request to update an existing vaccination record"
      },
      "UpdateVaccineTypeRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isCore": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isRabies": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "reminderThresholdDays": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "scheduleStages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/VaccineScheduleStageDto"
            },
            "description": "Null = leave the schedule unchanged; empty = clear it (revert to legacy single-duration\nbehavior). When non-null, int? UpdateVaccineTypeRequest.RestartIfLapsedAfterDays and\nbool? UpdateVaccineTypeRequest.RepeatFinalDose are applied verbatim as part of the same schedule edit\n(including null to clear the lapse window)."
          },
          "repeatFinalDose": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Null = leave unchanged; only applied alongside a non-null List&lt;VaccineScheduleStageDto&gt;? UpdateVaccineTypeRequest.ScheduleStages."
          },
          "restartIfLapsedAfterDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateVitalTypeRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "dataType": {
            "type": [
              "null",
              "string"
            ]
          },
          "minValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "acknowledgeExamTemplateImpact": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Caller has seen which exam templates bind this code and still wants to deactivate it.\nOnly consulted when bool? UpdateVitalTypeRequest.IsActive is being flipped to false on a bound type;\nwithout it that request is a 409 carrying the template list."
          }
        }
      },
      "UpdateWorkItemRuleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "titleTemplate": {
            "type": [
              "null",
              "string"
            ]
          },
          "descriptionTemplate": {
            "type": [
              "null",
              "string"
            ]
          },
          "speciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "requiredTagIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "excludedTagIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "triggerTagId": {
            "type": [
              "null",
              "string"
            ]
          },
          "minAgeMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxAgeMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cadenceOffsetsDays": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "recurrenceIntervalMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "autoSatisfyOnTrigger": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "emitReminderCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "emitTaskCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "emitTaskPriority": {
            "type": [
              "null",
              "string"
            ]
          },
          "triggerEventTypes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Replaces the rule's trigger event types when present (null = leave unchanged)."
          },
          "itemMaps": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateWorkItemRuleItemMapRequest"
            },
            "description": "Replaces the rule's item maps wholesale when present (null = leave unchanged; empty = clear)."
          }
        }
      },
      "UpdateWorkTaskDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          },
          "dueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "callbackType": {
            "type": [
              "null",
              "string"
            ]
          },
          "promisedById": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateWorkTaskStatusDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpsertCompensationDto": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "annualSalary": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "productionPercentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "productionThreshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "standardAnnualHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          },
          "effectiveUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "compensationThresholdOverridePercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "UpsertCompensationExclusionDto": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "description": "\"clinic\" or \"vet\"."
          },
          "scopeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required when string UpsertCompensationExclusionDto.Scope is \"vet\": the provider's user id."
          },
          "buckets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "description": "Replaces the full bucket set for a single scope (\"clinic\" or one \"vet\")."
      },
      "UpsertTerminalDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          }
        }
      },
      "UserListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserResponseDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UserReconciliationReport": {
        "required": [
          "tenantId",
          "firebaseAccountCount",
          "activeUserRowCount",
          "orphanedFirebaseAccounts",
          "userRowsWithoutFirebaseAccount"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string"
          },
          "firebaseAccountCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "activeUserRowCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "orphanedFirebaseAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrphanedFirebaseAccount"
            }
          },
          "userRowsWithoutFirebaseAccount": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserRowWithoutFirebaseAccount"
            }
          },
          "isClean": {
            "type": "boolean",
            "description": "True when the two stores agree — nothing to act on."
          }
        },
        "description": "The result of diffing Firebase Auth against the tenant's user table, in both directions."
      },
      "UserResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/UserType"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastLoginAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "roleId": {
            "type": [
              "null",
              "string"
            ]
          },
          "roleName": {
            "type": [
              "null",
              "string"
            ]
          },
          "permissions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "invitedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "passwordResetRequired": {
            "type": "boolean"
          },
          "mentorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "mentorshipStartDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "mentorshipDurationDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isMentorshipActive": {
            "type": "boolean"
          },
          "isPrimaryProvider": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "deaNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "licenseNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "licenseState": {
            "type": [
              "null",
              "string"
            ]
          },
          "usdaNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "deaLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "stateLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "usdaLicenseExpiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "signatureImage": {
            "type": [
              "null",
              "string"
            ],
            "description": "The provider's stored signature as a `data:image/...;base64,` data URL, applied to\ngenerated documents (e.g. the vaccine certificate). Null when none on file."
          },
          "defaultExamTemplateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Provider's selected default exam template id, or null to use the built-in 7-system view."
          }
        }
      },
      "UserRowWithoutFirebaseAccount": {
        "required": [
          "userId",
          "email"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "An active user row whose Firebase account is missing. This user cannot sign in."
      },
      "UserSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          },
          "roleId": {
            "type": [
              "null",
              "string"
            ]
          },
          "roleName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UserType": {
        "type": "integer"
      },
      "VaccinationRecordDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccineType": {
            "$ref": "#/components/schemas/VaccineTypeSummaryDto"
          },
          "administeredDate": {
            "type": "string",
            "format": "date-time"
          },
          "expirationDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Next-due date (when the current dose lapses). Not the vial expiry — see DateTime? VaccinationRecordDto.VaccineExpirationDate.",
            "format": "date-time"
          },
          "vaccineExpirationDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical vaccine vial/lot expiration date (distinct from the next-due DateTime? VaccinationRecordDto.ExpirationDate).",
            "format": "date-time"
          },
          "administeredBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Who physically gave the injection (often a tech/RVT) — audit detail, never the certificate signer. Null = not recorded / external.",
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "doctorOfRecord": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The DVM on the record — the default certifying veterinarian for certificates. Null = no doctor (external dose): certifies unsigned.",
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "manufacturer": {
            "type": [
              "null",
              "string"
            ]
          },
          "route": {
            "type": [
              "null",
              "string"
            ]
          },
          "site": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryTransactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduleStageSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Schedule stage this dose was resolved to at administration (1 = first dose / series restart); null for legacy records.",
            "format": "int32"
          },
          "hasUnresolvedLot": {
            "type": "boolean",
            "description": "True when the underlying inventory lot is a temporary placeholder awaiting resolution.\nCertificate generation is blocked while this is true."
          },
          "isVoided": {
            "type": "boolean",
            "description": "True when the dose was retracted (billing line voided, or a mis-entry corrected). The record\nstays on the chart for audit but is not a valid dose: it drives no reminders, does not count\ntoward vaccination status or schedule stage, and cannot be certified. Render it struck through."
          },
          "voidedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "voidedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "voidReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Vaccination record with related entities"
      },
      "VaccinationStatus": {
        "type": "integer"
      },
      "VaccineAdministrationResult": {
        "required": [
          "transactionId",
          "vaccinationRecordId",
          "lotId"
        ],
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string"
          },
          "vaccinationRecordId": {
            "type": "string"
          },
          "lotId": {
            "type": "string"
          },
          "workTaskId": {
            "type": [
              "null",
              "string"
            ]
          },
          "isTemporaryLot": {
            "type": "boolean"
          },
          "invoiceLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Present when the request included string? AdministerVaccineRequest.InvoiceId and the\ndispense auto-created a matching line item. Lets the payments UI skip the unbilled-items\npoll and add the line directly."
          },
          "invoiceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The estimate the dispense was attached to — caller-supplied or auto-resolved\nserver-side. Lets a payments UI that had no estimate of its own adopt the\nserver's estimate instead of failing to reconcile the line."
          },
          "estimateId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The draft Estimate the walk-in dispense landed on (the single billing path,\nfound or created for the patient). The payments panel converts this estimate\n(`POST /estimates/{id}/convert-to-invoice`) instead of direct-creating a\nparallel bill (ITE-678). Mutually exclusive with string? VaccineAdministrationResult.InvoiceLineItemId."
          },
          "estimateLineItemId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The Performed estimate line the dispense was stamped onto, when string? VaccineAdministrationResult.EstimateId is set."
          }
        }
      },
      "VaccineCertificateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vaccinationRecordId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "rabiesTagId": {
            "type": [
              "null",
              "string"
            ]
          },
          "rabiesTagNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "issuedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          },
          "supersededByCertificateId": {
            "type": [
              "null",
              "string"
            ]
          },
          "revokedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "revocationReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "snapshot": {
            "$ref": "#/components/schemas/VaccineCertificateSnapshotDto"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Non-blocking warnings computed at issuance for recommended-but-missing certificate fields\n(vial expiration, rabies tag, DVM signature, license number). Surfaced to the UI so staff can\nbackfill; the certificate still issues. Empty when nothing is missing or on read-back."
          },
          "isStale": {
            "type": "boolean",
            "description": "True when the underlying vaccination record was edited AFTER this certificate froze its\nsnapshot (ITE-281) — the printed values may no longer match the record. Prompt a reissue;\nnever reissue silently. Computed on read for the current-certificate endpoint only."
          }
        },
        "description": "An issued vaccine certificate record (the persisted, queryable system-of-record).\nRendering/printing is a separate concern handled by the certificate print pipeline."
      },
      "VaccineCertificateSnapshotDto": {
        "type": "object",
        "properties": {
          "patientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "sex": {
            "type": [
              "null",
              "string"
            ]
          },
          "spayedNeutered": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "microchipNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "weightLbs": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Patient's most recent recorded weight in pounds at issuance, when available.",
            "format": "double"
          },
          "ownerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccineName": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccineCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRabies": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "manufacturer": {
            "type": [
              "null",
              "string"
            ]
          },
          "lotNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "administeredDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "vaccineExpirationDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Physical vaccine vial/lot expiry (not the next-due date).",
            "format": "date-time"
          },
          "rabiesDueDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Next-due date (when this dose lapses).",
            "format": "date-time"
          },
          "durationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rabiesTagNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "veterinarianName": {
            "type": [
              "null",
              "string"
            ]
          },
          "veterinaryLicenseNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "licenseState": {
            "type": [
              "null",
              "string"
            ]
          },
          "usdaNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasVeterinarianSignature": {
            "type": "boolean",
            "description": "Whether the administering veterinarian had a signature on file when this certificate was\nissued (frozen at issuance). Drives the \"no signature on file\" warning. The raw signature\nimage itself is intentionally not exposed here — it's only used server-side for rendering."
          },
          "clinicName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicPhone": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Frozen copy of the printed values, surfaced for read/preview."
      },
      "VaccineExemptionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "vaccineTypeId": {
            "type": "string"
          },
          "vaccineTypeName": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "createdByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "revokedByName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "VaccineScheduleEntryStatus": {
        "type": "integer",
        "description": "Per-vaccine standing within a patient's computed schedule (ITE-685). These are the same\nbuckets the patient-level VaccinationStatus rollup is folded from: a core entry\nthat is VaccineScheduleEntryStatus.Missing makes the patient PartiallyVaccinated, VaccineScheduleEntryStatus.Overdue\nwins over everything, VaccineScheduleEntryStatus.DueSoon maps to Due. An entry with no expiration and no\nduration to age against counts as VaccineScheduleEntryStatus.UpToDate (open-ended protection)."
      },
      "VaccineScheduleStageDto": {
        "type": "object",
        "properties": {
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "1-based dose number within the schedule.",
            "format": "int32"
          },
          "intervalDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Days after the prior dose at which THIS dose is due (null for stage 1 / expiry-driven boosters).",
            "format": "int32"
          },
          "intervalMaxDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Upper bound of the recommended window (display only).",
            "format": "int32"
          },
          "durationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Months of immunity this dose confers (falls back to the type's labeled duration).",
            "format": "int32"
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "One dose in a vaccine type's ordered schedule. The final stage repeats indefinitely as the\nsteady-state booster unless bool VaccineTypeDto.RepeatFinalDose is off (series simply\nends). A dose's next-due date is the following stage's int? VaccineScheduleStageDto.IntervalDays\nafter administration when set (series dose, e.g. lepto dose 2 in 21 days); otherwise the dose\nconfers int? VaccineScheduleStageDto.DurationMonths of validity and the next dose is due at expiry."
      },
      "VaccineTypeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "species": {
            "type": "string"
          },
          "durationMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isCore": {
            "type": "boolean"
          },
          "isRabies": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "reminderThresholdDays": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "scheduleStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VaccineScheduleStageDto"
            },
            "description": "Explicitly configured dose schedule; empty when the type uses legacy single-duration behavior."
          },
          "repeatFinalDose": {
            "type": "boolean",
            "description": "False = the series ends after the last dose (no ongoing booster, no next-due date)."
          },
          "restartIfLapsedAfterDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Grace window (days past due) after which a new dose restarts the series at stage 1.",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Full vaccine type details"
      },
      "VaccineTypeListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VaccineTypeDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        },
        "description": "Paginated list of vaccine types"
      },
      "VaccineTypeSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "species": {
            "type": "string"
          },
          "isCore": {
            "type": "boolean"
          },
          "isRabies": {
            "type": "boolean"
          }
        },
        "description": "Vaccine type summary for dropdowns and lists"
      },
      "VarianceAlertDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "metric": {
            "type": "string"
          },
          "currentValue": {
            "type": "string"
          },
          "normalRange": {
            "type": "string"
          },
          "deviation": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "direction": {
            "type": "string"
          },
          "impact": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "suggestedAction": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "VarianceAlertsDto": {
        "type": "object",
        "properties": {
          "threshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "alertCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VarianceAlertDto"
            }
          },
          "negativeAlerts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "positiveAlerts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "VendorDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "addressLine1": {
            "type": [
              "null",
              "string"
            ]
          },
          "addressLine2": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "country": {
            "type": [
              "null",
              "string"
            ]
          },
          "accountNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "VendorListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VendorDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "VendorSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "VerifyRdvmCodeRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "The 6-digit verification code sent to the RDVM's email"
          }
        }
      },
      "VerifyTokenRequest": {
        "required": [
          "sessionId",
          "clinicId",
          "code",
          "email"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "code": {
            "maxLength": 10,
            "minLength": 0,
            "type": "string",
            "description": "The 6-digit verification code sent to the user's email"
          },
          "email": {
            "maxLength": 254,
            "minLength": 0,
            "type": "string",
            "description": "The email address that the code was sent to"
          }
        }
      },
      "VerifyTokenResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "patients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientSummaryDto"
            }
          }
        }
      },
      "VitalMeasurementDetailDto": {
        "required": [
          "id",
          "patientId",
          "vitalTypeCode",
          "vitalTypeLabel",
          "value",
          "unit",
          "takenAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "vitalTypeCode": {
            "type": "string"
          },
          "vitalTypeLabel": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Numeric reading; null when the stored value is text (see string? VitalMeasurementDetailDto.ValueText).",
            "format": "double"
          },
          "valueText": {
            "type": [
              "null",
              "string"
            ],
            "description": "Text reading; null for numeric readings."
          },
          "unit": {
            "type": "string"
          },
          "takenAt": {
            "type": "string",
            "format": "date-time"
          },
          "takenById": {
            "type": [
              "null",
              "string"
            ]
          },
          "appointmentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isWithinRange": {
            "type": "boolean"
          }
        }
      },
      "VitalMeasurementSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vitalTypeCode": {
            "type": "string"
          },
          "vitalTypeLabel": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "takenAt": {
            "type": "string",
            "format": "date-time"
          },
          "takenBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserSummaryDto"
              }
            ]
          }
        },
        "description": "Vital measurement summary"
      },
      "VitalsSummaryDto": {
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "vitalTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VitalTypeSummaryDto"
            }
          },
          "measurementsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/PatientVitalMeasurementDto"
              }
            }
          },
          "totalMeasurements": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastMeasurementDate": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "VitalTakenByDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          }
        }
      },
      "VitalThresholdAlertDto": {
        "required": [
          "severity",
          "message"
        ],
        "type": "object",
        "properties": {
          "isOutOfRange": {
            "type": "boolean"
          },
          "isBelowMin": {
            "type": "boolean"
          },
          "isAboveMax": {
            "type": "boolean"
          },
          "normalMin": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "normalMax": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "severity": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "VitalTrendDto": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string"
          },
          "percent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "delta": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "isSignificant": {
            "type": "boolean"
          },
          "severity": {
            "type": "string"
          },
          "isOutOfRange": {
            "type": "boolean"
          },
          "isImproving": {
            "type": "boolean"
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "VitalTypeDetailDto": {
        "required": [
          "id",
          "code",
          "label",
          "dataType"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "dataType": {
            "type": "string"
          },
          "minValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "isSystem": {
            "type": "boolean",
            "description": "Seeded product type: not deletable; Code/DataType locked."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "VitalTypeSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "dataType": {
            "type": "string"
          },
          "minValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "measurementCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "latestMeasurement": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PatientVitalMeasurementDto"
              }
            ]
          },
          "trend": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VitalTrendDto"
              }
            ]
          }
        }
      },
      "VitalTypeUsageDto": {
        "required": [
          "examTemplates"
        ],
        "type": "object",
        "properties": {
          "hasMeasurements": {
            "type": "boolean",
            "description": "Recorded measurements exist — hard delete is blocked."
          },
          "examTemplates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExamTemplateRefDto"
            },
            "description": "Exam templates with a field bound to this type's code. Non-empty means delete is blocked\nand deactivation needs bool? UpdateVitalTypeRequest.AcknowledgeExamTemplateImpact."
          }
        },
        "description": "What would break if this vital type were deleted or deactivated."
      },
      "VoiceAiPhoneNumberRequest": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string"
          }
        }
      },
      "VoiceAiSettingsDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "retellAgentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "transferNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "adoptionMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "activeHoursStart": {
            "type": [
              "null",
              "string"
            ]
          },
          "activeHoursEnd": {
            "type": [
              "null",
              "string"
            ]
          },
          "overflowRingSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "transferTolerance": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxTurnsBeforeTransfer": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxCallDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "emergencyKeywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowedActions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "customGreeting": {
            "type": [
              "null",
              "string"
            ]
          },
          "voiceModel": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AiModelConfigDto"
              }
            ]
          },
          "clinicName": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "clinicPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "customFaqs": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Voice AI agent settings for autonomous call handling via Retell AI."
      },
      "VoidEstimateItemRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required when voiding a controlled-substance dispense (DEA correction)."
          }
        }
      },
      "VoidEstimateItemResponse": {
        "type": "object",
        "properties": {
          "inventoryReversed": {
            "type": "boolean"
          },
          "deaCorrectionCreated": {
            "type": "boolean"
          },
          "prescriptionsCancelled": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "vaccinationsVoided": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Vaccination records retracted by this void. Non-zero means a dose came off the patient's\nchart — worth surfacing, since it changes what the patient is considered protected against.",
            "format": "int32"
          }
        }
      },
      "VoidInvoiceDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Request body for POST /invoices/{id}/void — cancel a bill that should never\nhave been billed. The reason is required: voiding erases receivable revenue,\nso every void must carry a human-stated why into the audit log."
      },
      "VoidRabiesTagRequest": {
        "required": [
          "reason"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "VoidVaccinationRecordRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Why the dose was retracted. Shown alongside the struck-through record."
          }
        },
        "description": "Retract a recorded dose, keeping it on the chart for audit."
      },
      "WarningSeverity": {
        "type": "integer"
      },
      "WebRtcCredentialsResponse": {
        "type": "object",
        "properties": {
          "sipUsername": {
            "type": "string"
          },
          "sipPassword": {
            "type": "string"
          },
          "callerIdNumber": {
            "type": "string"
          },
          "callerIdName": {
            "type": "string"
          }
        },
        "description": "WebRTC credentials for Telnyx client initialization"
      },
      "WidgetAppointmentResponse": {
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "scheduledTime": {
            "type": "string",
            "format": "date-time"
          },
          "providerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "confirmationNumber": {
            "type": "string"
          }
        }
      },
      "WidgetAppointmentTypeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isDefault": {
            "type": "boolean"
          }
        },
        "description": "An online-bookable appointment type as the widget sees it."
      },
      "WidgetBookingPolicyDto": {
        "type": "object",
        "properties": {
          "minAdvanceBookingHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxAdvanceBookingDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minCancellationNoticeHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "defaultAppointmentTypeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Appointment type the widget should book by default. Drives location-intent\nfiltering and slot duration. Null means the clinic hasn't configured one,\nin which case the widget should treat booking as unavailable."
          },
          "defaultAppointmentTypeName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Display name of the default appointment type, surfaced in confirmation copy."
          },
          "bookableAppointmentTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetAppointmentTypeDto"
            },
            "description": "The appointment types a client may self-book (ITE-430), in display order. Falls back to\njust the default type for clinics that flagged none. Empty = online booking unavailable."
          },
          "referralSourceOptions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Suggested answers to \"how did you hear about us\" (ITE-413), served rather than compiled\ninto the widget so the list has one owner. Not validation — the widget may send anything,\nand free text is kept verbatim and bucketed as \"Other\" at report time."
          }
        }
      },
      "WidgetBrandingDto": {
        "type": "object",
        "properties": {
          "primaryColor": {
            "type": "string"
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WidgetChatbotConfigDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "welcomeMessage": {
            "type": [
              "null",
              "string"
            ]
          },
          "schedulingEnabled": {
            "type": "boolean"
          },
          "medicationRefillEnabled": {
            "type": "boolean"
          },
          "triageEnabled": {
            "type": "boolean"
          },
          "intakeEnabled": {
            "type": "boolean"
          },
          "requireVerificationForScheduling": {
            "type": "boolean"
          },
          "maxConversationTurns": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "autoEscalateEmergencies": {
            "type": "boolean"
          },
          "model": {
            "$ref": "#/components/schemas/AiModelConfigDto"
          }
        },
        "description": "B.O.N.D. (Best Optimal Needs Determination) Widget Chatbot configuration"
      },
      "WidgetChatMessageDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WidgetChatSettingsDto": {
        "type": "object",
        "properties": {
          "welcomeMessage": {
            "type": "string"
          },
          "operatingHoursStart": {
            "type": [
              "null",
              "string"
            ]
          },
          "operatingHoursEnd": {
            "type": [
              "null",
              "string"
            ]
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WidgetClientInfoDto": {
        "required": [
          "name",
          "email",
          "phone"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 500,
            "minLength": 0,
            "type": "string"
          },
          "email": {
            "maxLength": 254,
            "minLength": 0,
            "type": "string"
          },
          "phone": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string"
          },
          "referralSource": {
            "maxLength": 200,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "\"How did you hear about us\" (ITE-413), answered by the client at booking. Written to\n`Client.ReferralSource` — marketing attribution — only when this booking creates the\nclient; an existing client's answer is never overwritten by a later booking. Ignored for\nreturning clients. Free text: usually one of\nIReadOnlyList&lt;string&gt; ReferralSourceOptions.Presets, but\nanything is accepted and stored verbatim."
          }
        }
      },
      "WidgetConfigDto": {
        "type": "object",
        "properties": {
          "clinicId": {
            "type": "string"
          },
          "clinicName": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone for the clinic (e.g., \"America/New_York\").\nFrontend should use this to display times in the clinic's local timezone."
          },
          "features": {
            "$ref": "#/components/schemas/WidgetFeaturesDto"
          },
          "branding": {
            "$ref": "#/components/schemas/WidgetBrandingDto"
          },
          "chatSettings": {
            "$ref": "#/components/schemas/WidgetChatSettingsDto"
          },
          "allowedDomains": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "bookingPolicy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WidgetBookingPolicyDto"
              }
            ]
          }
        }
      },
      "WidgetFeaturesDto": {
        "type": "object",
        "properties": {
          "chatEnabled": {
            "type": "boolean"
          },
          "bookingEnabled": {
            "type": "boolean"
          },
          "portalEnabled": {
            "type": "boolean"
          }
        }
      },
      "WidgetOutboundRequest": {
        "required": [
          "tenantId",
          "sessionId",
          "content"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "content": {
            "maxLength": 10000,
            "minLength": 0,
            "type": "string"
          }
        },
        "description": "Request from Orchestrate API to send a message to a widget client"
      },
      "WidgetPatientInfoDto": {
        "type": "object",
        "properties": {
          "existingPatientId": {
            "maxLength": 200,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "maxLength": 500,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          },
          "species": {
            "maxLength": 500,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          },
          "breed": {
            "maxLength": 500,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WidgetSessionDto": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "clinicId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WidgetSmsConsentSubmitRequest": {
        "required": [
          "sessionId",
          "clinicId",
          "phoneNumber"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "clinicId": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "phoneNumber": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string"
          },
          "consentGranted": {
            "type": "boolean"
          },
          "clientId": {
            "maxLength": 200,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Widget SMS consent submit request"
      },
      "WindowGate": {
        "required": [
          "slotConfigurationRowExists",
          "defaultSlotDurationMinutes",
          "minAdvanceBookingHours",
          "maxAdvanceBookingDays",
          "bufferBetweenAppointments"
        ],
        "type": "object",
        "properties": {
          "slotConfigurationRowExists": {
            "type": "boolean"
          },
          "defaultSlotDurationMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minAdvanceBookingHours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxAdvanceBookingDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "bufferBetweenAppointments": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "defaultWidgetAppointmentTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultTypeResolves": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "WorkItemEventDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workItemType": {
            "$ref": "#/components/schemas/WorkItemType"
          },
          "workItemId": {
            "type": "string"
          },
          "eventType": {
            "$ref": "#/components/schemas/WorkItemEventType"
          },
          "actorUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "actorName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Display name of the acting user; \"System\" semantics are left to the client when null."
          },
          "data": {
            "type": [
              "null",
              "object"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "One lifecycle transition of a work item (Reminder or WorkTask) — a row in\nthe \"why this reminder?\" timeline."
      },
      "WorkItemEventListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkItemEventDto"
            }
          }
        }
      },
      "WorkItemEventType": {
        "type": "integer",
        "description": "Lifecycle transitions recorded in the work_item_events history table.\nThis is the data behind the \"why this reminder?\" timeline (PAW-624)."
      },
      "WorkItemRuleDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/WorkItemRuleKind"
          },
          "emitType": {
            "$ref": "#/components/schemas/WorkItemType"
          },
          "emitReminderCategory": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderCategory"
              }
            ]
          },
          "emitTaskCategory": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WorkTaskCategory"
              }
            ]
          },
          "emitTaskPriority": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Priority"
              }
            ]
          },
          "titleTemplate": {
            "type": [
              "null",
              "string"
            ]
          },
          "descriptionTemplate": {
            "type": [
              "null",
              "string"
            ]
          },
          "triggerEventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "speciesIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "requiredTagIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "excludedTagIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "triggerTagId": {
            "type": [
              "null",
              "string"
            ]
          },
          "minAgeMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "maxAgeMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "cadenceOffsetsDays": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "recurrenceIntervalMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "autoSatisfyOnTrigger": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "itemMaps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkItemRuleItemMapDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkItemRuleItemMapDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "billableItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "billableItemName": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccineTypeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "vaccineTypeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceCatalogItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceCatalogItemName": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "inventoryItemName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WorkItemRuleKind": {
        "type": "integer",
        "description": "What domain a `WorkItemRule` governs. Drives which dimension columns\napply and how the debugger/admin UI render the rule in clinic language."
      },
      "WorkItemRuleListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkItemRuleDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "WorkItemRuleVersionDto": {
        "type": "object",
        "properties": {
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "snapshot": {
            "type": [
              "null",
              "object"
            ]
          },
          "editedByUserId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkItemRuleVersionListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkItemRuleVersionDto"
            }
          }
        }
      },
      "WorkItemType": {
        "type": "integer",
        "description": "Which work-item table a WorkItemEventType history row refers to."
      },
      "WorkTaskCategory": {
        "type": "integer"
      },
      "WorkTaskDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "patientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "patient": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WorkTaskPatientSummaryDto"
              }
            ]
          },
          "assignedToId": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedTo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WorkTaskUserSummaryDto"
              }
            ]
          },
          "createdById": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WorkTaskUserSummaryDto"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "dueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "completedById": {
            "type": [
              "null",
              "string"
            ]
          },
          "completedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WorkTaskUserSummaryDto"
              }
            ]
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkTaskNoteDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "callbackType": {
            "type": [
              "null",
              "string"
            ],
            "description": "Subtype of a callback: \"DoctorCallback\" | \"LabResult\" | … (null otherwise)."
          },
          "promisedById": {
            "type": [
              "null",
              "string"
            ],
            "description": "Staff member who promised the client a contact (accountability axis)."
          },
          "promisedBy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WorkTaskUserSummaryDto"
              }
            ]
          },
          "outcome": {
            "type": [
              "null",
              "string"
            ],
            "description": "Structured contact result set on completion: \"Reached\" | \"LeftVoicemail\" | … (null until completed)."
          },
          "escalated": {
            "type": "boolean",
            "description": "True once an overdue callback has been escalated to administrators (PAW-625)."
          },
          "entityType": {
            "type": [
              "null",
              "string"
            ],
            "description": "Type of entity this task is linked to (e.g., \"appointment\", \"soap_note\")"
          },
          "entityId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID of the linked entity - frontend resolves to URL based on EntityType"
          }
        }
      },
      "WorkTaskListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkTaskDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "WorkTaskNoteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workTaskId": {
            "type": "string"
          },
          "authorId": {
            "type": "string"
          },
          "authorName": {
            "type": [
              "null",
              "string"
            ]
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkTaskPatientSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "species": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WorkTaskStatsDto": {
        "type": "object",
        "properties": {
          "openCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inProgressCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "completedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "overdueCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "myTasksCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "WorkTaskUserSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "XplorPayCredentialsDto": {
        "type": "object",
        "properties": {
          "terminalApiKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "payLinkApiKey": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Firebase ID Token or API Key. Enter your JWT token.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "ApiKey": {
        "type": "apiKey",
        "description": "API Key for simple integrations (Zapier, etc.)",
        "name": "X-API-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ],
  "tags": [
    {
      "name": "AdminS3"
    },
    {
      "name": "ApiKeys"
    },
    {
      "name": "Appointments"
    },
    {
      "name": "AppointmentTypes"
    },
    {
      "name": "BillableItems"
    },
    {
      "name": "Breeds"
    },
    {
      "name": "BulkClientExport"
    },
    {
      "name": "BulkPatientExport"
    },
    {
      "name": "CareQueue"
    },
    {
      "name": "CaseMilestones"
    },
    {
      "name": "Cases"
    },
    {
      "name": "ChatExport"
    },
    {
      "name": "ClientAppInvite"
    },
    {
      "name": "ClientExport"
    },
    {
      "name": "Clients"
    },
    {
      "name": "ClinicConfig"
    },
    {
      "name": "ClinicSettings"
    },
    {
      "name": "Clocking"
    },
    {
      "name": "Compliance"
    },
    {
      "name": "ConsentDocuments"
    },
    {
      "name": "DeaBooks"
    },
    {
      "name": "DeaExport"
    },
    {
      "name": "DiagnosisTerms"
    },
    {
      "name": "DiscountCodes"
    },
    {
      "name": "Drafts"
    },
    {
      "name": "EdgePrintJobs"
    },
    {
      "name": "EdgePrinters"
    },
    {
      "name": "EmailVerification"
    },
    {
      "name": "Erx"
    },
    {
      "name": "Estimates"
    },
    {
      "name": "ExamTemplates"
    },
    {
      "name": "Expenses"
    },
    {
      "name": "Featurebase"
    },
    {
      "name": "FeatureFlags"
    },
    {
      "name": "Flowboard"
    },
    {
      "name": "GroupCodes"
    },
    {
      "name": "GroupVisits"
    },
    {
      "name": "Health"
    },
    {
      "name": "HomeAgain"
    },
    {
      "name": "IntegrationCredentials"
    },
    {
      "name": "InternalPrescribing"
    },
    {
      "name": "InternalWidget"
    },
    {
      "name": "InventoryApprovals"
    },
    {
      "name": "Inventory"
    },
    {
      "name": "InventoryLocations"
    },
    {
      "name": "Invoices"
    },
    {
      "name": "JourneyMilestones"
    },
    {
      "name": "Kiosk"
    },
    {
      "name": "LabPanels"
    },
    {
      "name": "Labs"
    },
    {
      "name": "LocationClosures"
    },
    {
      "name": "Locations"
    },
    {
      "name": "Logos"
    },
    {
      "name": "MedicationRequests"
    },
    {
      "name": "MentorMetrics"
    },
    {
      "name": "Metrics"
    },
    {
      "name": "NpsAnalytics"
    },
    {
      "name": "OnlineBookingReadiness"
    },
    {
      "name": "Partners"
    },
    {
      "name": "PatientGroups"
    },
    {
      "name": "PatientMasses"
    },
    {
      "name": "PatientProblems"
    },
    {
      "name": "PatientRecordExport"
    },
    {
      "name": "Patients"
    },
    {
      "name": "Payments"
    },
    {
      "name": "PaymentTokens"
    },
    {
      "name": "Phones"
    },
    {
      "name": "PriceRules"
    },
    {
      "name": "Printers"
    },
    {
      "name": "PrintJobs"
    },
    {
      "name": "PtoRequests"
    },
    {
      "name": "PublicNps"
    },
    {
      "name": "PublicPriceList"
    },
    {
      "name": "PublicQuestionnaires"
    },
    {
      "name": "PublicSmsConsent"
    },
    {
      "name": "PurchaseOrders"
    },
    {
      "name": "QiEvents"
    },
    {
      "name": "QuestionnaireResponses"
    },
    {
      "name": "Questionnaires"
    },
    {
      "name": "RabiesTags"
    },
    {
      "name": "RdvmPortal"
    },
    {
      "name": "Recordings"
    },
    {
      "name": "RecurringExpenses"
    },
    {
      "name": "ReferralMessages"
    },
    {
      "name": "Referrals"
    },
    {
      "name": "Reminders"
    },
    {
      "name": "Reports"
    },
    {
      "name": "RetailItems"
    },
    {
      "name": "Roles"
    },
    {
      "name": "RoomDayAssignments"
    },
    {
      "name": "RxGovernance"
    },
    {
      "name": "Pharmacies"
    },
    {
      "name": "SavedReports"
    },
    {
      "name": "ScheduleItems"
    },
    {
      "name": "ServiceCatalog"
    },
    {
      "name": "Shifts"
    },
    {
      "name": "ShiftSwaps"
    },
    {
      "name": "SlotConfigurations"
    },
    {
      "name": "SmsConsent"
    },
    {
      "name": "Species"
    },
    {
      "name": "Subscriptions"
    },
    {
      "name": "SurgicalRecords"
    },
    {
      "name": "TagAssignments"
    },
    {
      "name": "Tags"
    },
    {
      "name": "TelnyxCallControl"
    },
    {
      "name": "Templates"
    },
    {
      "name": "TenantKnowledge"
    },
    {
      "name": "TimeEntries"
    },
    {
      "name": "Transparency"
    },
    {
      "name": "Users"
    },
    {
      "name": "Vaccinations"
    },
    {
      "name": "VaccineAdministration"
    },
    {
      "name": "VaccineCertificateRecords"
    },
    {
      "name": "VaccineCertificates"
    },
    {
      "name": "VaccineTypes"
    },
    {
      "name": "Vendors"
    },
    {
      "name": "Vitals"
    },
    {
      "name": "VitalTypes"
    },
    {
      "name": "WidgetChatbot"
    },
    {
      "name": "Widget"
    },
    {
      "name": "WorkItemRules"
    },
    {
      "name": "WorkTasks"
    }
  ]
}