Skip to content

Commit

Permalink
Merge pull request #23 from cathrkri/example1
Browse files Browse the repository at this point in the history
models based on current class diagram
  • Loading branch information
apbaluna authored Feb 19, 2026
2 parents 7dc1ada + 49aeb2a commit b127e10
Show file tree
Hide file tree
Showing 25 changed files with 641 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package ntnu.sytemutvikling.team6.models;

public class AnonymousDonation extends Donation {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ntnu.sytemutvikling.team6.models;

public class Charity {
abstract class Charity {
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ntnu.sytemutvikling.team6.models;

public class DonationRegistry {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package ntnu.sytemutvikling.team6.models;

public class Role {
public class Inbox {

}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ntnu.sytemutvikling.team6.models;

public class PublicDonation extends Donation {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ntnu.sytemutvikling.team6.models;

public class Settings {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ntnu.sytemutvikling.team6.models;

public class UserRegistry {

}
307 changes: 307 additions & 0 deletions helpmehelpapplication/src/main/resources/tempClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
@startuml



' =========================

' DOMAIN LAYER

' =========================



package "Domain Layer" {



class User {

- idNext : static int

- id : int

- name : String

- email : String

- passwordHash : String

- role : String

- settings : Settings

- inbox : Inbox


+ getUserId() : int

+ setUserId(id : int)

+ getUserName() : String

+ setUserName(name : String)

+ getUserEmail() : String

+ setUserEmail(email : String)

+ getUserPasswordHash() : String

+ setUserPasswordHash(passwordHash : String)

+ getUserRole() : String

+ setUserRole(role : String)

}



class Settings {

- lightmode : boolean

- language : String

- anonymous : boolean


+ getSettings() : String

}



class Inbox {

- messages : ArrayList


+ getMessages() : ArrayList

+ addMessage(message : Message)

+ removeMessage(message : Message)

}



class Message {

- title : String

- from : Charity

- date : LocalDateTime


+ getTitle() : String

+ getFrom() : Charity

+ getDate() : LocalDateTime

}



class Charity {

- idNext : static int

- id : int

- name : String

- description : String

- totalDonations : double

- verified : boolean

- category : String


+ getCharityId() : int

+ setCharityId(id : int)

+ getCharityName() : String

+ setCharityName(name : String)

+ getCharityDescription() : String

+ setCharityDescription(description : String)

+ getCharityTotalDonations() : double

+ setCharityTotalDonations(totalDonations : double)

}



abstract class Donation {

- idNext : static int

- id : int

- amount : double

- date : LocalDateTime

- charity : Charity

- user : User


+ getDonationId() : int

+ setDonationId(id : int)

+ getDonationAmount() : double

+ setDonationAmount(amount : double)

+ getDonationDate() : LocalDateTime

+ setDonationDate(date : LocalDateTime)

+ getDonorInfo() : String

}



class AnonymousDonation {

- comment : String

}



class PublicDonation {

- comment : String

}



class Feedback {

- id : int

- message : String

- date : LocalDateTime

- charityId : int


+ getId() : int

+ setId(id : int)

+ getMessage() : String

+ setMessage(message : String)

+ getDate() : LocalDateTime

+ setDate(date : LocalDateTime)

}



class UserRegistry {

- users : List

+ addUser(user : User)

+ removeUser(user : User)

+ getUserById(id : int) : User

+ getAllUsers() : List

}



class CharityRegistry {

- charities : List

+ addCharity(charity : Charity)

+ removeCharity(charity : Charity)

+ getCharityById(id : int) : Charity

+ getAllCharities() : List

}



class DonationRegistry {

- donations : List

+ addDonation(donation : Donation)

+ removeDonation(donation : Donation)

+ getDonationById(id : int) : Donation

+ getAllDonations() : List

}



' Associations

User "1" -- "0..*" Donation

Charity "1" -- "0..*" Donation



User "1" -- "0..*" Feedback

Charity "1" -- "0..*" Feedback



Donation <|-- AnonymousDonation

Donation <|-- PublicDonation



User "1" *-- "1" Settings

User "1" *-- "1" Inbox

Inbox "1" -- "0..*" Message

Message "1" --> "1" Charity



}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit b127e10

Please sign in to comment.