Authority remapping (MODMARCMIG-10)

[MODMARCMIG-9] Implement POST Endpoint for Data-Saving Step in MARC Migration Operation Created: 12/Dec/23  Updated: 31/Jan/24

Status: Open
Project: mod-marc-migrations
Components: None
Affects versions: None
Fix versions: 1.0.0
Parent: Authority remapping

Type: Story Priority: P3
Reporter: Pavlo Smahin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: back-end, epam-spitfire
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Gantt End to Start
has to be done after MODMARCMIG-7 Implement Async Records Mapping Mecha... In Progress
has to be done after MODELINKS-173 Implement Endpoint for Bulk Authoriti... In Code Review
Relates
relates to UXPROD-4082 Long term solution for applying mappi... In Progress
Sprint: Spitfire Sprint 185
Story Points: 5
Development Team: Spitfire
Release: Quesnelia (R1 2024)
Epic Link: Authority remapping

 Description   

Overview:

Following the completion of the data mapping process for chunked records in the MARC migration operation, this story focuses on implementing a POST endpoint to trigger the subsequent data-saving step. The endpoint, when called, will initiate the data-saving process for already processed mapping chunk steps within the operation.

Requirements/Scope:

  1. Create a new POST endpoint (POST /marc-migrations/<id>/steps) dedicated to triggering the data-saving step for previously processed mapping chunk steps in the MARC migration operation.
  2. Implement logic to update the operation status to "DATA_SAVING" upon endpoint invocation and handle the data-saving process for chunks.

Approach:

  1. Implement Data-Saving Endpoint:
    • Develop a new endpoint (e.g., POST /marc-migrations/<id>/steps) responsible for triggering the data-saving step for processed chunk_steps.
  2. Update Operation Status and Return Response:
    • Upon invoking the endpoint, modify the operation status to "DATA_SAVING" and return an acknowledgment response.
  3. Process Chunks for Data Saving:
    • Initiate asynchronous processing for chunks within the operation.
    • For each chunk:
      • Create a new step in the database table to track the data-saving process.
      • Send a request to mod-entities-links, triggering an endpoint with the filename containing mapped entities.
      • Process the response received, which will include error chunk file names, and update chunk_step and chunk entities accordingly.
  4. Update Operation Status Based on Chunk Processing:
    • After processing all chunks, update the operation entity status to "DATA_SAVING_COMPLETED" or "DATA_SAVING_FAILED" based on the outcomes of the processed chunks.

Request Body Example:

{
  "operationStepType": {
    "type": "string",
    "enum": ["DATA_SAVING"]
  }
}

Acceptance Criteria:

  • The new POST endpoint (POST /marc-migrations/<id>/steps) for triggering the data-saving step in the MARC migration operation is successfully implemented.
  • Upon invoking the endpoint with the correct payload, the operation status transitions to "DATA_SAVING".
  • The endpoint effectively initiates the data-saving process for chunks that were processed during the mapping phase.
  • Covered by unit tests


 Comments   
Comment by Valery_Pilko [ 04/Jan/24 ]

QA note:
Check request/response/statuses

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