From f9371d6d4939850a36c4d6753f876f3ed2166a15 Mon Sep 17 00:00:00 2001 From: Antony Hruschev Date: Fri, 25 Oct 2024 19:58:17 +0400 Subject: [PATCH] CIRCSTORE-536: Upgrade to RMB v35.3.0 (#493) Upgrade to RMB v35.3.0 (#493) --- .github/workflows/postgres.yml | 26 +++++++++ pom.xml | 9 +++- ramls/actual-cost-record-storage.raml | 3 -- ramls/cancellation-reason.raml | 2 - ramls/check-in-storage.raml | 1 - ramls/circulation-settings-storage.raml | 1 - ramls/fixed-due-date-schedule.raml | 2 - ramls/loan-policy-storage.raml | 2 - ramls/loan-storage.raml | 2 - ramls/patron-action-session.raml | 1 - ramls/raml-util | 2 +- ramls/request-policy-storage.raml | 2 - ramls/request-preference-storage.raml | 1 - ramls/request-storage.raml | 2 - ramls/scheduled-notice-storage.raml | 1 - ramls/staff-slips.raml | 2 - ramls/tlr-feature-toggle-job.raml | 2 - .../folio/rest/impl/ActualCostRecordAPI.java | 18 +++---- .../rest/impl/CancellationReasonsAPI.java | 35 ++++++------ .../folio/rest/impl/CheckInStorageAPI.java | 15 +++--- .../org/folio/rest/impl/CheckOutLockAPI.java | 3 +- .../rest/impl/CirculationSettingsAPI.java | 15 +++--- .../rest/impl/FixedDueDateSchedulesAPI.java | 52 ++++++------------ .../org/folio/rest/impl/LoanPoliciesAPI.java | 42 +++++---------- .../java/org/folio/rest/impl/LoansAPI.java | 54 ++++++------------- .../rest/impl/PatronActionSessionAPI.java | 16 +++--- .../rest/impl/PatronNoticePoliciesAPI.java | 10 ++-- .../folio/rest/impl/RequestPoliciesAPI.java | 22 +++++--- .../rest/impl/RequestPreferencesAPI.java | 25 +++++++-- .../java/org/folio/rest/impl/RequestsAPI.java | 45 +++++----------- .../folio/rest/impl/ScheduledNoticesAPI.java | 39 +++++--------- .../org/folio/rest/impl/StaffSlipsAPI.java | 24 +++++---- .../rest/impl/TlrFeatureToggleJobAPI.java | 16 +++--- 33 files changed, 213 insertions(+), 279 deletions(-) create mode 100644 .github/workflows/postgres.yml diff --git a/.github/workflows/postgres.yml b/.github/workflows/postgres.yml new file mode 100644 index 000000000..9a1470bd6 --- /dev/null +++ b/.github/workflows/postgres.yml @@ -0,0 +1,26 @@ +name: postgres +on: + workflow_dispatch: + inputs: + postgres: + description: "List of postgres container images, to be injected as TESTCONTAINERS_POSTGRES_IMAGE" + default: '["postgres:16-alpine", "postgres:18-alpine"]' +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + postgres: ${{ fromJSON(github.event.inputs.postgres) }} + fail-fast: false + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + cache: maven + - run: mvn --batch-mode verify + env: + TESTCONTAINERS_POSTGRES_IMAGE: ${{ matrix.postgres }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 0a4a9b26e..f88037b7b 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ UTF-8 ${basedir}/ramls 4.5.9 - 35.2.0 + 35.3.0 6.1.5 @@ -181,7 +181,12 @@ org.apache.commons commons-lang3 - 3.12.0 + 3.17.0 + + + commons-io + commons-io + 2.17.0 org.apache.logging.log4j diff --git a/ramls/actual-cost-record-storage.raml b/ramls/actual-cost-record-storage.raml index d20ea5e04..02776e67c 100644 --- a/ramls/actual-cost-record-storage.raml +++ b/ramls/actual-cost-record-storage.raml @@ -15,7 +15,6 @@ types: parameters: !include raml-util/schemas/parameters.schema traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml @@ -55,5 +54,3 @@ resourceTypes: is: [validate] delete: description: "Delete actual cost record" - is: [language] - diff --git a/ramls/cancellation-reason.raml b/ramls/cancellation-reason.raml index c4e005ae2..979dacd1b 100644 --- a/ramls/cancellation-reason.raml +++ b/ramls/cancellation-reason.raml @@ -15,7 +15,6 @@ types: parameters: !include raml-util/schemas/parameters.schema traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml @@ -48,7 +47,6 @@ resourceTypes: 501: description: "Not implemented yet" delete: - is: [language] responses: 204: description: "All cancellation reasons deleted" diff --git a/ramls/check-in-storage.raml b/ramls/check-in-storage.raml index be384f885..c3ca6eab7 100644 --- a/ramls/check-in-storage.raml +++ b/ramls/check-in-storage.raml @@ -15,7 +15,6 @@ types: check-ins: !include check-ins.json traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml diff --git a/ramls/circulation-settings-storage.raml b/ramls/circulation-settings-storage.raml index 7f87a73e9..75a0175f8 100644 --- a/ramls/circulation-settings-storage.raml +++ b/ramls/circulation-settings-storage.raml @@ -9,7 +9,6 @@ documentation: content: Storage for circulation settings traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml diff --git a/ramls/fixed-due-date-schedule.raml b/ramls/fixed-due-date-schedule.raml index 7896bc952..093819b2f 100644 --- a/ramls/fixed-due-date-schedule.raml +++ b/ramls/fixed-due-date-schedule.raml @@ -16,7 +16,6 @@ types: parameters: !include raml-util/schemas/parameters.schema traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml @@ -49,7 +48,6 @@ resourceTypes: 501: description: "Not implemented yet" delete: - is: [language] responses: 204: description: "All fixed due date schedules deleted" diff --git a/ramls/loan-policy-storage.raml b/ramls/loan-policy-storage.raml index a5aaf1ca7..58927202b 100644 --- a/ramls/loan-policy-storage.raml +++ b/ramls/loan-policy-storage.raml @@ -14,7 +14,6 @@ types: errors: !include raml-util/schemas/errors.schema traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml @@ -46,7 +45,6 @@ resourceTypes: 501: description: "Not implemented yet" delete: - is: [language] responses: 204: description: "All loans deleted" diff --git a/ramls/loan-storage.raml b/ramls/loan-storage.raml index 0f49b5886..23a325360 100644 --- a/ramls/loan-storage.raml +++ b/ramls/loan-storage.raml @@ -19,7 +19,6 @@ types: anonymize-loans-request: !include anonymize-storage-loans-request.json traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml @@ -49,7 +48,6 @@ resourceTypes: post: is: [validate] delete: - is: [language] responses: 204: description: "All loans deleted" diff --git a/ramls/patron-action-session.raml b/ramls/patron-action-session.raml index ab906a45c..a6ae94cf0 100644 --- a/ramls/patron-action-session.raml +++ b/ramls/patron-action-session.raml @@ -17,7 +17,6 @@ types: traits: pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml - language: !include raml-util/traits/language.raml validate: !include raml-util/traits/validation.raml resourceTypes: diff --git a/ramls/raml-util b/ramls/raml-util index 0b1259759..f48a63f3e 160000 --- a/ramls/raml-util +++ b/ramls/raml-util @@ -1 +1 @@ -Subproject commit 0b125975982df99324c88c200d50abe2b22f7688 +Subproject commit f48a63f3e45b9a3b437d21c3a61ed10b8ceb5f25 diff --git a/ramls/request-policy-storage.raml b/ramls/request-policy-storage.raml index 331caa775..409095f27 100644 --- a/ramls/request-policy-storage.raml +++ b/ramls/request-policy-storage.raml @@ -16,7 +16,6 @@ types: errors: !include raml-util/schemas/errors.schema traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml @@ -62,7 +61,6 @@ resourceTypes: text/plain: example: "Internal server error, contact administrator" delete: - is: [language] responses: 204: description: "All request policies deleted" diff --git a/ramls/request-preference-storage.raml b/ramls/request-preference-storage.raml index b830e9238..fa4eb8d4c 100644 --- a/ramls/request-preference-storage.raml +++ b/ramls/request-preference-storage.raml @@ -14,7 +14,6 @@ types: errors: !include raml-util/schemas/errors.schema traits: - language: !include raml-util/traits/language.raml validate: !include raml-util/traits/validation.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml diff --git a/ramls/request-storage.raml b/ramls/request-storage.raml index 90577772d..cf32c0fc7 100644 --- a/ramls/request-storage.raml +++ b/ramls/request-storage.raml @@ -15,7 +15,6 @@ types: parameters: !include raml-util/schemas/parameters.schema traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml @@ -47,7 +46,6 @@ resourceTypes: 501: description: "Not implemented yet" delete: - is: [language] responses: 204: description: "All requests deleted" diff --git a/ramls/scheduled-notice-storage.raml b/ramls/scheduled-notice-storage.raml index 3583dc6e0..ded70a266 100644 --- a/ramls/scheduled-notice-storage.raml +++ b/ramls/scheduled-notice-storage.raml @@ -15,7 +15,6 @@ types: parameters: !include raml-util/schemas/parameters.schema traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml diff --git a/ramls/staff-slips.raml b/ramls/staff-slips.raml index b15fabbb1..67d6d300e 100644 --- a/ramls/staff-slips.raml +++ b/ramls/staff-slips.raml @@ -15,7 +15,6 @@ types: parameters: !include raml-util/schemas/parameters.schema traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml @@ -46,7 +45,6 @@ resourceTypes: 501: description: "Not implemented yet" delete: - is: [language] responses: 500: description: "Internal server error, e.g. due to misconfiguration" diff --git a/ramls/tlr-feature-toggle-job.raml b/ramls/tlr-feature-toggle-job.raml index 2e4945a68..009901544 100644 --- a/ramls/tlr-feature-toggle-job.raml +++ b/ramls/tlr-feature-toggle-job.raml @@ -17,7 +17,6 @@ types: kvConfiguration: !include kv-configuration.json traits: - language: !include raml-util/traits/language.raml pageable: !include raml-util/traits/pageable.raml searchable: !include raml-util/traits/searchable.raml validate: !include raml-util/traits/validation.raml @@ -57,7 +56,6 @@ resourceTypes: is: [validate] delete: description: "Removes TLR feature toggle job" - is: [language] /tlr-feature-toggle-job/start: post: responses: diff --git a/src/main/java/org/folio/rest/impl/ActualCostRecordAPI.java b/src/main/java/org/folio/rest/impl/ActualCostRecordAPI.java index 2d01469c8..ca3590c15 100644 --- a/src/main/java/org/folio/rest/impl/ActualCostRecordAPI.java +++ b/src/main/java/org/folio/rest/impl/ActualCostRecordAPI.java @@ -17,16 +17,16 @@ public class ActualCostRecordAPI implements ActualCostRecordStorage { - public void getActualCostRecordStorageActualCostRecords(int offset, int limit, String query, - String lang, Map okapiHeaders, Handler> asyncResultHandler, - Context vertxContext) { + public void getActualCostRecordStorageActualCostRecords(String totalRecords, int offset, + int limit, String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { PgUtil.get(ACTUAL_COST_RECORD_TABLE, ACTUAL_COST_RECORD_CLASS, ActualCostRecords.class, query, offset, limit, okapiHeaders, vertxContext, GetActualCostRecordStorageActualCostRecordsResponse.class, asyncResultHandler); } - public void postActualCostRecordStorageActualCostRecords(String lang, ActualCostRecord entity, + public void postActualCostRecordStorageActualCostRecords(ActualCostRecord entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { @@ -34,7 +34,7 @@ public void postActualCostRecordStorageActualCostRecords(String lang, ActualCost PostActualCostRecordStorageActualCostRecordsResponse.class, asyncResultHandler); } - public void getActualCostRecordStorageActualCostRecordsById(String id, String lang, + public void getActualCostRecordStorageActualCostRecordsById(String id, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { @@ -43,16 +43,16 @@ public void getActualCostRecordStorageActualCostRecordsById(String id, String la asyncResultHandler); } - public void putActualCostRecordStorageActualCostRecordsById(String id, String lang, - ActualCostRecord entity, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + public void putActualCostRecordStorageActualCostRecordsById(String id, ActualCostRecord entity, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { PgUtil.put(ACTUAL_COST_RECORD_TABLE, entity, id, okapiHeaders, vertxContext, PutActualCostRecordStorageActualCostRecordsByIdResponse.class, asyncResultHandler); } - public void deleteActualCostRecordStorageActualCostRecordsById(String id, String lang, + public void deleteActualCostRecordStorageActualCostRecordsById(String id, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { diff --git a/src/main/java/org/folio/rest/impl/CancellationReasonsAPI.java b/src/main/java/org/folio/rest/impl/CancellationReasonsAPI.java index 5b932d284..cd93b9737 100644 --- a/src/main/java/org/folio/rest/impl/CancellationReasonsAPI.java +++ b/src/main/java/org/folio/rest/impl/CancellationReasonsAPI.java @@ -43,10 +43,8 @@ private String getErrorResponse(String response) { @Override @Validate - public void deleteCancellationReasonStorageCancellationReasons(String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void deleteCancellationReasonStorageCancellationReasons(Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { try { String tenantId = okapiHeaders.get(TENANT_HEADER); String deleteAllQuery = String.format("DELETE FROM %s_%s.%s", tenantId, @@ -74,9 +72,10 @@ public void deleteCancellationReasonStorageCancellationReasons(String lang, @Override @Validate - public void getCancellationReasonStorageCancellationReasons(int offset, - int limit, String query, String lang, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + public void getCancellationReasonStorageCancellationReasons(String totalRecords, int offset, + int limit, String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { + PgUtil.get(TABLE_NAME, CancellationReason.class, CancellationReasons.class, query, offset, limit, okapiHeaders, vertxContext, GetCancellationReasonStorageCancellationReasonsResponse.class, asyncResultHandler); @@ -84,9 +83,10 @@ public void getCancellationReasonStorageCancellationReasons(int offset, @Override @Validate - public void postCancellationReasonStorageCancellationReasons(String lang, - CancellationReason entity, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + public void postCancellationReasonStorageCancellationReasons(CancellationReason entity, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { + PgUtil.post(TABLE_NAME, entity, okapiHeaders, vertxContext, PostCancellationReasonStorageCancellationReasonsResponse.class, asyncResultHandler); } @@ -94,8 +94,9 @@ public void postCancellationReasonStorageCancellationReasons(String lang, @Override @Validate public void getCancellationReasonStorageCancellationReasonsByCancellationReasonId( - String cancellationReasonId, String lang, Map okapiHeaders, + String cancellationReasonId, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + PgUtil.getById(TABLE_NAME, CancellationReason.class, cancellationReasonId, okapiHeaders, vertxContext, GetCancellationReasonStorageCancellationReasonsByCancellationReasonIdResponse.class, asyncResultHandler); } @@ -103,8 +104,9 @@ public void getCancellationReasonStorageCancellationReasonsByCancellationReasonI @Override @Validate public void deleteCancellationReasonStorageCancellationReasonsByCancellationReasonId( - String cancellationReasonId, String lang, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + String cancellationReasonId, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { + PgUtil.deleteById(TABLE_NAME, cancellationReasonId, okapiHeaders, vertxContext, DeleteCancellationReasonStorageCancellationReasonsByCancellationReasonIdResponse.class, asyncResultHandler); } @@ -112,10 +114,9 @@ public void deleteCancellationReasonStorageCancellationReasonsByCancellationReas @Override @Validate public void putCancellationReasonStorageCancellationReasonsByCancellationReasonId( - String cancellationReasonId, String lang, CancellationReason entity, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + String cancellationReasonId, CancellationReason entity, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { + PgUtil.put(TABLE_NAME, entity, cancellationReasonId, okapiHeaders, vertxContext, PutCancellationReasonStorageCancellationReasonsByCancellationReasonIdResponse.class, asyncResultHandler); } diff --git a/src/main/java/org/folio/rest/impl/CheckInStorageAPI.java b/src/main/java/org/folio/rest/impl/CheckInStorageAPI.java index 5b096c150..ebf20e261 100644 --- a/src/main/java/org/folio/rest/impl/CheckInStorageAPI.java +++ b/src/main/java/org/folio/rest/impl/CheckInStorageAPI.java @@ -17,9 +17,9 @@ public class CheckInStorageAPI implements CheckInStorageCheckIns { @Validate @Override - public void getCheckInStorageCheckIns( - int offset, int limit, String query, String lang, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + public void getCheckInStorageCheckIns(String totalRecords, int offset, int limit, String query, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { new CheckInService(vertxContext, okapiHeaders).findByQuery(query, offset, limit) .onComplete(asyncResultHandler); @@ -27,8 +27,7 @@ public void getCheckInStorageCheckIns( @Validate @Override - public void postCheckInStorageCheckIns( - String lang, CheckIn entity, Map okapiHeaders, + public void postCheckInStorageCheckIns(CheckIn entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new CheckInService(vertxContext, okapiHeaders).create(entity) @@ -37,9 +36,9 @@ public void postCheckInStorageCheckIns( @Validate @Override - public void getCheckInStorageCheckInsByCheckInId( - String checkInId, String lang, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + public void getCheckInStorageCheckInsByCheckInId(String checkInId, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { new CheckInService(vertxContext, okapiHeaders).findById(checkInId) .onComplete(asyncResultHandler); diff --git a/src/main/java/org/folio/rest/impl/CheckOutLockAPI.java b/src/main/java/org/folio/rest/impl/CheckOutLockAPI.java index e76950a5e..39153e500 100644 --- a/src/main/java/org/folio/rest/impl/CheckOutLockAPI.java +++ b/src/main/java/org/folio/rest/impl/CheckOutLockAPI.java @@ -155,8 +155,7 @@ public void deleteCheckOutLockStorageByLockId(String lockId, Map }); } - private String getLocksSqlWithQueryParams(String tenantId, String userId, int offset, - int limit) { + private String getLocksSqlWithQueryParams(String tenantId, String userId, int offset, int limit) { return String.format("select * from %s.%s where user_id = '%s' OFFSET '%s' LIMIT '%s'", convertToPsqlStandard(tenantId), CHECK_OUT_LOCK_TABLE, userId, offset, limit); diff --git a/src/main/java/org/folio/rest/impl/CirculationSettingsAPI.java b/src/main/java/org/folio/rest/impl/CirculationSettingsAPI.java index a70809f2e..86dda0e09 100644 --- a/src/main/java/org/folio/rest/impl/CirculationSettingsAPI.java +++ b/src/main/java/org/folio/rest/impl/CirculationSettingsAPI.java @@ -20,7 +20,7 @@ public class CirculationSettingsAPI implements CirculationSettingsStorage { @Override - public void postCirculationSettingsStorageCirculationSettings(String lang, + public void postCirculationSettingsStorageCirculationSettings( CirculationSetting circulationSettings, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { @@ -33,8 +33,8 @@ public void postCirculationSettingsStorageCirculationSettings(String lang, } @Override - public void getCirculationSettingsStorageCirculationSettings(int offset, - int limit, String query, String lang, Map okapiHeaders, + public void getCirculationSettingsStorageCirculationSettings(String totalRecords, int offset, + int limit, String query, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new CirculationSettingsService(vertxContext, okapiHeaders) @@ -44,7 +44,7 @@ public void getCirculationSettingsStorageCirculationSettings(int offset, @Override public void getCirculationSettingsStorageCirculationSettingsByCirculationSettingsId( - String circulationSettingsId, String lang, Map okapiHeaders, + String circulationSettingsId, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new CirculationSettingsService(vertxContext, okapiHeaders) @@ -54,9 +54,8 @@ public void getCirculationSettingsStorageCirculationSettingsByCirculationSetting @Override public void putCirculationSettingsStorageCirculationSettingsByCirculationSettingsId( - String circulationSettingsId, String lang, CirculationSetting entity, - Map okapiHeaders, Handler> asyncResultHandler, - Context vertxContext) { + String circulationSettingsId, CirculationSetting entity, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { new CirculationSettingsService(vertxContext, okapiHeaders) .update(circulationSettingsId, entity) @@ -65,7 +64,7 @@ public void putCirculationSettingsStorageCirculationSettingsByCirculationSetting @Override public void deleteCirculationSettingsStorageCirculationSettingsByCirculationSettingsId( - String circulationSettingsId, String lang, Map okapiHeaders, + String circulationSettingsId, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new CirculationSettingsService(vertxContext, okapiHeaders) diff --git a/src/main/java/org/folio/rest/impl/FixedDueDateSchedulesAPI.java b/src/main/java/org/folio/rest/impl/FixedDueDateSchedulesAPI.java index de091623a..43b3f391e 100644 --- a/src/main/java/org/folio/rest/impl/FixedDueDateSchedulesAPI.java +++ b/src/main/java/org/folio/rest/impl/FixedDueDateSchedulesAPI.java @@ -34,11 +34,8 @@ public class FixedDueDateSchedulesAPI implements FixedDueDateScheduleStorage { @Override @Validate public void deleteFixedDueDateScheduleStorageFixedDueDateSchedules( - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { String tenantId = okapiHeaders.get(TENANT_HEADER); @@ -74,14 +71,10 @@ public void deleteFixedDueDateScheduleStorageFixedDueDateSchedules( @Override @Validate - public void getFixedDueDateScheduleStorageFixedDueDateSchedules( - int offset, - int limit, - String query, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void getFixedDueDateScheduleStorageFixedDueDateSchedules(String totalRecords, int offset, + int limit, String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { + PgUtil.get(FIXED_SCHEDULE_TABLE, DUE_DATE_SCHEDULE_CLASS, FixedDueDateSchedules.class, query, offset, limit, okapiHeaders, vertxContext, FixedDueDateScheduleStorage.GetFixedDueDateScheduleStorageFixedDueDateSchedulesResponse.class, @@ -90,11 +83,8 @@ public void getFixedDueDateScheduleStorageFixedDueDateSchedules( @Override @Validate - public void postFixedDueDateScheduleStorageFixedDueDateSchedules( - String lang, - FixedDueDateSchedule entity, - Map okapiHeaders, - Handler> asyncResultHandler, + public void postFixedDueDateScheduleStorageFixedDueDateSchedules(FixedDueDateSchedule entity, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { Errors errors = isDateRangeValid(entity.getSchedules()); @@ -113,11 +103,8 @@ public void postFixedDueDateScheduleStorageFixedDueDateSchedules( @Override @Validate public void getFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDateScheduleId( - String fixedDueDateScheduleId, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + String fixedDueDateScheduleId, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { // TODO: do we really need this special check? // A 404 "Not found" from PgUtil.getById without "invalid UUID format" is good enough, isn't it? @@ -135,13 +122,9 @@ public void getFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDateSch @Override @Validate public void deleteFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDateScheduleId( - String fixedDueDateScheduleId, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext - ) { + String fixedDueDateScheduleId, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { + PgUtil.deleteById(FIXED_SCHEDULE_TABLE, fixedDueDateScheduleId, okapiHeaders, vertxContext, DeleteFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDateScheduleIdResponse.class, asyncResultHandler); @@ -150,13 +133,8 @@ public void deleteFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDate @Override @Validate public void putFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDateScheduleId( - String fixedDueDateScheduleId, - String lang, - FixedDueDateSchedule entity, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext - ) { + String fixedDueDateScheduleId, FixedDueDateSchedule entity, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { Errors errors = isDateRangeValid(entity.getSchedules()); if (errors != null){ diff --git a/src/main/java/org/folio/rest/impl/LoanPoliciesAPI.java b/src/main/java/org/folio/rest/impl/LoanPoliciesAPI.java index 671587a51..893920c2b 100644 --- a/src/main/java/org/folio/rest/impl/LoanPoliciesAPI.java +++ b/src/main/java/org/folio/rest/impl/LoanPoliciesAPI.java @@ -26,10 +26,8 @@ public class LoanPoliciesAPI implements LoanPolicyStorage { @Override @Validate - public void deleteLoanPolicyStorageLoanPolicies( - String lang, Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void deleteLoanPolicyStorageLoanPolicies(Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { String tenantId = okapiHeaders.get(TENANT_HEADER); @@ -53,14 +51,9 @@ public void deleteLoanPolicyStorageLoanPolicies( @Override @Validate - public void getLoanPolicyStorageLoanPolicies( - int offset, - int limit, - String query, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void getLoanPolicyStorageLoanPolicies(String totalRecords, int offset, int limit, + String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { PgUtil.get(LOAN_POLICY_TABLE, LOAN_POLICY_CLASS, LoanPolicies.class, query, offset, limit, okapiHeaders, vertxContext, @@ -69,9 +62,7 @@ public void getLoanPolicyStorageLoanPolicies( @Override @Validate - public void postLoanPolicyStorageLoanPolicies( - String lang, LoanPolicy entity, - Map okapiHeaders, + public void postLoanPolicyStorageLoanPolicies(LoanPolicy entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { @@ -82,11 +73,8 @@ public void postLoanPolicyStorageLoanPolicies( @Override @Validate - public void getLoanPolicyStorageLoanPoliciesByLoanPolicyId( - String loanPolicyId, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, + public void getLoanPolicyStorageLoanPoliciesByLoanPolicyId(String loanPolicyId, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { PgUtil.getById(LOAN_POLICY_TABLE, LOAN_POLICY_CLASS, loanPolicyId, okapiHeaders, vertxContext, @@ -95,10 +83,8 @@ public void getLoanPolicyStorageLoanPoliciesByLoanPolicyId( @Override @Validate - public void deleteLoanPolicyStorageLoanPoliciesByLoanPolicyId( - String loanPolicyId, - String lang, Map okapiHeaders, - Handler> asyncResultHandler, + public void deleteLoanPolicyStorageLoanPoliciesByLoanPolicyId(String loanPolicyId, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { PgUtil.deleteById(LOAN_POLICY_TABLE, loanPolicyId, okapiHeaders, vertxContext, @@ -107,12 +93,8 @@ public void deleteLoanPolicyStorageLoanPoliciesByLoanPolicyId( @Override @Validate - public void putLoanPolicyStorageLoanPoliciesByLoanPolicyId( - String loanPolicyId, - String lang, - LoanPolicy entity, - Map okapiHeaders, - Handler> asyncResultHandler, + public void putLoanPolicyStorageLoanPoliciesByLoanPolicyId(String loanPolicyId, LoanPolicy entity, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { validate(entity, errors -> respond422(errors, asyncResultHandler), () -> diff --git a/src/main/java/org/folio/rest/impl/LoansAPI.java b/src/main/java/org/folio/rest/impl/LoansAPI.java index 6ca331ed3..65949d910 100644 --- a/src/main/java/org/folio/rest/impl/LoansAPI.java +++ b/src/main/java/org/folio/rest/impl/LoansAPI.java @@ -17,11 +17,8 @@ public class LoansAPI implements LoanStorage { @Validate @Override - public void deleteLoanStorageLoans( - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void deleteLoanStorageLoans(Map okapiHeaders, + Handler> asyncResultHandler,Context vertxContext) { new LoanService(vertxContext, okapiHeaders).deleteAll() .onComplete(asyncResultHandler); @@ -29,13 +26,8 @@ public void deleteLoanStorageLoans( @Validate @Override - public void getLoanStorageLoans( - int offset, - int limit, - String query, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, + public void getLoanStorageLoans(String totalRecords, int offset, int limit, String query, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new LoanService(vertxContext, okapiHeaders).findByQuery(query, offset, limit) @@ -44,12 +36,8 @@ public void getLoanStorageLoans( @Validate @Override - public void postLoanStorageLoans( - String lang, - Loan loan, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void postLoanStorageLoans(Loan loan, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { new LoanService(vertxContext, okapiHeaders).create(loan) .onComplete(asyncResultHandler); @@ -69,12 +57,8 @@ public void postLoanStorageLoansAnonymizeByUserId( @Validate @Override - public void getLoanStorageLoansByLoanId( - String loanId, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void getLoanStorageLoansByLoanId(String loanId, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { new LoanService(vertxContext, okapiHeaders).findById(loanId) .onComplete(asyncResultHandler); @@ -82,12 +66,8 @@ public void getLoanStorageLoansByLoanId( @Validate @Override - public void deleteLoanStorageLoansByLoanId( - String loanId, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void deleteLoanStorageLoansByLoanId(String loanId, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { new LoanService(vertxContext, okapiHeaders).delete(loanId) .onComplete(asyncResultHandler); @@ -95,12 +75,8 @@ public void deleteLoanStorageLoansByLoanId( @Validate @Override - public void putLoanStorageLoansByLoanId( - String loanId, - String lang, - Loan loan, - Map okapiHeaders, - Handler> asyncResultHandler, + public void putLoanStorageLoansByLoanId(String loanId, Loan loan, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new LoanService(vertxContext, okapiHeaders).createOrUpdate(loanId, loan) @@ -109,9 +85,9 @@ public void putLoanStorageLoansByLoanId( @Validate @Override - public void getLoanStorageLoanHistory(int offset, int limit, String query, String lang, - Map okapiHeaders, Handler> asyncResultHandler, - Context vertxContext) { + public void getLoanStorageLoanHistory(String totalRecords, int offset, int limit, String query, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { new LoanService(vertxContext, okapiHeaders).getLoanHistory(query, offset, limit) .onComplete(asyncResultHandler); diff --git a/src/main/java/org/folio/rest/impl/PatronActionSessionAPI.java b/src/main/java/org/folio/rest/impl/PatronActionSessionAPI.java index 115de576a..c12f35323 100644 --- a/src/main/java/org/folio/rest/impl/PatronActionSessionAPI.java +++ b/src/main/java/org/folio/rest/impl/PatronActionSessionAPI.java @@ -45,8 +45,8 @@ public class PatronActionSessionAPI implements PatronActionSessionStorage { @Validate @Override - public void getPatronActionSessionStoragePatronActionSessions(int offset, - int limit, String query, String lang, Map okapiHeaders, + public void getPatronActionSessionStoragePatronActionSessions(String totalRecords, int offset, + int limit, String query, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { PgUtil.get(PATRON_ACTION_SESSION_TABLE, PatronActionSession.class, PatronActionSessions.class, @@ -56,9 +56,9 @@ public void getPatronActionSessionStoragePatronActionSessions(int offset, @Validate @Override - public void postPatronActionSessionStoragePatronActionSessions( - String lang, PatronActionSession entity, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + public void postPatronActionSessionStoragePatronActionSessions(PatronActionSession entity, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { PgUtil.post(PATRON_ACTION_SESSION_TABLE, entity, okapiHeaders, vertxContext, PostPatronActionSessionStoragePatronActionSessionsResponse.class, asyncResultHandler); @@ -67,7 +67,7 @@ public void postPatronActionSessionStoragePatronActionSessions( @Validate @Override public void getPatronActionSessionStoragePatronActionSessionsByPatronSessionId( - String patronSessionId, String lang, Map okapiHeaders, + String patronSessionId, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { PgUtil.getById(PATRON_ACTION_SESSION_TABLE, PatronActionSession.class, patronSessionId, @@ -78,7 +78,7 @@ public void getPatronActionSessionStoragePatronActionSessionsByPatronSessionId( @Validate @Override public void deletePatronActionSessionStoragePatronActionSessionsByPatronSessionId( - String patronSessionId, String lang, Map okapiHeaders, + String patronSessionId, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { PgUtil.deleteById(PATRON_ACTION_SESSION_TABLE, patronSessionId, okapiHeaders, vertxContext, @@ -146,7 +146,7 @@ private ExpiredSession mapToExpiredSession(Row row){ @Validate @Override public void putPatronActionSessionStoragePatronActionSessionsByPatronSessionId( - String patronSessionId, String lang, PatronActionSession entity, Map okapiHeaders, + String patronSessionId, PatronActionSession entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { PgUtil.put(PATRON_ACTION_SESSION_TABLE, entity, patronSessionId, okapiHeaders, vertxContext, diff --git a/src/main/java/org/folio/rest/impl/PatronNoticePoliciesAPI.java b/src/main/java/org/folio/rest/impl/PatronNoticePoliciesAPI.java index 3297bd2ca..78b423dc6 100644 --- a/src/main/java/org/folio/rest/impl/PatronNoticePoliciesAPI.java +++ b/src/main/java/org/folio/rest/impl/PatronNoticePoliciesAPI.java @@ -72,13 +72,9 @@ public class PatronNoticePoliciesAPI implements PatronNoticePolicyStorage { @Validate @Override - public void getPatronNoticePolicyStoragePatronNoticePolicies( - int offset, - int limit, - String query, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void getPatronNoticePolicyStoragePatronNoticePolicies(String totalRecords, int offset, + int limit, String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { vertxContext.runOnContext(v -> { try { diff --git a/src/main/java/org/folio/rest/impl/RequestPoliciesAPI.java b/src/main/java/org/folio/rest/impl/RequestPoliciesAPI.java index f782fe1f1..62bcae421 100644 --- a/src/main/java/org/folio/rest/impl/RequestPoliciesAPI.java +++ b/src/main/java/org/folio/rest/impl/RequestPoliciesAPI.java @@ -36,7 +36,10 @@ public class RequestPoliciesAPI implements RequestPolicyStorage { @Validate @Override - public void getRequestPolicyStorageRequestPolicies(int offset, int limit, String query, String lang, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void getRequestPolicyStorageRequestPolicies(String totalRecords, int offset, int limit, + String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { + PgUtil.get(REQUEST_POLICY_TABLE, REQUEST_POLICY_CLASS, RequestPolicies.class, query, offset, limit, okapiHeaders, vertxContext, GetRequestPolicyStorageRequestPoliciesResponse.class, asyncResultHandler); @@ -44,7 +47,7 @@ public void getRequestPolicyStorageRequestPolicies(int offset, int limit, String @Validate @Override - public void postRequestPolicyStorageRequestPolicies(String lang, RequestPolicy entity, + public void postRequestPolicyStorageRequestPolicies(RequestPolicy entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { @@ -124,7 +127,8 @@ public void postRequestPolicyStorageRequestPolicies(String lang, RequestPolicy e @Validate @Override - public void deleteRequestPolicyStorageRequestPolicies(String lang, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void deleteRequestPolicyStorageRequestPolicies(Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { String tenantId = okapiHeaders.get(TENANT_HEADER); @@ -150,7 +154,10 @@ public void deleteRequestPolicyStorageRequestPolicies(String lang, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void getRequestPolicyStorageRequestPoliciesByRequestPolicyId(String requestPolicyId, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { + PgUtil.getById(REQUEST_POLICY_TABLE, REQUEST_POLICY_CLASS, requestPolicyId, okapiHeaders, vertxContext, GetRequestPolicyStorageRequestPoliciesByRequestPolicyIdResponse.class, asyncResultHandler); } @@ -158,7 +165,7 @@ public void getRequestPolicyStorageRequestPoliciesByRequestPolicyId(String reque @Validate @Override public void putRequestPolicyStorageRequestPoliciesByRequestPolicyId(String requestPolicyId, - String lang, RequestPolicy entity, Map okapiHeaders, + RequestPolicy entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new RequestPolicyValidationService(vertxContext.owner(), okapiHeaders) @@ -182,7 +189,10 @@ public void putRequestPolicyStorageRequestPoliciesByRequestPolicyId(String reque @Validate @Override - public void deleteRequestPolicyStorageRequestPoliciesByRequestPolicyId(String requestPolicyId, String lang, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void deleteRequestPolicyStorageRequestPoliciesByRequestPolicyId(String requestPolicyId, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { + PgUtil.deleteById(REQUEST_POLICY_TABLE, requestPolicyId, okapiHeaders, vertxContext, DeleteRequestPolicyStorageRequestPoliciesByRequestPolicyIdResponse.class, asyncResultHandler); } diff --git a/src/main/java/org/folio/rest/impl/RequestPreferencesAPI.java b/src/main/java/org/folio/rest/impl/RequestPreferencesAPI.java index a81b1ac24..edb45f0d5 100644 --- a/src/main/java/org/folio/rest/impl/RequestPreferencesAPI.java +++ b/src/main/java/org/folio/rest/impl/RequestPreferencesAPI.java @@ -26,7 +26,10 @@ public class RequestPreferencesAPI implements RequestPreferenceStorage { @Override @Validate - public void getRequestPreferenceStorageRequestPreference(int offset, int limit, String query, String lang, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void getRequestPreferenceStorageRequestPreference(String totalRecords, int offset, + int limit, String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { + PgUtil.get(REQUEST_PREFERENCE_TABLE, RequestPreference.class, RequestPreferences.class, query, offset, limit, okapiHeaders, vertxContext, GetRequestPreferenceStorageRequestPreferenceResponse.class, asyncResultHandler); @@ -34,27 +37,39 @@ public void getRequestPreferenceStorageRequestPreference(int offset, int limit, @Override @Validate - public void postRequestPreferenceStorageRequestPreference(String lang, RequestPreference entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void postRequestPreferenceStorageRequestPreference(RequestPreference entity, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { + PgUtil.post(REQUEST_PREFERENCE_TABLE, entity, okapiHeaders, vertxContext, PostRequestPreferenceStorageRequestPreferenceResponse.class, uniqueUserViolationHandler(entity, asyncResultHandler)); } @Override @Validate - public void getRequestPreferenceStorageRequestPreferenceById(String id, String lang, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void getRequestPreferenceStorageRequestPreferenceById(String id, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { + PgUtil.getById(REQUEST_PREFERENCE_TABLE, RequestPreference.class, id, okapiHeaders, vertxContext, GetRequestPreferenceStorageRequestPreferenceByIdResponse.class, asyncResultHandler); } @Override @Validate - public void deleteRequestPreferenceStorageRequestPreferenceById(String id, String lang, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void deleteRequestPreferenceStorageRequestPreferenceById(String id, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { + PgUtil.deleteById(REQUEST_PREFERENCE_TABLE, id, okapiHeaders, vertxContext, DeleteRequestPreferenceStorageRequestPreferenceByIdResponse.class, asyncResultHandler); } @Override @Validate - public void putRequestPreferenceStorageRequestPreferenceById(String id, String lang, RequestPreference entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void putRequestPreferenceStorageRequestPreferenceById(String id, RequestPreference entity, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { + PgUtil.put(REQUEST_PREFERENCE_TABLE, entity, id, okapiHeaders, vertxContext, PutRequestPreferenceStorageRequestPreferenceByIdResponse.class, uniqueUserViolationHandler(entity, asyncResultHandler)); } diff --git a/src/main/java/org/folio/rest/impl/RequestsAPI.java b/src/main/java/org/folio/rest/impl/RequestsAPI.java index 60b77530a..b82d1c1d8 100644 --- a/src/main/java/org/folio/rest/impl/RequestsAPI.java +++ b/src/main/java/org/folio/rest/impl/RequestsAPI.java @@ -17,11 +17,8 @@ public class RequestsAPI implements RequestStorage { @Validate @Override - public void deleteRequestStorageRequests( - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void deleteRequestStorageRequests(Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { new RequestService(vertxContext, okapiHeaders).deleteAll() .onComplete(asyncResultHandler); @@ -29,13 +26,8 @@ public void deleteRequestStorageRequests( @Validate @Override - public void getRequestStorageRequests( - int offset, - int limit, - String query, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, + public void getRequestStorageRequests(String totalRecords, int offset, int limit, String query, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new RequestService(vertxContext, okapiHeaders).findByQuery(query, offset, limit) @@ -44,12 +36,8 @@ public void getRequestStorageRequests( @Validate @Override - public void postRequestStorageRequests( - String lang, - Request request, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void postRequestStorageRequests(Request request, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { new RequestService(vertxContext, okapiHeaders).create(request) .onComplete(asyncResultHandler); @@ -57,11 +45,8 @@ public void postRequestStorageRequests( @Validate @Override - public void getRequestStorageRequestsByRequestId( - String requestId, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, + public void getRequestStorageRequestsByRequestId(String requestId, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new RequestService(vertxContext, okapiHeaders).findById(requestId) @@ -70,11 +55,8 @@ public void getRequestStorageRequestsByRequestId( @Validate @Override - public void deleteRequestStorageRequestsByRequestId( - String requestId, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, + public void deleteRequestStorageRequestsByRequestId(String requestId, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new RequestService(vertxContext, okapiHeaders).delete(requestId) @@ -83,11 +65,8 @@ public void deleteRequestStorageRequestsByRequestId( @Validate @Override - public void putRequestStorageRequestsByRequestId( - String requestId, - String lang, Request request, - Map okapiHeaders, - Handler> asyncResultHandler, + public void putRequestStorageRequestsByRequestId(String requestId, Request request, + Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { new RequestService(vertxContext, okapiHeaders).createOrUpdate(requestId, request) diff --git a/src/main/java/org/folio/rest/impl/ScheduledNoticesAPI.java b/src/main/java/org/folio/rest/impl/ScheduledNoticesAPI.java index b89cccc4c..bea19b184 100644 --- a/src/main/java/org/folio/rest/impl/ScheduledNoticesAPI.java +++ b/src/main/java/org/folio/rest/impl/ScheduledNoticesAPI.java @@ -38,13 +38,9 @@ public class ScheduledNoticesAPI implements ScheduledNoticeStorage { @Validate @Override - public void getScheduledNoticeStorageScheduledNotices(int offset, - int limit, - String query, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void getScheduledNoticeStorageScheduledNotices(String totalRecords, int offset, int limit, + String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { PgUtil.get(SCHEDULED_NOTICE_TABLE, ScheduledNotice.class, ScheduledNotices.class, query, offset, limit, okapiHeaders, vertxContext, GetScheduledNoticeStorageScheduledNoticesResponse.class, asyncResultHandler); @@ -70,11 +66,10 @@ public void deleteScheduledNoticeStorageScheduledNotices(String query, @Validate @Override - public void postScheduledNoticeStorageScheduledNotices(String lang, - ScheduledNotice entity, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void postScheduledNoticeStorageScheduledNotices(ScheduledNotice entity, + Map okapiHeaders, + Handler> asyncResultHandler, + Context vertxContext) { PgUtil.post(SCHEDULED_NOTICE_TABLE, entity, okapiHeaders, vertxContext, PostScheduledNoticeStorageScheduledNoticesResponse.class, asyncResultHandler); @@ -83,10 +78,8 @@ public void postScheduledNoticeStorageScheduledNotices(String lang, @Validate @Override public void getScheduledNoticeStorageScheduledNoticesByScheduledNoticeId(String scheduledNoticeId, - String lang, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { PgUtil.getById(SCHEDULED_NOTICE_TABLE, ScheduledNotice.class, scheduledNoticeId, okapiHeaders, vertxContext, GetScheduledNoticeStorageScheduledNoticesByScheduledNoticeIdResponse.class, asyncResultHandler); @@ -94,10 +87,9 @@ public void getScheduledNoticeStorageScheduledNoticesByScheduledNoticeId(String @Validate @Override - public void deleteScheduledNoticeStorageScheduledNoticesByScheduledNoticeId(String scheduledNoticeId, - String lang, Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + public void deleteScheduledNoticeStorageScheduledNoticesByScheduledNoticeId( + String scheduledNoticeId, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { PgUtil.deleteById(SCHEDULED_NOTICE_TABLE, scheduledNoticeId, okapiHeaders, vertxContext, DeleteScheduledNoticeStorageScheduledNoticesByScheduledNoticeIdResponse.class, asyncResultHandler); @@ -107,11 +99,8 @@ public void deleteScheduledNoticeStorageScheduledNoticesByScheduledNoticeId(Stri @Validate @Override public void putScheduledNoticeStorageScheduledNoticesByScheduledNoticeId(String scheduledNoticeId, - String lang, - ScheduledNotice entity, - Map okapiHeaders, - Handler> asyncResultHandler, - Context vertxContext) { + ScheduledNotice entity, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { PgUtil.put(SCHEDULED_NOTICE_TABLE, entity, scheduledNoticeId, okapiHeaders, vertxContext, PutScheduledNoticeStorageScheduledNoticesByScheduledNoticeIdResponse.class, asyncResultHandler); diff --git a/src/main/java/org/folio/rest/impl/StaffSlipsAPI.java b/src/main/java/org/folio/rest/impl/StaffSlipsAPI.java index 9dfcfc50b..89d224902 100644 --- a/src/main/java/org/folio/rest/impl/StaffSlipsAPI.java +++ b/src/main/java/org/folio/rest/impl/StaffSlipsAPI.java @@ -27,7 +27,7 @@ public class StaffSlipsAPI implements StaffSlipsStorage { @Validate @Override - public void deleteStaffSlipsStorageStaffSlips(String lang, Map okapiHeaders, + public void deleteStaffSlipsStorageStaffSlips(Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { String tenantId = okapiHeaders.get(TENANT_HEADER); @@ -57,8 +57,9 @@ public void deleteStaffSlipsStorageStaffSlips(String lang, Map o @Validate @Override - public void getStaffSlipsStorageStaffSlips(int offset, int limit, String query, String lang, - Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void getStaffSlipsStorageStaffSlips(String totalRecords, int offset, int limit, + String query, Map okapiHeaders, + Handler> asyncResultHandler, Context vertxContext) { PgUtil.get(STAFF_SLIP_TABLE, STAFF_SLIP_CLASS, StaffSlips.class, query, offset, limit, okapiHeaders, vertxContext, GetStaffSlipsStorageStaffSlipsResponse.class, asyncResultHandler); @@ -66,7 +67,7 @@ public void getStaffSlipsStorageStaffSlips(int offset, int limit, String query, @Validate @Override - public void postStaffSlipsStorageStaffSlips(String lang, StaffSlip entity, Map okapiHeaders, + public void postStaffSlipsStorageStaffSlips(StaffSlip entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { ImmutablePair validationResult = validateStaffSlip(entity); @@ -84,8 +85,9 @@ public void postStaffSlipsStorageStaffSlips(String lang, StaffSlip entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void getStaffSlipsStorageStaffSlipsByStaffSlipId(String staffSlipId, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { PgUtil.getById(STAFF_SLIP_TABLE, STAFF_SLIP_CLASS, staffSlipId, okapiHeaders, vertxContext, GetStaffSlipsStorageStaffSlipsByStaffSlipIdResponse.class, asyncResultHandler); @@ -93,8 +95,9 @@ public void getStaffSlipsStorageStaffSlipsByStaffSlipId(String staffSlipId, Stri @Validate @Override - public void deleteStaffSlipsStorageStaffSlipsByStaffSlipId(String staffSlipId, String lang, - Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void deleteStaffSlipsStorageStaffSlipsByStaffSlipId(String staffSlipId, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { PgUtil.deleteById(STAFF_SLIP_TABLE, staffSlipId, okapiHeaders, vertxContext, DeleteStaffSlipsStorageStaffSlipsByStaffSlipIdResponse.class, asyncResultHandler); @@ -102,8 +105,9 @@ public void deleteStaffSlipsStorageStaffSlipsByStaffSlipId(String staffSlipId, S @Validate @Override - public void putStaffSlipsStorageStaffSlipsByStaffSlipId(String staffSlipId, String lang, StaffSlip entity, - Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { + public void putStaffSlipsStorageStaffSlipsByStaffSlipId(String staffSlipId, StaffSlip entity, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { ImmutablePair validationResult = validateStaffSlip(entity); diff --git a/src/main/java/org/folio/rest/impl/TlrFeatureToggleJobAPI.java b/src/main/java/org/folio/rest/impl/TlrFeatureToggleJobAPI.java index 5c74460af..8c59c1af2 100644 --- a/src/main/java/org/folio/rest/impl/TlrFeatureToggleJobAPI.java +++ b/src/main/java/org/folio/rest/impl/TlrFeatureToggleJobAPI.java @@ -19,8 +19,8 @@ public class TlrFeatureToggleJobAPI implements TlrFeatureToggleJobStorage { @Override - public void getTlrFeatureToggleJobStorageTlrFeatureToggleJobs(int offset, int limit, - String query, String lang, Map okapiHeaders, + public void getTlrFeatureToggleJobStorageTlrFeatureToggleJobs(String totalRecords, int offset, + int limit, String query, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { PgUtil.get(TLR_FEATURE_TOGGLE_JOB_TABLE, TLR_FEATURE_TOGGLE_JOB_CLASS, TlrFeatureToggleJobs.class, @@ -29,16 +29,16 @@ public void getTlrFeatureToggleJobStorageTlrFeatureToggleJobs(int offset, int li } @Override - public void postTlrFeatureToggleJobStorageTlrFeatureToggleJobs(String lang, - TlrFeatureToggleJob entity, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + public void postTlrFeatureToggleJobStorageTlrFeatureToggleJobs(TlrFeatureToggleJob entity, + Map okapiHeaders, Handler> asyncResultHandler, + Context vertxContext) { PgUtil.post(TLR_FEATURE_TOGGLE_JOB_TABLE, entity, okapiHeaders, vertxContext, PostTlrFeatureToggleJobStorageTlrFeatureToggleJobsResponse.class, asyncResultHandler); } @Override - public void getTlrFeatureToggleJobStorageTlrFeatureToggleJobsById(String id, String lang, + public void getTlrFeatureToggleJobStorageTlrFeatureToggleJobsById(String id, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { @@ -48,7 +48,7 @@ public void getTlrFeatureToggleJobStorageTlrFeatureToggleJobsById(String id, Str } @Override - public void putTlrFeatureToggleJobStorageTlrFeatureToggleJobsById(String id, String lang, + public void putTlrFeatureToggleJobStorageTlrFeatureToggleJobsById(String id, TlrFeatureToggleJob entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { @@ -58,7 +58,7 @@ public void putTlrFeatureToggleJobStorageTlrFeatureToggleJobsById(String id, Str } @Override - public void deleteTlrFeatureToggleJobStorageTlrFeatureToggleJobsById(String id, String lang, + public void deleteTlrFeatureToggleJobStorageTlrFeatureToggleJobsById(String id, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) {