{
  "name": "thai_severance_pay",
  "slug": "severance-pay",
  "description": {
    "th": "คำนวณค่าชดเชยเมื่อเลิกจ้างตามมาตรา 118 พ.ร.บ.คุ้มครองแรงงาน จากวันเริ่มงาน วันทำงานวันสุดท้าย และค่าจ้างสุดท้าย (รายเดือน/รายวัน) ได้อายุงาน จำนวนวันที่ได้ ค่าชดเชย และส่วนที่ได้รับยกเว้นภาษี พร้อมลิงก์เปิดเครื่องคำนวณ",
    "en": "Computes statutory severance pay under section 118 of the Thai Labour Protection Act from start date, last working day and last wage (monthly or daily). Returns length of service, days of pay, the amount and its tax-exempt part, with a link to the calculator."
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "start": {
        "description": "First day of work, YYYY-MM-DD (Gregorian).",
        "type": "string"
      },
      "lastDay": {
        "description": "Last day of work (employment ends after this day), YYYY-MM-DD.",
        "type": "string"
      },
      "wage": {
        "description": "Last wage rate in baht (per month or per day, see wageType); more than 0.",
        "anyOf": [
          {
            "type": "number",
            "exclusiveMinimum": 0
          },
          {
            "type": "string",
            "pattern": "^\\s*(฿\\s*)?(\\d+|\\d{1,3}(,\\d{3})+)(\\.\\d{1,2})?\\s*$"
          }
        ]
      },
      "wageType": {
        "description": "Whether wage is per month or per day.",
        "type": "string",
        "enum": [
          "monthly",
          "daily"
        ]
      },
      "receivedDate": {
        "description": "Date the severance is received, YYYY-MM-DD; default lastDay. Picks the tax-exemption rule.",
        "type": "string"
      },
      "reason": {
        "description": "Why employment ended; retirement and contract-end get no tax exemption. Default dismissal.",
        "type": "string",
        "enum": [
          "dismissal",
          "retirement",
          "contract-end"
        ]
      }
    },
    "required": [
      "start",
      "lastDay",
      "wage",
      "wageType"
    ],
    "additionalProperties": false
  }
}
