# 04 – Carriers

Tested in the QA company only · Pages: Carrier List, Add Carrier, Edit Carrier, status switch, delete, carrier login

## Works fine

- Carrier List opens; shows Carrier ID, Status, Type, Name, Email, Phone, Source, Advertise.
- Add Carrier saves ("Carrier created successfully"), the carrier appears in the list and gets a login.
- Edit Carrier opens with every value pre-filled.
- Active/Inactive switch asks first ("carrier will be immediately unable to log in…") and works both ways.
- Delete asks "Are you sure… cannot be undone", then removes the carrier ("Carrier deleted successfully").
- The carrier can log in and reaches the Carrier dashboard.

## Issues

| # | Sev | What the user experiences | Steps | Evidence |
|---|-----|---------------------------|-------|----------|
| K1 | Medium | **A new company has no Carrier Type yet** (list empty but required). It works once added under Master, but nothing tells the user (same onboarding gap as CRM C1). The form also needs 15 required fields incl. two document uploads. | New company → Add Carrier → open Carrier Type | – |
| K2 | **High** – *fixed locally, awaiting upload* | **A carrier cannot be edited without uploading both documents again.** On Edit, "Broker Carrier" and "COI Ins. Cert." are empty and required even though they were uploaded; Update shows "This field is required". | Carrier List → Edit → change name → Update | `screens/carrier_edit.png` |
| K3 | Medium – *fixed locally, awaiting upload* | **After a failed save the form lost most of what was typed** (dispatch email, carrier type, dates, addresses, banking…) and the real reason was not visible. (The save itself was correctly refused: same email, same role, same company.) Now everything typed is kept, the reason is shown in a red box above the form, and the user is told to pick the two document files and the password again (browsers cannot keep those). | Add Carrier with an email already used by another carrier of the same company | `screens/carrier_dup_email.png` |
| K4 | Low | The **View** option is hidden in the Action menu (the page itself works at `/view_Carrier/<id>`). Probably intentional – please confirm. | Carrier List → Action | – |
| K5 | Low – *fixed locally, awaiting upload* | **The same phone number was accepted for two carriers of one company** (email was already checked). Now blocked inside the same company ("A carrier with this phone number already exists in your company."); a customer, a user or another company's carrier may still use the same number. | Add two carriers with one phone | `screens/carrier_list_data.png` |
| K6 | Low | Missing script `bootstrap-multiselect.min.js` (404) and script errors (`classList` / `addEventListener` of null) on carrier pages. | Open any carrier page, check console | – |
| K7 | Low | On the login page the **Carrier tile sometimes does not stay selected** if clicked right after typing the email; Login then stays disabled with no hint. | Type carrier email → click Carrier quickly | `screens/login_carrier_tiles.png` |
| K8 | Low (security) | The carrier dashboard calls the FMCSA website from the browser with the **API key visible in the page**, and the call fails. | Carrier login → check network | – |
| K9 | Low | Carrier ID starts high for a new company (990, 991). | Add first carrier | `screens/carrier_after_create_click.png` |

## Not tested (and why)

- DOT / MC number lookup, Upload Agreement, multiple banking/contact/equipment/lane rows.
- What an **inactive** carrier sees at login (the Carrier tile problem K7 got in the way) – to be re-checked.
- Carrier portal itself (bids, drivers, trucks, orders) – separate module.
- Real company carriers and large lists.
