use of org.folio.circulation.domain.notes.NoteCreator in project mod-circulation by folio-org.
the class DeclareLostResource method declareItemLostWhenClaimedReturned.
private CompletableFuture<Result<Loan>> declareItemLostWhenClaimedReturned(Loan loan, DeclareItemLostRequest request, Clients clients) {
final NotesRepository notesRepository = NotesRepository.createUsing(clients);
final NoteCreator creator = new NoteCreator(notesRepository);
return ofAsync(() -> declareItemLost(loan, request)).thenCompose(r -> r.after(l -> creator.createGeneralUserNote(loan.getUserId(), "Claimed returned item marked declared lost"))).thenCompose(r -> r.after(note -> completedFuture(succeeded(loan))));
}
use of org.folio.circulation.domain.notes.NoteCreator in project mod-circulation by folio-org.
the class DeclareClaimedReturnedItemAsMissingResource method createNote.
private CompletableFuture<Result<Loan>> createNote(Clients clients, Loan loan) {
final NotesRepository notesRepository = NotesRepository.createUsing(clients);
final NoteCreator creator = new NoteCreator(notesRepository);
return creator.createGeneralUserNote(loan.getUserId(), "Claimed returned item marked missing").thenCompose(r -> r.after(note -> completedFuture(succeeded(loan))));
}
Aggregations