{
 "openapi": "3.1.0",
 "info": {
  "title": "Overtime Rules (HRMS)",
  "version": "20261030b",
  "description": "Overtime is a conclusion, not an entry. The rules of the country a person is paid in apply to them, and the most specific wins: an agreement over a regional rule over the national one."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "overtime-rules": {
    "type": "object",
    "required": [
     "code",
     "name"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "code": {
      "type": "string",
      "description": "Code"
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "jurisdiction": {
      "type": "string",
      "description": "Jurisdiction"
     },
     "applies_to": {
      "type": "string",
      "description": "Applies to",
      "enum": [
       "all",
       "non_exempt",
       "hourly",
       "union"
      ]
     },
     "union_code": {
      "type": "string",
      "description": "Union code"
     },
     "daily_threshold": {
      "type": "string",
      "format": "decimal",
      "description": "Overtime after, per day"
     },
     "daily_double_threshold": {
      "type": "string",
      "format": "decimal",
      "description": "Double time after, per day"
     },
     "weekly_threshold": {
      "type": "string",
      "format": "decimal",
      "description": "Overtime after, per week"
     },
     "seventh_day_rule": {
      "type": "boolean",
      "description": "Seventh consecutive day is premium"
     },
     "seventh_day_double_after": {
      "type": "string",
      "format": "decimal",
      "description": "Double after, on the seventh day"
     },
     "overtime_multiplier": {
      "type": "string",
      "format": "decimal",
      "description": "Overtime multiplier"
     },
     "double_multiplier": {
      "type": "string",
      "format": "decimal",
      "description": "Double multiplier"
     },
     "paid_leave_counts": {
      "type": "boolean",
      "description": "Paid leave counts toward the threshold"
     },
     "week_starts_on": {
      "type": "integer",
      "description": "Week starts on"
     },
     "priority": {
      "type": "integer",
      "description": "Order"
     },
     "is_active": {
      "type": "boolean",
      "description": "Active"
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "country": {
      "type": "string",
      "description": "Country"
     },
     "premium_basis": {
      "type": "string",
      "description": "Premium paid on",
      "enum": [
       "regular_rate — the regular rate of pay",
       "basic_wage — the basic wage (Saudi Labour Law art. 107)"
      ]
     },
     "public_employer_applies": {
      "type": "boolean",
      "description": "Applies to a public employer"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/hrms/overtime-rules": {
   "get": {
    "summary": "list overtime-rules",
    "operationId": "list_overtime_rules_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create overtime-rules",
    "operationId": "create_overtime_rules_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/overtime-rules/{id}": {
   "get": {
    "summary": "get overtime-rules",
    "operationId": "get_overtime_rules_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change overtime-rules",
    "operationId": "change_overtime_rules_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete overtime-rules",
    "operationId": "delete_overtime_rules_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/overtime-rules/public-employer": {
   "get": {
    "summary": "Public employer",
    "operationId": "action_overtime_rules_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "Public employer",
    "operationId": "action_overtime_rules_1_5",
    "description": "Body keys: publicEmployer, public_employer",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/overtime-rules/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_overtime_rules_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}