@startuml
skinparam sequenceMessageAlign center
title TO LIST ALL ACCOUNTS IN A GIVEN PROJECT
legend top
US014 - As Manager, I want to get a list of all human resources in a project.
end legend


class "ListAccountsInProjectController" {
- resourceListAllocationService
+ listAccountsByProjectCode(projectCode)
}

class "ResourceListAllocationService" {
- iProjectResourceRepository
- iAccountRepository
- accountMapper
+ listAccountsByProjectCode(projectCode)
}

interface "IProjectResourceRepository" {
+ getAccountsAllocatedToProject(projectCode)
}

class "ProjectResourceRepository" {
- projectResources
+ getAccountsAllocatedToProject(projectCode)
}

interface "IAccountRepository" {
+ getAccounts(emails)
+ hasEmail(email)
}

class "AccountRepository" {
- accounts
+ getAccounts(emails)
+ hasEmail(email)
}

class "AccountMapper" {
+ accountToDto(account)
+ accountsToDto(accounts)
}

class "AccountDto" {
+ name
+ email
+ status
+ AccountDto(name, email, status)

}

class "Account" {
- name
- email
- accountStatus
+ getAccountName()
+ getAccountEmail()
+ getAccountStatus()
}

class "ProjectResource" {
- projectCode
- accountEmail
+ hasProjectCode(projectCode)
+ getEmail()
}

ListAccountsInProjectController <.. ResourceListAllocationService: is injected

ResourceListAllocationService <.. IAccountRepository: is injected
IAccountRepository <|.. AccountRepository: implements
AccountRepository --> Account: has

ResourceListAllocationService <.. IProjectResourceRepository: is injected
IProjectResourceRepository <|.. ProjectResourceRepository: implements
ProjectResourceRepository --> ProjectResource: has

ResourceListAllocationService <.. AccountMapper: is injected
AccountMapper ...> AccountDto: creates
AccountDto ..> Account: uses

@enduml