classDiagram
    class ShippingCompany {
        +Int id*
        +String name*
        +Date createdAt*
        +Collection~Vessel~ vessels*
    }

    class Vessel {
        +Int id*
        +ShippingCompany company*
        +String name*
        +String type*
        +Date createdAt*
        +Collection~Trip~ trips*
    }

    class Trip {
        +Int id*
        +Vessel vessel*
        +String pilotageReference*
        +String captainName
        +Location startLocation*
        +Location endLocation*
        +Date startDate*
        +Date endDate*
        +Date createdAt*
        +Collection~TripLocation~ tripLocations*
        +Collection~UserTrip~ userTrips*
    }

    class TripLocation {
        +Int id*
        +Trip trip*
        +Location location*
        +Date date*
        +Date createdAt*
    }

    class Location {
        +Int id*
        +Zone zone*
        +String name*
        +Date createdAt*
        +Collection~TripLocation~ tripLocations*
        +Collection~UserTripLocation~ userTripLocations*
        +Collection~UserTripWorkLog~ startWorkLogs*
        +Collection~UserTripWorkLog~ endWorkLogs*
    }

    class Zone {
        +Int id*
        +String name*
        +Date createdAt*
        +Collection~Location~ locations*
    }

    class User {
        +Int id*
        +String firstName*
        +String lastName*
        +String email*
        +String pilotageId*
        +Boolean active*
        +Date createdAt*
        +Collection~UserTrip~ userTrips*
    }

    class UserTrip {
        +Int id*
        +Trip trip*
        +User user*
        +String captainName*
        +Date startDate*
        +Date endDate*
        +Date createdAt*
        +Collection~UserTripLocation~ tripLocations*
        +Collection~UserTripWorkLog~ workLogs*
    }

    class UserTripLocation {
        +Int id*
        +UserTrip userTrip*
        +Location location*
        +Date plannedDate*
        +Date createdAt*
    }

    class UserTripWorkLog {
        +Int id*
        +UserTrip userTrip*
        +Location startLocation*
        +Location endLocation*
        +Date startDate*
        +Date endDate*
        +Date createdAt*
    }

    ShippingCompany "1" -- "*" Vessel
    Vessel "1" -- "*" Trip
    Trip "1" -- "*" TripLocation
    Trip "1" -- "*" UserTrip
    TripLocation "1" -- "1" Location
    UserTrip "1" -- "*" UserTripWorkLog
    UserTrip "1" -- "*" UserTripLocation
    UserTripLocation "1" -- "1" Location
    UserTripWorkLog "1" -- "1" Location : startLocation
    UserTripWorkLog "1" -- "1" Location : endLocation
    User "1" -- "*" UserTrip
    Zone "1" -- "*" Location