use of org.folio.circulation.domain.notice.PatronNotice in project mod-circulation by folio-org.
the class TitleLevelRequestNoticeSender method applyTlrCancellationNotice.
private CompletableFuture<Result<Void>> applyTlrCancellationNotice(TlrSettingsConfiguration tlrSettings, PatronNoticeEvent patronNoticeEvent) {
UUID cancellationTemplateId = tlrSettings.getCancellationPatronNoticeTemplateId();
if (cancellationTemplateId != null) {
NoticeLogContext noticeLogContext = new NoticeLogContext().withTriggeringEvent(patronNoticeEvent.getEventType().getRepresentation()).withTemplateId(cancellationTemplateId.toString());
NoticeConfiguration noticeConfiguration = buildTlrNoticeConfiguration(patronNoticeEvent, cancellationTemplateId);
PatronNotice patronNotice = new PatronNotice(patronNoticeEvent.getUser().getId(), patronNoticeEvent.getNoticeContext(), noticeConfiguration);
return patronNoticeService.sendNotice(patronNotice, noticeLogContext);
}
return ofAsync(() -> null);
}
use of org.folio.circulation.domain.notice.PatronNotice in project mod-circulation by folio-org.
the class TitleLevelRequestNoticeSender method applyTlrConfirmationNotice.
private CompletableFuture<Result<Void>> applyTlrConfirmationNotice(TlrSettingsConfiguration tlrSettings, PatronNoticeEvent patronNoticeEvent) {
UUID confirmationTemplateId = tlrSettings.getConfirmationPatronNoticeTemplateId();
if (confirmationTemplateId != null) {
NoticeLogContext noticeLogContext = new NoticeLogContext().withTriggeringEvent(patronNoticeEvent.getEventType().getRepresentation()).withTemplateId(confirmationTemplateId.toString());
NoticeConfiguration noticeConfiguration = buildTlrNoticeConfiguration(patronNoticeEvent, confirmationTemplateId);
PatronNotice patronNotice = new PatronNotice(patronNoticeEvent.getUser().getId(), patronNoticeEvent.getNoticeContext(), noticeConfiguration);
return patronNoticeService.sendNotice(patronNotice, noticeLogContext);
}
return ofAsync(() -> null);
}
Aggregations