classDiagram
%% User Management Classes
class User {
-int userId
-String email
-String username
-String name
-String surname
-String password
-String profilePicture
+register() : void
+login() : String
+logout() : void
+editProfile() : void
+uploadProfilePicture() : void
+followUser() : void
+unfollowUser() : void
+filterForumFeed() : ForumFeed
+forgotPassword() : link
}
class Task {
<<abstract>>
-int taskId
-String title
-String description
-DateTime date or deadline
-TaskStatus status
-AssignmentStatus assignmentStatus
-Set<User> assignees
+create(): Task
+update(): Task
+delete(): void
+changeStatus(): void
+assignUser(): void
+acceptTask(): void
+declineTask(): void
}
class HarvestTask {
-Map<Plant, double> harvestAmounts
}
class MaintenanceTask {
-String maintenanceType
}
class CustomTask {
-String customType
}
Task <|-- HarvestTask
Task <|-- MaintenanceTask
Task <|-- CustomTask
class WeatherService {
-String weatherData
+fetchWeatherData(): String
+sendWeatherAlerts(): void
}
class ForumFeed {
+filterByFollowedUsers(): List<ForumPost>
}
%% Garden Management Classes
class Garden {
-int gardenId
-String type
-String name
-String description
-String location
-double size
-boolean isPublic
+create(): Garden
+update(): Garden
+delete(): void
+acceptMember(): void
+removeMember(): void
+appointManager(): void
}
class GardenMembership {
-int membershipId
-DateTime joinDate
-GardenRole role
+requestJoin(): void
+leave(): void
+changeRole(): void
+getRole(): GardenRole
}
class Plant {
-int plantId
-String name
-String species
-String careInstructions
-String photoUrl
+add(): Plant
+update(): Plant
+getDetails(): String
+uploadPhoto(): void
}
%% Forum and Communication Classes
class ForumPost {
-int postId
-String title
-String content
-DateTime postedDate
-DateTime lastEditedDate
+create(): ForumPost
+edit(): void
+delete(): void
+report(): void
}
class Comment {
-int commentId
-String content
-DateTime postedDate
+create(): Comment
+edit(): Comment
+delete(): void
+report(): void
}
class Notification {
-int notificationId
-String content
-String channel
-NotificationType type
-DateTime sentDate
-boolean isRead
+send(): void
+enable(): void
+setReminder(): void
+disable(): void
+markAsRead(): void
+delete(): void
}
%% Enum Classes
class TaskStatus {
<<enumeration>>
PENDING
IN_PROGRESS
COMPLETED
}
class AssignmentStatus {
<<enumeration>>
ASSIGNED
ACCEPTED
DECLINED
COMPLETED
}
%% Garden Roles (Now Properly Defined)
class GardenRole {
<<abstract>>
}
class Manager {
+ inviteMember(): void
+ acceptJoinRequest(): void
+ declineJoinRequest(): void
+ manageGarden(): void
+ assignManager(): void
+ assignTasks(): void
+ acceptOrRemoveMembers(): void
+ createCustomTasks(): void
+ editGardenDetails(): void
}
class Worker {
+ acceptOrDeclineTask(): void
+ leaveGarden(): void
+ completeAssignedTask(): void
+ selfAssignTask(): void
+ logMaintenance(): void
+ updateTaskStatus(): void
+ logHarvest(): void
+ commentOnGardenForum(): void
}
GardenRole <|-- Manager
GardenRole <|-- Worker
class NotificationType {
<<enumeration>>
TASK_UPDATE
WEATHER_ALERT
FORUM_ACTIVITY
MAINTENANCE_REMINDER
DEADLINE_APPROACHING
NEW_MEMBER_REQUEST
HARVEST_READY
}
class SystemRole {
<<abstract>>
}
class SystemAdministrator {
+ giveLocationInformation(): void
+ manageUsers(): void
+ manageForums(): void
+ closeGarden(): void
+ appointModerators(): void
}
class Moderator {
+ reviewReport(): void
+ deleteInappropriateContent(): void
+ banUser(): void
}
class Member {
+ createGarden(): Notification
+ recommendGarden(): void
+ requestJoinGarden(): void
+ leaveGarden(): void
+ createTask(): void
+ acceptTask(): void
+ acceptInvitation(): void
+ declineInvitation(): void
+ commentOnForum(): void
+ logHarvest(): void
}
class LocationService {
- String locationData
+ fetchLocationData(): String
+ sendLocationBasedRecommendations(): void
}
class Guest {
+ viewPublicPosts(): List<ForumPost>
+ viewPublicGardens(): List<Garden>
+ register(): void
}
SystemRole <|-- SystemAdministrator
SystemRole <|-- Moderator
SystemRole <|-- Member
SystemRole <|-- Guest
%% Relationships
User "1" -- "*" User : follows
User "*" -- "1" SystemRole : has
User "1" -- "*" Notification : receives
User "1" -- "*" ForumPost : creates
User "1" -- "*" Comment : creates
ForumPost "1" -- "*" Comment : has
Garden "1" -- "*" ForumPost : contains
Garden "1" -- "*" Task : contains
Task "1" -- "1" User : createdBy
User "1" -- "*" Task : assigned
Garden "1" -- "*" GardenMembership : has
User "1" -- "*" GardenMembership : memberOf
GardenMembership "*" -- "1" GardenRole : has
Garden "1" -- "*" Plant : has
WeatherService "*" -- "1" Notification : sends alerts
LocationService "*" -- "1" Member : sends garden recommendations
Notification "*" -- "1" User : received by
ForumFeed "1" -- "*" ForumPost : contains