diff --git a/ramls/acq-models b/ramls/acq-models index 0aa7610b..0bcdf73c 160000 --- a/ramls/acq-models +++ b/ramls/acq-models @@ -1 +1 @@ -Subproject commit 0aa7610b631c394b87656435fd60d2a19750763f +Subproject commit 0bcdf73cb9dbedd0ce615e687c8c97a316e180a6 diff --git a/ramls/fund_update_log.raml b/ramls/fund_update_log.raml index 8f091177..06ba6f42 100644 --- a/ramls/fund_update_log.raml +++ b/ramls/fund_update_log.raml @@ -38,7 +38,7 @@ resourceTypes: get: description: Get list of fund update logs is: [ - searchable: {description: "with valid searchable fields: for example jobName", example: "[\"jobName\", \"allocation update\", \"=\"]"}, + searchable: {description: "with valid searchable fields: for example jobName", example: "[\"jobName\", \"fund update\", \"=\"]"}, pageable ] /{id}: diff --git a/src/main/resources/templates/db_scripts/schema.json b/src/main/resources/templates/db_scripts/schema.json index 4d63570e..06481767 100644 --- a/src/main/resources/templates/db_scripts/schema.json +++ b/src/main/resources/templates/db_scripts/schema.json @@ -681,7 +681,8 @@ { "tableName": "fund_update_log", "fromModuleVersion": "mod-finance-storage-8.7.0", - "withMetadata": true + "withMetadata": true, + "withOptimisticLocking": "failOnConflict" } ] } diff --git a/src/test/java/org/folio/rest/impl/EntitiesCrudTest.java b/src/test/java/org/folio/rest/impl/EntitiesCrudTest.java index 9dc3cedd..320f12b9 100644 --- a/src/test/java/org/folio/rest/impl/EntitiesCrudTest.java +++ b/src/test/java/org/folio/rest/impl/EntitiesCrudTest.java @@ -7,6 +7,7 @@ import static org.folio.rest.utils.TestEntities.FISCAL_YEAR; import static org.folio.rest.utils.TestEntities.FUND; import static org.folio.rest.utils.TestEntities.FUND_TYPE; +import static org.folio.rest.utils.TestEntities.FUND_UPDATE_LOG; import static org.folio.rest.utils.TestEntities.GROUP; import static org.folio.rest.utils.TestEntities.GROUP_FUND_FY; import static org.folio.rest.utils.TestEntities.LEDGER; @@ -51,7 +52,7 @@ public class EntitiesCrudTest extends TestBase { */ static Stream deleteOrder() { return Stream.of(GROUP_FUND_FY, BUDGET_EXPENSE_CLASS, BUDGET, LEDGER_FISCAL_YEAR_ROLLOVER_ERROR, - LEDGER_FISCAL_YEAR_ROLLOVER, FUND, FUND_TYPE, LEDGER, FISCAL_YEAR, GROUP, EXPENSE_CLASS); + LEDGER_FISCAL_YEAR_ROLLOVER, FUND, FUND_TYPE, LEDGER, FISCAL_YEAR, GROUP, EXPENSE_CLASS, FUND_UPDATE_LOG); } static Stream deleteFailOrder() { diff --git a/src/test/java/org/folio/rest/utils/TestEntities.java b/src/test/java/org/folio/rest/utils/TestEntities.java index ec6a055d..0f180f16 100644 --- a/src/test/java/org/folio/rest/utils/TestEntities.java +++ b/src/test/java/org/folio/rest/utils/TestEntities.java @@ -18,8 +18,8 @@ public enum TestEntities { LEDGER_FISCAL_YEAR_ROLLOVER(HelperUtils.getEndpoint(FinanceStorageLedgerRollovers.class), LedgerFiscalYearRollover.class, "data/ledger-fiscal-year-rollovers/", "main-library.json", "restrictEncumbrance", "true", 0, true), LEDGER_FISCAL_YEAR_ROLLOVER_LOG(HelperUtils.getEndpoint(FinanceStorageLedgerRolloversLogs.class), LedgerFiscalYearRolloverLog.class, null, null, null, null, 0, false), LEDGER_FISCAL_YEAR_ROLLOVER_PROGRESS(HelperUtils.getEndpoint(FinanceStorageLedgerRolloversProgress.class), LedgerFiscalYearRolloverProgress.class, "data/ledger-fiscal-year-rollovers/", "main-library-progress.json", "financialRolloverStatus", "Success", 0, false), - LEDGER_FISCAL_YEAR_ROLLOVER_ERROR(HelperUtils.getEndpoint(FinanceStorageLedgerRolloversErrors.class), LedgerFiscalYearRolloverError.class, "data/ledger-fiscal-year-rollovers/", "main-library-errors.json", "errorType", "Fund", 0, false); - + LEDGER_FISCAL_YEAR_ROLLOVER_ERROR(HelperUtils.getEndpoint(FinanceStorageLedgerRolloversErrors.class), LedgerFiscalYearRolloverError.class, "data/ledger-fiscal-year-rollovers/", "main-library-errors.json", "errorType", "Fund", 0, false), + FUND_UPDATE_LOG(HelperUtils.getEndpoint(FinanceStorageFundUpdateLogs.class), FundUpdateLog.class, "data/fund-update-log/", "monthly-fund-update.json", "jobName", "Weekly Fund Update", 0, true); TestEntities(String endpoint, Class clazz, String pathToSamples, String sampleFileName, String updatedFieldName, String updatedFieldValue, int initialQuantity, boolean isOptLockingEnabled) { diff --git a/src/test/resources/data/fund-update-log/monthly-fund-update.json b/src/test/resources/data/fund-update-log/monthly-fund-update.json new file mode 100644 index 00000000..a8799d3b --- /dev/null +++ b/src/test/resources/data/fund-update-log/monthly-fund-update.json @@ -0,0 +1,12 @@ +{ + "id": "123e4567-e89b-12d3-a456-426614174000", + "jobNumber": 1, + "jobName": "Monthly Fund Update", + "jobDetails": { + "description": "Updating fund details for the month", + "startTime": "2023-10-01T00:00:00Z", + "endTime": "2023-10-01T01:00:00Z" + }, + "status": "COMPLETED", + "recordsCount": 100 +}