Calculate Year
ปรับปีที่นับโควตาของบันทึกการลาให้ถูกต้องตามกฎของระบบ ใช้เมื่อต้องการคำนวณว่าการลาควรนับเป็นโควตาของปีใด
Endpoint
POST /api/v1/open-apis/salary/update-data-filterRequest Body
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
path_action | string | Yes | ต้องเป็น calculate_year | "calculate_year" |
quota_year | string | Yes | ปีโควตา (YYYY) | "2026" |
company_id | string | No | กรองตามบริษัท (Base64) | - |
branch_id | string | No | กรองตามสาขา (Base64) | - |
department_id | string | No | กรองตามแผนก (Base64) | - |
position_id | string | No | กรองตามตำแหน่ง (Base64) | - |
employee_id | string | No | เฉพาะพนักงานคนเดียว (Base64) | - |
keyword | string | No | ค้นหาพนักงาน | - |
Response Format
Success Response
{
"code": 200,
"message": "สำเร็จ",
"payload": [
{
"employee_id": "202503219741427917A0",
"employee_code": "EMP001",
"updated_records": 3
},
{
"employee_id": "20250321A8B9C0D1E2F3",
"employee_code": "EMP002",
"updated_records": 1
}
]
}Error Response
{
"code": 400,
"message": "ไม่สำเร็จ",
"errors": ["Missing required parameter: 'quota_year'"]
}Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/salary/update-data-filter" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"path_action": "calculate_year",
"quota_year": "2026"
}'Notes
- API นี้ตรวจสอบว่าการลาแต่ละรายการควรนับเป็นโควตาของปีใด แล้วปรับ
in_yearให้ถูกต้อง - ใช้เมื่อมีการเปลี่ยนกฎเกณฑ์การนับปีโควตา หรือข้อมูลการลาข้ามปี
Related APIs
- Calculate Quota - คำนวณยอดโควตาจากข้อมูลการลา
- Reset Quota - รีเซ็ตโควตาทั้งหมด
Last updated on