Design and implement a domain service that will process these three delivery orders (JSON on 2nd page) and return appropriate types of objects based on the delivery type with the following specifications:
- Each delivery type can have a different workflow.
- Delivery with “enterpriseDelivery” type needs to be sent off to a 3rd party API for validation of the enterprise.
- Delivery order coming from an email campaign needs to communicate with a separate marketing service indicating the success of the given email campaign.
Questions are welcome.
Demonstrate the use of SOLID principles, design patterns and domain driven design. Indicate and showcase what sort of automated testing procedure would you recommend to use for such a service.
- The code does not have to be 100% functional, the purpose of this test is to get insight into your problem solving process and your understanding of the OOP.
- We are looking for encapsulation, inheritance/abstraction and polymorphism.
- Provide readme.md to explain your thought process.
- Please deliver the code via a public version control repository.
This script has 3 levels of code.
- Controller to receive the http request.
- A use case which performs an action using the domain.
- The domain to execute the use case and return a response back down the chain.
- Receive HTTP Request
- Validate JSON
- Instantiate Delivery Order Container Factory
- Create a new delivery order request
- Pass the request to the delivery order service
- Process the delivery order following instructions above
- Return Generated invoices using service process method
Option #1
Run: php framework_independent_test.php to generate a json response based
on data in tests/DummyJson.php
Option #2
With Symfony framework included in your composer.json, go to URL http.../delivery/process