{
  "$comment": "Machine-readable companion to https://valem.run/calculators/uae/gratuity. Formula, inputs, outputs, engine-verified test vectors, cited sources and the re-runnable Valem ModelSpec behind the page.",
  "url": "https://valem.run/calculators/uae/gratuity",
  "dataUrl": "https://valem.run/calculators/uae/gratuity.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "United Arab Emirates gratuity model by Valem (https://valem.run/calculators/uae/gratuity), CC BY 4.0.",
    "note": "Covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds themselves are law and are not licensed by anyone; the cited sources are where they come from."
  },
  "verificationUrl": "https://valem.run/calculators/uae/gratuity/verify",
  "country": "uae",
  "countryName": "United Arab Emirates",
  "formula": "gratuity",
  "formulaName": "Gratuity",
  "title": "Gratuity Calculator UAE — end of service",
  "answer": "UAE gratuity is 21 days of your basic salary per year for the first five years, then 30 days per year beyond, payable after one year.",
  "lang": "en",
  "currency": "AED",
  "taxYear": "2026",
  "verification": {
    "claim": "internal-consistency",
    "statement": "The Valem engine reproduces this model's stated formula through 4 self-test cases (below, and re-runnable against the spec). That asserts internal consistency, NOT that the formula matches current law — the cited sources are the evidence for that, and carry the date each was last checked.",
    "selfTestCases": 4,
    "ratesAreIllustrative": false,
    "sourcesCheckedOn": "2026-08-02"
  },
  "sources": [
    {
      "label": "u.ae — end-of-service benefits",
      "url": "https://u.ae/en/information-and-services/jobs/working-in-uae-private-sector/end-of-service-benefits",
      "checked": "2026-08-02"
    }
  ],
  "terminalOutput": "gratuity",
  "inputs": [
    {
      "name": "basicMonthly",
      "type": "number",
      "label": "Basic monthly salary (AED)",
      "minimum": 0
    },
    {
      "name": "years",
      "type": "number",
      "label": "Years of service",
      "minimum": 0
    }
  ],
  "outputs": [
    {
      "name": "dailyWage",
      "type": "number",
      "formula": "$round(basicMonthly / 30, 4)"
    },
    {
      "name": "gratuity",
      "type": "number",
      "label": "End-of-service gratuity",
      "format": "currency",
      "formula": "(years < 1 ? 0 : ($d := basicMonthly / 30; $f := years < 5 ? years : 5; $b := years > 5 ? years - 5 : 0; $g := $d * $const.daysFirst5 * $f + $d * $const.daysBeyond * $b; $cap := basicMonthly * $const.maxMonths; $round($g < $cap ? $g : $cap, 2)))"
    }
  ],
  "testCases": [
    {
      "description": "G1 basic 10,000 AED, 3 years",
      "given": {
        "basicMonthly": 10000,
        "years": 3
      },
      "expect": {
        "gratuity": 21000
      }
    },
    {
      "description": "G2 basic 15,000 AED, 7 years",
      "given": {
        "basicMonthly": 15000,
        "years": 7
      },
      "expect": {
        "gratuity": 82500
      }
    },
    {
      "description": "G3 under one year — no gratuity",
      "given": {
        "basicMonthly": 12000,
        "years": 0.67
      },
      "expect": {
        "gratuity": 0
      }
    },
    {
      "description": "G4 basic 10,000 AED, 30 years — the two-year statutory cap binds",
      "given": {
        "basicMonthly": 10000,
        "years": 30
      },
      "expect": {
        "gratuity": 240000
      }
    }
  ],
  "spec": {
    "id": "net-salary-uae",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "basicMonthly": {
          "type": "number",
          "minimum": 0
        },
        "years": {
          "type": "number",
          "minimum": 0
        },
        "dailyWage": {
          "type": "number",
          "readOnly": true
        },
        "gratuity": {
          "type": "number",
          "readOnly": true
        }
      }
    },
    "constants": {
      "daysFirst5": 21,
      "daysBeyond": 30,
      "maxMonths": 24
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ 'basicMonthly': 10000, 'years': 3 }"
      }
    ],
    "derivations": [
      {
        "path": "$.dailyWage",
        "expr": "$round(basicMonthly / 30, 4)"
      },
      {
        "path": "$.gratuity",
        "expr": "(years < 1 ? 0 : ($d := basicMonthly / 30; $f := years < 5 ? years : 5; $b := years > 5 ? years - 5 : 0; $g := $d * $const.daysFirst5 * $f + $d * $const.daysBeyond * $b; $cap := basicMonthly * $const.maxMonths; $round($g < $cap ? $g : $cap, 2)))"
      }
    ],
    "constraints": [],
    "metaDerivations": [],
    "viewDefinition": {
      "renderer": "builtin",
      "defaultView": "main",
      "views": [
        {
          "id": "main",
          "label": "Gratuity",
          "layout": "vertical",
          "components": [
            {
              "id": "basic",
              "type": "numericField",
              "label": "Basic monthly salary (AED)",
              "bind": "$.basicMonthly"
            },
            {
              "id": "years",
              "type": "numericField",
              "label": "Years of service",
              "bind": "$.years"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "gTile",
                  "type": "statTile",
                  "label": "End-of-service gratuity",
                  "bind": "$.gratuity",
                  "format": "currency",
                  "currency": "AED"
                }
              ]
            },
            {
              "id": "note",
              "type": "staticText",
              "text": "'UAE has no personal income tax; net pay equals gross for expats. End-of-service gratuity = 21 days of BASIC salary per year for the first 5 years, then 30 days per year beyond, pro-rata, payable after 1 year. Use basic salary, not total. Estimate, not legal advice. The total is capped by law at two years' wage, which starts to bite at about 25.5 years of service.'"
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Sources",
              "items": [
                {
                  "label": "u.ae — end-of-service benefits",
                  "url": "https://u.ae/en/information-and-services/jobs/working-in-uae-private-sector/end-of-service-benefits",
                  "date": "2026-08-02"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "G1 basic 10,000 AED, 3 years",
        "given": {
          "$.basicMonthly": 10000,
          "$.years": 3
        },
        "expect": {
          "$.gratuity": 21000
        }
      },
      {
        "description": "G2 basic 15,000 AED, 7 years",
        "given": {
          "$.basicMonthly": 15000,
          "$.years": 7
        },
        "expect": {
          "$.gratuity": 82500
        }
      },
      {
        "description": "G3 under one year — no gratuity",
        "given": {
          "$.basicMonthly": 12000,
          "$.years": 0.67
        },
        "expect": {
          "$.gratuity": 0
        }
      },
      {
        "description": "G4 basic 10,000 AED, 30 years — the two-year statutory cap binds",
        "given": {
          "$.basicMonthly": 10000,
          "$.years": 30
        },
        "expect": {
          "$.gratuity": 240000
        }
      }
    ]
  }
}
