[MODEXPW-80] Retrieve item records based on the provided identifiers Created: 31/Jan/22  Updated: 21/Mar/22  Resolved: 21/Mar/22

Status: Closed
Project: mod-data-export-worker
Components: None
Affects versions: None
Fix versions: 1.4.0

Type: Story Priority: P3
Reporter: Magda Zacharska Assignee: Siarhei Charniak
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Defines
defines UXPROD-3523 Bulk Edit - in app approach - item lo... Closed
Relates
relates to FEXPCMN-3 Update schemas to support item retrieval Closed
relates to MODEXPS-79 Update folio-export-common schemas Closed
Sprint: Firebird Sprint 135
Story Points: 5
Development Team: Firebird
RCA Group: TBD

 Description   

Purpose/Overview:
After uploading a CSV file with item identifiers the user should be able to see the preview of matched records(top 10) and be able to download a CSV file with matched records, so that all records can be reviewed.

Requirements/Scope:
1. List of supported identifiers includes:

  • Item barcodes
  • Item UUIDs
  • Item HRIDs
  • Item former identifier
  • Item accession number
  • Holdings UUIDs

2. All records returned are available for UI:

  • top 10 to be displayed in the preview
  • all records to be downloaded in a separate csv file if user requests it

3. Keys are replaced with values - especially the location keys are replaced with locations values
4. The file name follows the convention: <yyyy-mm-dd-Matched-Records-<name of the file with identifiers>.csv

Approach:
Similar to the work done in MODEXPW-45 Closed but the download does not start automatically

Acceptance criteria:

  • All listed identifiers are supported
  • The data is available for the UI to be displayed on the landing page
  • User can save the file in the csv format and the file name follows the naming convention
  • File contains all fields from the item record
  • Keys are replaced with corresponding values
  • Unit and API tests are written where applicable


 Comments   
Comment by Siarhei Charniak [ 21/Mar/22 ]

Magda Zacharska
Verified on folio-snapshot-2 environment for barcodes, other identifier types work as well.

Post job command:

curl --location --request POST 'https://folio-snapshot-2-okapi.dev.folio.org:443/data-export-spring/jobs' \
--header 'x-okapi-tenant: diku' \
--header "x-okapi-token: $TOKEN" \
--header 'Content-Type: application/json' \
--data-raw '{
  "type": "BULK_EDIT_IDENTIFIERS",
  "exportTypeSpecificParameters": {
      "query": "active=true"
  },
  "identifierType": "BARCODE",
  "entityType": "ITEM"
}'

Response:

{
    "id": "cc034dd1-e1f5-410a-a0f3-7e0021c10186",
    "name": "000001",
    "source": "diku_admin",
    "isSystemSource": false,
    "type": "BULK_EDIT_IDENTIFIERS",
    "exportTypeSpecificParameters": {
        "query": "active=true"
    },
    "status": "SCHEDULED",
    "metadata": {
        "createdDate": "2022-03-18T15:16:59.267+00:00",
        "createdByUserId": "21a3ac2e-aa2f-5dd2-bcb6-f2d019e29a87",
        "createdByUsername": "diku_admin",
        "updatedDate": "2022-03-18T15:16:59.267+00:00",
        "updatedByUserId": "21a3ac2e-aa2f-5dd2-bcb6-f2d019e29a87",
        "updatedByUsername": "diku_admin"
    },
    "identifierType": "BARCODE",
    "entityType": "ITEM"
}

Upload file with identifiers:

curl --location --request POST 'https://folio-snapshot-2-okapi.dev.folio.org:443/bulk-edit/cc034dd1-e1f5-410a-a0f3-7e0021c10186/upload' \
--header 'x-okapi-tenant: diku' \
--header "x-okapi-token: $TOKEN" \
--header 'Content-Type: multipart/form-data' \
--form 'file=@"/Users/siarhei/Downloads/barcodes.csv"'

Response:

2

Start job:

curl --location --request POST 'https://folio-snapshot-2-okapi.dev.folio.org:443/bulk-edit/cc034dd1-e1f5-410a-a0f3-7e0021c10186/start' \
--header 'x-okapi-tenant: diku' \
--header "x-okapi-token: $TOKEN" \
--header 'Content-Type: application/json'

Response:

1

Check job status - successful:

curl --location --request GET 'https://folio-snapshot-2-okapi.dev.folio.org:443/data-export-spring/jobs/cc034dd1-e1f5-410a-a0f3-7e0021c10186' \
--header 'x-okapi-tenant: diku' \
--header "x-okapi-token: $TOKEN" \
--header 'Content-Type: application/json'

