ericksonreyes / domain-driven-design
Domain Driven Design Inspired Classes and Interfaces
v2.1.0
2020-08-05 10:12 UTC
Requires
- php: >=7.2
Requires (Dev)
- fzaninotto/faker: ~1.4
- leanphp/phpspec-code-coverage: ^4.2
- mockery/mockery: ~1.0
- phing/phing: ^2.16
- php-coveralls/php-coveralls: ^2.1
- phpmd/phpmd: ^2.6
- phpspec/phpspec: ^4.0
- phpunit/phpunit: ~7.0
- sebastian/phpcpd: ^4.1
- squizlabs/php_codesniffer: ^3.3
README
A collection of Domain Driven Design inspired Classes and Interfaces.
Installation
composer require ericksonreyes/domain-driven-design
Usage
Value Objects
- Identifier
- Currency
- Email Address
- Money
- Full Name
- Name Title
- Person Name
- Name Suffix
- Address
- Street
- City
- State
- Country Code
- Zip Code
- File
Examples
Interfaces
- Command Bus
- Event Bus
- Event Handler
- Event Publisher
- Event Repository
- Exception Handler
- Identity Generator
Abstract Exceptions
- AuthenticationFailureException - Authentication/Login failed.
- PermissionDeniedException - Authorization failed. No permission to access a record or execute a command.
- RecordConflictException - Saving an existing record or overwriting a record with state that has been changed.
- DeletedRecordException - Accessing or deleting a record that has been deleted already.
- RecordNotFoundException - Accessing or deleting a record that never existed.
- MissingActionPerformerException - Commands that has no action performer for accountability.
- EmptyIdentifierException - Entity or aggregate with an empty identifier value.
Exceptions
- MissingEventReplayMethodException - Event sourced entity or aggregate does not have the required event replay method.
- DomainEventOwnershipException - Replaying an event that does not belong to the entity or aggregate.