Search in sources :

Example 1 with NoticeLogContextItem

use of org.folio.circulation.domain.representations.logs.NoticeLogContextItem in project mod-circulation by folio-org.

the class FeeFineScheduledNoticeHandler method buildNoticeLogContext.

@Override
protected NoticeLogContext buildNoticeLogContext(ScheduledNoticeContext context) {
    Loan loan = context.getLoan();
    ScheduledNotice notice = context.getNotice();
    NoticeLogContextItem logContextItem = NoticeLogContextItem.from(loan).withTemplateId(notice.getConfiguration().getTemplateId()).withTriggeringEvent(notice.getTriggeringEvent().getRepresentation()).withNoticePolicyId(context.getPatronNoticePolicyId());
    return new NoticeLogContext().withUser(loan.getUser()).withAccountId(context.getAccount().getId()).withItems(singletonList(logContextItem));
}
Also used : NoticeLogContextItem(org.folio.circulation.domain.representations.logs.NoticeLogContextItem) NoticeLogContext(org.folio.circulation.domain.representations.logs.NoticeLogContext) Loan(org.folio.circulation.domain.Loan)

Example 2 with NoticeLogContextItem

use of org.folio.circulation.domain.representations.logs.NoticeLogContextItem in project mod-circulation by folio-org.

the class RequestScheduledNoticeHandler method buildNoticeLogContext.

@Override
protected NoticeLogContext buildNoticeLogContext(ScheduledNoticeContext context) {
    ScheduledNotice notice = context.getNotice();
    Request request = context.getRequest();
    NoticeLogContextItem logContextItem = NoticeLogContextItem.from(request).withTemplateId(notice.getConfiguration().getTemplateId()).withTriggeringEvent(notice.getTriggeringEvent().getRepresentation()).withNoticePolicyId(context.getPatronNoticePolicyId());
    return new NoticeLogContext().withUser(request.getRequester()).withRequestId(request.getId()).withItems(singletonList(logContextItem));
}
Also used : NoticeLogContextItem(org.folio.circulation.domain.representations.logs.NoticeLogContextItem) NoticeLogContext(org.folio.circulation.domain.representations.logs.NoticeLogContext) Request(org.folio.circulation.domain.Request)

Aggregations

NoticeLogContext (org.folio.circulation.domain.representations.logs.NoticeLogContext)2 NoticeLogContextItem (org.folio.circulation.domain.representations.logs.NoticeLogContextItem)2 Loan (org.folio.circulation.domain.Loan)1 Request (org.folio.circulation.domain.Request)1