From 75e0378c4345f89aa811a6bd842f11bc693377f4 Mon Sep 17 00:00:00 2001 From: siarhei-charniak Date: Fri, 9 Aug 2024 11:46:43 +0300 Subject: [PATCH] MODEXPW-489 --- descriptors/ModuleDescriptor-template.json | 237 +------- .../service/JobCommandsReceiverService.java | 29 - src/main/resources/swagger.api/bulk-edit.yaml | 505 ------------------ .../ItemsContentUpdateTestData.java | 85 --- 4 files changed, 2 insertions(+), 854 deletions(-) delete mode 100644 src/test/java/org/folio/dew/controller/ItemsContentUpdateTestData.java diff --git a/descriptors/ModuleDescriptor-template.json b/descriptors/ModuleDescriptor-template.json index ff9174305..a939e9d38 100644 --- a/descriptors/ModuleDescriptor-template.json +++ b/descriptors/ModuleDescriptor-template.json @@ -146,7 +146,7 @@ "provides": [ { "id": "bulk-edit", - "version": "3.0", + "version": "4.0", "handlers": [ { "methods": [ "POST" ], @@ -210,75 +210,6 @@ "consortium-search.items.collection.get" ] }, - { - "methods": [ "POST" ], - "pathPattern": "/bulk-edit/{id}/item-content-update/upload", - "permissionsRequired": [ "bulk-edit.items-content-update.collection.post" ], - "modulePermissions": [ - "inventory-storage.call-number-types.item.get", - "inventory-storage.call-number-types.collection.get", - "inventory-storage.item-damaged-statuses.item.get", - "inventory-storage.item-damaged-statuses.collection.get", - "inventory-storage.electronic-access-relationships.item.get", - "inventory-storage.electronic-access-relationships.collection.get", - "inventory-storage.item-note-types.item.get", - "inventory-storage.item-note-types.collection.get", - "inventory-storage.service-points.item.get", - "inventory-storage.service-points.collection.get", - "inventory-storage.statistical-codes.item.get", - "inventory-storage.statistical-codes.collection.get", - "inventory-storage.material-types.item.get", - "inventory-storage.material-types.collection.get", - "inventory-storage.loan-types.item.get", - "inventory-storage.loan-types.collection.get", - "inventory-storage.locations.item.get", - "inventory-storage.locations.collection.get", - "inventory-storage.instances.item.get", - "inventory-storage.instances.collection.get", - "inventory-storage.holdings.item.get", - "inventory-storage.holdings.collection.get", - "configuration.entries.collection.get" - ] - }, - { - "methods": [ "POST" ], - "pathPattern": "/bulk-edit/{id}/user-content-update/upload", - "permissionsRequired": [ "bulk-edit.users-content-update.collection.post" ], - "modulePermissions": [ - "users.collection.get", - "users.item.get", - "users.item.put", - "usergroups.item.get", - "addresstypes.item.get", - "proxiesfor.item.get", - "departments.item.get", - "usergroups.collection.get", - "addresstypes.collection.get" - ] - }, - { - "methods": [ "POST" ], - "pathPattern": "/bulk-edit/{id}/holdings-content-update/upload", - "permissionsRequired": [ "bulk-edit.holdings-content-update.collection.post" ], - "modulePermissions": [ - "inventory-storage.instances.item.get", - "inventory-storage.holdings-types.collection.get", - "inventory-storage.holdings-types.item.get", - "inventory-storage.locations.collection.get", - "inventory-storage.locations.item.get", - "inventory-storage.call-number-types.collection.get", - "inventory-storage.call-number-types.item.get", - "inventory-storage.holdings-note-types.collection.get", - "inventory-storage.holdings-note-types.item.get", - "inventory-storage.ill-policies.collection.get", - "inventory-storage.ill-policies.item.get", - "inventory-storage.holdings-sources.collection.get", - "inventory-storage.holdings-sources.item.get", - "inventory-storage.statistical-codes.collection.get", - "inventory-storage.statistical-codes.item.get", - "inventory-storage.electronic-access-relationships.collection.get" - ] - }, { "methods": [ "POST" ], "pathPattern": "/bulk-edit/{id}/start", @@ -331,104 +262,6 @@ "inventory-storage.holdings.item.put" ] }, - { - "methods": [ - "POST" - ], - "pathPattern": "/bulk-edit/{jobId}/roll-back", - "permissionsRequired": [ - "bulk-edit.roll-back.item.post" - ], - "modulePermissions": [ - "users.collection.get", - "users.item.get", - "users.item.put", - "usergroups.item.get", - "addresstypes.item.get", - "proxiesfor.item.get", - "departments.item.get", - "usergroups.collection.get", - "addresstypes.collection.get", - "data-export.job.item.get" - ] - }, - { - "methods": [ "GET" ], - "pathPattern": "/bulk-edit/{jobId}/preview/users", - "permissionsRequired": [ "bulk-edit.preview-users.collection.get" ], - "modulePermissions": [ - "users.collection.get", - "addresstypes.collection.get", - "usergroups.collection.get" - ] - }, - { - "methods": [ "GET" ], - "pathPattern": "/bulk-edit/{jobId}/preview/items", - "permissionsRequired": [ "bulk-edit.preview-items.collection.get" ], - "modulePermissions": [ - "inventory.items.collection.get", - "inventory-storage.material-types.collection.get", - "inventory-storage.statistical-codes.collection.get", - "inventory-storage.item-note-types.collection.get", - "inventory-storage.call-number-types.collection.get", - "inventory-storage.electronic-access-relationships.collection.get", - "inventory-storage.service-points.collection.get", - "users.collection.get", - "inventory-storage.locations.collection.get", - "inventory-storage.loan-types.collection.get", - "inventory-storage.item-damaged-statuses.collection.get", - "inventory-storage.instances.collection.get", - "inventory-storage.holdings.collection.get", - "configuration.entries.collection.get" - ] - }, - { - "methods": [ "GET" ], - "pathPattern": "/bulk-edit/{jobId}/preview/holdings", - "permissionsRequired": [ "bulk-edit.preview-holdings.collection.get" ], - "modulePermissions": [ - "inventory-storage.holdings.collection.get", - "inventory-storage.holdings-types.collection.get", - "inventory-storage.holdings-types.item.get", - "inventory-storage.locations.collection.get", - "inventory-storage.locations.item.get", - "inventory-storage.call-number-types.collection.get", - "inventory-storage.call-number-types.item.get", - "inventory-storage.ill-policies.collection.get", - "inventory-storage.ill-policies.item.get", - "inventory-storage.holdings-sources.collection.get", - "inventory-storage.instances.item.get", - "inventory-storage.statistical-codes.collection.get", - "inventory-storage.statistical-codes.item.get", - "inventory-storage.electronic-access-relationships.collection.get", - "inventory-storage.holdings-note-types.collection.get" - ] - }, - { - "methods": [ "GET" ], - "pathPattern": "/bulk-edit/{jobId}/errors", - "permissionsRequired": [ "bulk-edit.errors.collection.get" ], - "modulePermissions": [] - }, - { - "methods": [ "GET" ], - "pathPattern": "/bulk-edit/{jobId}/preview/updated-items/download", - "permissionsRequired": [ "bulk-edit.preview.updated-items.collection.get" ], - "modulePermissions": [] - }, - { - "methods": [ "GET" ], - "pathPattern": "/bulk-edit/{jobId}/preview/updated-users/download", - "permissionsRequired": [ "bulk-edit.preview.updated-users.collection.get" ], - "modulePermissions": [] - }, - { - "methods": [ "GET" ], - "pathPattern": "/bulk-edit/{jobId}/preview/updated-holdings/download", - "permissionsRequired": [ "bulk-edit.preview.updated-holdings.collection.get" ], - "modulePermissions": [] - }, { "methods": [ "GET" ], "pathPattern": "/refresh-presigned-url", @@ -489,66 +322,11 @@ "displayName" : "upload identifiers list", "description" : "Upload list of item identifiers" }, - { - "permissionName" : "bulk-edit.items-content-update.collection.post", - "displayName" : "upload items content update collection", - "description" : "Upload collection of item content updates" - }, - { - "permissionName" : "bulk-edit.users-content-update.collection.post", - "displayName" : "upload users content update collection", - "description" : "Upload collection of user content updates" - }, - { - "permissionName" : "bulk-edit.holdings-content-update.collection.post", - "displayName" : "upload holdings records content update collection", - "description" : "Upload collection of holdings records content updates" - }, - { - "permissionName" : "bulk-edit.preview.updated-items.collection.get", - "displayName" : "download updated items preview csv", - "description" : "Download csv of preview updated items" - }, - { - "permissionName" : "bulk-edit.preview.updated-users.collection.get", - "displayName" : "download updated users preview csv", - "description" : "Download csv with preview of updated users" - }, - { - "permissionName" : "bulk-edit.preview.updated-holdings.collection.get", - "displayName" : "download updated holdings records preview csv", - "description" : "Download csv with preview of updated holdings records" - }, { "permissionName": "bulk-edit.start.item.post", "displayName": "start update items", "description": "Start update items" }, - { - "permissionName": "bulk-edit.roll-back.item.post", - "displayName": "roll back list of uploaded items", - "description": "Roll back list of uploaded items" - }, - { - "permissionName" : "bulk-edit.preview-users.collection.get", - "displayName" : "get N users for preview", - "description" : "Get N users for preview" - }, - { - "permissionName" : "bulk-edit.preview-items.collection.get", - "displayName" : "get N items for preview", - "description" : "Get N items for preview" - }, - { - "permissionName" : "bulk-edit.preview-holdings.collection.get", - "displayName" : "get N holdings for preview", - "description" : "Get N holdings for preview" - }, - { - "permissionName" : "bulk-edit.errors.collection.get", - "displayName" : "get errors for preview", - "description" : "Get errors for preview" - }, { "permissionName" : "refresh-presigned-url.get", "displayName" : "Get refreshed presigned url for export file", @@ -560,18 +338,7 @@ "description" : "All permissions for bulk-edit module", "subPermissions" : [ "bulk-edit.item.post", - "bulk-edit.items-content-update.collection.post", - "bulk-edit.users-content-update.collection.post", - "bulk-edit.holdings-content-update.collection.post", - "bulk-edit.preview.updated-items.collection.get", - "bulk-edit.preview.updated-users.collection.get", - "bulk-edit.preview.updated-holdings.collection.get", - "bulk-edit.start.item.post", - "bulk-edit.roll-back.item.post", - "bulk-edit.preview-users.collection.get", - "bulk-edit.preview-items.collection.get", - "bulk-edit.preview-holdings.collection.get", - "bulk-edit.errors.collection.get" + "bulk-edit.start.item.post" ] }, { diff --git a/src/main/java/org/folio/dew/service/JobCommandsReceiverService.java b/src/main/java/org/folio/dew/service/JobCommandsReceiverService.java index 14ba515fb..fbc8fe0c1 100644 --- a/src/main/java/org/folio/dew/service/JobCommandsReceiverService.java +++ b/src/main/java/org/folio/dew/service/JobCommandsReceiverService.java @@ -136,35 +136,6 @@ private String resolveJobKey(JobCommand jobCommand) { private void prepareJobParameters(JobCommand jobCommand) { var paramsBuilder = new JobParametersBuilder(jobCommand.getJobParameters()); - // TODO enrich exportType.json with value MARC_EXPORT - if ("MARC_EXPORT".equals(jobCommand.getExportType().getValue())) { - var uploadedFilePath = jobCommand.getJobParameters().getString(FILE_NAME); - if (nonNull(uploadedFilePath) && FilenameUtils.isExtension(uploadedFilePath, "cql")) { - var tempIdentifiersFileName = workDir + FilenameUtils.getBaseName(uploadedFilePath) + CSV_EXTENSION; - try (var lines = localFilesStorage.lines(uploadedFilePath); - var outputStream = new FileOutputStream(tempIdentifiersFileName)) { - var query = lines.collect(Collectors.joining()); - // TODO enrich entityType.json with values INSTANCE, HOLDINGS - InputStreamResource resource = null; - if ("INSTANCE".equals(jobCommand.getEntityType().getValue())) { - resource = searchClient.getInstanceIds(query).getBody(); - } else if ("HOLDINGS".equals(jobCommand.getEntityType().getValue())) { - resource = searchClient.getHoldingIds(query).getBody(); - } - if (nonNull(resource)) { - resource.getInputStream().transferTo(outputStream); - } - var identifiersUrl = remoteFilesStorage.objectToPresignedObjectUrl( - remoteFilesStorage.uploadObject(FilenameUtils.getName(tempIdentifiersFileName), tempIdentifiersFileName, null, "text/csv", true)); - paramsBuilder.addString(FILE_NAME, identifiersUrl, JOB_PARAMETER_DEFAULT_IDENTIFYING_VALUE); - } catch (Exception e) { - var msg = String.format("Failed to read %s, reason: %s", FilenameUtils.getBaseName(uploadedFilePath), e.getMessage()); - log.error(msg); - throw new FileOperationException(msg); - } - } - } - var jobId = jobCommand.getId().toString(); var outputFileName = fileNameResolver.resolve(jobCommand, workDir, jobId); diff --git a/src/main/resources/swagger.api/bulk-edit.yaml b/src/main/resources/swagger.api/bulk-edit.yaml index 15299b86e..a55c1b4ba 100644 --- a/src/main/resources/swagger.api/bulk-edit.yaml +++ b/src/main/resources/swagger.api/bulk-edit.yaml @@ -5,481 +5,6 @@ info: servers: - url: /bulk-edit/ paths: - /{jobId}/item-content-update/upload: - post: - description: Upload item content updates - operationId: postItemContentUpdates - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - - in: query - name: limit - required: false - schema: - type: integer - description: The numbers of records to return - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/itemContentUpdateCollection" - responses: - "200": - description: Collection of items for preview - content: - application/json: - schema: - $ref: "#/components/schemas/itemCollection" - "400": - description: Bad request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "404": - description: Not found - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "500": - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/user-content-update/upload: - post: - description: Upload user content updates - operationId: postUserContentUpdates - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - - in: query - name: limit - required: false - schema: - type: integer - description: The numbers of records to return - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/userContentUpdateCollection" - responses: - "200": - description: Collection of users for preview - content: - application/json: - schema: - $ref: "#/components/schemas/userCollection" - "400": - description: Bad request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "404": - description: Not found - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "500": - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/holdings-content-update/upload: - post: - description: Upload holdings record content updates - operationId: postHoldingsContentUpdates - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - - in: query - name: limit - required: false - schema: - type: integer - description: The numbers of records to return - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/holdingsContentUpdateCollection" - responses: - "200": - description: Collection of holdings records for preview - content: - application/json: - schema: - $ref: "#/components/schemas/holdingsRecordCollection" - "400": - description: Bad request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "404": - description: Not found - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "500": - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/preview/updated-items/download: - get: - description: Download updated items preview as csv-file - operationId: downloadItemsPreviewByJobId - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - responses: - '200': - description: Preview of updated items to download - content: - text/csv: - schema: - type: string - format: binary - "400": - description: Bad request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "404": - description: Not found - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "500": - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/preview/updated-users/download: - get: - description: Download updated users preview as csv-file - operationId: downloadUsersPreviewByJobId - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - responses: - '200': - description: Preview of updated items to download - content: - text/csv: - schema: - type: string - format: binary - "400": - description: Bad request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "404": - description: Not found - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "500": - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/preview/updated-holdings/download: - get: - description: Download updated holdings records preview as csv-file - operationId: downloadHoldingsPreviewByJobId - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - responses: - '200': - description: Preview of updated holdings to download - content: - text/csv: - schema: - type: string - format: binary - "400": - description: Bad request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "404": - description: Not found - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - "500": - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/preview/users: - get: - description: Get a list of users for preview - operationId: getPreviewUsersByJobId - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - - in: query - name: limit - required: true - schema: - type: integer - description: The numbers of users to return - responses: - '200': - description: Collection of users for preview - content: - application/json: - schema: - $ref: "#/components/schemas/userCollection" - '400': - description: Bad Request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - '404': - description: Bad Request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - '500': - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/preview/items: - get: - description: Get a list of items for preview - operationId: getPreviewItemsByJobId - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - - in: query - name: limit - required: true - schema: - type: integer - description: The numbers of items to return - responses: - '200': - description: Collection of items for preview - content: - application/json: - schema: - $ref: "#/components/schemas/itemCollection" - '400': - description: Bad Request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - '404': - description: Not found - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - '500': - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/preview/holdings: - get: - description: Get a list of holdings for preview - operationId: getPreviewHoldingsByJobId - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - - in: query - name: limit - required: true - schema: - type: integer - description: The numbers of holdings to return - responses: - '200': - description: Collection of holdings for preview - content: - application/json: - schema: - $ref: "#/components/schemas/holdingsRecordCollection" - '400': - description: Bad Request - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - '404': - description: Not found - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - '500': - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - /{jobId}/errors: - get: - description: Get a list of errors for preview - operationId: getErrorsPreviewByJobId - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - - in: query - name: limit - required: true - schema: - type: integer - description: The numbers of users to return - responses: - '200': - description: Collection of users for preview - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" - '404': - description: No found - content: - text/plain: - schema: - type: string - example: Job not found - '500': - description: Internal server errors, e.g. due to misconfiguration - content: - text/plain: - schema: - type: string - example: Internal server error /{jobId}/upload: post: description: Upload csv file @@ -564,32 +89,6 @@ paths: $ref: "#/components/examples/errors" schema: $ref: "#/components/schemas/errors" - /{jobId}/roll-back: - post: - description: Roll back csv file - operationId: rollBackCsvFile - parameters: - - name: jobId - in: path - required: true - description: UUID of the JobCommand - schema: - $ref: "#/components/schemas/UUID" - responses: - "200": - description: Csv file roll back uploaded - content: - text/plain: - schema: - type: string - "500": - description: Internal server errors, e.g. due to misconfiguration - content: - application/json: - example: - $ref: "#/components/examples/errors" - schema: - $ref: "#/components/schemas/errors" components: schemas: UUID: @@ -641,10 +140,6 @@ components: $ref: '../../../../folio-export-common/schemas/inventory/electronicAccessRelationshipCollection.json#/ElectronicAccessRelationshipCollection' statisticalCodes: $ref: '../../../../folio-export-common/schemas/inventory/statisticalCodeCollection.json#/StatisticalCodeCollection' - itemContentUpdateCollection: - $ref: '../../../../folio-export-common/schemas/bulk-edit/itemContentUpdateCollection.json#/ItemContentUpdateCollection' - userContentUpdateCollection: - $ref: '../../../../folio-export-common/schemas/bulk-edit/userContentUpdateCollection.json#/UserContentUpdateCollection' customFieldCollection: $ref: '../../../../folio-export-common/schemas/user/customFieldCollection.json#/CustomFieldCollection' holdingsRecordCollection: diff --git a/src/test/java/org/folio/dew/controller/ItemsContentUpdateTestData.java b/src/test/java/org/folio/dew/controller/ItemsContentUpdateTestData.java deleted file mode 100644 index b4daf0324..000000000 --- a/src/test/java/org/folio/dew/controller/ItemsContentUpdateTestData.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.folio.dew.controller; - -import static org.folio.dew.domain.dto.ItemContentUpdate.ActionEnum.CLEAR_FIELD; -import static org.folio.dew.domain.dto.ItemContentUpdate.ActionEnum.REPLACE_WITH; -import static org.folio.dew.domain.dto.ItemContentUpdate.OptionEnum.PERMANENT_LOAN_TYPE; -import static org.folio.dew.domain.dto.ItemContentUpdate.OptionEnum.PERMANENT_LOCATION; -import static org.folio.dew.domain.dto.ItemContentUpdate.OptionEnum.STATUS; -import static org.folio.dew.domain.dto.ItemContentUpdate.OptionEnum.TEMPORARY_LOAN_TYPE; -import static org.folio.dew.domain.dto.ItemContentUpdate.OptionEnum.TEMPORARY_LOCATION; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import org.folio.dew.domain.dto.ItemContentUpdate; - -@AllArgsConstructor -@Getter -public enum ItemsContentUpdateTestData { - REPLACE_WITH_PERMANENT_LOCATION(PERMANENT_LOCATION, REPLACE_WITH, "Annex", - "src/test/resources/output/expected_items_with_updated_permanent_location.json", - "src/test/resources/output/expected_items_with_updated_permanent_location.csv", - "src/test/resources/output/expected_preview_items_with_updated_permanent_location.csv"), - REPLACE_WITH_TEMPORARY_LOCATION(TEMPORARY_LOCATION, REPLACE_WITH, "Annex", - "src/test/resources/output/expected_items_with_updated_temporary_location.json", - "src/test/resources/output/expected_items_with_updated_temporary_location.csv", - "src/test/resources/output/expected_preview_items_with_updated_temporary_location.csv"), - REPLACE_WITH_NULL_PERMANENT_LOCATION(PERMANENT_LOCATION, REPLACE_WITH, null, - "src/test/resources/output/expected_items_with_deleted_permanent_location.json", - "src/test/resources/output/expected_items_with_deleted_permanent_location.csv", - "src/test/resources/output/expected_preview_items_with_deleted_permanent_location.csv"), - REPLACE_WITH_NULL_TEMPORARY_LOCATION(TEMPORARY_LOCATION, REPLACE_WITH, null, - "src/test/resources/output/expected_items_with_deleted_temporary_location.json", - "src/test/resources/output/expected_items_with_deleted_temporary_location.csv", - "src/test/resources/output/expected_preview_items_with_deleted_temporary_location.csv"), - REPLACE_WITH_PERMANENT_LOAN_TYPE(PERMANENT_LOAN_TYPE, REPLACE_WITH, "Reading room", - "src/test/resources/output/expected_items_with_updated_permanent_loan_type.json", - "src/test/resources/output/expected_items_with_updated_permanent_loan_type.csv", - "src/test/resources/output/expected_items_with_updated_permanent_loan_type.csv"), - REPLACE_WITH_TEMPORARY_LOAN_TYPE(TEMPORARY_LOAN_TYPE, REPLACE_WITH, "Reading room", - "src/test/resources/output/expected_items_with_updated_temporary_loan_type.json", - "src/test/resources/output/expected_items_with_updated_temporary_loan_type.csv", - "src/test/resources/output/expected_items_with_updated_temporary_loan_type.csv"), - REPLACE_WITH_NULL_PERMANENT_LOAN_TYPE(PERMANENT_LOAN_TYPE, REPLACE_WITH, null, - "src/test/resources/output/expected_items_with_deleted_permanent_loan_type.json", - "src/test/resources/output/expected_items_with_deleted_permanent_loan_type.csv", - "src/test/resources/output/expected_preview_items_with_deleted_permanent_loan_type.csv"), - REPLACE_WITH_NULL_TEMPORARY_LOAN_TYPE(TEMPORARY_LOAN_TYPE, REPLACE_WITH, null, - "src/test/resources/output/expected_items_with_deleted_temporary_loan_type.json", - "src/test/resources/output/expected_items_with_deleted_temporary_loan_type.csv", - "src/test/resources/output/expected_preview_items_with_deleted_temporary_loan_type.csv"), - REPLACE_WITH_ALLOWED_STATUS(STATUS, REPLACE_WITH, "Missing", - "src/test/resources/output/expected_items_with_updated_status.json", - null, null), - REPLACE_WITH_NOT_ALLOWED_STATUS(STATUS, REPLACE_WITH, "Aged to lost", - "src/test/resources/output/expected_items_with_non_updated_status.json", - null, null), - REPLACE_WITH_EMPTY_STATUS(STATUS, REPLACE_WITH, null, - "src/test/resources/output/expected_items_with_non_updated_status.json", - null, null), - CLEAR_FIELD_PERMANENT_LOCATION(PERMANENT_LOCATION, CLEAR_FIELD, null, - "src/test/resources/output/expected_items_with_deleted_permanent_location.json", - "src/test/resources/output/expected_items_with_deleted_permanent_location.csv", - "src/test/resources/output/expected_preview_items_with_deleted_permanent_location.csv"), - CLEAR_FIELD_TEMPORARY_LOCATION(TEMPORARY_LOCATION, CLEAR_FIELD, null, - "src/test/resources/output/expected_items_with_deleted_temporary_location.json", - "src/test/resources/output/expected_items_with_deleted_temporary_location.csv", - "src/test/resources/output/expected_preview_items_with_deleted_temporary_location.csv"), - CLEAR_FIELD_STATUS(STATUS, CLEAR_FIELD, null, - "src/test/resources/output/expected_items_with_non_updated_status.json", - null, null), - CLEAR_FIELD_PERMANENT_LOAN_TYPE(PERMANENT_LOAN_TYPE, CLEAR_FIELD, null, - "src/test/resources/output/expected_items_with_deleted_permanent_loan_type.json", - "src/test/resources/output/expected_items_with_deleted_permanent_loan_type.csv", - "src/test/resources/output/expected_preview_items_with_deleted_permanent_loan_type.csv"), - CLEAR_FIELD_TEMPORARY_LOAN_TYPE(TEMPORARY_LOAN_TYPE, CLEAR_FIELD, null, - "src/test/resources/output/expected_items_with_deleted_temporary_loan_type.json", - "src/test/resources/output/expected_items_with_deleted_temporary_loan_type.csv", - "src/test/resources/output/expected_preview_items_with_deleted_temporary_loan_type.csv"); - - final ItemContentUpdate.OptionEnum option; - final ItemContentUpdate.ActionEnum action; - final String value; - final String expectedPreviewJsonPath; - final String expectedCsvPath; - final String expectedPreviewCsvPath; -}