# Documentation for /tuf Porting Process This document serves as an ongoing log of all features, files, and architectural changes manually ported into the `/tuf` directory. ## 1. Security Features - Ported `env.php` and `auth_helper.php` from Bigbys, merging securely with Tuf's existing methods. - Added `rate_limiter.php` with tracking tables (`username_rate_limits`, `rate_limits`). - Aliased `sanitize_input.php` to maintain backward compatibility with `get_json_input`. - Modified `backend/login.php` to include Bcrypt hashing with SHA-256 fallback migration, rate limits, HttpOnly cookies for JWT, and session enforcement via `current_session_id`. ## 2. Geotagging - Added `latitude` and `longitude` to `attendance` and `late_attendance_requests` tables. - Integrated `requestEmployeeLocation.js` into mobile components. - Verified backend clock in/out and late request endpoints (`create_attendance.php`, `add_late_attendance_request.php`) capture and store geotagging coordinates. ## 3. Schedule Management - Synchronized backend APIs for `schedule-manager` from `central_juan`, ensuring approvals and endpoints exist (`list_submissions.php`, `approve_submission.php`, etc.). - Carefully ported UI components (`LayouSMDashboard.jsx`, `ScheduleBoard.jsx`, `TimeShiftView.jsx`, `WorkTimeSettings.jsx`). - Upgraded the frontend in `tuf` to include modern export functions (`ExcelJS` for XLSX and `jsPDF`/`jspdf-autotable` for PDF) natively. - Implemented and activated the unified dashboard export menu. ## 4. Central Juan Baseline - Ported the following exclusive `central_juan` backend services directly into `/tuf`: `employee_wage`, `user_logs`, `admin_account_settings`, `brand_api`, `company_config`, `config`, `employee_api`, `user_access_api`. - Ported the exclusive `central_juan` frontend components: `brandManagement`, `wage-management`, and `PricingPage.jsx`. ## 5. Minor Features - Safely copied the following missing components from `solidmark`: `accounting`, `employee_assignment`, `employee_reassignment`, and `liability_category_api` (backend). - Ported the missing frontend components: `accounting` and `ui` utilities.