Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/*.ide
/vendors
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,25 @@ More examples will be posted in my blog:

#### Immutable
* https://github.com/matthiasnoback/convenient-immutability @matthiasnoback

## Use case example

Domain requirements:

Mr. Smith is the proud owner of the restaurant Smith's Pizzeria. He wish to have a site to manage it's company and promote it's products on the Web. Here are the requirement he wishes you to implement.

* The owner is the only employee granted to create new or delete recipes.
* Recipes have ingredients that can be categorized with allergens
* a cashier takes the orders of phone, drive through or take out customers
* a delivery boy (or girl) delivers prepared meals to the customers who ordered by phone
* a waitress takes orders to seated clients
* waitress serve the meals to in house customers.
* performance bonus are alloted to each trimester based on waiting time of customers. Lower it is greater the bonus.
* bonus are calculated according to the following chart, based on type of client and average time to serve clients (todo)
* recipes are not available to customers as long as they have not been released.
* recipes can be back ordered which means that no customers can order them.
* retired recipes no longer appears on the menu, they have been removed from production.
* front desk, drive through and in house customers do not keep order history, they are considered anonymous customer, while Web and phone customers are identified with their phone number to track their orders.
* delivery boy pickup the customer order at an hour, and are expected to deliver it in order of priority based on ordered at time.
* Waitress should serve all meals of the customer table at the same time, but for bonus reason, the clock start ticking when the first table customer order is entered to the last meal served
* cashier make the customer pay on order, while delivery boy make them pay when order delivered, and waitress make them pay at end of diner.
7 changes: 7 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default:
suites:
admin_features:
paths: [ %paths.base%/features ]
contexts: [ Example\ApplicationContext ]
filters:
role: owner
24 changes: 18 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
{
"name": "vendor_name/package_name",
"description": "description_text",
"name": "php-ddd/php-ddd",
"description": "Example of structure and implementation of DDD in php with Symfony and Doctrine",
"minimum-stability": "stable",
"license": "proprietary",
"license": "MIT",
"authors": [
{
"name": "author's name",
"name": "",
"email": "email@example.com"
}
],
"require": {
"phpunit/phpunit": "^5.2"
"php": "^5.5",
"behat/behat": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"autoload": {
"psr-4": {
"Example\\": ["src", "tests"]
"Example\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Example\\": ["tests", "features/bootstrap"]
}
},
"config": {
"bin-dir": "bin"
}
}
Loading