Open mark-prins opened 2 months ago
Setting as normal as I don't believe there are any deployed multi-store sites, but you should be able to do this!
Yes, you shouldn't be able to import the same fridgetag into a different store (you'd need to move it to the new store first), but you should definitely be able to import a different fridgetag
See PR for needs refinement context š
Refinement:
If you import a fridge tag and you're logged into a store, other than the one already associated with the sensor, throw error. Duplicated configs for different stores is ok...
Yes, you shouldn't be able to import the same fridgetag into a different store (you'd need to move it to the new store first), but you should definitely be able to import a different fridgetag
How do you move a Fridge-tag to a different store?
Yes, you shouldn't be able to import the same fridgetag into a different store (you'd need to move it to the new store first), but you should definitely be able to import a different fridgetag
How do you move a Fridge-tag to a different store?
Hmm, I was thinking of the "Set location" button when viewing a sensor on desktop mSupply, but just realised that locations are specific to a store, and you can only see sensors associated with the store you're logged into => you can only ever move it to another location in the same store!
You can un-assign a sensor location though, and that blanks out the sensor's location, but doesn't change its store => if we changed vaccineShowSensor
to include sensors with a blank location, then it would show up if you login to a different store and then you could assign a location in the new store (and that would change the sensor's store as well)?
The other issue if you move store is that you'd still want to be able to see the original temperature logs and breaches in the original store. vaccineShowTemperatureBreach
filters the breaches by store, so that's fine. vaccineShowLogs
filters temperature logs by store, so that's also fine, but it also filters sensors by store, so that would need tweaked so that it filters by locations which belong to the current store instead.
I'd imagine that something similar is also possible in omSupply?
Hmm, I was thinking of the "Set location" button when viewing a sensor on desktop mSupply, but just realised that locations are specific to a store, and you can only see sensors associated with the store you're logged into => you can only ever move it to another location in the same store!
Ah, I wonder if this is also what happened for me on the oms demo server.
I had sensors (not Fridge-tag) associated with a store, then switched them to a new store on the same site.
The Chart
page shows the data ok, but the sensors don't appear in the Sensors
page
What went wrong? š²
Given:
Then: any fridge tag import will fail
The issue is that this call to check matching sensor config (berlinger.rs, line 204)
is checking for a config based on store_id, duration_milliseconds, minimum_temperature, maximum_temperature and type. However, the constraint on the table is for a unique description and this does not include the store_id, so the insert following the code above will fail.
Expected behaviour š¤
Able to import the fridge tag data for a new store.
How to Reproduce šØ
Steps to reproduce the behaviour:
Your environment š±