Example #1
0
 public List<Facility> getAllForDeliveryZoneAndProgram(Long deliveryZoneId, Long programId) {
   List<Facility> facilities =
       facilityRepository.getAllInDeliveryZoneFor(deliveryZoneId, programId);
   for (Facility facility : facilities) {
     facility
         .getSupportedPrograms()
         .add(
             programSupportedService.getFilledByFacilityIdAndProgramId(
                 facility.getId(), programId));
   }
   return facilities;
 }
Example #2
0
 public Facility getById(Long id) {
   Facility facility = facilityRepository.getById(id);
   facility.setSupportedPrograms(programSupportedService.getAllByFacilityId(id));
   return facility;
 }
Example #3
0
 @Transactional
 public void update(Facility facility) {
   save(facility);
   programSupportedService.updateSupportedPrograms(facility);
 }