@startuml

skinparam monochrome true
skinparam shadowing false
skinparam genericDisplay old
skinparam classAttributeIconSize 0
hide circle

package Gson {}
package Kotlin{
class Throwable {
}
}

package Repository {
'=================================================================================================='
'Overleaf
package ViewModelInterface {
    'Overleaf deprecated
    class PostHandler <<singleton>>{
        +getPostPreviews(): Collection<Post>
        +getPostDetail(id: String): PostDetail
        'teplate downloaden via postid
        +getProjectTemplate(id: String): void
        'teplate downloaden via postid + index des graph temlates im Post
        +getGraphTemplate((id: String, index: int): void
    }
    class CommandFactory <<singleton>> {
        +operationPossible(): Flow<>
        +addRow(projectID: ProjectID, index: int, content: List<Any>)
     }
    'Overleaf
    class ProjectHandler {
        -projectPreviews: Collection<ProjectPreview>
        +getProjectPreviews(): Collection<ProjectPreview>
        +getProjectByID(id: int):Flow<Project>
    }
    package CommunicationClasses {
    class Column {
            id : GZ
            name : String
            unit : String
            datatype : DataType

        }

        class Button {
            id : GZ
            name : String
            columnId : GZ
            value : GZ
        }

        class Notification {
            id : GZ
            message : String
            time : Time
        }

        class Time {
            hour : GZ
            minute : GZ
            second : GZ
        }

        class Member {
            id : GZ
            name : String
        }

        class ProjectPreview {
            id : GZ
            name : String
            image : Image
        }

        class Graph {
            id : GZ
            image : Image
        }

        class LineChart {
            dotSize : DotSize
            dotColor : Color
            lineType : LineType
            mappingVertical : List<Column>
            mappingHorizontal : Column
        }

        enum DotSize <<Enum>> {
            SMALL
            MEDIUM
            BIG
        }

        enum LineType <<Enum>> {
            DOTTED
            NONE
            CONTINUOUS
        }

        class PieChart {
            color : List<Color>
            mapping : List<Column>
            showPercentages : Boolean
        }


        enum DataType <<Enum>> {
            WHOLE_NUMBER
            FLOATING_POINT_NUMBER
            TIME
            STRING
        }

        class Project {
            id : GZ
            isOnlineProject : Boolean
            isAdmin : Boolean
            title : String
            description : String
            wallpaper : Image
            table : List<Column>
            data : List<Row>
            buttons : List<Button>
            notifications : List<Notification>
            graphs : List<Graph>
            members : List<Member>
        }

        class Row {
            id : GZ
            elements : List<String>

            getId() : GZ
            getElements() : List<String>
            setId(id : GZ)
            setElements(elements : List<String>)
        }

        Graph <|-- LineChart
        Graph <|-- PieChart

        Project ..> Column
        Project ..> Row
        Project ..> Graph
        Project ..> Button
        Project ..> Member
        Project ..> Notification

        LineChart ..> LineType
        LineChart ..> DotSize
        LineChart ..> Column

        PieChart ..> Column

        Notification ..> Time

        Column ..> DataType
    }

}

'=================================================================================================='
  'Overleaf deprecated
  package CommandCenter {
    'Overleaf deprecated
    class CommandInbox {
        -commandQueue: List<ProjectCommand>
        +addFromJson(commandWrapperJson: String) throws JsonSyntaxException
    }
    'Overleaf deprecated
     class CommandUtility <<static>> {
        +{static} setServerInfo(ProjectCommand, serverInfo: ServerInfo):ProjectCommand
        +{static} toNewCommand(ProjectCommand): ProjectCommand
     }
   '-----------------------------------------------------------------------------------------------'
     'Overleaf deprecated
     package UpToDater {
           'Wenn ich einmal länger als 72h am Stück offline war merke ich mir diese Intervalle
           'dann Frage ich jemanden auf dem Server an, der in diesen 72h keine Blindspots hat
           'Overleaf
           class OldDataFetcher {
           +from: DateTime
           +to: DateTime
           +from: ProjectID
           'null == daten nicht vorhanden
           +getOldData(): List<OldData>
           }
     }
   '-----------------------------------------------------------------------------------------------'
   package Commands {

   abstract class ProjectCommand <<abstract>>{
       +projectID: ProjectID
       +OnlineProjectID: OnlineProjectID?
       {field}+wentOnline: DateTime?
       {field}+serverRemoveTime: DateTime?
       +commandByUser: String?
       +isProjectAdmin: boolean?

       {abstract}+execute() throws IllegalOperationException
   }
   class AddRow {
      +index: Int
      +content: List<Any>

      +execute()
   }
   class DeleteRow {
      +index: Int
      +execute()
   }
   class DeleteColumn {
      +index: Int
      +execute()
   }
   class AddColumn {
      +index(): Int
      +type: DataType
      +execute()
   }
   class SetCell {
      +indexColumn: Int
      +indexRow: Int
      +execute()
   }
   class SetAdmin {
      +UserID: String
      +execute()
   }
   class AddUser {
      +UserID: String
      +execute()
   }

   class RemoveUser {
      +UserID: String
      +execute()
   }
   class CreateGraph {
      'TODO Felder'
      +execute()
   }
   class SetCalculationFunction {
      'TODO Felder'
      +execute()
   }
   class SetTransformationFunctionComposition {
      'TODO Felder'
      +execute()
   }
   class SetSetting {
      +name: String
      +value: String
      +execute()
   }
   class SetProjectName {
      +value: String
      +execute()
   }
   class SetProjectDescription {
      +value: String
      +execute()
   }
   class SetWallpaper {
      +value: Drawable
      +execute()
   }
   class SetNotification {
      'TODO: Felder'
      +execute()
   }
   class DeleteNotification {
      +notificationID: String
      +execute()
   }
   class SetUIElement {
      'TODO: Felder'
      +execute()
   }
   class RequestOldData {
      'TODO: Felder'
      +execute()
   }
   class SetIsOnlineProject {
      +value: boolean
      +execute()
   }
   class CreateProject {
      +execute()
   }
   class CommandWrapper {
   +commandCanonicalName: String
   +commandJson: String

   +Constructor(command: Command)
   +toJson(): String
   +unwrap(): Command
   -jsonFromCommand(Command): String
   }

   /'
   'Overleaf
   enum ProjectCommand <<enumeration>> {
      ..Table Commands..
      DELETE_ROW
      DELETE_COLUMN
      ADD_ROW
      ADD_COLUMN
      SET_CELL
      ..User Commands..
      SET_ADMIN
      ADD_USER
      REMOVE_USER
      ..Graph Commands..
      CREATE_GRAPH
      SET_TRANSFORMATION_FUNCTION_COMPOSITION
      SET_CALCULATION_FUNCTION
      ..String Commands..
      SET_SETTING
      SET_PROJECT_NAME
      SET_PROJECT_DESCRIPTION
      SET_WALLPAPER
      ..Notification Commands..
      SET_NOTIFICATION
      DELETE_NOTIFICATION
      ..UI Element Command..
      SET_UI_ELEMENT
      ..DateTime Commands..
      REQUEST_OLD_DATA
      ..Boolean Commands..
      SET_IS_ONLINE_PROJECT
      SET_PROJECT_ADMIN
      ..Void Commands..
      CREATE_PROJECT
      --
      +execute(ProjectCommandData) throws IllegalOperationException, JsonSyntaxException
      +generateProjectCommandData(): ProjectCommandData
      ..einfache Konstanten..
      -dataType(value: CommandTypeData):CommandTypeData
   }
   'Overleaf
   class ProjectCommandData <<data class>> {
      +commandType: ProjectCommand
      +projectID: ProjectID
      +OnlineProjectID: OnlineProjectID?
      {field}+wentOnline: DateTime?
      {field}+serverRemoveTime: DateTime?
      +commandByUser: String?
      +isProjectAdmin: boolean?
      +commandTypeDataJson: Json
   }
   'Overleaf provisorisch
   class CommandTypeData <<data class>> {
   }
   'Overleaf
   class TableCommandData <<data class>> {
      +indices: List<int>
      +content: List<Any>
   }
   'Overleaf provisorisch
   class GraphCommandData <<data class>> {

   }
   'Overleaf provisorisch
   class UserCommandData <<data class>> {

   }
   'Overleaf provisorisch
   class StringCommandData <<data class>> {

   }
   class NotificationCommandData <<data class>> {

   }
   class UIElementCommandData <<data class>> {

   }
   class DateTimeCommandData <<data class>> {

   }
   class BooleanCommandData <<data class>> {

   }
   '/
   'Overleaf
   class IllegalOperationException {
       }

   /'
   CommandUtility ..right> Gson : <<uses>>
   ProjectCommandData ..> ProjectCommand : <<uses>>
   ProjectCommand ..> IllegalOperationException : <<throws>>
   CommandTypeData "1" -o "1" ProjectCommandData
   CommandTypeData ^-- TableCommandData
   CommandTypeData ^-- GraphCommandData
   CommandTypeData ^-- StringCommandData
   CommandTypeData ^-- UserCommandData
   CommandTypeData ^-- NotificationCommandData
   CommandTypeData ^-- UIElementCommandData
   CommandTypeData ^-- DateTimeCommandData
   CommandTypeData ^-- BooleanCommandData
   Throwable ^-  IllegalOperationException

   CommandCenter ^-[hidden]- UpToDater
   UpToDater ^-[hidden]- Posts
   Row -[hidden]- TableCommandData

   TableCommandData -[hidden]- GraphCommandData
   StringCommandData -[hidden]- UserCommandData
   NotificationCommandData -[hidden]- UIElementCommandData
   DateTimeCommandData -[hidden]- BooleanCommandData
  '/

   }
  }
}

@enduml