{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anytax/json-schema/anytax-user-settings-dto-schema.json",
  "title": "UserSettingsDto",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anytax-openapi.json#/components/schemas/UserSettingsDto",
  "type": "object",
  "properties": {
    "user": {
      "description": "User information",
      "allOf": [
        {
          "$ref": "#/$defs/UserDto"
        }
      ]
    },
    "phoneNumber": {
      "type": "string",
      "description": "User phone number"
    },
    "emailNotifications": {
      "type": "boolean",
      "description": "Email notifications preference"
    },
    "smsNotifications": {
      "type": "boolean",
      "description": "SMS notifications preference"
    },
    "emailConsent": {
      "type": "boolean",
      "description": "Email / marketing newsletter consent"
    },
    "privacyConsent": {
      "type": "boolean",
      "description": "GDPR sensitive data consent (privacy policy)"
    },
    "partnerDataConsent": {
      "type": "boolean",
      "description": "Partner data use consent"
    },
    "address": {
      "type": "string",
      "description": "User address"
    },
    "city": {
      "type": "string",
      "description": "User city"
    },
    "country": {
      "type": "string",
      "description": "User country"
    },
    "postalCode": {
      "type": "string",
      "description": "User postal code"
    },
    "dateOfBirth": {
      "format": "date-time",
      "type": "string",
      "description": "User date of birth"
    },
    "taxId": {
      "type": "string",
      "description": "User tax identification number (Steuer-ID)"
    },
    "role": {
      "type": "string",
      "description": "User role"
    },
    "partnerId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Partner ID this user is attributed to"
    },
    "partner": {
      "description": "Partner this user is attributed to",
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/$defs/PartnerSummaryDto"
        }
      ]
    }
  },
  "required": [
    "user",
    "emailNotifications",
    "smsNotifications",
    "emailConsent",
    "privacyConsent",
    "partnerDataConsent"
  ],
  "$defs": {
    "PartnerSummaryDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Partner ID"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Partner display name"
        },
        "slug": {
          "type": "string",
          "description": "Partner slug (subdomain identifier)"
        }
      },
      "required": [
        "id",
        "slug"
      ]
    },
    "UserDto": {
      "type": "object",
      "properties": {
        "login": {
          "type": "string",
          "description": "User login"
        },
        "name": {
          "type": "string",
          "description": "User name"
        },
        "surname": {
          "type": "string",
          "description": "User surname"
        },
        "email": {
          "type": "string",
          "description": "User email"
        }
      },
      "required": [
        "login",
        "name",
        "surname",
        "email"
      ]
    }
  }
}