Replies: 4 comments
-
Currently you can mark "Make cocktails in my shelf public to all bar members" in settings and then other bar members will be able to filter by that shelf. Recently, I was exploring the feature of having bar specific shelf, but there's a lot of problems with that implementation in current codebase. (Like how would ingredient matching work on cocktail details, having two shelf requires having another add/remove to shelf actions, access policies, etc...). I'm still exploring a few different options, but I don't think this will be implemented any time soon. |
Beta Was this translation helpful? Give feedback.
-
The public cocktails function only shows cocktails where one of the accounts has marked ALL of the ingredients on the shelf tho. So if 2 out of three is marked on one account and 1 of the 3 on another account it will not show up if my test setup works. I have looked around in the code but are not that fluent in PHP. I see that a lot of what you are saying now is a bit complicated. I was thinking in terms of SQL queries, it should be fairly simple to accomplish this. I would have an option for the bar "members share shelf". The lookup for it would work like this: Without option set (same as now) would be a query similar to: SELECT * FROM y WHERE bar_id = 123 AND user_id = 456; With the option enabled would be without the user_id check: SELECT * FROM y WHERE bar_id = 123; This would have to go via the bar_memberships table but I think it could work. No need to add secondary option, no need to change the UI. The backend just have to query if ingredients exist differently based on a flag for the bar. |
Beta Was this translation helpful? Give feedback.
-
So for anyone seeing this and looking for a solution I kind of solved it in pure SQL with the help of some TRIGGERs. The following snippets where added (need to modify bar-id, we only have one). The solution was to create a trigger that is run on an insert and at the same time also insert the ingredient on the shelf for all users with association to the bar (with ID = 1 in this case). The DELETE TRIGGER pasted below does not filter on bar association but could probably be modified to do so. It just removes the ingredient for all users shelfs. CREATE TRIGGER insert_shelf_ingredient_for_all AFTER INSERT ON user_ingredients
BEGIN
INSERT OR IGNORE INTO user_ingredients (bar_membership_id, ingredient_id) SELECT bar_memberships.id, NEW.ingredient_id FROM bar_memberships WHERE bar_id = 1;
END;
CREATE TRIGGER delete_shelf_ingredient_for_all AFTER DELETE ON user_ingredients
BEGIN
DELETE FROM user_ingredients WHERE ingredient_id = OLD.ingredient_id;
END; |
Beta Was this translation helpful? Give feedback.
-
Latest release includes specific bar shelf, cheers! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I am currently testing this software as a bar menu in a real bar. So far we have had some setup of our own recopies and ingredients that we have. To connect different people with different roles in the bar they got their own accounts that can be used. However I noticed that the "on shelf" status of the ingredients does not sync between users. So if I log in with my account I have put some ingredients on the shelf and can make a considerable amount of the drinks. However, someone with their own "General" account does not have the same ingredients as "on shelf" and thus can't make the same drinks according to the software.
I think this decision must be deliberate. It is a big drawback for managing the same bar with several users (managers/procurement vs. bartenders). If both options is wanted perhaps this should be some type of configuration flag for the backend.
Beta Was this translation helpful? Give feedback.
All reactions