Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem Statement

...

operation-modeworkflow
uploadcreate-upload content
publishcreate-upload-publish content
linkcreate-upload-publish content and link it to textbook


Design

Image Removed

API Specifications

Bulk Content Upload API - POST - /v1/textbook/content/bulk/upload

Request Headers

...

1. Validations

File related validations to be done are,

  1. Validate the format of the file
  2. Validate whether the file is readable
  3. Validate whether the file has data

Data related validations to be done are,

  1. Check whether the file is conforming to the bulk content upload template(The template should be configurable)
  2. Number of rows in file should be less than Max rows allowed(configuration)
  3. Duplicity check within the file. Key is Taxonomy(BGMS)+ContentName


2. Processing

  1. Upload the CSV file to blob storage

      2. Make an entry in bulk_upload_process table

columndata to insertremarks
id

auto-generated unique id

processId
createdby

uploader id


createdoncurrent timestamp
data

blobstore url of CSV file


failureresult
failedCount to be updated here
lastupdatedon
last updated timestamp to be updated here on each update
objecttypecontent
organisationidtenant id

processendtime


endTime - current timestamp to be inserted here while moving this process to completed state

processstarttime


startTime - current timestamp to be inserted here while moving this process to processing state

retrycount

0Not used

status

queuedstatus - possible values - queued, processing, completed

storagedetails


report - blobstore url of result file

successresult


successCount to be updated here

taskcount

number of records in filetotalCount

uploadedby

uploader id


uploadeddate

current timestamp


3. Make entries into bulk_upload_process_task table (One record per content)

columndata to insertremarks

processid

processidid from master table

sequenceid

auto-generated sequence id

createdon

current timestamp

data

data in JSON format

failureresult


JSON data + failed message

iterationid

0Not used

lastupdatedon


last updated timestamp to be updated here on each update

status


possible values - queuedsuccess, failed

successresult


JSON data + success message


Image Added


...

API Specifications

Bulk Content Upload API - POST - /v1/textbook/content/bulk/upload

Request Headers

Content-Typemultipart/form-data
AuthorizationBearer {{api-key}}
x-authenticated-user-token{{keycloak-token}}
x-channel-id{{channel-identifier}}
x-framework-id{{framework-identifier}}
x-hashtag-id{{tenant-id}}
operation-modeupload/publish/link

...

Bulk Content Upload Status Check API - GET - /v1/textbook/content/bulk/upload/status/:processId

Request Headers

Acceptapplication/json
AuthorizationBearer {{api-key}}
x-authenticated-user-token{{keycloak-token}}


Response : Success Response - OK (200) - In Queue

...

Bulk Content Upload Status List API - GET - /v1/textbook/content/bulk/upload/status/list

Request Headers

Acceptapplication/json
AuthorizationBearer {{api-key}}
x-authenticated-user-token{{keycloak-token}}


Response : Success Response - OK (200)

...