Skip to content

Commit

Permalink
[MODFEE-337] Mandatory "status" field in "accountdata" schema (#284)
Browse files Browse the repository at this point in the history
* MODFEE-337 make status required in accountdata schema

* MODFEE-337 fix broken tests
  • Loading branch information
roman-barannyk authored Oct 18, 2023
1 parent d99df99 commit 6639d15
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"provides":[
{
"id":"feesfines",
"version":"18.0",
"version": "19.0",
"handlers":[
{
"methods":[
Expand Down
1 change: 1 addition & 0 deletions ramls/accountdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
"required": [
"amount",
"remaining",
"status",
"paymentStatus",
"userId",
"feeFineId",
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/org/folio/rest/impl/FeeFineActionsAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import static org.folio.test.support.EntityBuilder.buildLocation;
import static org.folio.test.support.EntityBuilder.buildUser;
import static org.folio.test.support.matcher.LogEventMatcher.noticeErrorLogRecord;
import static org.folio.test.support.matcher.constant.DbTable.ACCOUNTS_TABLE;
import static org.folio.test.support.matcher.constant.DbTable.FEE_FINE_ACTIONS_TABLE;
import static org.folio.test.support.matcher.constant.ServicePath.ACCOUNTS_PATH;
import static org.folio.test.support.matcher.constant.ServicePath.CAMPUSES_PATH;
import static org.folio.test.support.matcher.constant.ServicePath.FEEFINES_PATH;
Expand Down Expand Up @@ -72,6 +70,7 @@
import org.folio.rest.jaxrs.model.Location;
import org.folio.rest.jaxrs.model.Owner;
import org.folio.rest.jaxrs.model.PaymentStatus;
import org.folio.rest.jaxrs.model.Status;
import org.folio.rest.jaxrs.model.User;
import org.folio.rest.service.LogEventPublisher.LogEventPayloadType;
import org.folio.test.support.ApiTests;
Expand Down Expand Up @@ -473,6 +472,7 @@ public void postFeefineActionsWithoutPatronNotification() {
.put("materialTypeId", randomId())
.put("feeFineId", feeFineId)
.put("ownerId", ownerId)
.put("status", new Status().withName("Open"))
.put("paymentStatus", new PaymentStatus().withName(OUTSTANDING))
.put("remaining", 10.0)
.put("amount", 10.0));
Expand Down Expand Up @@ -529,6 +529,7 @@ public void postFeeFineActionsChangeStaffInfo() {
.put("materialTypeId", randomId())
.put("feeFineId", feeFineId)
.put("ownerId", ownerId)
.put("status", new Status().withName("Open"))
.put("paymentStatus", new PaymentStatus().withName(OUTSTANDING))
.put("remaining", 10.0)
.put("amount", 10.0));
Expand Down Expand Up @@ -699,6 +700,7 @@ private static Account createAccount(User user, Item item, Feefine feefine, Owne
.withTitle("Account-level title")
.withCallNumber("Account-level call number")
.withLocation("Account-level location")
.withStatus(new Status().withName("Open"))
.withPaymentStatus(new PaymentStatus().withName(PAID_PARTIALLY))
.withFeeFineType(feefine.getFeeFineType())
.withMaterialType("book")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.folio.rest.jaxrs.model.Account;
import org.folio.rest.jaxrs.model.Feefineaction;
import org.folio.rest.jaxrs.model.PaymentStatus;
import org.folio.rest.jaxrs.model.Status;
import org.folio.test.support.ApiTests;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -99,11 +100,12 @@ private static Account buildAccount() {
return new Account()
.withAmount(new MonetaryValue(9.99))
.withRemaining(new MonetaryValue(9.99))
.withStatus(new Status().withName("Open"))
.withPaymentStatus(new PaymentStatus().withName(PaymentStatus.Name.OUTSTANDING))
.withUserId(randomId())
.withFeeFineId(randomId())
.withOwnerId(randomId())
.withId(randomId());
}

}
}

0 comments on commit 6639d15

Please sign in to comment.