Automates attendance tracking and management in the HRMS staging portal. Records check-in/check-out, processes attendance corrections, generates attendance reports, and handles regularization requests. Requires hrms-auth and hrms-validator.
You manage attendance-related operations in the HRMS portal. You ensure accurate time records and handle regularization requests with proper audit trails.
hrms-auth — ensure active sessionhrms-validator with module attendance — validate attendance dataconfig/selectors.json1. Validate attendance data against attendance.schema.json
2. Verify employee exists in the system
3. Check for duplicate entry for the same date
4. Verify the date is not in the future (except pre-scheduled)
SELECTORS="$HOME/.openclaw/workspace/hrms-automation/config/selectors.json"
ATTENDANCE_URL=$(jq -r '.attendance.entryUrl' "$SELECTORS")
browser_navigate "${HRMS_STAGING_URL}${ATTENDANCE_URL}"
browser_wait_for_selector "$(jq -r '.attendance.fields.employeeId' "$SELECTORS")" 30000
Field mapping (selectors.json → attendance data):
.attendance.fields.employeeId → data.employeeId
.attendance.fields.date → data.date (date picker)
.attendance.fields.checkIn → data.checkInTime (time picker: HH:MM)
.attendance.fields.checkOut → data.checkOutTime (time picker: HH:MM)
.attendance.fields.status → data.status (dropdown: present, absent, half-day, WFH, on-duty)
.attendance.fields.shiftType → data.shiftType (dropdown: general, morning, evening, night)
.attendance.fields.overtimeHrs → data.overtimeHours (number)
.attendance.fields.remarks → data.remarks (textarea)
Time picker handling:
1. Click time input field
2. Clear existing value
3. Type time in HH:MM format (24-hour)
4. If time picker widget appears, use hour/minute selectors
5. Tab out and verify displayed time
1. Read back all entered values
2. Verify check-out is after check-in (unless overnight shift)
3. Calculate total hours worked
4. Verify against expected hours for the shift type
5. If overtime entered, verify it exceeds normal shift duration
6. Take pre-submission screenshot
7. Submit
8. Capture confirmation
9. Audit log
For importing attendance data from biometric systems or CSV:
Bulk Upload Protocol:
1. PRE-PROCESSING:
- Validate each record against attendance.schema.json
- Remove duplicates
- Flag anomalies:
* Missing check-out (forgot to clock out?)
* Unreasonably long hours (>16 hours)
* Unreasonably short hours (<1 hour, except half-day)
* Weekend/holiday attendance without prior approval
- Generate pre-upload report
2. NAVIGATE to bulk upload page:
BULK_URL=$(jq -r '.attendance.bulkUploadUrl' "$SELECTORS")
browser_navigate "${HRMS_STAGING_URL}${BULK_URL}"
3. UPLOAD:
- If CSV upload supported:
a. Format data to expected CSV template
b. Upload via file input
c. Wait for processing
d. Check for errors
- If form-based only:
a. Process each record individually
b. Rate limiting: 2s between records
c. Track progress
4. POST-UPLOAD VERIFICATION:
- Navigate to attendance view
- Spot-check 10% of uploaded records
- Verify data matches input
- Log verification results
5. GENERATE REPORT:
- Total records processed
- Successful uploads
- Failed records with reasons
- Anomalies flagged for review
When employees need to correct attendance records:
Regularization Workflow:
1. RECEIVE regularization request data:
- Employee ID
- Date(s) requiring regularization
- Original record (if any)
- Corrected values (check-in, check-out, status)
- Reason for regularization
- Supporting evidence (if any)
2. VALIDATE:
- Schema validation
- Verify the original record exists
- Check regularization policy:
* Maximum age of record that can be regularized (e.g., ≤30 days)
* Maximum regularizations per month per employee
* Required approval level
3. NAVIGATE to regularization page:
REG_URL=$(jq -r '.attendance.regularizationUrl' "$SELECTORS")
browser_navigate "${HRMS_STAGING_URL}${REG_URL}"
4. FILL regularization form:
- Select employee
- Select date
- Enter corrected check-in / check-out
- Select reason from dropdown
- Enter detailed comments
- Upload supporting document if required
5. SUBMIT and capture confirmation
6. AUDIT LOG with full before/after comparison
Available reports:
1. DAILY ATTENDANCE SUMMARY:
- Navigate to reports section
- Select date
- Export: total present, absent, on-leave, WFH, late arrivals
2. MONTHLY ATTENDANCE SUMMARY:
- Select month/year
- Export: per-employee summary with totals
- Calculate: working days, present days, absent days, leave days
3. LATE ARRIVAL REPORT:
- Filter employees arriving after threshold (policy-defined)
- Export: employee, date, expected time, actual time, delay
4. OVERTIME REPORT:
- Filter employees with overtime entries
- Export: employee, date, normal hours, overtime hours, total
Report output:
- Save as JSON to workspace/reports/attendance/[report-type]_[date].json
- Generate human-readable summary
- Log report generation to audit trail
When DRY_RUN=true:
| Error | Action |
|---|---|
| Duplicate entry detected | Skip, log as info (idempotent) |
| Time format rejected | Try alternate formats (HH:MM, H:MM AM/PM), log |
| Future date blocked | Skip if policy prohibits, log |
| Regularization limit exceeded | HALT, notify user, do not override |
| Biometric data mismatch | Flag for manual review, do not auto-correct |
| Overtime not authorized | Flag, do not submit overtime component |
| Concurrent edit detected | Refresh, re-read, re-attempt once |