[Spike] Preview of the records before the changes are committed
Role | Person | Comments |
|---|---|---|
Solution Architect | @Raman Auramau | Looks adequate, but it makes sense to also explicitly document expectations and assumptions about the amount of data |
Java Lead | @Viachaslau Khandramai (Deactivated) | Done. Assumptions/questions are in progress. |
UI Lead | @Uladislau Samets |
|
Product Owner | @Magda Zacharska |
|
https://folio-org.atlassian.net/browse/MODEXPW-81 - Spike - Preview of the records before the changes are committed
https://folio-org.atlassian.net/browse/UXPROD-3705 - Bulk Edit - User data - in app approach
Approach
Initially client uploads csv-file with edited records for updating in the DB. At the present moment this file should be generated and saved automatically.
High-level approach:
Client uploads csv-file with identifiers.
Items retrieving starts automatically and asynchronously.
Client makes changes on the corresponding forms on UI and send PUT request with ContentUpdate request.
Bulk Edit app waits for completing point 2), after that application applies changes and save them to the generated csv-file on server side.
Client may download this file
Client may start Bulk Edit UPDATE. In this case standard updating flow can be executed with the only one change - csv-file with updated data is made automatically (not manually as for users).
Assumptions/Questions
1) Number of items to update? Statistics, predictions?
2) Saving csv? Cleaning mechanism?
API Changes
Method | Path | Provided permissions | Request | Response | Description | Notes |
|---|---|---|---|---|---|---|
GET | /bulk-edit/{jobId}/preview/users | bulk-edit.preview.users.collection.get | NA | 200 OK (userCollection.json) | Get users preview | |
GET | /bulk-edit/{jobId}/preview/items | bulk-edit.preview.items.collection.get | NA | 200 OK (itemCollection.json) | Get items preview | |
POST | /bulk-edit/{jobId}/content-update/upload | bulk-edit.items.content-update.upload.post | ContentUpdateCollection | 201 CREATED | Update records based on ContentUpdateCollection request and return updated items collection. Should support limit query parameter to control number of returned items. | |
GET | /bulk-edit/{jobId}/preview/updated-items/download | bulk-edit.preview.updated-items.download.get | NA | 200 OK (csv-file with items) | Download preview as csv-file |
Schemas ContentUpdateCollection
Property | Type | Default | Required | Notes |
|---|---|---|---|---|
entityType | enum[USER, ITEM] | N | Y | Type of entity: USER or ITEM |
contentUpdates | array<ContentUpdate> | N | Y | Array of content updates |
totalRecords | integer | N | Y | Total number of content updates records |
Schemas ContentUpdate
Property | Type | Default | Required | Notes |
|---|---|---|---|---|
option | enum | N | Y | Option to change |
action | enum | N | Y | Changing action |
value | object | N | N | New value |
UPDATE: Supporting of the USERS In-App together with ITEMS
Method | Path | Provided permissions | Request | Response | Description | Notes |
|---|---|---|---|---|---|---|
GET | /bulk-edit/{jobId}/preview/users | bulk-edit.preview.users.collection.get | NA | 200 OK (userCollection.json) | Get users preview | |
GET | /bulk-edit/{jobId}/preview/items | bulk-edit.preview.items.collection.get | NA | 200 OK (itemCollection.json) | Get items preview | |
POST | /bulk-edit/{jobId}/item-content-update/upload | bulk-edit.items.content-update.upload.post | ItemContentUpdateCollection | 201 CREATED | Update records based on ItemContentUpdateCollection request and return updated items collection. Should support limit query parameter to control number of returned items. | |
POST | /bulk-edit/{jobId}/user-content-update/upload | bulk-edit.users.content-update.upload.post | UserContentUpdateCollection | 201 CREATED | Update records based on UserContentUpdateCollection request and return updated users collection. Should support limit query parameter to control number of returned users. | |
GET | /bulk-edit/{jobId}/preview/updated-items/download | bulk-edit.preview.updated-items.download.get | NA | 200 OK (csv-file with items) | Download preview as csv-file |
Schema ItemContentUpdateCollection
Property | Type | Default | Required | Notes |
|---|---|---|---|---|
itemContentUpdates | array<ItemContentUpdate> | N | Y | Array of item content updates |
totalRecords | integer | N | Y | Total number of content updates records |
Schema UserContentUpdateCollection
Property | Type | Default | Required | Notes |
|---|---|---|---|---|
userContentUpdates | array<UserContentUpdate> | N | Y | Array of user content updates |
totalRecords | integer | N | Y | Total number of content updates records |
Schema ItemContentUpdate
Property | Type | Default | Required | Notes |
|---|---|---|---|---|
option | enum | N | Y | Option to change |
action | enum | N | Y | Changing action |
value | object | N | N | New value |
Schema UserContentUpdate
Property | Type | Default | Required | Notes |
|---|---|---|---|---|
option | enum | N | Y | Option to change |
action | enum | N | Y | Changing action |
value | object | N | N | New value |