Add implementation for the get, getAll functions in OpenlmisCachedResource on UI

Description

Acceptance criteria

  • Implement OpenlmisCachedResource with interface described in

  • Internally the class should use an OpenlmisResource and LocalDatabase

  • It should check whether data is up to date on each call and refetch if necessary (304 status is returned from the backend if data is up-to-date)

Helpful resources

The purpose of this ticket is to implement the following functions for fetching resources to OpenlmisCachedResource:

  • get

  • getAll

Acceptance Criteria:

  • functions are used to send requests to backend with last modified date parameter

  • functions should get records by using an OpenlmisResource if the backend response is 200 and save up-to-date data in local database

  • functions should get records from local database if the backend response is 304

  • for getting single record, data and last modified date should be updated based on orderable's last modified date field

  • for getting all records, data should be updated and the global date (last modified date) should be set to the date of the last update

Assignee

Aleksandra Sołtys

Reporter

Paulina Buzderewicz

Labels

Story Points

8

Time tracking

64h

Epic Link

Components

Sprint

None

Fix versions

Priority

Major
Configure