Response:

{
    "id": "cc034dd1-e1f5-410a-a0f3-7e0021c10186",
    "name": "000001",
    "source": "diku_admin",
    "isSystemSource": false,
    "type": "BULK_EDIT_IDENTIFIERS",
    "exportTypeSpecificParameters": {
        "query": "active=true"
    },
    "status": "SUCCESSFUL",
    "files": [
        "https://folio-snapshot-2-export.s3.us-east-1.amazonaws.com/2022-03-18-Matched-Records-barcodes.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA2VGNPE73JV77RBGE%2F20220318%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220318T151709Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=22e53485065ec4dc392a45b9a29036ff4383d387cd12cef4a2b94f637e850eb9"
    ],
    "startTime": "2022-03-18T15:17:08.621+00:00",
    "endTime": "2022-03-18T15:17:09.468+00:00",
    "metadata": {
        "createdDate": "2022-03-18T15:16:59.267+00:00",
        "createdByUserId": "21a3ac2e-aa2f-5dd2-bcb6-f2d019e29a87",
        "createdByUsername": "diku_admin",
        "updatedDate": "2022-03-18T15:17:09.846+00:00",
        "updatedByUserId": "21a3ac2e-aa2f-5dd2-bcb6-f2d019e29a87",
        "updatedByUsername": "diku_admin"
    },
    "identifierType": "BARCODE",
    "entityType": "ITEM"
}

Get preview for the job:

curl --location --request GET 'https://folio-snapshot-2-okapi.dev.folio.org:443/bulk-edit/cc034dd1-e1f5-410a-a0f3-7e0021c10186/preview?limit=3' \
--header 'x-okapi-tenant: diku' \
--header "x-okapi-token: $TOKEN" \
--header 'Content-Type: application/json'

Response:

