Skip to content

Commit aba5cd5

Browse files
committed
Add basic concepts
* Administration context: ** Owner hire candidate * Sale context: ** Create Waitress, Cook, Cashier and Delivery boy when Candidate is hired * Shipping context ** Create Delivery boy when Candidate is hired * Application context ** Add EventPublisher ** Add Symfony port adapter ** Add InMemory port adapter ** Behat context
1 parent 777b9ca commit aba5cd5

File tree

64 files changed

+3279
-622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3279
-622
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/*.ide
2+
/vendors

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,25 @@ More examples will be posted in my blog:
1818

1919
#### Immutable
2020
* https://github.com/matthiasnoback/convenient-immutability @matthiasnoback
21+
22+
## Use case example
23+
24+
Domain requirements:
25+
26+
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.
27+
28+
* The owner is the only employee granted to create new or delete recipes.
29+
* Recipes have ingredients that can be categorized with allergens
30+
* a cashier takes the orders of phone, drive through or take out customers
31+
* a delivery boy (or girl) delivers prepared meals to the customers who ordered by phone
32+
* a waitress takes orders to seated clients
33+
* waitress serve the meals to in house customers.
34+
* performance bonus are alloted to each trimester based on waiting time of customers. Lower it is greater the bonus.
35+
* bonus are calculated according to the following chart, based on type of client and average time to serve clients (todo)
36+
* recipes are not available to customers as long as they have not been released.
37+
* recipes can be back ordered which means that no customers can order them.
38+
* retired recipes no longer appears on the menu, they have been removed from production.
39+
* 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.
40+
* delivery boy pickup the customer order at an hour, and are expected to deliver it in order of priority based on ordered at time.
41+
* 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
42+
* 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.

behat.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
default:
2+
suites:
3+
admin_features:
4+
paths: [ %paths.base%/features ]
5+
contexts: [ Example\ApplicationContext ]
6+
filters:
7+
role: owner

composer.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
{
2-
"name": "vendor_name/package_name",
3-
"description": "description_text",
2+
"name": "php-ddd/php-ddd",
3+
"description": "Example of structure and implementation of DDD in php with Symfony and Doctrine",
44
"minimum-stability": "stable",
5-
"license": "proprietary",
5+
"license": "MIT",
66
"authors": [
77
{
8-
"name": "author's name",
8+
"name": "",
99
"email": "email@example.com"
1010
}
1111
],
1212
"require": {
13-
"phpunit/phpunit": "^5.2"
13+
"php": "^5.5",
14+
"behat/behat": "^3.1"
15+
},
16+
"require-dev": {
17+
"phpunit/phpunit": "~4.0"
1418
},
1519
"autoload": {
1620
"psr-4": {
17-
"Example\\": ["src", "tests"]
21+
"Example\\": "src"
1822
}
23+
},
24+
"autoload-dev": {
25+
"psr-4": {
26+
"Example\\": ["tests", "features/bootstrap"]
27+
}
28+
},
29+
"config": {
30+
"bin-dir": "bin"
1931
}
2032
}

0 commit comments

Comments
 (0)