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

class Email {
    int id
    string email
}

class SubjectSuggestion {
    int id
    int subject_id
    string title
    text description
    text importance
    text assist
    string firstname
    string lastname
    string email
    string phone_number
    bool agree_to_terms
    bool email_confirmed
    files()
}

class File {
    int id
    string filename
    string original_filename
    string fqcn
    int fqcn_id
}

SubjectSuggestion --> File

class Subject {
    int id
    string title
    string short_description
    string description
    string image
    string type
    enum state draft|new|rejected|selected
    files()
    round()
    donations()
    suggestions()
    subjects()
}

Subject --> SubjectSuggestion
Subject --> File
Subject --> Subject

class VotingRound {
    int id
    date start
    date end
    subjects()
}

VotingRound --> Subject

class Vote {
    int id
    int subject_id
    int voting_round_id
    string email
    text why_important
    bool agree_to_terms
}

Vote --> Subject
Vote --> VotingRound

class Assistant {
    int id
    string email
    bool know_what_to_do
    text what_to_do
    bool agree_to_terms
    bool email_confirmed
}

class Donation {
    int id
    text message
    bool shared_over_multiple_subjects
}

Subject --> Donation

@enduml
