use of org.hisp.dhis.smscompression.models.DeleteSmsSubmission in project dhis2-core by dhis2.
the class DeleteEventSMSListener method postProcess.
@Override
protected SmsResponse postProcess(IncomingSms sms, SmsSubmission submission) throws SMSProcessingException {
DeleteSmsSubmission subm = (DeleteSmsSubmission) submission;
Uid eventid = subm.getEvent();
ProgramStageInstance psi = programStageInstanceService.getProgramStageInstance(eventid.getUid());
if (psi == null) {
throw new SMSProcessingException(SmsResponse.INVALID_EVENT.set(eventid));
}
programStageInstanceService.deleteProgramStageInstance(psi);
return SmsResponse.SUCCESS;
}
use of org.hisp.dhis.smscompression.models.DeleteSmsSubmission in project dhis2-core by dhis2.
the class DeleteEventSMSListenerTest method createDeleteSubmission.
private DeleteSmsSubmission createDeleteSubmission() {
DeleteSmsSubmission subm = new DeleteSmsSubmission();
subm.setUserId(user.getUid());
subm.setEvent(programStageInstance.getUid());
subm.setSubmissionId(1);
return subm;
}
Aggregations