Improve caching of the Stock Card Summaries
Currently the Stock Card Summaries are fetched and overwritten each time we log in to the application and each time we enter any stock management screen. This entails a lot of data to fetch, which may not be efficient on slow connections. We should be smarter about fetching them - do it only for those records that changed.
The stock card summaries fetch should support If-Modified-Since request header - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since - it means it should only fetch those records that have changed since the provided date. If the are no records that changed it returns 304 ??
We only fetch the missing data and the data that changed with stock card summaries to avoid sending the same data over and over again
We properly handle user permissions - if user is assigned more roles, the missing stock card summaries should be fetched
We properly handle new products - if new stock cards are created they should be fetched
We properly handle records with occurredDate in the past