{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getmyluna-app/json-schema/getmyluna-app-onboard-request-schema.json",
  "title": "OnboardRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getmyluna-app-openapi.json#/components/schemas/OnboardRequest",
  "properties": {
    "email": {
      "title": "Email",
      "type": "string"
    },
    "password": {
      "description": "At least 10 characters (new accounts).",
      "minLength": 10,
      "title": "Password",
      "type": "string"
    },
    "username": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Login alias; defaults to the part of the email before `@`. Never shown to the family.",
      "title": "Username"
    },
    "display_name": {
      "anyOf": [
        {
          "maxLength": 40,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Your first name, shown to the family. Not an email address.",
      "title": "Display Name"
    },
    "baby_name": {
      "maxLength": 80,
      "title": "Baby Name",
      "type": "string"
    },
    "dob": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "YYYY-MM-DD. Required unless `due_date` is given.",
      "title": "Dob"
    },
    "due_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Not born yet: YYYY-MM-DD, up to 14 days ago to 10 months ahead. The log stays empty until the date of birth is added.",
      "title": "Due Date"
    },
    "client_today": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional: the browser's local date (YYYY-MM-DD). Used for the due-date window when within a day of the family's local date.",
      "title": "Client Today"
    },
    "family_name": {
      "anyOf": [
        {
          "maxLength": 120,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Family Name"
    },
    "gender": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Gender"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "IANA zone; default `Europe/London`.",
      "title": "Timezone"
    },
    "region": {
      "anyOf": [
        {
          "enum": [
            "uk",
            "us",
            "za"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Default `uk`. `za` (South Africa) also defaults `timezone` to `Africa/Johannesburg`.",
      "title": "Region"
    },
    "units": {
      "anyOf": [
        {
          "enum": [
            "metric",
            "imperial"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Units"
    },
    "acquisition": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional first-touch attribution (utm_source etc.).",
      "title": "Acquisition"
    },
    "health_consent": {
      "description": "Must be `true`: explicit consent to store the baby's log (unticked box on the form). Recorded with its wording version.",
      "title": "Health Consent",
      "type": "boolean"
    }
  },
  "required": [
    "email",
    "password",
    "baby_name",
    "health_consent"
  ],
  "type": "object"
}