{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://letzpay.lu/ai/letzpay-tax-draft-v1.schema.json",
  "title": "LëtzPay proposed tax draft v1",
  "description": "Local, unconfirmed proposals. Not a backup, certificate, tax return or calculation result. Omit unknown figures; never invent zero or certify eligibility. Maximum UTF-8 file size: 65536 bytes.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "version",
    "taxYear",
    "currency",
    "profile",
    "amounts"
  ],
  "properties": {
    "format": {
      "const": "letzpay-tax-draft"
    },
    "version": {
      "const": 1
    },
    "taxYear": {
      "enum": [
        2025,
        2026
      ]
    },
    "currency": {
      "const": "EUR"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160,
      "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f-\\u009f]+$",
      "description": "An anonymous simulation label, at most 160 UTF-8 bytes. No identifiers or personal document names."
    },
    "profile": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "residence": {
          "type": "string",
          "enum": [
            "LU",
            "DE",
            "FR",
            "BE"
          ],
          "description": "Your residence for this tax year"
        },
        "household": {
          "type": "string",
          "enum": [
            "single",
            "partner",
            "parent",
            "other"
          ],
          "description": "Your household for this tax year"
        },
        "partnerIncome": {
          "type": "string",
          "enum": [
            "lu",
            "foreign",
            "none",
            "other",
            "unsure"
          ],
          "description": "What income did your partner have?"
        },
        "salaryOnly": {
          "type": "string",
          "enum": [
            "yes",
            "capital",
            "other",
            "unsure"
          ],
          "description": "Which types of income should we include?"
        },
        "stable": {
          "type": "string",
          "enum": [
            "yes",
            "no",
            "unsure"
          ],
          "description": "Whether residence and household situation stayed unchanged throughout the tax year: yes = no changes; no = at least one change; unsure = not yet established. Changes and their dates must be reviewed in the app."
        }
      }
    },
    "amounts": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "gross": {
          "$ref": "#/$defs/eurAmount",
          "description": "Gross salary. Proposed annual amount, not a verified entitlement."
        },
        "social": {
          "$ref": "#/$defs/eurAmount",
          "description": "Deductible compulsory contributions. Proposed annual amount, not a verified entitlement."
        },
        "withheld": {
          "$ref": "#/$defs/eurAmount",
          "description": "Income tax withheld. Proposed annual amount, not a verified entitlement."
        },
        "paidCIS": {
          "$ref": "#/$defs/eurAmount",
          "description": "Employee credit paid (CIS). Proposed annual amount, not a verified entitlement."
        },
        "paidCO2": {
          "$ref": "#/$defs/eurAmount",
          "description": "CO₂ credit paid. Proposed annual amount, not a verified entitlement."
        },
        "commutingAllowance": {
          "$ref": "#/$defs/eurAmount",
          "description": "Commuting deduction · FD. Proposed annual amount, not a verified entitlement."
        },
        "actualEmploymentCosts": {
          "$ref": "#/$defs/eurAmount",
          "description": "Work expenses. Proposed annual amount, not a verified entitlement."
        },
        "insurance": {
          "$ref": "#/$defs/eurAmount",
          "description": "Insurance premiums. Proposed annual amount, not a verified entitlement."
        },
        "consumerInterest": {
          "$ref": "#/$defs/eurAmount",
          "description": "Personal-loan interest. Proposed annual amount, not a verified entitlement."
        },
        "pension": {
          "$ref": "#/$defs/eurAmount",
          "description": "Private pension savings (111bis). Proposed annual amount, not a verified entitlement."
        },
        "advancesPaid": {
          "$ref": "#/$defs/eurAmount",
          "description": "ACD advances paid. Proposed annual amount, not a verified entitlement."
        },
        "priorRefunds": {
          "$ref": "#/$defs/eurAmount",
          "description": "ACD refunds already received. Proposed annual amount, not a verified entitlement."
        },
        "mortgage": {
          "$ref": "#/$defs/eurAmount",
          "description": "Mortgage interest. Proposed annual amount, not a verified entitlement."
        },
        "donation": {
          "$ref": "#/$defs/eurAmount",
          "description": "Charitable donations. Proposed annual amount, not a verified entitlement."
        },
        "donationCarry1": {
          "$ref": "#/$defs/eurAmount",
          "description": "Unused donations from the previous year. Proposed annual amount, not a verified entitlement."
        },
        "donationCarry2": {
          "$ref": "#/$defs/eurAmount",
          "description": "Unused donations from two years earlier. Proposed annual amount, not a verified entitlement."
        },
        "mortgageEmployerAssistance": {
          "$ref": "#/$defs/eurAmount",
          "description": "Tax-exempt employer interest assistance. Proposed annual amount, not a verified entitlement."
        },
        "mortgageOtherAssistance": {
          "$ref": "#/$defs/eurAmount",
          "description": "Other interest subsidies. Proposed annual amount, not a verified entitlement."
        },
        "partnerGross": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · annual gross salary. Proposed annual amount, not a verified entitlement."
        },
        "partnerSocial": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · deductible mandatory contributions. Proposed annual amount, not a verified entitlement."
        },
        "partnerWithheld": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · tax withheld in the salary country. Proposed annual amount, not a verified entitlement."
        },
        "partnerPaidCIS": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · CIS already paid. Proposed annual amount, not a verified entitlement."
        },
        "partnerPaidCO2": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · CO₂ credit already paid. Proposed annual amount, not a verified entitlement."
        },
        "partnerCommutingAllowance": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner’s commuting allowance (FD). Proposed annual amount, not a verified entitlement."
        },
        "partnerNet": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · foreign net income for the Luxembourg calculation. Proposed annual amount, not a verified entitlement."
        },
        "partnerInsurance": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · insurance premiums. Proposed annual amount, not a verified entitlement."
        },
        "partnerConsumerInterest": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · consumer-loan interest. Proposed annual amount, not a verified entitlement."
        },
        "partnerPension": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · pension savings (111bis). Proposed annual amount, not a verified entitlement."
        },
        "partnerActualEmploymentCosts": {
          "$ref": "#/$defs/eurAmount",
          "description": "Partner · employment expenses. Proposed annual amount, not a verified entitlement."
        }
      }
    }
  },
  "$defs": {
    "eurAmount": {
      "type": "string",
      "pattern": "^(?:(?:0|[1-9][0-9]{0,5})\\.[0-9]{2}|1000000\\.00)$",
      "description": "EUR decimal string, two decimal places, no grouping separator. 0.00 is an explicit known zero; omit unknown figures. Maximum 1000000.00."
    }
  }
}
