@startuml
'https://plantuml.com/class-diagram

entity Event {
    String city
    LocalDate startDate
    LocalDate endDate
}
entity Race {
    String raceType
    String distance
    Event event
}
entity Result {
    Athlete athlete
    Race race
    int rank
    int bib
    int fantasyPoints
    int proneShooting
    int standingShooting
    int totalMisses
}

entity SprintResults {
    String result
    String behind
}

entity IndividualResults {
    int proneShooting2
    int standingShooting2
    String skiTime
    String result
    String behind
}
entity MassStartResults {
    int proneShooting2
    int standingShooting2
    String time
}
entity PursuitResults {
    int proneShooting2
    int standingShooting2
    String time
}

entity Athlete{
    String name
    String country
    Blob photo
}
entity Team {
    String teamName
    User user
    Event event
    Athlete athlete1
    Athlete athlete2
    Athlete athlete3
}
entity User {
    String username
    String email
    String password
    String role
}

Event " 1 " --down* " * " Race
Race "1" --right* "*" Result
User "1" --left* "*" Team
Team " *  " *-down- "1  " Athlete
Result "*" *-right- "1" Athlete
Team "*" *-left- "1" Event

Result <|..down IndividualResults
Result <|..down SprintResults
Result <|..down PursuitResults
Result <|..down MassStartResults

@enduml
