## 2026-07-04 - Mobile PM Schedule Approval API

- What was changed:
  Added a protected mobile PM schedule approval endpoint that promotes a draft schedule plan to approved, records `approved_by` and `approved_at`, and returns the updated schedule item in the same payload shape as the PM mobile schedule list.
  Extracted the PM mobile schedule item/change-request payload builder into a shared backend service so the list and approval endpoints stay aligned.
  Expanded the backend mobile PM schedule API tests to cover successful approval, non-PM rejection, missing plans, and already-approved conflict handling.
- Files touched:
  `app/Http/Controllers/Api/MobileProjectManagerScheduleApprovalController.php`
  `app/Http/Controllers/Api/MobileProjectManagerScheduleController.php`
  `app/Services/MobileProjectManagerSchedulePayloadService.php`
  `app/Services/SchedulePlanService.php`
  `routes/api.php`
  `tests/Feature/MobileProjectManagerScheduleApiTest.php`
  `docs/CODEX_LOG.md`

## 2026-07-04 - Mobile PM Schedule PDF Links

- What was changed:
  Extended the protected mobile PM schedule payload so each draft or approved schedule plan now includes a `documentUrl` pointing to an API-authenticated PDF endpoint.
  Added a dedicated mobile schedule-plan PDF route/controller under `auth:api` so the Flutter PM app can fetch the same schedule PDF over bearer-token auth instead of relying on web-session `/admin/...` routes.
  Expanded backend tests to assert the new `documentUrl` contract on the schedule list payload and to verify mobile PDF access control for Project Manager versus Supervisor users.
- Files touched:
  `app/Http/Controllers/Api/MobileProjectManagerScheduleController.php`
  `app/Http/Controllers/Api/MobileSchedulePlanPdfController.php`
  `routes/api.php`
  `tests/Feature/MobileProjectManagerScheduleApiTest.php`
  `tests/Feature/SchedulePlanPdfDownloadTest.php`
  `docs/CODEX_LOG.md`

## 2026-07-02 - Mobile PM Schedule API

- What was changed:
  Added a protected mobile PM schedule API that returns summary counts and normalized `pending`, `approved`, and `changeRequests` buckets from the existing scheduling domain so the Flutter PM schedule screen can consume real server data without mobile-side approval actions.
  Added a focused feature test covering PM access, non-PM rejection, empty payload handling, and status-to-tab mapping for draft plans, approved plans, and pending change requests.
  Expanded the PM mobile schedule payload with structured metrics and detailed schedule-plan data so the app can show richer cards and a full-detail bottom sheet without additional requests.
- Files touched:
  `app/Http/Controllers/Api/MobileProjectManagerScheduleController.php`
  `routes/api.php`
  `tests/Feature/MobileProjectManagerScheduleApiTest.php`
  `docs/CODEX_LOG.md`

## 2026-06-27 - Schedule Plan Quarterly PDF Export

- What was changed:
  Added a PM-only quarterly schedule PDF download flow from the schedule plan view page, following the scheduling clarification that the Project Manager exports the plan for DIAL sharing.
  Created a dedicated PDF report endpoint and print template that summarizes the full quarterly plan with terminal, zone, period, shift, manpower allocation, equipment allocation, sub-areas, approval metadata, and planned weekday distribution without rendering a per-day schedule table.
  Added a focused feature test for PDF access control and download behavior, and updated the single-role migration so SQLite-based test runs can complete successfully.
  Expanded PDF access to Admin users too and added a direct `PDF` action button in each schedule row on the zone schedule list page so the export is visible before opening the individual schedule view.
  Redesigned the quarterly PDF layout into a more formal schedule sheet by tightening top spacing, removing the low-value weekday distribution block, replacing the clipped sub-area chips with a stable coverage box, surfacing actual manpower assignments more clearly, improving approval wording for draft schedules, and moving equipment allocation to its own page to prevent footer overlap and page-bottom clipping.
  Reworked the schedule PDF again to use the training sheet style header and footer, then tuned the footer positioning using direct rendered-PDF inspection so the final footer block sits in the bottom page margin instead of floating in the content area.
