I am trying to create this API endpoint that will accept JSON payload and will calculate quote based on provided factors and their ratings.
I have Entities that contain information about
"ABI code" ratings.
These AgeRating, PostcodeRating and AbiRating entities implement RatingFactorInterface to force implementation of getRatingFactor() method.
QuoteController seems to be violating "Single Responsibility" and "Open/Close" design principles as the factors like "age", "postcode" can change - extra factor can be added or one of the factors might not be used.
I was thinking maybe it would be possible for rating factors to be specified in the dependency injection container, but can't seem find a good example how this would work especially with factors that depend on other services like AbiCodeRating which also depends on ABI code which is returned by using third party API which accepts car registration number.
Consultant required to refactor the controller and other classes in a project so I'm not violating Single Responsibility, Open / Close or other SOLID design principles. I will need a consultant to explain the refactoring process.