@startuml
'skinparam monochrome true
skinparam packageStyle rectangle
skinparam shadowing false
skinparam linetype polyline
'skinparam linetype orto

skinparam classAttributeIconSize 0

'left to right direction

class ApplicationSession
{
    + static getInstance()
    + getCurrentSession()
}

class UserSession
{
    + getUserEmail()
}

class Employee {
    - String name
    - String email
    - int cc_number
    - int tax_number
    - int phoneNumber
    - int id
    - String address
}

class Request {
    - double area
    - String location
    - double distanceFromTheCityCenter
    - double price
    - String status
    - String date

    + Request(reference, description,\ninformalDescription, technicalDescription,\nduration, cost, createdBy, taskCategory)
}

class typeOfProperty {
    - String description

    + typeOfProperty(typeOfProperty)
}

class Organization {
    - String name
    - String vatNumber
    - String website
    - String phone
    - String email

    - addRequest(request)
    - validateRequest(request)
    + anyEmployeeHasEmail(email)
    + Organization(name, vatNumber, webSite, phone, email, postalAddress, manager)
    + createRequest(reference, description, informalDesccription,\ntechnicalDescription, duration, cost, taskCategoryDescription)
    - getEmployeeByEmail(email)

}

class locationsRepository {
    + getLocation(location)
}

class OrganizationRepository {
    + getOrganizationByEmployeeEmail(email)
}

class Repositories {
    - Repositories()
    + getInstance() : Repositories
    + getTypeOfProperty()
    + getOrganizationRepository()
}

class CreateRequestController {
    + CreateRequestController(organizationRepository, locationsRepository)
    + createRequest(status, date, area, location, distanceFromTheCityCenter, price)
    - getTypeOfProperty(typeOfProperty)
    - getEmployeeFromSession()
}

note right of CreateRequestController
    - userEmail is obtained
    from the user session
    - categoryDescription
    is retrieved from selected data
end note

note bottom of locationsRepository
    - used for displaying
    the location of the property
end note

class CreateRequestUI {
}

class Owner{
    - String name
    - String email
    - int cc_number
    - int tax_number
    - int phoneNumber
}

Repositories -> Repositories : instance
ApplicationSession -> ApplicationSession : instance

CreateRequestUI .> CreateRequestController

CreateRequestController .> Repositories : repositories

Repositories -> "1" locationsRepository

CreateRequestController ..> typeOfProperty
CreateRequestController ..> OrganizationRepository : organizationRepository
CreateRequestController ..> locationsRepository : locationsRepository

Repositories --> "1" OrganizationRepository

OrganizationRepository --> "*" Organization
ApplicationSession --> "1" UserSession : userSession

CreateRequestController ..> "1" Organization : organization
CreateRequestController ..> ApplicationSession
CreateRequestController ..> UserSession
Request "*" --> "1" typeOfProperty : typeOfProperty
locationsRepository "1" --> "*" typeOfProperty : typeOfProperty
Organization "1" --> "*" Request : requests
Request -> Owner : createdBy
Request --> Organization : assigns
Organization --> "*" Employee : employs
Employee --> Request : handles

@enduml