- Files touched:
  `app/Filament/Resources/SchedulePlanners/Pages/ListZoneSchedules.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ViewSchedulePlan.php`
  `app/Http/Controllers/SchedulePlanPdfController.php`
  `resources/views/filament/resources/schedule-planners/pages/list-zone-schedules.blade.php`
  `resources/views/filament/resources/schedule-planners/pages/view-schedule-plan.blade.php`
  `resources/views/pdf/schedule-plan-quarterly.blade.php`
  `routes/web.php`
  `tests/Feature/SchedulePlanPdfDownloadTest.php`
  `database/migrations/2026_06_14_171500_migrate_users_to_single_role_and_drop_role_user_table.php`
  `docs/CODEX_LOG.md`

## 2026-06-25 - Scheduling Backend Foundation

- What was changed:
  Added the scheduling database structure for shift master, schedule plans, day-wise plan rows, manpower/equipment assignments, and PM-approved change request staging tables.
  Implemented scheduling models and a service layer that creates draft plans by expanding the selected quarter or custom range into one row per day, blocks overlapping zone plans, and prepares backend approval/apply/reject logic for later edit workflows.
  Connected the existing Filament scheduling UI to real backend saves, replaced free-text shift timing with shift master selection, added equipment assignment, showed saved schedules in the zone workspace, and enabled Project Manager approval from the schedule list.
  Added a Filament `Shift Master` resource and seeded the default `09:00-18:00` day shift.
  Added explicit `View` and `Edit` actions for saved plans in the zone schedule list, plus direct draft-plan editing that rebuilds the generated day-wise rows when the date range, shift, team, or equipment changes.
  Extended approved-plan editing so admin can raise uniform date-range change requests inside an approved quarterly plan, while PM can approve or reject those requests and the workspace/view pages show grouped pending, approved, and rejected revision history under the base plan.
  Simplified schedule plan `View` and `Edit` routes to use plan-only URLs and normalized scheduling page navigation to explicit named routes so custom Filament page links behave consistently on local and remote environments.
- Files touched:
  `app/Filament/Resources/SchedulePlanners/Pages/ListZoneSchedules.php`
  `app/Filament/Resources/SchedulePlanners/Pages/EditSchedulePlan.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ScheduleZone.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ViewSchedulePlan.php`
  `app/Filament/Resources/SchedulePlanners/Schemas/ApprovedScheduleChangeRequestForm.php`
  `app/Filament/Resources/SchedulePlanners/Schemas/ZoneScheduleForm.php`
  `app/Filament/Resources/ScheduleShifts/ScheduleShiftResource.php`
  `app/Filament/Resources/ScheduleShifts/Pages/CreateScheduleShift.php`
  `app/Filament/Resources/ScheduleShifts/Pages/EditScheduleShift.php`
  `app/Filament/Resources/ScheduleShifts/Pages/ListScheduleShifts.php`
  `app/Filament/Resources/ScheduleShifts/Schemas/ScheduleShiftForm.php`
  `app/Filament/Resources/ScheduleShifts/Tables/ScheduleShiftsTable.php`
  `app/Models/Equipment.php`
  `app/Models/ScheduleChangeRequest.php`
  `app/Models/ScheduleChangeRequestDay.php`
  `app/Models/ScheduleChangeRequestDayAssignment.php`
  `app/Models/ScheduleChangeRequestDayEquipment.php`
  `app/Models/SchedulePlan.php`
  `app/Models/SchedulePlanDay.php`
  `app/Models/SchedulePlanDayAssignment.php`
  `app/Models/SchedulePlanDayEquipment.php`
  `app/Models/ScheduleShift.php`
  `app/Models/User.php`
  `app/Models/Zone.php`
  `app/Services/SchedulePlanService.php`
  `database/migrations/2026_06_25_090000_create_schedule_shifts_table.php`
  `database/migrations/2026_06_25_090100_create_schedule_plans_table.php`
  `database/migrations/2026_06_25_090200_create_schedule_plan_days_table.php`
  `database/migrations/2026_06_25_090300_create_schedule_plan_day_assignments_table.php`
  `database/migrations/2026_06_25_090400_create_schedule_plan_day_equipment_table.php`
  `database/migrations/2026_06_25_090500_create_schedule_change_requests_table.php`
  `database/migrations/2026_06_25_090600_create_schedule_change_request_days_table.php`
  `database/migrations/2026_06_25_090700_create_schedule_change_request_day_assignments_table.php`
  `database/migrations/2026_06_25_090800_create_schedule_change_request_day_equipment_table.php`
  `database/seeders/DatabaseSeeder.php`
  `database/seeders/ScheduleShiftsTableSeeder.php`
  `resources/views/filament/resources/schedule-planners/pages/list-zone-schedules.blade.php`
  `resources/views/filament/resources/schedule-planners/pages/schedule-zone.blade.php`
  `resources/views/filament/resources/schedule-planners/pages/view-schedule-plan.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-25 - Filament Work Planning Navigation Fix

- What was changed:
  Removed the child navigation icon from the Filament `Shift Master` resource so the `Work Planning` sidebar group can keep its top-level icon without triggering Filament's grouped-navigation icon conflict on login.
- Files touched:
  `app/Filament/Resources/ScheduleShifts/ScheduleShiftResource.php`
  `docs/CODEX_LOG.md`

## 2026-06-19 - Scheduling UI Prototype

- What was changed:
  Added a new Filament `Scheduling` admin resource that lists terminal-zone master rows and provides a `Schedule` action per zone.
  Added a zone-specific scheduling form page with UI-only fields for date range, supervisor, operators, operatives, shift timing, and status, plus placeholder messaging for future overlap validation and backend save logic.
- Files touched:
  `app/Filament/Resources/SchedulePlanners/SchedulePlannerResource.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ListSchedulePlanners.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ScheduleZone.php`
  `app/Filament/Resources/SchedulePlanners/Schemas/ZoneScheduleForm.php`
  `app/Filament/Resources/SchedulePlanners/Tables/SchedulePlannersTable.php`
  `resources/views/filament/resources/schedule-planners/pages/schedule-zone.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-19 - Scheduling Flow Refinement

