@startuml
'https://plantuml.com/class-diagram


'Inheritance
Person <|-- Admin
Person <|-- SectionManager
Admin <|-- SuperAdmin

'Aggregation
'Category o-- SubCategory
Category o-- SectionManager
'Composition
Center *-- Admin

'Category "0..1" - "0..*" Promotion

Category "0..*" - "0..*" Promotion
SectionManager "0..*" - "0..1" Promotion

'This needs to be changed to many-to-many relationship
'in case a product can belong to more than one category
'SubCategory "0..1" - "0..*" exemptedFromPromotion
'Promotion "0..*" - "1" exemptedFromPromotion


abstract class Person {
    Integer id
    String fullname
    String email
    String passw
    login()
}

class Admin {
    createPromotions()
}

class SuperAdmin {
    manageAccounts()
}

class SectionManager{
    managePromotions()
}

class Category {
    Integer id
    Integer parent_id
    String name
    Getters()
    Setters()
}

'class SubCategory {
'    Integer id
'    String name
'    Getters()
'    Setters()
'}

class Center {
    Integer id
    String city
}

class Promotion {
    Integer id
    Float percentage
    Timestamp validUntil
    status
    comment
    created_at
    Getters()
    Setters()
}



@enduml