use of py.org.fundacionparaguaya.pspserver.families.dtos.FamilyMapDTO in project FP-PSP-SERVER by FundacionParaguaya.
the class FamilySnapshotsManagerImpl method getFamilyMapById.
@Override
public FamilyMapDTO getFamilyMapById(Long familyId) {
checkArgument(familyId > 0, i18n.translate("argument.nonNegative", familyId));
FamilyMapDTO familyFile = new FamilyMapDTO();
FamilyDTO family = Optional.ofNullable(familyRepository.findOne(familyId)).map(familyMapper::entityToDto).orElseThrow(() -> new UnknownResourceException(i18n.translate("family.notExist")));
BeanUtils.copyProperties(family, familyFile);
familyFile.setSnapshotIndicators(snapshotService.getLastSnapshotIndicatorsByFamily(familyId));
return familyFile;
}
Aggregations