@startuml
skin rose
skinparam backgroundColor #EEEBDC
/' left to right direction '/

enum AttachmentType {
  + Description
  + DueDate
  + File
  + Url
  + Text
  + Tip
  + Hint
  + Warning
  + Progress
  + Importance
}

enum RequestType {
  + Add
  + Update
  + Remove
}

enum AccessLevel {
  + View
  + AddSolutions
  + Edit
  + AddUsers
  + FullAccess
}

enum MembershipLevel {
  + View
  + AddTasks
  + Edit
  + AddUsers
  + FullAccess
}

enum TaskVisibility {
  + Private
  + Public
  + Paid
}

enum SolutionType {
  + File
  + Url
  + Text
}

hide AccessLevel methods
hide MembershipLevel methods
hide AttachmentType methods
hide TaskVisibility methods
hide SolutionType methods
hide RequestType methods

class User {
  - id : int
  + name : String
  + email : String
  + password : String

  + register()
  + login()
  + changePassword()
}

class Access {
  - userId : int
  - taskId : int
  + accessLevel : AccessLevel
  + changeAccessLevel()
}

class Task {
  - id : int
  + attachments : List<Attachment>
  + solutions : List<Solution>
  + requests : List<Request>
  + name : String
  + visibility : TaskVisibility
  + create()
  + remove()
  + fork()
  + changeVisibility()
  + transferOwnership()
}

class Attachment {
  + type : AttachmentType
  + data : Blob
  + isPrivate: boolean
  + description : String
}

class Solution {
  + description: String
  + type: SolutionType
  + data: blob
  + approve()
  + decline()
}

class TaskGroup {
  + tasks : List<Task>
  + name : String
  + description : String
  + addTask()
  + removeTask()
  + addUser()
  + removeUser()
}

class Membership {
  - userId : int
  + taskGroupId : int
  + membershipLevel: MembershipLevel
  + changeMembershipLevel()
}

class Request {
  - id : int
  - userId : int
  - attachmentId : int
  + type : RequestType
  + message : String
  + isApplied
  + isRejected
  + apply()
  + reject()
  + revoke()
}

hide Attachment methods

User -u.> Access : <<manages>>
User -u.> Membership : <<manages>>
User -u.> Attachment : <<owns>>
User -u.> Request : <<supervises>>
User -u.> Solution : <<supervises>>

Task -d.> Access : <<grants>>
TaskGroup -d.> Membership : <<grants>>

Task -d-> Attachment : contains
Task -d-> Request : associates
Task -d-> Solution : associates

Request <-u- Attachment : associates

TaskGroup -u-> Task : manages

AttachmentType --* Attachment
RequestType -r-* Request
AccessLevel --* Access
MembershipLevel --* Membership
TaskVisibility --* Task
SolutionType -u-* Solution

@enduml
