Skip to content

Commit df802fd

Browse files
CIRC-1925 Update reminder scheduler to handle printed notices (folio-org#1417)
* CIRC-1925 Update reminder scheduler to handle printed notices * CIRC-1925 fix merge from master --------- Co-authored-by: Niels Erik <nielserik@indexdata.com>
1 parent 0ede6b7 commit df802fd

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/main/java/org/folio/circulation/domain/notice/NoticeFormat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
public enum NoticeFormat {
66

77
EMAIL("Email", "email", "text/html"),
8-
PRINT("Print", "mail", "text"),
8+
PRINT("Print", "mail", "text/html"),
99
UNKNOWN("Unknown", "", "");
1010

1111

src/main/java/org/folio/circulation/resources/ScheduledDigitalRemindersProcessingResource.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ protected CompletableFuture<Result<MultipleRecords<ScheduledNotice>>> findNotice
4141
return CqlQuery.lessThanOrEqualTo("nextRunTime", formatDateTime(ClockUtil.getZonedDateTime().withZoneSameInstant(ZoneOffset.UTC)))
4242
.combine(exactMatch("noticeConfig.sendInRealTime", "true"), CqlQuery::and)
4343
.combine(exactMatch("triggeringEvent", DUE_DATE_WITH_REMINDER_FEE.getRepresentation()), CqlQuery::and)
44-
.combine(exactMatch("noticeConfig.format", "Email"), CqlQuery::and)
4544
.map(cqlQuery -> cqlQuery.sortBy(CqlSortBy.ascending("nextRunTime")))
4645
.after(query -> scheduledNoticesRepository.findBy(query, pageLimit));
4746
}

src/test/java/api/loans/ReminderFeeTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import api.support.builders.FeeFineOwnerBuilder;
66
import api.support.builders.HoldingBuilder;
77
import api.support.builders.ItemBuilder;
8+
import api.support.fakes.FakeModNotify;
89
import api.support.http.IndividualResource;
910
import api.support.http.ItemResource;
1011
import api.support.http.UserResource;
@@ -402,7 +403,9 @@ void willScheduleRemindersAroundClosedDays() {
402403
verifyNumberOfPublishedEvents(NOTICE, 3);
403404
verifyNumberOfPublishedEvents(NOTICE_ERROR, 0);
404405
waitAtMost(1, SECONDS).until(accountsClient::getAll, hasSize(2));
405-
406+
waitAtMost(1, SECONDS).until(() ->
407+
FakeModNotify.getSentPatronNotices().stream()
408+
.filter(r -> r.getString("deliveryChannel").equals("mail")).toList(), hasSize(1));
406409
}
407410

408411
@Test

src/test/java/api/support/fixtures/OverdueFinePoliciesFixture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public IndividualResource remindersOneDayBetween(boolean canScheduleRemindersOnC
129129
.withAddedReminderEntry(1, "day", 0.00,
130130
"Email", SECOND_REMINDER_TEMPLATE_ID.toString())
131131
.withAddedReminderEntry(1,"day", 2.15,
132-
"Email", THIRD_REMINDER_TEMPLATE_ID.toString())
132+
"Print", THIRD_REMINDER_TEMPLATE_ID.toString())
133133
.withCanSendReminderUponClosedDay(canScheduleRemindersOnClosedDays)
134134
.withAllowRenewalOfItemsWithReminderFees(true);
135135
return overdueFinePolicyRecordCreator.createIfAbsent(policy.create());

0 commit comments

Comments
 (0)