Files
kulakpos_web/walkthroughs/2026-04-15_a04c374b_Overtime_Data_Mapping_Update_Walkthrough.md

25 lines
1.7 KiB
Markdown
Raw Normal View History

2026-05-14 11:55:22 +07:00
# Overtime Data Mapping Update Walkthrough
I have updated the mapping logic in `overtime_history_page.dart` to correctly handle the new JSON response format provided.
## Changes Made
### 1. Overtime Data Mapping Update
- **Field Mapping**: Updated `overtime_history_page.dart` to use new keys: `id`, `tgl`, `starttime`, `endtime`, `total_waktu`, `whattodo`, etc.
- **ISO8601 Support**: Added specialized parsing for ISO8601 time strings (e.g., `2025-09-29T18:00:00.000Z`) with local time conversion.
- **Robustness**: Improved date/time formatting with better null safety and placeholder handling.
### 2. Subordinate Directory API Integration
- **New `DirectoryApi`**: Created `lib/api/directory/directory_api.dart` to handle fetching subordinate details via the `getdatadetailsbawahan` endpoint.
- **Live UI**: Updated `DirectoryPage` to replace placeholder data with real-time employee information.
- **Enhanced Card Design**:
- **NIK Badge**: Added a stylized NIK identifier for each employee.
- **Device Visibility**: Integrated a new row showing the employee's model and brand (e.g., "samsung Galaxy A32").
- **Active Status**: Implemented a green/grey status indicator for the `isactive` flag.
- **Details Dialog**: Created a comprehensive "View Profile" dialog that displays full employee information, including NIK, Email, Location, Full Device Details, and Status, with a professional UI.
## Verification Results
- **Field Mapping**: Verified fields: `nik`, `nama`, `lokasi`, `device_name`, `brand`, `isactive`, and `posisi`.
- **UI Responsiveness**: Confirmed the directory grid and details dialog are responsive and visually consistent.
- **Code Quality**: Resolved lint errors related to invalid widget parameters in the details dialog.