use of org.folio.circulation.domain.notice.NoticeEventType in project mod-circulation by folio-org.
the class ItemLevelRequestNoticeSender method sendNoticeOnRequestCreated.
@Override
public Result<RequestAndRelatedRecords> sendNoticeOnRequestCreated(RequestAndRelatedRecords relatedRecords) {
Request request = relatedRecords.getRequest();
Item item = request.getItem();
NoticeEventType eventType = requestTypeToEventMap.getOrDefault(request.getRequestType(), NoticeEventType.UNKNOWN);
PatronNoticeEvent requestCreatedEvent = createPatronNoticeEvent(request, eventType).withItem(item);
patronNoticeService.acceptNoticeEvent(requestCreatedEvent);
Loan loan = request.getLoan();
if (request.getRequestType() == RequestType.RECALL && loan != null) {
sendNoticeOnItemRecalledEvent(loan);
sendLogEvent(loan);
}
return Result.succeeded(relatedRecords);
}
use of org.folio.circulation.domain.notice.NoticeEventType in project mod-circulation by folio-org.
the class TitleLevelRequestNoticeSender method sendNoticeOnRequestCreated.
@Override
public Result<RequestAndRelatedRecords> sendNoticeOnRequestCreated(RequestAndRelatedRecords relatedRecords) {
Request request = relatedRecords.getRequest();
TlrSettingsConfiguration tlrSettings = request.getTlrSettingsConfiguration();
NoticeEventType eventType = requestTypeToEventMap.getOrDefault(request.getRequestType(), NoticeEventType.UNKNOWN);
if (tlrSettings.isTitleLevelRequestsFeatureEnabled() && tlrSettings.getConfirmationPatronNoticeTemplateId() != null) {
PatronNoticeEvent requestCreatedEvent = createPatronNoticeEvent(request, eventType);
applyTlrConfirmationNotice(request.getTlrSettingsConfiguration(), requestCreatedEvent);
}
return Result.succeeded(relatedRecords);
}
Aggregations