Search in sources :

Example 1 with TlrSettingsConfiguration

use of org.folio.circulation.domain.configuration.TlrSettingsConfiguration 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);
}
Also used : NoticeEventType(org.folio.circulation.domain.notice.NoticeEventType) Request(org.folio.circulation.domain.Request) TlrSettingsConfiguration(org.folio.circulation.domain.configuration.TlrSettingsConfiguration) PatronNoticeEvent(org.folio.circulation.domain.notice.PatronNoticeEvent)

Aggregations

Request (org.folio.circulation.domain.Request)1 TlrSettingsConfiguration (org.folio.circulation.domain.configuration.TlrSettingsConfiguration)1 NoticeEventType (org.folio.circulation.domain.notice.NoticeEventType)1 PatronNoticeEvent (org.folio.circulation.domain.notice.PatronNoticeEvent)1