Search in sources :

Example 31 with Period

use of org.folio.circulation.domain.policy.Period in project mod-circulation by folio-org.

the class OverduePeriodCalculatorServiceTest method createLoanPolicy.

private static LoanPolicy createLoanPolicy(Integer gracePeriodDuration, String gracePeriodInterval) {
    LoanPolicyBuilder builder = new LoanPolicyBuilder();
    if (ObjectUtils.allNotNull(gracePeriodDuration, gracePeriodInterval)) {
        Period gracePeriod = Period.from(gracePeriodDuration, gracePeriodInterval);
        builder = builder.withGracePeriod(gracePeriod);
    }
    return LoanPolicy.from(builder.create());
}
Also used : Period(org.folio.circulation.domain.policy.Period) LoanPolicyBuilder(api.support.builders.LoanPolicyBuilder)

Example 32 with Period

use of org.folio.circulation.domain.policy.Period in project mod-circulation by folio-org.

the class OverdueFineScheduledNoticesProcessingTests method assertThatScheduledNoticeExists.

private void assertThatScheduledNoticeExists(TriggeringEvent triggeringEvent, NoticeTiming timing, Boolean recurring, ZonedDateTime nextRunTime) {
    Period expectedRecurringPeriod = recurring ? RECURRING_PERIOD : null;
    assertThat(scheduledNoticesClient.getAll(), hasItems(hasScheduledFeeFineNotice(actionId, loanId, userId, TEMPLATE_IDS.get(timing), triggeringEvent, nextRunTime, timing, expectedRecurringPeriod, true)));
}
Also used : Period(org.folio.circulation.domain.policy.Period)

Example 33 with Period

use of org.folio.circulation.domain.policy.Period in project mod-circulation by folio-org.

the class LostItemFeePoliciesFixture method chargeFeePolicy.

private LostItemFeePolicyBuilder chargeFeePolicy(double lostItemFeeCost, double lostItemProcessingFeeCost) {
    Period itemAgedLostOverdue = Period.months(12);
    Period patronBilledAfterAgedLost = Period.months(12);
    return new LostItemFeePolicyBuilder().withName("No lost item fees policy").withItemAgedToLostAfterOverdue(itemAgedLostOverdue).withPatronBilledAfterItemAgedToLost(patronBilledAfterAgedLost).withSetCost(lostItemFeeCost).chargeProcessingFeeWhenDeclaredLost(lostItemProcessingFeeCost).withChargeAmountItemSystem(true).refundProcessingFeeWhenReturned().withReplacedLostItemProcessingFee(true).withReplacementAllowed(true).chargeOverdueFineWhenReturned();
}
Also used : LostItemFeePolicyBuilder(api.support.builders.LostItemFeePolicyBuilder) Period(org.folio.circulation.domain.policy.Period)

Aggregations

Period (org.folio.circulation.domain.policy.Period)33 ZonedDateTime (java.time.ZonedDateTime)25 Test (org.junit.jupiter.api.Test)17 ClockUtil.getZonedDateTime (org.folio.circulation.support.utils.ClockUtil.getZonedDateTime)16 IndividualResource (api.support.http.IndividualResource)15 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)15 JsonObject (io.vertx.core.json.JsonObject)14 NoticeConfigurationBuilder (api.support.builders.NoticeConfigurationBuilder)10 NoticePolicyBuilder (api.support.builders.NoticePolicyBuilder)10 LostItemFeePolicyBuilder (api.support.builders.LostItemFeePolicyBuilder)9 UUID (java.util.UUID)9 CsvSource (org.junit.jupiter.params.provider.CsvSource)8 LoanPolicyBuilder (api.support.builders.LoanPolicyBuilder)7 RequestBuilder (api.support.builders.RequestBuilder)5 CheckOutByBarcodeRequestBuilder (api.support.builders.CheckOutByBarcodeRequestBuilder)4 ItemResource (api.support.http.ItemResource)3 NOTICE (org.folio.circulation.domain.representations.logs.LogEventType.NOTICE)3 NOTICE_ERROR (org.folio.circulation.domain.representations.logs.LogEventType.NOTICE_ERROR)3 APITests (api.support.APITests)2 UserBuilder (api.support.builders.UserBuilder)2