I have tasked myself with building a Laravel application for my employer.
Background: The application is a quotation, invoice solution. My employer supplies PABX systems to various dealers around the continent of Africa. They register a dealership, each dealership then registers their users. Each user can then configure a solution for their client on any one of three PABX systems based on the client requirements.
What I have achieved thus far.
- Registration implementation of all users.
- Validation.
- Configuration of two of the three systems. From input received, to the logic and storing the data of each quote in required tables including pivot tables where required.
- Retrieving the data from the tables to be shown on the quote/invoice.
- Back end for my employer as well as one for each dealer to then get summaries on data to date.
My issue at the moment is configuration of the third and biggest system. It consists of one main unit with its default limitations. The limitations can be increased with various cards and various licenses. There after the main unit can be expanded by three more expansion units. Each again taking their own cards. If a certain card is equipped, it could create a situation where other cards may not be equipped in the same unit.
So there are thus various different possible configurations possible for each scenario. I guess roughly 100 possible different configurations. I have to create a method to receive the information from an input form (client requirements) and find the most efficient and cost effective configuration.
I cannot let the user manually configure the systems as this could result in faulty configurations and the solution has to be "idiot proof"
I could wright an if/switch method where the input data would be passed through and the method to then give me the first (most cost effective) configuration of main unit, expansion unit, cards and licenses) based on the user input.
I do not mind typing the code at all or working through the logic even if it is 100 possible scenarios. My question to you is what would be the best approach to this. To create a switch or an if statement or is there an alternative approach to this?
Thank you in advance for your input.
Aucun commentaire:
Enregistrer un commentaire