{
    "items": [
        {
            "id": "100d10bf-2f06-4aa0-be15-0b95b2d9f9e3",
            "_version": 2,
            "hrid": "item000000000015",
            "holdingsRecordId": "e3ff6133-b9a2-4d4c-a1c9-dc1867d4df19",
            "formerIds": [],
            "discoverySuppress": null,
            "title": "A semantic web primer",
            "contributorNames": [
                {
                    "name": "Antoniou, Grigoris"
                },
                {
                    "name": "Van Harmelen, Frank"
                }
            ],
            "callNumber": "TK5105.88815 . A58 2004 FT MEADE",
            "barcode": "90000",
            "effectiveShelvingOrder": "TK 45105.88815 A58 42004 FT MEADE",
            "accessionNumber": null,
            "itemLevelCallNumber": "TK5105.88815 . A58 2004 FT MEADE",
            "itemLevelCallNumberPrefix": null,
            "itemLevelCallNumberSuffix": null,
            "itemLevelCallNumberTypeId": null,
            "effectiveCallNumberComponents": {
                "callNumber": "TK5105.88815 . A58 2004 FT MEADE",
                "prefix": null,
                "suffix": null,
                "typeId": "512173a7-bd09-490e-b773-17d83f2b63fe"
            },
            "volume": null,
            "enumeration": "",
            "chronology": "",
            "yearCaption": [],
            "itemIdentifier": null,
            "copyNumber": null,
            "numberOfPieces": null,
            "descriptionOfPieces": null,
            "numberOfMissingPieces": null,
            "missingPieces": null,
            "missingPiecesDate": null,
            "itemDamagedStatusId": null,
            "itemDamagedStatusDate": null,
            "administrativeNotes": [],
            "notes": [],
            "circulationNotes": [],
            "status": {
                "name": "Available",
                "date": 1647611249489
            },
            "materialType": {
                "id": "1a54b431-2e4f-452d-9cae-9cee66c9a892",
                "name": "book"
            },
            "isBoundWith": false,
            "boundWithTitles": null,
            "permanentLoanType": {
                "id": "2b94c631-fca9-4892-a730-03ee529ffe27",
                "name": "Can circulate"
            },
            "temporaryLoanType": null,
            "permanentLocation": {
                "id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
                "name": "Main Library"
            },
            "temporaryLocation": {
                "id": "53cf956f-c1df-410b-8bea-27f712cca7c0",
                "name": "Annex"
            },
            "effectiveLocation": {
                "id": "53cf956f-c1df-410b-8bea-27f712cca7c0",
                "name": "Annex"
            },
            "electronicAccess": [
                {
                    "uri": "http://www.loc.gov/catdir/toc/ecip0718/2007020429.html",
                    "linkText": "Links available",
                    "materialsSpecification": "Table of contents",
                    "publicNote": "Table of contents only",
                    "relationshipId": "3b430592-2e09-4b48-9a0c-0636d66b9fb3"
                }
            ],
            "inTransitDestinationServicePointId": null,
            "statisticalCodeIds": [
                "b5968c9e-cddc-4576-99e3-8e60aed8b0dd"
            ],
            "purchaseOrderLineIdentifier": null,
            "metadata": {
                "createdDate": 1647611249489,
                "createdByUserId": null,
                "createdByUsername": null,
                "updatedDate": 1647611325704,
                "updatedByUserId": null,
                "updatedByUsername": null
            },
            "tags": {
                "tagList": []
            },
            "lastCheckIn": null
        },
        {
            "id": "7212ba6a-8dcf-45a1-be9a-ffaa847c4423",
            "_version": 1,
            "hrid": "item000000000014",
            "holdingsRecordId": "e3ff6133-b9a2-4d4c-a1c9-dc1867d4df19",
            "formerIds": [],
            "discoverySuppress": null,
            "title": "A semantic web primer",
            "contributorNames": [
                {
                    "name": "Antoniou, Grigoris"
                },
                {
                    "name": "Van Harmelen, Frank"
                }
            ],
            "callNumber": "TK5105.88815 . A58 2004 FT MEADE",
            "barcode": "10101",
            "effectiveShelvingOrder": "TK 45105.88815 A58 42004 FT MEADE COPY 12",
            "accessionNumber": null,
            "itemLevelCallNumber": "TK5105.88815 . A58 2004 FT MEADE",
            "itemLevelCallNumberPrefix": null,
            "itemLevelCallNumberSuffix": null,
            "itemLevelCallNumberTypeId": null,
            "effectiveCallNumberComponents": {
                "callNumber": "TK5105.88815 . A58 2004 FT MEADE",
                "prefix": null,
                "suffix": null,
                "typeId": "512173a7-bd09-490e-b773-17d83f2b63fe"
            },
            "volume": null,
            "enumeration": "",
            "chronology": "",
            "yearCaption": [],
            "itemIdentifier": null,
            "copyNumber": "Copy 2",
            "numberOfPieces": null,
            "descriptionOfPieces": null,
            "numberOfMissingPieces": null,
            "missingPieces": null,
            "missingPiecesDate": null,
            "itemDamagedStatusId": null,
            "itemDamagedStatusDate": null,
            "administrativeNotes": [],
            "notes": [],
            "circulationNotes": [],
            "status": {
                "name": "Available",
                "date": 1647611249529
            },
            "materialType": {
                "id": "1a54b431-2e4f-452d-9cae-9cee66c9a892",
                "name": "book"
            },
            "isBoundWith": false,
            "boundWithTitles": null,
            "permanentLoanType": {
                "id": "2b94c631-fca9-4892-a730-03ee529ffe27",
                "name": "Can circulate"
            },
            "temporaryLoanType": null,
            "permanentLocation": {
                "id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
                "name": "Main Library"
            },
            "temporaryLocation": null,
            "effectiveLocation": {
                "id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
                "name": "Main Library"
            },
            "electronicAccess": [
                {
                    "uri": "http://www.loc.gov/catdir/toc/ecip0718/2007020429.html",
                    "linkText": "Links available",
                    "materialsSpecification": "Table of contents",
                    "publicNote": "Table of contents only",
                    "relationshipId": "3b430592-2e09-4b48-9a0c-0636d66b9fb3"
                }
            ],
            "inTransitDestinationServicePointId": null,
            "statisticalCodeIds": [
                "b5968c9e-cddc-4576-99e3-8e60aed8b0dd"
            ],
            "purchaseOrderLineIdentifier": null,
            "metadata": {
                "createdDate": 1647611249529,
                "createdByUserId": null,
                "createdByUsername": null,
                "updatedDate": 1647611249529,
                "updatedByUserId": null,
                "updatedByUsername": null
            },
            "tags": {
                "tagList": []
            },
            "lastCheckIn": null
        }
    ],
    "totalRecords": 2,
    "resultInfo": null
}
Comment by Magda Zacharska [ 21/Mar/22 ]

Hi Siarhei Charniak - why does the response contain title and contributors properties?

Generated at Thu Feb 08 22:30:29 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.