tfrayner / beerfestdb

Beer festival cellar management database and related software.
GNU General Public License v3.0
2 stars 3 forks source link

Cask creation upon order receipt only occurs when using the web UI #6

Closed tfrayner closed 7 years ago

tfrayner commented 8 years ago

The CaskManagement/Cask autocreation which occurs after web UI update to indicate product arrival does not occur when using load_data.pl to load data. This is at least partly by design, since the load_data.pl script is intended as a lower-level access to the database than the more user-friendly site. So while I'm not convinced there's a bug to be fixed here, there should at least be a user-friendly way of escaping from a situation where a product is marked as having arrived without having populated CaskManagement or Cask.

I suggest an option added to preload_festival_casks.pl to take the object creation one step further and instantiate actual Casks rather than just virtual CaskManagements.

tfrayner commented 7 years ago

In the end I have decided that having load_data.pl and the web interface both behaving in the same manner trumps any need to keep the former script as a low-level data loader; in future we will want to try to keep the object creation logic synchronised between these classes (most likely via the CaskPreloader role class, which is where this is currently handled).