- What was changed:
  Refined the scheduling UI into a three-step flow: zone list, zone-specific schedules page, and create schedule page.
  Changed the zone list row action from direct scheduling to a `Schedules` view and added a UI-only intermediate page prepared to show multiple schedules for the same terminal-zone with a `Create Schedule` action.
- Files touched:
  `app/Filament/Resources/SchedulePlanners/SchedulePlannerResource.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ListZoneSchedules.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ScheduleZone.php`
  `app/Filament/Resources/SchedulePlanners/Tables/SchedulePlannersTable.php`
  `resources/views/filament/resources/schedule-planners/pages/list-zone-schedules.blade.php`
  `resources/views/filament/resources/schedule-planners/pages/schedule-zone.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-19 - Schedule List UI Upgrade

- What was changed:
  Redesigned the zone-specific schedule list page so it reads like a real scheduling workspace instead of a plain placeholder.
  Added a proper page header, summary cards, area context panel, and a table-style empty state aligned with the dark admin theme.
  Reworked the page again to use Filament-native sections and inline-safe styling after the earlier Tailwind utility approach did not render reliably inside the current admin panel.
- Files touched:
  `resources/views/filament/resources/schedule-planners/pages/list-zone-schedules.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-19 - Sidebar Navigation Order And Spacing

- What was changed:
  Set the admin panel navigation group order so `Work Planning` appears before `Consumable Master` and `Equipment Master`.
  Added explicit navigation sort values for `Manpower Management` and `Zone Master` to keep the ungrouped items in the intended order.
  Normalized sidebar spacing by tightening the nav layout CSS so group headers and item rows use consistent vertical gaps and button heights.
  Adjusted the sidebar again so navigation groups stay expanded, child item icons remain visible, and the sidebar uses native Filament spacing instead of the earlier over-aggressive custom gap overrides.
  Added a client-side reset for persisted collapsed sidebar group state so previously hidden `Work Planning`, `Consumable Master`, and `Equipment Master` items become visible again after the navigation refactor.
  Re-enabled accordion-style navigation groups and changed the spacing fix to target only the top-level sidebar group container and grouped item stack, avoiding the earlier broad sidebar layout overrides.
  Added top-level sidebar icons for `Work Planning`, `Consumable Master`, and `Equipment Master` so the grouped accordion headers visually align with the other main navigation items.
  Removed child-item navigation icons from resources inside those three groups because Filament does not allow icons on both the group header and its grouped items at the same time.
