Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Calculate Quota

คำนวณโควตาการลาจากข้อมูลการลาจริงในระบบ ใช้สำหรับ sync ข้อมูลและปรับยอดโควตาให้ตรงกับข้อมูลจริง

Endpoint

POST /api/v1/open-apis/salary/update-data-filter

Request Body

ParameterTypeRequiredDescriptionExample
path_actionstringYesต้องเป็น calculate_quota"calculate_quota"
quota_yearstringYesปีโควตา (YYYY)"2026"
company_idstringNoกรองตามบริษัท (Base64)-
branch_idstringNoกรองตามสาขา (Base64)-
department_idstringNoกรองตามแผนก (Base64)-
position_idstringNoกรองตามตำแหน่ง (Base64)-
employee_idstringNoคำนวณเฉพาะพนักงานคนเดียว (Base64)-
keywordstringNoค้นหาพนักงาน-
employee_type_codearrayNoกรองตามประเภทพนักงาน["01", "02"]

Response Format

Success Response

{ "code": 200, "message": "สำเร็จ", "payload": { "calculated_employees": 50, "updated_quotas": 120 } }

Response Fields

FieldTypeDescription
calculated_employeesnumberจำนวนพนักงานที่คำนวณ
updated_quotasnumberจำนวนโควตาที่อัปเดต

Error Response

{ "code": 400, "message": "ไม่สำเร็จ", "errors": ["Missing required parameter: 'quota_year'"] }

Code Examples

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_quota", "quota_year": "2026" }'

Notes

  • API นี้ sync ข้อมูลการลาจริงกับยอดโควตา ใช้เมื่อยอด actual ไม่ตรงกับข้อมูลจริง
  • ถ้ามีพนักงานจำนวนมาก ให้ใช้ Create Calculate Queue แทนเพื่อประมวลผลแบบ Asynchronous
  • ใช้ filter เพื่อจำกัดขอบเขตการคำนวณ

Last updated on