Hi,
TL;DR: I need to have some sort of version control on my things. One equivalent to live and another for dev.
I am working on some sort of restaurant menu feature. I need to implement a feature so that the person in charge can make changes to the menu during opening hours without interfering with the customers in the restaurant using the menu.
He or she would work on the new menu for 1 - 2 … days or whatever time is needed, and at the very end when the new menu is satisfactory, he’d publish the menu that will now be live and available for the end user.
For the example let’s say I have 2 objects : “menu” and “menu_item”
“Menu” has some datasets :
- a name : text
- a list of “menu_items”
- a photo
I need to be able to :
- sort the list
- add a menu_item
- remove a menu_item
- rename the menu
- delete the photo
- etc…
You get the idea. What would be your best way of doing so?
Icing on the cake : in order to be able to make statistics over time, it would be great if objects would not be deleted and re-created every time a slight modification is made.
Thanks
It might be an option to use dates for that. When there is a need for a new menu or menu-item, create a new one by copying the old one or adding a one. Make all of the modifcations. Publish the new version when needed, the old version gets dateValidTo = publish date. The new version gets dateValidFrom = publish date. When displaying the current menu do a search for menu and items without a dateValidTo value. This way you can also plan in advance when a menu needs to go ‘live’. Additionally you can consider using a status or versioning.
1 Like
Thanks,
I get how that will work for adding or removing something. But how about changing something. Like renaming the menu, or changing the menu photo ?
Unless I double every single field of the object, with a “current_state_[field_name]” and “future_state[field_name]”
1 Like
For instance with a version (current version plus 1) for a total menu change (for the new season) and sub versions (1.1) for a menu item change.
So that will be multiple objects for “the same thing” right?
I think I thought about that, with a status “live” or “dev” sort of thing on each thing. I wanted to find an other solution just so I can keep objects in time for easier calculations for statistics. But I’ll end up doing this probably
1 Like
Yeah indeed. You can consider only allowing the highest version to be edited and have the previous ones as history to make it not too complex.
Man, next you will be introducing branches so that multiple people can work on the same menu. Who knew designing a restaurant menu would be so similar to software development. 
If only Bubble would allow to create temporary objects (variables) on the front-end that would remove a bunch of difficulties
Yeah that would be awesome.