- Files touched:
  `app/Providers/Filament/AdminPanelProvider.php`
  `app/Filament/Resources/Users/UserResource.php`
  `app/Filament/Resources/ZoneMasters/ZoneMasterResource.php`
  `resources/views/filament/components/brand-styles.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-14 - Roles, Modules, and Permission Seeders

- What was changed:
  Added production-safe, idempotent seeders for `roles`, `modules`, `web_role_module_permissions`, and `mobile_role_module_permissions`.
  Updated `DatabaseSeeder` to call the new seeders instead of creating a default test user.
- Files touched:
  `database/seeders/DatabaseSeeder.php`
  `database/seeders/ModulesTableSeeder.php`
  `database/seeders/RolesTableSeeder.php`
  `database/seeders/RoleModulePermissionsSeeder.php`
  `docs/CODEX_LOG.md`

## 2026-06-14 - Users Table Employee ID Update

- What was changed:
  Added a production migration to replace `users.email_verified_at` with a unique `users.employee_id` column.
  Updated the `User` model fillable fields and removed the obsolete verification cast.
  Updated the user factory to generate unique `employee_id` values.
- Files touched:
  `database/migrations/2026_06_14_160000_replace_email_verified_at_with_employee_id_on_users_table.php`
  `app/Models/User.php`
  `database/factories/UserFactory.php`
  `docs/CODEX_LOG.md`

## 2026-06-14 - Single-Role User Migration

- What was changed:
  Added a migration to move from `role_user` to a single `users.role_id` relationship.
  The migration backfills `users.role_id` from `role_user` when each user has at most one role, auto-populates missing `employee_id` values, makes `employee_id` non-null, and drops the `role_user` table.
  Added `User -> role` and `Role -> users` model relationships.
- Files touched:
  `database/migrations/2026_06_14_171500_migrate_users_to_single_role_and_drop_role_user_table.php`
  `app/Models/User.php`
  `app/Models/Role.php`
  `docs/CODEX_LOG.md`

## 2026-06-14 - Enforce Required User Role

- What was changed:
  Added a follow-up migration to make `users.role_id` non-nullable after the single-role backfill.
- Files touched:
  `database/migrations/2026_06_14_174500_make_role_id_not_nullable_on_users_table.php`
  `docs/CODEX_LOG.md`

## 2026-06-15 - Manpower Schema Foundation

- What was changed:
  Added a migration to store `users.mobile`.
  Added `manpower_designations` and `manpower` tables with a `user_id` link to `users`, designation master data, supervisor linkage, document fields, compliance dates, and nullable emergency-contact fields.
  Added `Manpower` and `ManpowerDesignation` models.
  Updated the `User` model with `mobile`, `manpower`, and `supervisedManpower` support.
  Updated the user factory to generate a sample mobile number.
- Files touched:
  `database/migrations/2026_06_15_100000_add_mobile_to_users_table.php`
  `database/migrations/2026_06_15_100100_create_manpower_designations_table.php`
  `database/migrations/2026_06_15_100200_create_manpower_table.php`
  `app/Models/Manpower.php`
  `app/Models/ManpowerDesignation.php`
  `app/Models/User.php`
  `database/factories/UserFactory.php`
  `docs/CODEX_LOG.md`

## 2026-06-15 - Remove Default Filament Dashboard Widgets

- What was changed:
  Updated the default Filament dashboard widgets to keep the welcome/account widget and remove only the Filament info/version card from the admin dashboard.
- Files touched:
  `app/Providers/Filament/AdminPanelProvider.php`
  `docs/CODEX_LOG.md`

## 2026-06-15 - Manpower Management Admin Resource

- What was changed:
  Added a Filament admin resource for manpower management with a compact list view, search by name and employee number, status and designation filters, breadcrumbs, and combined create/edit/show flows for `users` and `manpower`.
  Enabled explicit panel breadcrumbs and removed delete actions so records are managed through active/inactive status only.
  Added designation-based supervisor logic so only `Operator` and `Operative` entries require a supervisor dropdown.
- Files touched:
  `app/Providers/Filament/AdminPanelProvider.php`
  `app/Filament/Resources/Users/UserResource.php`
  `app/Filament/Resources/Users/Schemas/UserForm.php`
  `app/Filament/Resources/Users/Schemas/UserInfolist.php`
  `app/Filament/Resources/Users/Tables/UsersTable.php`
  `app/Filament/Resources/Users/Pages/ListUsers.php`
  `app/Filament/Resources/Users/Pages/CreateUser.php`
  `app/Filament/Resources/Users/Pages/EditUser.php`
  `app/Filament/Resources/Users/Pages/ViewUser.php`
  `docs/CODEX_LOG.md`

## 2026-06-15 - Manpower Role Refactor And Employee ID Login

- What was changed:
  Refactored manpower to use `users.role_id` as the designation source instead of a separate `manpower_designations` table.
  Relaxed manpower fields so they are optional, kept `users.mobile` required, and made `users.email` optional in the admin form.
  Switched Filament admin login to use `employee_id` instead of email so optional email does not block web admin access.
- Files touched:
  `app/Filament/Auth/Login.php`
  `app/Providers/Filament/AdminPanelProvider.php`
  `app/Filament/Resources/Users/UserResource.php`
  `app/Filament/Resources/Users/Schemas/UserForm.php`
  `app/Filament/Resources/Users/Schemas/UserInfolist.php`
  `app/Filament/Resources/Users/Tables/UsersTable.php`
  `app/Models/Manpower.php`
  `database/migrations/2026_06_15_100000_add_mobile_to_users_table.php`
  `database/migrations/2026_06_15_100200_create_manpower_table.php`
  `database/migrations/2026_06_15_100300_make_email_nullable_on_users_table.php`
  `database/migrations/2026_06_15_100400_drop_manpower_designations_table_and_column.php`
  `docs/CODEX_LOG.md`

## 2026-06-15 - Normalize Existing Manpower Nullability

- What was changed:
  Added a follow-up migration to make the legacy non-null manpower profile fields nullable on already-migrated databases, so existing local and server schemas match the refactored optional manpower form.
- Files touched:
  `database/migrations/2026_06_15_100500_make_manpower_fields_nullable.php`
  `docs/CODEX_LOG.md`

## 2026-06-17 - Zone Master Foundation

- What was changed:
  Added `terminals` and `zones` master tables aligned with the SRS area/zone master structure.
  Added `Terminal` and `Zone` models with `terminal -> zones` and `zone -> terminal` relationships, plus JSON casting for `sub_areas`.
  Added a Filament `Zone Master` admin resource with terminal selection, zone name, JSON-array sub-area entry, status visibility, alphabetical listing, and edit-only record management.
  Added a terminal seeder for the fixed `T2` and `T3` master values.
- Files touched:
  `database/migrations/2026_06_17_071224_create_terminals_table.php`
  `database/migrations/2026_06_17_071226_create_zones_table.php`
  `app/Models/Terminal.php`
  `app/Models/Zone.php`
  `app/Filament/Resources/ZoneMasters/ZoneMasterResource.php`
  `app/Filament/Resources/ZoneMasters/Schemas/ZoneMasterForm.php`
  `app/Filament/Resources/ZoneMasters/Tables/ZoneMastersTable.php`
  `app/Filament/Resources/ZoneMasters/Pages/ListZoneMasters.php`
  `app/Filament/Resources/ZoneMasters/Pages/EditZoneMaster.php`
  `database/seeders/TerminalsTableSeeder.php`
  `database/seeders/DatabaseSeeder.php`
  `docs/CODEX_LOG.md`

## 2026-06-17 - Zone Master Form UX Refinement

- What was changed:
  Simplified the Zone Master create/edit form actions by changing the main action label to `Submit`, removing the extra `Create and create another` flow, and renaming `Cancel` to `Back`.
  Replaced the `sub_areas` tags input with a repeater so users get a clear `Add Sub-Area` button while still storing the data as a JSON array of strings in the database.
  Removed the frontend status toggle so new zones stay active by default from the database layer.
- Files touched:
  `app/Filament/Resources/ZoneMasters/ZoneMasterResource.php`
  `app/Filament/Resources/ZoneMasters/Schemas/ZoneMasterForm.php`
  `app/Filament/Resources/ZoneMasters/Pages/CreateZoneMaster.php`
  `app/Filament/Resources/ZoneMasters/Pages/EditZoneMaster.php`
  `docs/CODEX_LOG.md`

## 2026-06-17 - Zone Master Sub-Area Normalization

- What was changed:
  Standardized `zones.sub_areas` to a single canonical format: JSON array in the database and array in Laravel.
  Added a `Zone` model accessor/mutator so reads and writes always normalize sub-area values as arrays of strings.
  Added a one-time migration to normalize any existing non-array `sub_areas` values in deployed databases into JSON arrays.
  Updated the Zone Master table `sub_areas` column to render its final display string directly from the `Zone` model instance, avoiding Filament's raw attribute state path for this column.
- Files touched:
  `app/Models/Zone.php`
  `app/Filament/Resources/ZoneMasters/Tables/ZoneMastersTable.php`
  `database/migrations/2026_06_17_083320_normalize_zone_sub_areas_to_json_arrays_table.php`
  `docs/CODEX_LOG.md`

## 2026-06-17 - Zone Master Admin Flow Cleanup

- What was changed:
  Changed the sub-area add control to a centered red icon button without a text label.
  Disabled sub-area reordering in the Zone Master form.
  Updated Zone Master create and edit flows to redirect back to the zone list after submit.
  Changed the `Back` action on create and edit to link directly to the zone list screen.
  Removed the status column from the Zone Master list and made the sub-area add button more prominent with a larger filled red circular icon button.
  Tightened the sub-area add action styling further by overriding the button classes so it renders as a solid red circular button with a white plus icon.
  Switched the sub-area add action away from Filament's default icon-button styling to a filled button with fixed circular dimensions so the visual matches the intended red circle plus control.
  Reduced the plus button dimensions for a tighter rounded look and aligned the form actions with `Submit` on the left and `Back` on the right.
  Moved the Zone Master `Submit` and `Back` controls into the section footer so they align to the card width instead of the full page action row, and reduced the plus button size again for a smaller circular appearance.
- Files touched:
  `app/Filament/Resources/ZoneMasters/Tables/ZoneMastersTable.php`
  `app/Filament/Resources/ZoneMasters/Schemas/ZoneMasterForm.php`
  `app/Filament/Resources/ZoneMasters/Pages/CreateZoneMaster.php`
  `app/Filament/Resources/ZoneMasters/Pages/EditZoneMaster.php`
  `docs/CODEX_LOG.md`

## 2026-06-17 - Admin Favicon Update

- What was changed:
  Updated the Filament admin panel to use a real favicon PNG asset.
  Added the favicon image from the mobile app launch icon so the web admin branding matches the app.
- Files touched:
  `app/Providers/Filament/AdminPanelProvider.php`
  `public/favicon.ico`
  `public/favicon.png`
  `docs/CODEX_LOG.md`

## 2026-06-17 - Admin Portal Title Update

- What was changed:
  Changed the application display name default from `Laravel` to `Appletree DIAL Maintenance Portal` so the web admin title uses the correct branding.
- Files touched:
  `.env`
  `.env.example`
  `config/app.php`
  `docs/CODEX_LOG.md`

## 2026-06-17 - Filament Brand Label Update

- What was changed:
  Set the Filament admin panel brand label explicitly to `Appletree DIAL Maintenance Portal` so the top-left sidebar header no longer shows the default `Laravel` text.
- Files touched:
  `app/Providers/Filament/AdminPanelProvider.php`
  `docs/CODEX_LOG.md`

## 2026-06-17 - Filament Brand Styling Update

- What was changed:
  Replaced the default Filament brand block with a custom Appletree logo-and-title header.
  Styled the admin brand area with a red background, red title treatment, centered title placement, and left-aligned logo support across the panel layout.
  Refined the layout so the strip keeps the logo on the far left while the title is rendered independently in the top bar for true centered alignment.
- Files touched:
  `app/Providers/Filament/AdminPanelProvider.php`
  `resources/views/filament/components/brand.blade.php`

## 2026-06-18 - Equipment Master Admin CRUD Foundation

- What was changed:
  Added the `equipment` master table with identity, compliance, terminal, ownership, status, and supporting document fields based on the SRS equipment master requirements.
  Added the `Equipment` model with terminal relationship, date casts, and centralized type, ownership, and status option lists.
  Added a Filament `Equipment Master` sidebar resource with list, create, and edit flows plus document uploads for MFG, TPI, SOP, rescue plan, and escalation matrix files.
- Files touched:
  `database/migrations/2026_06_18_160000_create_equipment_table.php`
  `app/Models/Equipment.php`
  `app/Filament/Resources/EquipmentMasters/EquipmentMasterResource.php`
  `app/Filament/Resources/EquipmentMasters/Schemas/EquipmentMasterForm.php`
  `app/Filament/Resources/EquipmentMasters/Tables/EquipmentMastersTable.php`
  `app/Filament/Resources/EquipmentMasters/Pages/ListEquipmentMasters.php`
  `app/Filament/Resources/EquipmentMasters/Pages/CreateEquipmentMaster.php`
  `app/Filament/Resources/EquipmentMasters/Pages/EditEquipmentMaster.php`
  `docs/CODEX_LOG.md`

## 2026-06-18 - Equipment Master Navigation Group

- What was changed:
  Grouped the equipment admin navigation under an `Equipment Master` dropdown.
  Renamed the existing CRUD menu item to `Equipment` and added an `Equipment Allocation` sidebar item as a placeholder page for the upcoming allocation workflow.
- Files touched:
  `app/Filament/Resources/EquipmentMasters/EquipmentMasterResource.php`
  `docs/CODEX_LOG.md`

## 2026-06-18 - Equipment Allocation Admin CRUD Foundation

- What was changed:
  Added the `equipment_allocation` table with equipment, supervisor allocation, zone, allocation date, return tracking, condition, and verification fields aligned to the SRS workflow.
  Added the `EquipmentAllocation` model plus supporting relationships on `Equipment`, `User`, and `Zone`.
  Replaced the placeholder allocation page with a real Filament `Equipment Allocation` CRUD under the `Equipment Master` navigation group.
- Files touched:
  `database/migrations/2026_06_18_163000_create_equipment_allocation_table.php`
  `app/Models/EquipmentAllocation.php`
  `app/Models/Equipment.php`
  `app/Models/User.php`
  `app/Models/Zone.php`
  `app/Filament/Resources/EquipmentAllocations/EquipmentAllocationResource.php`
  `app/Filament/Resources/EquipmentAllocations/Schemas/EquipmentAllocationForm.php`
  `app/Filament/Resources/EquipmentAllocations/Tables/EquipmentAllocationsTable.php`
  `app/Filament/Resources/EquipmentAllocations/Pages/ListEquipmentAllocations.php`
  `app/Filament/Resources/EquipmentAllocations/Pages/CreateEquipmentAllocation.php`
  `app/Filament/Resources/EquipmentAllocations/Pages/EditEquipmentAllocation.php`
  `docs/CODEX_LOG.md`
  `resources/views/filament/components/brand-styles.blade.php`
  `resources/views/filament/components/topbar-title.blade.php`
  `public/appletree-logo.png`
  `docs/CODEX_LOG.md`

## 2026-06-18 - Login Page Brand Color Refresh

- What was changed:
  Updated the Filament login page styling to keep the background black while switching the auth card, inputs, links, and submit button accents to the Appletree brand green and red palette.
  Kept the existing login layout and component structure intact by applying scoped CSS overrides through the shared Filament brand stylesheet.
- Files touched:
  `resources/views/filament/components/brand-styles.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-18 - Admin Panel Green Theme Refresh

