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

'SWitCH G4 THEME
'
'COLORS
'Blue #application
'Pink #pink
'Red #salmon
'Yellow #khaki
'Green #technology
'
'DEFAULTS

'hide members
hide circle
skinparam linetype ortho

skinparam minClassWidth 150
skinparam nodesep 150
skinparam ranksep 20
skinparam padding 1
skinparam roundCorner 8

left to right direction



skinparam package {
    backgroundColor white
    borderColor grey
    shadowing false
    fontStyle normal
    fontSize 16
    borderThickness 0.5
    fontColor #aaa
    stereotypeFontSize 10
    stereotypeFontColor lightGrey

}

skinparam class {
    stereotypeFontSize 10
    fontSize 16
    fontName Helvetica
    arrowColor black
    arrowThickness 1
    attributeIconSize 0
    borderThickness 0.5
}

skinparam class<<AGGREGATE ROOT>> {
    borderColor black
    backgroundColor #eee



}

skinparam class<<ENTITY>> {
    borderColor yellow
    backgroundColor #khaki
}

skinparam class<<VALUE OBJECT>> {
    borderColor green
    backgroundColor #technology
}



skinparam note {
    fontSize 14
    fontName Helvetica
    borderColor black
    borderThickness 0.5
    backgroundColor AliceBlue
}


'TITLE ON TOP
'title The new Big Picture

'HEADER FOOTER DESCRIPTIONS
'center header DDD - Domain Driven Design
'center footer DDD - Domain Driven Design



'class Resource <<VALUE OBJECT>> #technology ##green{}



package Resource <<AGGREGATE>>  {
    entity Resource <<AGGREGATE ROOT>><<ENTITY>>{
        resourceID
        timePeriod
        percentageAllocation
        costPerHour
        role
    }
}

package Project <<AGGREGATE>> {
    entity Project <<AGGREGATE ROOT>><<ENTITY>>{
        code
        name
        description
        projectBudget
        typologyID
        customer
        sprintDuration
        plannedSprints
        status
        startDate
        endDate
        businessSector
     }
    'entity ProductBacklog <<ENTITY>>
}

package Sprint <<AGGREGATE>>   {

    'class SprintID <<VALUE OBJECT>>
    entity Sprint <<AGGREGATE ROOT>><<ENTITY>>{
        sprintID
        sprintStatus
        sprintBacklog
        order
        startDate
        endDate
    }
    'entity SprintBacklogItem <<VALUE OBJECT>>
}

package UserStory <<AGGREGATE>>{
    'entity TaskInUS
    'class UserStoryID <<VALUE OBJECT>>
    entity UserStory <<AGGREGATE ROOT>><<ENTITY>>{
        description
        id
        parentUserStory
        status
        effort
        priority
    }


}

package User <<AGGREGATE>>{
    entity User <<AGGREGATE ROOT>><<ENTITY>>{
        userID
        email
        password
        userName
        function
        photo
        status
    }
    'class UserID <<VALUE OBJECT>>
}


package Profile <<AGGREGATE>>{
    entity Profile <<AGGREGATE ROOT>><<ENTITY>>{
        profileID
        name
    }
    'class ProfileName <<VALUE OBJECT>>
}

package Typology <<AGGREGATE>>{
    entity Typology <<AGGREGATE ROOT>><<ENTITY>>{
        name
    }
    'class TypologyName <<VALUE OBJECT>>
}

package ProfileRequest <<AGGREGATE>>{
      entity ProfileRequest <<AGGREGATE ROOT>><<ENTITY>>{
        id
      }
}

package Task <<AGGREGATE>>{
      entity Task <<AGGREGATE ROOT>><<ENTITY>>{
        taskID
        name
        description
        startDate
        endDate
        type
        status
        hours
        effort
        percentageOfExecution
      }
}

'ProjectDeprecated -right- ProductBacklog
Resource --->"userID" User
Project ->"typologyID" Typology
Project "projectCode"<----- Resource


Sprint ------>"projectCode" Project
'Sprint -right- SprintBacklogItem
'SprintBacklogItem -down-> UserStory
UserStory ->"sprintID" Sprint
Project "projectCode"<-left- UserStory
Resource "resouceID            "<-left- Task

Task ---->"      sprintID" Sprint
Task -->"userStoryID" UserStory

Profile "profileID"<--- User
ProfileRequest ->"profileID" Profile
ProfileRequest ->"userID" User

'note  "This note is connected\nto several objects." as N2
'Profile .. N2

@enduml