Hi all,
This is a fairly general question about design I guess. I have an app where people can book equipment. There is often some commonality between the bookings (such as 'Notes' about the booking), some need start & end times, some don't, some need a file uploaded with the booking, some don't etc.
At the moment I have a single Equipment model and just quite a few nullable() columns, and also for some of the more complex equipment there are extra related models that I check for in a kind of $equipment->specialBooking way and show/hide fields as appropriate.
This is making some of the code very straightforward as I can operate on the single Equipment model and share a lot of code - but other code is getting a bit spidery where there are a lot of if/else type stuff in the code & views.
So I was wondering if anyone else here has had to work with this kind of pattern and what they did? I'm tempted to separate the different major types of Equipment into their own models/controllers (maybe with common code in a helper/repo) and just deal with the complications that itself brings?