{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shepherd-vet/json-schema/shepherd-vet-open-api-client-controller-client-update-model-schema.json",
  "title": "OpenApiClientController.ClientUpdateModel",
  "description": "Client update REST model used for a full replacement (PUT). Send the complete representation: any editable field omitted from the request body is cleared\n(set to null / empty / its default). In particular, omitting IsTaxExempt, the email/SMS notification flags, or ReferralSourceIds resets them\n(booleans become false, the referral source list becomes empty). FirstName, LastName and ClientPhones are required and must be provided.\nThe exceptions to the clear-on-omit rule are ClientStatusId and ClientInfo, which are preserved (left unchanged) when omitted. Each property\ndocuments its individual omit behavior below.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shepherd-vet-client-api-openapi.yml#/components/schemas/OpenApiClientController.ClientUpdateModel",
  "required": [
    "clientPhones",
    "firstName",
    "lastName"
  ],
  "type": "object",
  "properties": {
    "additionalText": {
      "description": "Free-text field of additional info for the client.",
      "type": "string"
    },
    "alerts": {
      "description": "Important info for the client, e.g. \"Difficult to work with\"",
      "type": "string"
    },
    "authorizedAgents": {
      "description": "The authorized agent edits to apply. Each entry adds or edits an agent (include the agent's id to edit it\nin place, omit the id to add a new agent) or removes one (set authorizedAgentIdForRemove with a removalNote).\nAgents not referenced here are left unchanged.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/OpenApiClientController.AuthorizedAgentEditModel"
      }
    },
    "clientCoOwner": {
      "$ref": "#/$defs/OpenApiClientController.ClientCoOwnerWriteModel",
      "description": "Object representing related ClientCoOwnerWriteModel entity. Replaces the existing co-owner."
    },
    "clientDiscountId": {
      "description": "Unique identifier representing the related ClientDiscount entity. While a PetAssure membership is active the\ndiscount is locked: clearing or omitting it preserves the PetAssure discount, and changing it to a different\ndiscount is rejected until the membership is removed in the UI.",
      "type": "string"
    },
    "clientInfo": {
      "$ref": "#/$defs/OpenApiClientController.ClientInfoWriteModel",
      "description": "Object representing related ClientInfoWriteModel entity (address/contact block). Exception to the clear-on-omit rule: preserved (left unchanged) when omitted."
    },
    "clientPhones": {
      "description": "The list of related ClientPhoneWrite objects. Replaces all existing phones. Must have exactly one primary phone. Required.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/OpenApiClientController.ClientPhoneWriteModel"
      }
    },
    "clientStatusId": {
      "description": "Unique identifier representing the related ClientStatus entity. Exception to the clear-on-omit rule: preserved (left unchanged) when omitted.",
      "type": "string"
    },
    "clientTypeId": {
      "description": "Unique identifier representing the related ClientType entity.",
      "type": "string"
    },
    "dateOfBirth": {
      "format": "date-time",
      "description": "Birth date of the client.",
      "type": "string"
    },
    "email": {
      "description": "The client's email.",
      "type": "string"
    },
    "emailMassCommuncationNotification": {
      "description": "Flag indicating whether the client accepts mass message email notifications.",
      "type": "boolean"
    },
    "emailNotification": {
      "description": "Flag indicating whether the client accepts appointment Email notifications.",
      "type": "boolean"
    },
    "firstName": {
      "description": "The client's first name. Required.",
      "type": "string"
    },
    "genderId": {
      "description": "Unique identifier representing the related Gender entity.",
      "type": "string"
    },
    "isTaxExempt": {
      "description": "Flag indicating whether the client is exempt from taxes. Omit to reset to false (the client will be charged tax).",
      "type": "boolean"
    },
    "lastName": {
      "description": "The client's last name. Required.",
      "type": "string"
    },
    "middleName": {
      "description": "The client's middle name.",
      "type": "string"
    },
    "referralSourceIds": {
      "description": "Unique identifier list representing the related ReferralSource entity. Omit to clear all referral sources.",
      "type": "array",
      "items": {
        "format": "uuid",
        "type": "string"
      }
    },
    "reminderEmailNotification": {
      "description": "Flag indicating whether the client accepts reminder Email notifications. Omit to reset to false.",
      "type": "boolean"
    },
    "reminderPostcardNotification": {
      "description": "Flag indicating whether the client accepts postcard notifications.",
      "type": "boolean"
    },
    "smsDirectMessagingNotification": {
      "description": "Flag indicating whether the client accepts direct messaging SMS notifications.",
      "type": "boolean"
    },
    "smsMassCommuncationNotification": {
      "description": "Flag indicating whether the client accepts mass message SMS notifications.",
      "type": "boolean"
    },
    "smsNotification": {
      "description": "Flag indicating whether the client accepts appointment SMS notifications.",
      "type": "boolean"
    }
  },
  "$defs": {
    "OpenApiClientController.AuthorizedAgentEditModel": {
      "description": "AuthorizedAgent edit entry. Each entry either adds/edits an agent or removes one (but not both).",
      "type": "object",
      "properties": {
        "authorizedAgent": {
          "$ref": "#/$defs/OpenApiClientController.AuthorizedAgentWriteModel",
          "description": "The agent to add or edit. Include the agent's id to edit it in place, or omit the id to add a new agent.\nLeave this null when removing an agent."
        },
        "authorizedAgentIdForRemove": {
          "format": "uuid",
          "description": "The id of an existing authorized agent to remove. When set, leave authorizedAgent null and provide a removalNote.",
          "type": "string"
        },
        "removalNote": {
          "description": "The reason the agent is being removed; recorded in client history. Required when authorizedAgentIdForRemove is set.",
          "type": "string"
        }
      }
    },
    "OpenApiClientController.AuthorizedAgentWriteModel": {
      "description": "AuthorizedAgent write REST model.",
      "required": [
        "approvalNote",
        "firstName",
        "lastName",
        "phoneNumber"
      ],
      "type": "object",
      "properties": {
        "approvalNote": {
          "description": "Authorized agent's approval note (e.g. Approved by Mrs. Smith while out of town until September 1st)",
          "type": "string"
        },
        "firstName": {
          "description": "The authorized agent's first name.",
          "type": "string"
        },
        "id": {
          "format": "uuid",
          "description": "The authorized agent's identifier, as returned by a read. Provide it to edit that existing agent in place;\nomit it to add a new agent.",
          "type": "string"
        },
        "lastName": {
          "description": "The authorized agent's last name.",
          "type": "string"
        },
        "phoneNumber": {
          "description": "The authorized agent's phone number.",
          "maxLength": 10,
          "minLength": 10,
          "pattern": "^[0-9]*$",
          "type": "string"
        },
        "role": {
          "description": "The authorized agent's role.",
          "type": "string"
        }
      }
    },
    "OpenApiClientController.ClientCoOwnerWriteModel": {
      "description": "Write REST model for client co owner.",
      "required": [
        "firstName",
        "lastName"
      ],
      "type": "object",
      "properties": {
        "clientCoOwnerPhones": {
          "description": "The list of related ClientCoOwnerPhone objects.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/OpenApiClientController.ClientPhoneWriteModel"
          }
        },
        "email": {
          "description": "The co-owner's email address.",
          "type": "string"
        },
        "emailDirectMessagingNotification": {
          "description": "Flag indicating whether the co-owner accepts Email - Direct Messaging notifications. Omit to leave the current value unchanged.",
          "type": "boolean"
        },
        "firstName": {
          "description": "The co-owner's first name.",
          "type": "string"
        },
        "lastName": {
          "description": "The co-owner's last name.",
          "type": "string"
        },
        "smsDirectMessagingNotification": {
          "description": "Flag indicating whether the co-owner accepts SMS - Direct Messaging notifications. Omit to leave the current value unchanged.",
          "type": "boolean"
        }
      }
    },
    "OpenApiClientController.ClientInfoWriteModel": {
      "description": "ClientInfo write REST model",
      "type": "object",
      "properties": {
        "address": {
          "description": "Address Line 1 should include the most essential details to identify a location clearly(e.g.street and number).",
          "type": "string"
        },
        "address2": {
          "description": "Address Line 2 should be used to capture additional information that doesn't fit into Address Line 1.\nThis line is essential for adding specific details to ensure accurate delivery or location identification (e.g. apt Apt 12C).",
          "type": "string"
        },
        "city": {
          "description": "City where the client resides.",
          "type": "string"
        },
        "driverLicenseExpirationDate": {
          "format": "date-time",
          "description": "The expiration date of the client's driver license.",
          "type": "string"
        },
        "driverLicenseNumber": {
          "description": "The client's driver license number.",
          "type": "string"
        },
        "driverLicenseState": {
          "description": "The state that issued the client's driver license.",
          "type": "string"
        },
        "state": {
          "description": "Name of the state or province in the client's residential address.\nCan be represented either as an abbreviation (e.g., \"TX\") or as the full name (e.g., \"Texas\").",
          "type": "string"
        },
        "zipCode": {
          "description": "Postal or ZIP code in the client's residential address.",
          "type": "string"
        }
      }
    },
    "OpenApiClientController.ClientPhoneWriteModel": {
      "description": "ClientPhone write REST model",
      "required": [
        "countryId",
        "phoneNumber",
        "phoneTypeId"
      ],
      "type": "object",
      "properties": {
        "countryId": {
          "description": "Unique identifier representing the related Country entity.",
          "type": "string"
        },
        "isPrimary": {
          "description": "Flag indicating whether this instance is the primary phone number for the client.",
          "type": "boolean"
        },
        "phoneNumber": {
          "description": "The client's phone number.",
          "maxLength": 10,
          "minLength": 10,
          "pattern": "^[0-9]*$",
          "type": "string"
        },
        "phoneNumberName": {
          "description": "Optional label/name for the phone number (e.g. \"Mobile\", \"Home\").",
          "type": "string"
        },
        "phoneTypeId": {
          "description": "Unique identifier representing the related PhoneType entity.",
          "type": "string"
        }
      }
    }
  }
}