Ability to Extend Entities - "Extra Data"

Description

Step 1: Drive a decision on the ExtraData Approach/Solution

Please see https://openlmis.atlassian.net/wiki/display/OP/OpenLMIS+v3+Architecture+ExtraData+approaches

Step 2: Implement the solution (could create sub-tasks if needed)

This ticket does NOT include making every OpenLMIS entity extensible. It just includes building this tooling and demonstrating it with an extension onto one entity. We don't want it to be a contrived example, but instead a real-world example that an OpenLMIS implementation would be likely to use. One possibility is extending the Product entity to add a Barcode field.

Acceptance Criteria

  • A user can be saved with extraData (the PUT /api/users endpoint can be saved with a JSON request body with an "extraData" property; see example below)

  • A user can be searched for using extraData (the POST /api/users/search endpoint can be called with a JSON request body with an "extraData" property; see example below)

The JSON request body for the two endpoints above would have an "extraData" property that contains a JSON object with zero or more key-value pairs; both keys and values must be strings.

Example JSON with extraData property

{ "username": "devadmin", ... other user properties ... "extraData": { "color": "orange", "belongsTo": "VR" } }

Attachments

5

QAlity Plus - Test Management

Checklists

Activity

Anna Czyrko 
December 2, 2016 at 9:57 AM

sorry for delay, I rechecked ticket, I confirm all works.

Chongsun Ahn 
December 2, 2016 at 9:10 AM

if there's no further tests, let's move this to done. Otherwise, I'd like to know if there are further things I need to fix.

Anna Czyrko 
December 2, 2016 at 6:11 AM

thank you for information. Personally I expect a message like: ie. "lack of users".

Chongsun Ahn 
November 30, 2016 at 6:19 PM
(edited)

Hey , this is the intended behavior of the endpoint. Since it is a search endpoint, if the search criteria is valid, but no users match the criteria, it will return 200 OK and an empty array (no matching users).

Anna Czyrko 
November 30, 2016 at 1:23 PM

I tested:

  • Create user with extraData - All works.

  • Search existing User by existing extraData - All works

  • Search existing User by not complete existing extraData - All works

  • Search existing User by non-existing extraData - I have strange situation. I try to search user by non – exist extraData. I got status 200 OK and empty Response Body.

More informations in report below:

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Original estimate

Time tracking

1d 4h logged

Components

Sprint

Fix versions

Priority

Time Assistant

Created September 14, 2016 at 10:32 PM
Updated April 4, 2018 at 6:02 PM
Resolved December 2, 2016 at 9:57 AM

Flag notifications