Files
kulakpos_web/walkthroughs/2026-05-11_96851ba9_Attendance_Delegation_Approval_Feature.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

2.0 KiB

Attendance Delegation Approval Feature

We've successfully added the approval flow with a signature pad for the attendance delegation module.

Changes Made

1. New Dependency

We've added react-native-signature-canvas to the frontend ess_ebi project. This library allows users to draw a signature natively or via a webview context, returning a clean Base64 image encoded string that's easily transported via API.

2. Backend API Endpoint

We added a new API route in ess_api/ess_api/app/routes/delegation-routes.js and a corresponding service function in delegation-attendance-services.js.

  • Endpoint: POST /api/delegations/attendance/approve
  • Behavior: It executes an UPDATE query on the trx_multi_attendance table to:
    • Set status = 3
    • Store the base64 signature string in the sign_image_delegate column.
    • Set time_stamp_delegate = NOW().

3. Frontend Approval Flow

In ListAttendanceDelegation.js, the "Approve" button now triggers the new Modal that contains the SignatureScreen.

  • Users are required to draw their signature.
  • If they attempt to save an empty signature, they receive a warning prompt to "Please provide a signature first."
  • Upon successful signing, the handleSignature function is called, which connects to the new API endpoint, passing the ID, NIK, and Base64 string.
  • Upon a successful response, the interface alerts the user and refreshes the history list.

Validation Results

  • Code formatting and styles conform to existing application standards (using predefined HOKBEN UI colors like COLORS.yellowhokben and COLORS.black).
  • State variables correctly capture and track the selected delegation item for approval.
  • Data structures align properly with existing trx_multi_attendance database architecture schema.

Next Steps

You can now test this feature directly from the HOKBEN ESS mobile app by clicking "Approve" on any pending attendance delegation item. The popup should appear allowing you to draw and save the signature!