Search in sources :

Example 1 with PatronNoticeEventBuilder

use of org.folio.circulation.domain.notice.PatronNoticeEventBuilder in project mod-circulation by folio-org.

the class RequestNoticeSender method sendRequestAwaitingPickupNotice.

private CompletableFuture<Result<Void>> sendRequestAwaitingPickupNotice(Request request) {
    Item item = request.getItem();
    User user = request.getRequester();
    PatronNoticeEvent noticeEvent = new PatronNoticeEventBuilder().withItem(item).withUser(user).withEventType(NoticeEventType.AVAILABLE).withNoticeContext(createRequestNoticeContext(request)).withNoticeLogContext(NoticeLogContext.from(request)).build();
    return patronNoticeService.acceptNoticeEvent(noticeEvent);
}
Also used : Item(org.folio.circulation.domain.Item) User(org.folio.circulation.domain.User) PatronNoticeEvent(org.folio.circulation.domain.notice.PatronNoticeEvent) PatronNoticeEventBuilder(org.folio.circulation.domain.notice.PatronNoticeEventBuilder)

Example 2 with PatronNoticeEventBuilder

use of org.folio.circulation.domain.notice.PatronNoticeEventBuilder in project mod-circulation by folio-org.

the class RequestNoticeSender method sendNoticeOnItemRecalledEvent.

protected Result<Void> sendNoticeOnItemRecalledEvent(Loan loan) {
    if (loan.getUser() != null && loan.getItem() != null) {
        PatronNoticeEvent itemRecalledEvent = new PatronNoticeEventBuilder().withItem(loan.getItem()).withUser(loan.getUser()).withEventType(NoticeEventType.ITEM_RECALLED).withNoticeContext(TemplateContextUtil.createLoanNoticeContext(loan)).withNoticeLogContext(NoticeLogContext.from(loan)).build();
        patronNoticeService.acceptNoticeEvent(itemRecalledEvent);
    }
    return Result.succeeded(null);
}
Also used : PatronNoticeEvent(org.folio.circulation.domain.notice.PatronNoticeEvent) PatronNoticeEventBuilder(org.folio.circulation.domain.notice.PatronNoticeEventBuilder)

Aggregations

PatronNoticeEvent (org.folio.circulation.domain.notice.PatronNoticeEvent)2 PatronNoticeEventBuilder (org.folio.circulation.domain.notice.PatronNoticeEventBuilder)2 Item (org.folio.circulation.domain.Item)1 User (org.folio.circulation.domain.User)1