private void fillProgram(DeliveryZoneProgramSchedule deliveryZoneProgramSchedule) {
    Program program = programService.getByCode(deliveryZoneProgramSchedule.getProgram().getCode());
    if (program == null) throw new DataException("program.code.invalid");
    if (!program.isPush()) throw new DataException("error.program.not.push");

    deliveryZoneProgramSchedule.setProgram(program);
  }
  private void fillSchedule(DeliveryZoneProgramSchedule deliveryZoneProgramSchedule) {
    ProcessingSchedule schedule =
        scheduleService.getByCode(deliveryZoneProgramSchedule.getSchedule().getCode());
    if (schedule == null) throw new DataException("schedule.code.invalid");

    deliveryZoneProgramSchedule.setSchedule(schedule);
  }
  private void fillDeliveryZone(DeliveryZoneProgramSchedule deliveryZoneProgramSchedule) {
    DeliveryZone deliveryZone =
        deliveryZoneService.getByCode(deliveryZoneProgramSchedule.getDeliveryZone().getCode());
    if (deliveryZone == null) throw new DataException("deliveryZone.code.invalid");

    deliveryZoneProgramSchedule.setDeliveryZone(deliveryZone);
  }
  public void save(DeliveryZoneProgramSchedule deliveryZoneProgramSchedule) {
    fillProgram(deliveryZoneProgramSchedule);
    fillDeliveryZone(deliveryZoneProgramSchedule);
    fillSchedule(deliveryZoneProgramSchedule);

    if (deliveryZoneProgramSchedule.getId() == null) repository.insert(deliveryZoneProgramSchedule);
    else repository.update(deliveryZoneProgramSchedule);
  }