- What was changed:
  Switched the Filament admin panel primary theme color from yellow to green so actions, highlights, and component states align with the Appletree brand palette.
  Added subtle admin-page styling refinements for page backgrounds, cards, tables, inputs, and active sidebar states while keeping the existing layout and interaction patterns intact.
- Files touched:
  `app/Providers/Filament/AdminPanelProvider.php`
  `resources/views/filament/components/brand-styles.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-18 - Admin Theme Refinement Rollback

- What was changed:
  Removed the broader admin page surface styling so the panel keeps Filament's original page backgrounds and structure.
  Kept the green primary theme and a few restrained accent treatments for active navigation, hover states, and primary actions.
- Files touched:
  `resources/views/filament/components/brand-styles.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-18 - Consumable Master Sidebar And Admin Resources

- What was changed:
  Added `Consumable Master` as a new sidebar group with `Consumables`, `Consumable Transactions`, `Unit`, and `Category` submenus.
  Added separate master tables for units and categories, and created the `consumables` table with item, brand, unit, category, minimum stock, and current stock fields.
  Added Filament admin resources for consumables, units, and categories, plus a placeholder `Consumable Transactions` page until the `stock_movement` table is implemented.
- Files touched:
  `database/migrations/2026_06_18_120000_create_consumable_units_table.php`
  `database/migrations/2026_06_18_120100_create_consumable_categories_table.php`
  `database/migrations/2026_06_18_120200_create_consumables_table.php`
  `app/Models/Consumable.php`
  `app/Models/ConsumableUnit.php`
  `app/Models/ConsumableCategory.php`
  `app/Filament/Resources/Consumables/ConsumableResource.php`
  `app/Filament/Resources/Consumables/Schemas/ConsumableForm.php`
  `app/Filament/Resources/Consumables/Tables/ConsumablesTable.php`
  `app/Filament/Resources/Consumables/Pages/ListConsumables.php`
  `app/Filament/Resources/Consumables/Pages/CreateConsumable.php`
  `app/Filament/Resources/Consumables/Pages/EditConsumable.php`
  `app/Filament/Resources/ConsumableUnits/ConsumableUnitResource.php`
  `app/Filament/Resources/ConsumableUnits/Schemas/ConsumableUnitForm.php`
  `app/Filament/Resources/ConsumableUnits/Tables/ConsumableUnitsTable.php`
  `app/Filament/Resources/ConsumableUnits/Pages/ListConsumableUnits.php`
  `app/Filament/Resources/ConsumableUnits/Pages/CreateConsumableUnit.php`
  `app/Filament/Resources/ConsumableUnits/Pages/EditConsumableUnit.php`
  `app/Filament/Resources/ConsumableCategories/ConsumableCategoryResource.php`
  `app/Filament/Resources/ConsumableCategories/Schemas/ConsumableCategoryForm.php`
  `app/Filament/Resources/ConsumableCategories/Tables/ConsumableCategoriesTable.php`
  `app/Filament/Resources/ConsumableCategories/Pages/ListConsumableCategories.php`
  `app/Filament/Resources/ConsumableCategories/Pages/CreateConsumableCategory.php`
  `app/Filament/Resources/ConsumableCategories/Pages/EditConsumableCategory.php`
  `app/Filament/Pages/ConsumableTransactions.php`
  `resources/views/filament/pages/consumable-transactions.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-18 - Remove Supervisor Mapping From Manpower

- What was changed:
  Removed supervisor assignment from manpower create, edit, and view flows so manpower records no longer store a supervisor mapping.
  Removed the related manpower supervisor relationships from the models and aligned the manpower SRS section with the updated behavior.
  Added a follow-up migration to drop the `supervisor_user_id` column from the `manpower` table.
- Files touched:
  `app/Filament/Resources/Users/Schemas/UserForm.php`
  `app/Filament/Resources/Users/Schemas/UserInfolist.php`
  `app/Filament/Resources/Users/UserResource.php`
  `app/Models/Manpower.php`
  `app/Models/User.php`
  `database/migrations/2026_06_18_170000_drop_supervisor_user_id_from_manpower_table.php`
  `docs/SRS.md`
  `docs/CODEX_LOG.md`

## 2026-06-29 - Refine Schedule PDF Footer Alignment

- What was changed:
  Adjusted the quarterly schedule PDF footer so it sits at the page bottom more cleanly and matches the training sheet layout more closely.
  Reworked the footer column sizing and alignment to push the contact block further right and reduce the visible empty space above it.
- Files touched:
  `resources/views/pdf/schedule-plan-quarterly.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-29 - Enhance Schedule PDF Visual Hierarchy

