Search in sources :

Example 1 with LostItemFeePolicyBuilder

use of api.support.builders.LostItemFeePolicyBuilder in project mod-circulation by folio-org.

the class LostItemFeePoliciesFixture method facultyStandardPolicy.

public LostItemFeePolicyBuilder facultyStandardPolicy() {
    final Period itemAgedLostOverdue = Period.months(12);
    final Period patronBilledAfterAgedLost = Period.months(12);
    return new LostItemFeePolicyBuilder().withName("Undergrad standard").withDescription("This is description for undergrad standard").withItemAgedToLostAfterOverdue(itemAgedLostOverdue).withPatronBilledAfterItemAgedToLost(patronBilledAfterAgedLost).withNoChargeAmountItem().doNotChargeProcessingFeeWhenDeclaredLost().withChargeAmountItemSystem(true).refundProcessingFeeWhenReturned().withReplacedLostItemProcessingFee(true).withReplacementAllowed(true).chargeOverdueFineWhenReturned();
}
Also used : LostItemFeePolicyBuilder(api.support.builders.LostItemFeePolicyBuilder) Period(org.folio.circulation.domain.policy.Period)

Example 2 with LostItemFeePolicyBuilder

use of api.support.builders.LostItemFeePolicyBuilder in project mod-circulation by folio-org.

the class LoanToChargeFeesTest method shouldNotCloseLoanIfSetCostFeeHasToBeCharged.

@Test
void shouldNotCloseLoanIfSetCostFeeHasToBeCharged() {
    val lostItemPolicy = new LostItemFeePolicyBuilder().billPatronImmediatelyWhenAgedToLost().withSetCost(11.00);
    assertFalse(loanForLostItemPolicy(lostItemPolicy).shouldCloseLoan());
}
Also used : lombok.val(lombok.val) LostItemFeePolicyBuilder(api.support.builders.LostItemFeePolicyBuilder) Test(org.junit.jupiter.api.Test)

Example 3 with LostItemFeePolicyBuilder

use of api.support.builders.LostItemFeePolicyBuilder in project mod-circulation by folio-org.

the class LoanToChargeFeesTest method shouldNotCloseLoanIfActualCostFeeHasToBeCharged.

@Test
void shouldNotCloseLoanIfActualCostFeeHasToBeCharged() {
    val lostItemPolicy = new LostItemFeePolicyBuilder().billPatronImmediatelyWhenAgedToLost().withActualCost(11.00);
    assertFalse(loanForLostItemPolicy(lostItemPolicy).shouldCloseLoan());
}
Also used : lombok.val(lombok.val) LostItemFeePolicyBuilder(api.support.builders.LostItemFeePolicyBuilder) Test(org.junit.jupiter.api.Test)

Example 4 with LostItemFeePolicyBuilder

use of api.support.builders.LostItemFeePolicyBuilder in project mod-circulation by folio-org.

the class LoanToChargeFeesTest method shouldNotCloseLoanIfProcessingFeeHasToBeCharged.

@Test
void shouldNotCloseLoanIfProcessingFeeHasToBeCharged() {
    val lostItemPolicy = new LostItemFeePolicyBuilder().billPatronImmediatelyWhenAgedToLost().chargeProcessingFeeWhenAgedToLost(10.00);
    assertFalse(loanForLostItemPolicy(lostItemPolicy).shouldCloseLoan());
}
Also used : lombok.val(lombok.val) LostItemFeePolicyBuilder(api.support.builders.LostItemFeePolicyBuilder) Test(org.junit.jupiter.api.Test)

Example 5 with LostItemFeePolicyBuilder

use of api.support.builders.LostItemFeePolicyBuilder in project mod-circulation by folio-org.

the class LoanToChargeFeesTest method shouldCloseLoanIfNoFeesToChargeForDelayedBilling.

@Test
void shouldCloseLoanIfNoFeesToChargeForDelayedBilling() {
    val lostItemPolicy = new LostItemFeePolicyBuilder().withPatronBilledAfterItemAgedToLost(Period.minutes(1));
    assertTrue(loanForLostItemPolicy(lostItemPolicy).shouldCloseLoan());
}
Also used : lombok.val(lombok.val) LostItemFeePolicyBuilder(api.support.builders.LostItemFeePolicyBuilder) Test(org.junit.jupiter.api.Test)

Aggregations

LostItemFeePolicyBuilder (api.support.builders.LostItemFeePolicyBuilder)34 Test (org.junit.jupiter.api.Test)23 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)19 ZonedDateTime (java.time.ZonedDateTime)12 ClockUtil.getZonedDateTime (org.folio.circulation.support.utils.ClockUtil.getZonedDateTime)10 Period (org.folio.circulation.domain.policy.Period)9 IndividualResource (api.support.http.IndividualResource)8 UUID (java.util.UUID)8 NoticePolicyBuilder (api.support.builders.NoticePolicyBuilder)6 lombok.val (lombok.val)6 AgeToLostResult (api.support.fixtures.AgeToLostFixture.AgeToLostResult)5 JsonObject (io.vertx.core.json.JsonObject)5 LoanPolicyBuilder (api.support.builders.LoanPolicyBuilder)4 OverdueFinePolicyBuilder (api.support.builders.OverdueFinePolicyBuilder)4 CsvSource (org.junit.jupiter.params.provider.CsvSource)4 DeclareItemLostRequestBuilder (api.support.builders.DeclareItemLostRequestBuilder)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)3 ValueSource (org.junit.jupiter.params.provider.ValueSource)3 NoticeConfigurationBuilder (api.support.builders.NoticeConfigurationBuilder)2 NullSource (org.junit.jupiter.params.provider.NullSource)2