-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
31 lines (13 loc) · 1.22 KB
/
README
File metadata and controls
31 lines (13 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Tests
cd test
./../vendor/bin/phpunit --bootstrap="bootstrap.php" ./
# Domain
It's loan investment domain. A loan is split into tranches. Tranches can have different monthly interest percentages. Besides, each tranche has a maximum amount available to invest. There are investors who can invest into those tranches and get interest in the end of each month.
# Project structure
There three higher-level directories: domain, useCases and infrastructure. Domain is where, well, domain concepts live: entities, value-objects and repository interfaces. UseCases is where those domain entities are orchestrated by USeCases classes. Infrastructure code resided in infrastructure directory.
# Use cases
UseCase classes represent use-case approach from clean architecture. It's akin to an Application Service class from DDD: class that coordinates injected dependencies to carry out some use case logic.
# Action interface
This interface declares the basic functionality of any application: it acts upon a request and returns a response.
# Validation
I follow the approach of context validation. Hence it resides in commands, not entities. Plus with this approach it's way easier to map errors to UI -- and with no exceptions thrown.