- What was changed:
  Refreshed the quarterly schedule PDF design with a stronger title section, metadata badges, more prominent section headings, upgraded summary cards, striped data tables, and styled sub-area chips for a cleaner client-facing report.
- Files touched:
  `resources/views/pdf/schedule-plan-quarterly.blade.php`
  `docs/CODEX_LOG.md`

## 2026-06-30 - Add Schedule PDF Preview Option

- What was changed:
  Added a separate inline PDF preview route for schedule plans so Admin and Project Manager can open the report in a new tab before downloading it.
  Added distinct `View PDF` and `Download PDF` actions on the schedule detail page and schedule list page, while keeping access restricted from Supervisor users.
  Split the schedule list page so PDF controls appear in their own dedicated column, separate from general row actions.
- Files touched:
  `app/Http/Controllers/SchedulePlanPdfController.php`
  `routes/web.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ViewSchedulePlan.php`
  `app/Filament/Resources/SchedulePlanners/Pages/ListZoneSchedules.php`
  `resources/views/filament/resources/schedule-planners/pages/view-schedule-plan.blade.php`
  `resources/views/filament/resources/schedule-planners/pages/list-zone-schedules.blade.php`
  `tests/Feature/SchedulePlanPdfDownloadTest.php`
  `docs/CODEX_LOG.md`

## 2026-07-01 - Add Mobile Login API With Passport PAT

- What was changed:
  Added the first dedicated mobile API route at `/api/mobile/auth/login` using Laravel Passport personal access tokens.
  Authenticates against `users.employee_id` + `password`, validates the requested role against the user's assigned single role, and blocks inactive manpower accounts.
  Returns the authenticated user payload plus mobile module access derived from `mobile_role_module_permissions` and `modules`.
- Files touched:
  `bootstrap/app.php`
  `config/auth.php`
  `routes/api.php`
  `app/Models/User.php`
  `app/Http/Requests/Api/MobileLoginRequest.php`
  `app/Http/Controllers/Api/MobileAuthController.php`
  `tests/Feature/MobileLoginApiTest.php`
  `docs/CODEX_LOG.md`
