@startuml

package dao {


    interface FAQDao{
        getQuestionsByOfferId(offerId : int) : ArrayList<Question>
        questionExists(id : int) : boolean
        hasAnAnswer(id : int) : boolean
    }
    class FAQDaoMySQL
    FactoryDaoSQL .up.|> AbstractFactoryDao
    FAQDaoMySQL .up.|> FAQDao

    interface DAO<T>{
        find(id : int) : T
        create(T obj) : T
        update(T obj) : T
        delete(T obj) : boolean
    }

    abstract AbstractFactoryDao{
        - {static } final connectionDB : ConnectionDB
        + {static} getFactory(type : TypeDB) : AbstractFactoryDao
        + getFAQDao() : FAQDao
    }

    class FactoryDaoSQL{
    }


    DAO <|-- FAQDao
}
package db{
    class ConnectionDBMySQL{
        - connection : Connection
        - ConnectionDBMySQL()
        + {static} getInstance() : ConnectionDBMySQL
        + getDb() : Connection
    }

    class LazyHolderDB{
        + {static} final INSTANCE : ConnectionDBMySQL
    }
    interface ConnectionDB
    ConnectionDBMySQL -Left-> LazyHolderDB
    ConnectionDBMySQL .up.|> ConnectionDB

}
package business{
    class SessionFacade{
        + SessionFacade()
        + getUser() : User
    }

    class Question{
        -questionId : int
        -content : String
        -score : int
        -answer : Answer
        -userId : int
        -offerId : int
        + Question()
        + getQuestionId() : int
        + getContent() : String
        + getScore() : int
        + getAnswer() : Answer
        + getUserId() : int
        + getOfferId() : int
        + setId(id:int) : void
        + setContent(content:String) : void
        + setAnswer(answer:Answer) : void
        + setScore(score:int) : void
        + setUserId(userId:int) : void
        + setOfferId(categoryId:int) : void
    }

    class Answer{
        -answerId : int
        -content : String
        -score : int
        -userId : int
        + Answer()
        + getAnswerId() : int
        + getContent() : String
        + getScore() : int
        + getUserId() : int
        + setId(id:int) : void
        + setContent(content:String) : void
        + setScore(score:int) : void
        + setUserId(userId:int) : void
    }

    class FAQFacade{
        + FAQFacade()
        + getQuestion(id : int) : Question
        + createQuestion(id : int, userid : int, offerid : int, answer : Answer, question : String, score : int) : Question
        + getQuestionsByOfferId(offerid : int) : ArrayList<Question>
        + updateQuestionScore(id : int, score : int) : Question
        + updateAnswerScore(id : int, score : int) : Answer
    }

}

package gui{

    class LoadView{
        + {static} load(nameFxml : Parent) : Parent
        + {static} changeScreen(actionEvent : ActionEvent, view : String) : void
    }

    package controller{
        class FAQController{
            + handleNewQuestion(offerid : int, question : String) : void
            + handleNewAnswer(questionid : int, answer : String)
        }

    }
}
FAQFacade <--Up- FAQController
SessionFacade <--Up- FAQFacade
FAQFacade .Up.> AbstractFactoryDao



@enduml