@startuml seeRoadNetwork
autonumber

skinparam sequence {
ParticipantBorderColor black
ParticipantBackgroundColor white
}

actor "Logistics Manager" as manager
box "<<System(C4)>>\n System"
participant UI as UI <<Container(C4)>>
participant Auth as Auth <<Container(C4)>>
participant Logistics as Logistics <<Container(C4)>>
participant WarehouseManagement as WHM <<Container(C4)>>
end box

participant Google as Google <<System(C4)>>


activate manager
manager->UI: I want to login
activate UI

alt Login through email and password in EletricGo

UI -> Auth: POST Login(email, password)
activate Auth

Auth --> UI: 200 OK
deactivate Auth

else Login through Google

UI -> Google: Login with Google account
activate Google
Google --> UI: 200 OK
deactivate Google

end



UI --> manager: informs about the success of login

manager -> UI: I want to see the roadNetwork

UI -> Auth: GET getAllWarehouses()
activate Auth
Auth -> WHM: GET GetAllWarehouses()
activate WHM

WHM --> Auth: 200 OK + all warehouses
deactivate WHM
Auth --> UI: 200 OK + all warehouses
loop for each warehouse

    UI -> Logistics: GET allPaths(warehouse)
    activate Logistics
    Logistics --> UI: 200 OK + all paths

end

UI -> Logistics: GET allTrucks()
Logistics --> UI: 200 OK + all trucks
deactivate Logistics
UI --> manager: shows roadNetwork

deactivate UI
deactivate manager
@enduml