# Carrier Network and Reefer Upgrade

This release expands FleetLume for dispatch companies that coordinate loads using equipment owned by outside carriers and owner-operators.

## Before updating

1. Back up the database.
2. Back up the `storage/uploads` folder.
3. Keep a copy of the current configuration file.

## Update procedure

1. Upload and replace the application files.
2. Open:

```text
https://fleetlume.space/install.php?unlock=1
```

3. Enter the same database credentials used by the current installation.
4. Complete the update.
5. Sign in as an administrator and review carrier, driver, truck, trailer, and load assignments.

## New records and fields

The updater adds carrier profiles, carrier-linked portal accounts, equipment ownership, carrier load economics, reefer specifications, load temperature requirements, stop temperatures, seal numbers, and temperature logs.

Existing records are retained. Older drivers, trucks, trailers, and loads may show as unassigned until a carrier is selected.

## Recommended setup after updating

- Add each carrier company and its MC, DOT, insurance, payment terms, and dispatch fee.
- Link drivers, trucks, and trailers to the correct carrier.
- Create a Carrier portal account for companies that need access.
- Review each reefer trailer’s temperature unit, safe operating range, current setpoint, fuel level, washout date, and service due date.
- Use the temperature-controlled load section when booking refrigerated freight.


## Local and staging environments

This package no longer depends on a fixed host. The installer detects the current browser host automatically. Use `http://localhost` with the appropriate subfolder Base URL for local testing, then rerun the installer on the live server with `https://fleetlume.space`.


## Compact sidebar and fuel-control upgrade

This release replaces the long navigation list with grouped, collapsible sections that remember their open state. Mobile navigation now uses a wider touch-friendly drawer with a close control.

The new Fuel Allocation area supports load-based recommendations, fuel-card and cash-advance allowances, driver receipt submissions, approval, balance reconciliation, and automatic accounting expense creation. After uploading the update, rerun the installer using the same database details so the new fuel tables and accounting category are created.

## Driver logbook and Hours-of-Service upgrade

This release adds driver HOS profiles, daily log records, duty events, certification, edit requests, HOS clocks, a dispatcher review board, an inspection view, and daily PDF output.

After replacing the files, rerun the installer with the current database credentials:

```text
/install.php?unlock=1
```

The updater creates the HOS tables and adds the log-day start-time setting without intentionally removing existing records.

After updating:

1. Open **Driver Logbooks & HOS**.
2. Open each driver's HOS profile.
3. Select the operating region, default rule set, cycle, home terminal, time zone, and log-day start time.
4. Confirm whether Personal Conveyance, Yard Move, short-haul, or an ELD exemption is allowed.
5. Link each driver portal account to the matching driver profile.
6. Review `HOS_COMPLIANCE_NOTES.md` before production use.

## Gemini AI integration

This release adds the FleetLume AI workspace, document reader, operations assistant, fuel allowance review, and HOS/accounting explanation modes.

After replacing the files:

1. Back up the database and uploads.
2. Run `/install.php?unlock=1` with the existing database credentials.
3. Sign in as an owner or administrator.
4. Open **FleetLume AI**.
5. Enter the Gemini API key, select the model available to the Google AI project, enable the module, and run **Test Connection**.
6. Review role permissions and grant **Use FleetLume AI** only where needed.

The API key is not included in the package and is not stored in the database. The settings screen writes it to `config/gemini.php`. Human review remains required for every generated result.

## UI v3 and AI automation upgrade

After replacing files, run `/install.php?unlock=1` using the current database credentials. This creates the automation rules, runs, action queue, and AI change-log tables and adds starter rules.

Then:

1. Open **FleetLume AI → Autopilot**.
2. Review the starter automation rules and target roles.
3. Choose **Recommend only** or **Automatically run safe actions**.
4. Confirm Gemini is enabled if AI prioritization and drafting are required.
5. Run all automations once and review the approval queue and change feed.
6. Add the CLI cron command shown in `AI_AUTOMATION.md`.
7. Test the interface at desktop, tablet, and phone widths before production rollout.

The design update is loaded through `public/assets/css/app-v3.css` and `public/assets/js/app-v3.js`, which preserves compatibility with existing views while adding responsive behavior globally.

## UI v6 Dark Control Center

1. Back up the current project and database.
2. Replace the application files with this package.
3. Run `install.php?unlock=1` using the current database details.
4. Sign in and hard-refresh the browser.
5. If the previous design remains, unregister the existing service worker and clear site storage.

No new database tables are required specifically for the UI. The dashboard now reads a grouped load-status summary from the existing loads table.
