HRMS FACE ATTENDANCE - FINAL TWO-WAY SYNC SERVER 1. Copy api/face_attendance into the same HRMS installation. 2. The API auto-creates the mobile/attendance support tables when first used. sql/face_attendance_mobile.sql is also included for manual installation. 3. Flutter uses the existing active admin_users credentials. 4. Branch access follows the HRMS account permissions. ATTENDANCE - Four slots: MORNING_IN -> MORNING_OUT -> LUNCH_IN -> FINAL_OUT. - Working time = (Morning Out - Morning In) + (Final Out - Lunch In). - >= 8:00 = 1.0 Present day. - >= 4:00 and < 8:00 = 0.5 Half Day. - < 4:00 = 0 payable/absent day. - Monthly payable = gross salary / working days * payable present-day units. - September 2026 uses Monday-Saturday working days (26). - Face/mobile timestamps are authoritative in Attendance Reports; attendance_daily remains the web mirror/fallback. TWO-WAY SYNC - Phone -> server: pending face/attendance events are pushed whenever a sync succeeds. - Server -> phone: sync_state.php returns current employees/faces and web/mobile attendance slot events. - The phone reconciles server events into its local SQLite attendance state. - Initial sync happens after login/startup. - Automatic sync runs every 10 minutes while the app is running. - Manual Sync button is available on the home screen. - When the server is offline, attendance/face events remain in SQLite and are retried later. - When the server comes back, pending local events upload first, then the latest server state is pulled. - If attendance is changed on the web, the phone receives it on the next successful sync. IMPORTANT - The Flutter app is an offline-capable attendance terminal; it does not require the HRMS server to be available at the exact moment of capture. - True background syncing after Android force-stop is not guaranteed by this source; keep the attendance app running for the 10-minute automatic polling requirement.