@startuml

entity User {
  * id: number <<PK>>
  --
  * firstName: string
  * lastName: string
  * email: string
  * password: string
  * salt: string
  locked: bool
  lastLogin: datetime
  * receiveNotifications: bool
  * roleId: number <<FK>>
  * areaId: number <<FK>>
  * functionId: number <<FK>>
}

entity Role {
  * id: number <<PK>>
  --
  * definition: string
}

entity Function {
  * id: number <<PK>>
  --
  * definition: string
}

entity Area {
  * id: number <<PK>>
  --
  * name: string
}

entity Event {
  * id: number <<PK>>
  --
  * date: date
  * startTime: time
  * endTime: time
  * name: string
  * locationId: number <<FK>>
  * voluntaryWachhabender: bool
  * amountOfPosten: number
  * vehicles: string
  * clothing: string
  * canceled: bool
}

entity Location {
  * id: number <<PK>>
  --
  * name: string
}

entity Availabillity {
  * id: number <<PK>>
  --
  * userId: number <<FK>>
  * date: date
  startTime: time
  endTime: time
}

entity Assignement {
  * eventId: number <<PK>>
  * availabillityId: number <<PK>>
  --
  * functionId: number <<FK>>
  startTime: time
  endTime: time
}

entity Vehicle {
  * id: number <<PK>>
  --
  * radioCallName: string
  * station: string
}

entity VehicleAssignement {
  * eventId: number <<PK>>
  * vehicleId: number <<PK>>
  --
}

User }|--|| Role
User }|--|| Area
User }|--|| Function

Event }|--|| Location

Location }|--|| Area

Availabillity }|--|| User

Assignement }|--|| Availabillity
Assignement }|--|| Event
Assignement }|--|| Function

VehicleAssignement }|--|| Vehicle
VehicleAssignement }|--|| Event

@enduml
