-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing a fridge tag fails if an import has happened in another store #4755
Comments
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. |
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 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. I'd imagine that something similar is also possible in omSupply? |
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 |
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 🌱
The text was updated successfully, but these errors were encountered: