samedi 19 mai 2018

Add an extra toplevel to entire website, and start with a clean version of the application

The problem:

We have a web application (in Symfony 2.8) with +- 125 tables filled with data. Now our client asks to add an extra top-level named "Division". And when they create a new Division, they get a blanc copy of the application to start working in. So almost like a new clean sheet.

The users stay the same, some will get access to 1 Division, some to both, but more Divisions will come in the future by just pressing "new division".

We are now going through the whole application:

  • The top-level entities get an extra property Division (via a DivisionTrait) added to them...

  • changing every single query by adding something like " AND division.id = $session->get('current_division') " in all controllers.

  • Injecting this division id in all form types and also extend every query.

  • And offcourse a lot of testing and debugging

But this is a lot of work.

The question:

What are the options or design patterns so we can achieve this in an easier way? I'm sure we are not the first ones with this problem. ;)

Aucun commentaire:

Enregistrer un commentaire