Files
kulakpos_web/walkthroughs/2026-05-05_95087241_Walkthrough__Overtime_Delegation_Rejection_API.md
eko54r 05fd3230b8
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 5m14s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped
update marketing
2026-05-14 11:55:22 +07:00

1.3 KiB

Walkthrough - Overtime Delegation Rejection API

I have implemented the rejection mechanism for the Overtime Delegation module. This allows superiors to reject delegation requests with a reason.

Changes Made

Backend Service

  • [delegation-overtime-services.js](file:///home/itc43/Documents/HOKBEN_PROJECT/ESS PROJECT/ess_api/ess_api/app/services/delegation-overtime-services.js):
    • Implemented rejectOvertimeDelegation: Updates status to 6, records the rejection NIK, comment, and timestamp.
    • Updated getOvertimeDelegationHistory: Now includes reject_by, comment_reject, timestamp_reject, and name_reject_by in the response.

Backend Routes

  • [delegation-routes.js](file:///home/itc43/Documents/HOKBEN_PROJECT/ESS PROJECT/ess_api/ess_api/app/routes/delegation-routes.js):
    • Added POST /api/delegations/overtime/reject route.

Verification Results

API Test

The new endpoint can be tested with the following structure:

  • URL: /api/delegations/overtime/reject
  • Method: POST
  • Body:
{
  "id": 123,
  "nik": "DELEGATOR_NIK",
  "reject_by": "REJECTOR_NIK",
  "comment_reject": "Rejected because of change in schedule"
}

The history endpoint /api/delegations/overtime/history will now return the rejection details for rejected items.