use of py.org.fundacionparaguaya.pspserver.network.dtos.DashboardDTO in project FP-PSP-SERVER by FundacionParaguaya.
the class ApplicationServiceImpl method getApplicationDashboard.
@Override
public ApplicationDTO getApplicationDashboard(Long applicationId, UserDetailsDTO details) {
ApplicationDTO dto = getUserApplication(details, applicationId);
Long organizationId = Optional.ofNullable(details.getOrganization()).orElse(new OrganizationDTO()).getId();
FamilyFilterDTO filter = FamilyFilterDTO.builder().applicationId(dto.getId()).organizationId(organizationId).build();
DashboardDTO dashboard = DashboardDTO.of(familyService.countFamiliesByFilter(filter), null, null, null, snapshotService.countSnapshotTaken(filter));
dto.setDashboard(dashboard);
return dto;
}
use of py.org.fundacionparaguaya.pspserver.network.dtos.DashboardDTO in project FP-PSP-SERVER by FundacionParaguaya.
the class ApplicationControllerTest method getDashboardTest.
private DashboardDTO getDashboardTest() {
DashboardDTO dto = new DashboardDTO();
dto.setNumberOfFamilies(new Long(1));
dto.setActivityFeed(new ArrayList<>());
dto.setSnapshotIndicators(new SnapshotIndicators());
dto.setSnapshotTaken(new SnapshotTaken());
dto.setTopOfIndicators(new ArrayList<>());
return dto;
}
use of py.org.fundacionparaguaya.pspserver.network.dtos.DashboardDTO in project FP-PSP-SERVER by FundacionParaguaya.
the class OrganizationServiceImpl method getOrganizationDashboard.
@Override
public OrganizationDTO getOrganizationDashboard(Long organizationId, UserDetailsDTO details) {
OrganizationDTO dto = new OrganizationDTO();
if (details.getOrganization() != null && details.getOrganization().getId() != null) {
dto = getOrganizationById(details.getOrganization().getId());
} else if (organizationId != null) {
dto = getOrganizationById(organizationId);
}
Long applicationId = Optional.ofNullable(details.getApplication()).orElse(new ApplicationDTO()).getId();
FamilyFilterDTO filter = FamilyFilterDTO.builder().applicationId(applicationId).organizationId(dto.getId()).build();
DashboardDTO dashboard = DashboardDTO.of(familyService.countFamiliesByFilter(filter), null, snapshotServiceImpl.getTopOfIndicators(organizationId), countSnapshotIndicators(organizationId), null);
dto.setDashboard(dashboard);
return dto;
}
Aggregations