{
 "openapi": "3.1.0",
 "info": {
  "title": "Personnel Actions (HRMS)",
  "version": "20261030b",
  "description": "Promotions, transfers and pay changes, each approved by somebody other than whoever asked and applied to the employee on the day it takes effect — with the history of what changed from what."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "personnel-actions": {
    "type": "object",
    "required": [
     "employee_id",
     "action_type",
     "effective_date"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Employee"
     },
     "action_type": {
      "type": "string",
      "description": "Type",
      "enum": [
       "promotion",
       "demotion",
       "transfer",
       "pay_change",
       "reorganisation",
       "data_correction"
      ]
     },
     "effective_date": {
      "type": "string",
      "format": "date",
      "description": "Takes effect on"
     },
     "reason": {
      "type": "string",
      "description": "Reason"
     },
     "detail": {
      "type": "object",
      "description": "Detail"
     },
     "approved_by": {
      "type": "string",
      "format": "uuid",
      "description": "Approved by",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "action_no": {
      "type": "string",
      "description": "Action no",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "requested_by": {
      "type": "string",
      "format": "uuid",
      "description": "Requested by",
      "readOnly": true
     },
     "requested_at": {
      "type": "string",
      "format": "date-time",
      "description": "Requested at",
      "readOnly": true
     },
     "approved_at": {
      "type": "string",
      "format": "date-time",
      "description": "Approved at",
      "readOnly": true
     },
     "rejected_reason": {
      "type": "string",
      "description": "Rejected reason",
      "readOnly": true
     },
     "proposed": {
      "type": "object",
      "description": "Proposed",
      "readOnly": true
     },
     "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_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
     },
     "to_position_id": {
      "type": "string",
      "format": "uuid",
      "description": "New position"
     },
     "to_manager_id": {
      "type": "string",
      "format": "uuid",
      "description": "New manager"
     },
     "to_org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "New organizational unit"
     },
     "to_base_pay": {
      "type": "string",
      "format": "decimal",
      "description": "New base pay"
     },
     "to_pay_type": {
      "type": "string",
      "description": "New pay type",
      "enum": [
       "salary",
       "hourly"
      ]
     },
     "to_work_state": {
      "type": "string",
      "description": "New work region"
     },
     "applied_at": {
      "type": "string",
      "format": "date-time",
      "description": "Applied at",
      "readOnly": true
     },
     "applied_change": {
      "type": "object",
      "description": "Applied change",
      "readOnly": true
     },
     "from_values": {
      "type": "object",
      "description": "From values",
      "readOnly": true
     },
     "rejected_by": {
      "type": "string",
      "format": "uuid",
      "description": "Rejected by",
      "readOnly": true
     },
     "rejected_at": {
      "type": "string",
      "format": "date-time",
      "description": "Rejected at",
      "readOnly": true
     },
     "cancelled_by": {
      "type": "string",
      "format": "uuid",
      "description": "Cancelled by",
      "readOnly": true
     },
     "cancelled_at": {
      "type": "string",
      "format": "date-time",
      "description": "Cancelled at",
      "readOnly": true
     },
     "type_override_reason": {
      "type": "string",
      "description": "Type override reason",
      "readOnly": true
     },
     "type_override_by": {
      "type": "string",
      "format": "uuid",
      "description": "Type override by",
      "readOnly": true
     },
     "type_override_at": {
      "type": "string",
      "format": "date-time",
      "description": "Type override at",
      "readOnly": true
     },
     "to_pay_group_id": {
      "type": "string",
      "format": "uuid",
      "description": "New pay group"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/hrms/personnel-actions": {
   "get": {
    "summary": "list personnel-actions",
    "operationId": "list_personnel_actions_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create personnel-actions",
    "operationId": "create_personnel_actions_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/personnel-actions/{id}": {
   "get": {
    "summary": "get personnel-actions",
    "operationId": "get_personnel_actions_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change personnel-actions",
    "operationId": "change_personnel_actions_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete personnel-actions",
    "operationId": "delete_personnel_actions_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/personnel-actions/{id}/approvals": {
   "get": {
    "summary": "Approvals",
    "operationId": "action_personnel_actions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/personnel-actions/{id}/submit": {
   "post": {
    "summary": "Submit",
    "operationId": "action_personnel_actions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/personnel-actions/{id}/approve": {
   "post": {
    "summary": "Approve",
    "operationId": "action_personnel_actions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/personnel-actions/{id}/reject": {
   "post": {
    "summary": "Reject",
    "operationId": "action_personnel_actions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/personnel-actions/{id}/make-effective": {
   "post": {
    "summary": "Make effective",
    "operationId": "action_personnel_actions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/personnel-actions/{id}/cancel": {
   "post": {
    "summary": "Cancel",
    "operationId": "action_personnel_actions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/personnel-actions/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_personnel_actions_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"
     }
    }
   }
  }
 }
}