Skip to content

Separation of Conserns #27

@Vulps22

Description

@Vulps22

The code is getting quite messy so let's break it down

After a bit of back and forth with AI I came up with this structure:

Image

Implement this structure within the code and clean up these files a bit

In case further changes are needed, this is the UML in text form for Mermaid

---
config:
  layout: dagre
---
classDiagram
direction TB
    class TableManager {
	    - summaryRow: HTMLElement
	    - headerRow: HTMLElement
	    - timesheetBody: HTMLElement
	    + initializeTable()
	    + clearTable()
	    + renderHeaderRow(days: int, currentMonth: int, year: int)
	    + renderSummaryRow(dailyTotals: Map~int, int~)
	    + renderTimesheetBody(ticketData: Ticket[])
	    + createCell(content: String, classes: String[]) : HTMLElement
	    + updateCell(cellIdentifier: String, newValue: String)
    }
    class DataManager {
	    + loadLogs()
	    + saveLogs()
    }
    class Ticket {
	    - String name
	    - Activity[] activities
	    + createTicketCell()
	    + createTotalCell()
	    + addActivity(activity: Activity)
    }
    class Timesheet {
	    - int selectedMonth
	    - Ticket[] tickets
	    - Map~int, int~ dailyTotals
	    + generateDays()
	    + generateTimesheet()
	    + updateSummaryRow()
	    + addTicket(Ticket)
    }
    class Activity {
	    - String name
	    - LogEntry[] logs
	    - Map~int, int~ dailyDurations
	    + groupActivitiesByName()
	    + addLog(log: LogEntry)
    }
    class LogEntry {
	    - String ticket
	    - String activity
	    - Date time
	    - int duration
    }

    Timesheet "1" --> "*" Ticket : contains
    Ticket "1" --> "*" Activity : groups
    Activity "1" --> "*" LogEntry : aggregates
    Timesheet --> DataManager : uses
    Timesheet --> TableManager : uses

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Status

In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions