├── README.md
├── var
└── cache
│ └── jms_serializer
│ └── .gitignore
├── src
├── IdentityAccess
│ ├── Test
│ │ ├── Resource
│ │ │ ├── _files
│ │ │ │ └── iddd_identity_access
│ │ │ │ │ ├── app
│ │ │ │ │ ├── logs
│ │ │ │ │ │ └── .gitkeep
│ │ │ │ │ ├── cache
│ │ │ │ │ │ └── .gitkeep
│ │ │ │ │ ├── config
│ │ │ │ │ │ ├── routing.yml
│ │ │ │ │ │ ├── security.yml
│ │ │ │ │ │ ├── config_test.yml
│ │ │ │ │ │ ├── routing_dev.yml
│ │ │ │ │ │ ├── parameters.yml.dist
│ │ │ │ │ │ ├── config_prod.yml
│ │ │ │ │ │ └── config_dev.yml
│ │ │ │ │ ├── .htaccess
│ │ │ │ │ ├── AppCache.php
│ │ │ │ │ ├── autoload.php
│ │ │ │ │ ├── Resources
│ │ │ │ │ │ └── views
│ │ │ │ │ │ │ └── base.html.twig
│ │ │ │ │ ├── console
│ │ │ │ │ └── phpunit.xml.dist
│ │ │ │ │ └── web
│ │ │ │ │ ├── robots.txt
│ │ │ │ │ ├── favicon.ico
│ │ │ │ │ ├── apple-touch-icon.png
│ │ │ │ │ ├── app.php
│ │ │ │ │ └── app_dev.php
│ │ │ ├── ResourceTestCase.php
│ │ │ ├── TenantResourceTest.php
│ │ │ └── GroupResourceTest.php
│ │ ├── Application
│ │ │ ├── ApplicationServiceTest.php
│ │ │ └── MockNotificationPublisher.php
│ │ └── Domain
│ │ │ └── Model
│ │ │ └── Identity
│ │ │ └── FullNameTest.php
│ ├── Resources
│ │ ├── config
│ │ │ ├── serializer
│ │ │ │ ├── SaasOvation\IdentityAccess\Domain\Model\Identity\TenantAdministratorRegistered.yml
│ │ │ │ ├── Domain.Model.Identity.TenantId.yml
│ │ │ │ ├── Domain.Model.Identity.Telephone.yml
│ │ │ │ ├── Domain.Model.Identity.EmailAddress.yml
│ │ │ │ ├── Domain.Model.Identity.FullName.yml
│ │ │ │ ├── Domain.Model.Identity.TenantProvisioned.yml
│ │ │ │ ├── Domain.Model.Access.RoleProvisioned.yml
│ │ │ │ ├── Domain.Model.Identity.UserPasswordChanged.yml
│ │ │ │ ├── Domain.Model.Identity.PersonNameChanged.yml
│ │ │ │ ├── Domain.Model.Identity.PersonContactInformationChanged.yml
│ │ │ │ ├── Domain.Model.Identity.UserRegistered.yml
│ │ │ │ ├── Domain.Model.Access.UserAssignedToRole.yml
│ │ │ │ ├── Domain.Model.Identity.ContactInformation.yml
│ │ │ │ └── Domain.Model.Identity.TenantAdministratorRegistered.yml
│ │ │ ├── doctrine
│ │ │ │ ├── SaasOvation.Common.Domain.Model.Process.ProcessId.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.TenantId.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Domain.Model.AbstractId.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.Telephone.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.EmailAddress.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Domain.Model.ConcurrencySafeEntity.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Domain.Model.IdentifiedDomainObject.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.FullName.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.GroupMember.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.Enablement.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.PostalAddress.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.RegistrationInvitation.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Access.Role.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Notification.PublishedNotificationTracker.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.Group.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.Person.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.User.dcm.xml
│ │ │ │ ├── SaasOvation.IdentityAccess.Domain.Model.Identity.Tenant.dcm.xml
│ │ │ │ └── SaasOvation.IdentityAccess.Domain.Model.Identity.ContactInformation.dcm.xml
│ │ │ └── identityaccess-doctrine.xml
│ │ └── bin
│ │ │ ├── db_setup.bat
│ │ │ └── db_setup.sh
│ ├── Resource
│ │ └── APIBundle
│ │ │ ├── SaasOvationIdentityAccessResourceAPIBundle.php
│ │ │ ├── Controller
│ │ │ ├── TenantsController.php
│ │ │ ├── AbstractResource.php
│ │ │ ├── GroupsController.php
│ │ │ ├── CurrentNotificationResource.php
│ │ │ └── NotificationsController.php
│ │ │ ├── DependencyInjection
│ │ │ └── Configuration.php
│ │ │ └── Resources
│ │ │ └── config
│ │ │ └── routes.xml
│ ├── Domain
│ │ └── Model
│ │ │ ├── Identity
│ │ │ ├── GroupMemberType.php
│ │ │ ├── EncryptionService.php
│ │ │ ├── GroupMemberType
│ │ │ │ ├── User.php
│ │ │ │ └── Group.php
│ │ │ ├── TenantId.php
│ │ │ ├── TenantActivated.php
│ │ │ ├── TenantDeactivated.php
│ │ │ ├── TenantProvisioned.php
│ │ │ ├── TenantRepository.php
│ │ │ ├── GroupRepository.php
│ │ │ ├── GroupProvisioned.php
│ │ │ ├── UserPasswordChanged.php
│ │ │ ├── PersonNameChanged.php
│ │ │ ├── GroupUserAdded.php
│ │ │ ├── GroupUserRemoved.php
│ │ │ ├── GroupGroupAdded.php
│ │ │ ├── GroupGroupRemoved.php
│ │ │ ├── UserEnablementChanged.php
│ │ │ ├── UserRepository.php
│ │ │ ├── PersonContactInformationChanged.php
│ │ │ └── UserRegistered.php
│ │ │ └── Access
│ │ │ ├── RoleRepository.php
│ │ │ ├── RoleProvisioned.php
│ │ │ ├── GroupAssignedToRole.php
│ │ │ ├── GroupUnassignedFromRole.php
│ │ │ └── UserUnassignedFromRole.php
│ ├── Application
│ │ ├── Command
│ │ │ ├── DeactivateTenantCommand.php
│ │ │ ├── ActivateTenantCommand.php
│ │ │ ├── AuthenticateUserCommand.php
│ │ │ ├── AssignUserToRoleCommand.php
│ │ │ ├── AddUserToGroupCommand.php
│ │ │ ├── RemoveUserFromGroupCommand.php
│ │ │ ├── ChangePrimaryTelephoneCommand.php
│ │ │ ├── ChangeSecondaryTelephoneCommand.php
│ │ │ ├── ProvisionGroupCommand.php
│ │ │ ├── ChangeEmailAddressCommand.php
│ │ │ ├── RemoveGroupFromGroupCommand.php
│ │ │ ├── ChangeUserPersonalNameCommand.php
│ │ │ ├── AddGroupToGroupCommand.php
│ │ │ └── ProvisionRoleCommand.php
│ │ ├── ApplicationServiceRegistry.php
│ │ └── GenericDomainEventSubscriber.php
│ └── Infrastructure
│ │ └── Services
│ │ └── MD5EncryptionService.php
├── Common
│ ├── Domain
│ │ └── Model
│ │ │ ├── Entity.php
│ │ │ ├── IdentifiedValueObject.php
│ │ │ ├── Identity.php
│ │ │ ├── DomainEventSubscriber.php
│ │ │ ├── Process
│ │ │ ├── ProcessCompletionType.php
│ │ │ ├── ProcessId.php
│ │ │ ├── TimeConstrainedProcessTrackerRepository.php
│ │ │ └── Process.php
│ │ │ ├── DomainEvent.php
│ │ │ ├── Comparable.php
│ │ │ ├── ImplementsDomainEvent.php
│ │ │ ├── IdentifiedDomainObject.php
│ │ │ ├── ConcurrencySafeEntity.php
│ │ │ └── AbstractId.php
│ ├── Media
│ │ ├── RepresentationReader.php
│ │ └── OvationsMediaType.php
│ ├── Persistence
│ │ ├── CleanableStore.php
│ │ └── PersistenceManagerProvider.php
│ ├── Event
│ │ ├── Sourcing
│ │ │ ├── EventNotifiable.php
│ │ │ ├── EventStoreAppendException.php
│ │ │ ├── EventStoreException.php
│ │ │ ├── EventStream.php
│ │ │ ├── EventDispatcher.php
│ │ │ ├── DispatchableDomainEvent.php
│ │ │ ├── EventStore.php
│ │ │ └── EventStreamId.php
│ │ ├── EventStore.php
│ │ └── EventSerializer.php
│ ├── Resources
│ │ ├── config
│ │ │ ├── serializer
│ │ │ │ ├── Domain.Model.AbstractId.yml
│ │ │ │ ├── Domain.Model.Process.ProcessId.yml
│ │ │ │ ├── Test.Port.Adapter.Persistence.LevelDB.Level.yml
│ │ │ │ ├── Event.StoredEvent.yml
│ │ │ │ ├── Test.Event.TestableDomainEvent.yml
│ │ │ │ ├── Notification.PublishedNotificationTracker.yml
│ │ │ │ ├── Notification.Notification.yml
│ │ │ │ └── Domain.Model.Process.TimeConstrainedProcessTracker.yml
│ │ │ ├── doctrine
│ │ │ │ ├── SaasOvation.Common.Domain.Model.Process.ProcessId.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Domain.Model.AbstractId.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Domain.Model.IdentifiedDomainObject.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Test.Domain.Model.Process.TestableTimeConstrainedProcess.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Event.StoredEvent.dcm.xml
│ │ │ │ ├── SaasOvation.Common.Notification.PublishedNotificationTracker.dcm.xml
│ │ │ │ └── SaasOvation.Common.Domain.Model.Process.AbstractProcess.dcm.xml
│ │ │ └── common-doctrine.xml
│ │ ├── bin
│ │ │ ├── db_setup.bat
│ │ │ └── db_setup.sh
│ │ └── sql
│ │ │ └── test_common.sql
│ ├── Notification
│ │ ├── NotificationPublisher.php
│ │ ├── PublishedNotificationTrackerStore.php
│ │ ├── NotificationLogInfo.php
│ │ └── NotificationSerializer.php
│ ├── Port
│ │ └── Adapter
│ │ │ ├── Messaging
│ │ │ ├── RabbitMQ
│ │ │ │ ├── MessageListener
│ │ │ │ │ ├── Type.php
│ │ │ │ │ └── Type
│ │ │ │ │ │ ├── Text.php
│ │ │ │ │ │ └── Binary.php
│ │ │ │ └── CustomTextMessageListener.php
│ │ │ ├── Exchanges.php
│ │ │ └── SlothMQ
│ │ │ │ └── ExchangePublisher.php
│ │ │ └── Persistence
│ │ │ ├── Doctrine
│ │ │ ├── AbstractDoctrineEntityManager.php
│ │ │ └── EntityManagerFactory.php
│ │ │ ├── EventSourcing
│ │ │ ├── LevelDB
│ │ │ │ ├── StreamKeyProvider.php
│ │ │ │ ├── LoggableJournalEntry.php
│ │ │ │ └── JournalKeyProvider.php
│ │ │ └── DefaultEventStream.php
│ │ │ └── LevelDB
│ │ │ └── AbstractLevelDBRepository.php
│ ├── Test
│ │ ├── Domain
│ │ │ └── Model
│ │ │ │ ├── TestAgilePMRabbitMQExchangeListener.php
│ │ │ │ ├── TestCollaborationRabbitMQExchangeListener.php
│ │ │ │ ├── TestIdentityAccessRabbitMQExchangeListener.php
│ │ │ │ ├── TestExchangeListener.php
│ │ │ │ ├── Process
│ │ │ │ ├── TestableTimeConstrainedProcessTimedOut.php
│ │ │ │ ├── TestableTimeConstrainedProcessTimedOutSubscriber.php
│ │ │ │ ├── TestableTimeConstrainedProcess.php
│ │ │ │ └── TestableTimeConstrainedProcessRepository.php
│ │ │ │ ├── TestAgilePMSlothMQExchangeListener.php
│ │ │ │ ├── TestCollaborationSlothMQExchangeListener.php
│ │ │ │ ├── TestIdentityAccessSlothMQExchangeListener.php
│ │ │ │ ├── DomainEventSubscriber.php
│ │ │ │ └── BaseTestExchangeListener.php
│ │ ├── Port
│ │ │ └── Adapter
│ │ │ │ └── Persistence
│ │ │ │ └── LevelDB
│ │ │ │ ├── Level.php
│ │ │ │ ├── LevelDBTest.php
│ │ │ │ └── TestableTimeConstrainedProcessTimedOutSubscriber.php
│ │ ├── Notification
│ │ │ ├── MockPublishedNotificationTrackerStore.php
│ │ │ └── NotificationPublisherCreationTest.php
│ │ ├── CommonTestCase.php
│ │ ├── Event
│ │ │ ├── AnotherTestableDomainEvent.php
│ │ │ ├── TestableDomainEvent.php
│ │ │ ├── EventSerializerTest.php
│ │ │ └── TestableNavigableDomainEvent.php
│ │ ├── Media
│ │ │ └── RepresentationReaderTest.php
│ │ └── BuildsServiceContainer.php
│ ├── Enum.php
│ └── Serializer
│ │ └── ObjectSerializer.php
├── Collaboration
│ ├── Domain
│ │ └── Model
│ │ │ ├── Collaborator
│ │ │ ├── Author.php
│ │ │ ├── Owner.php
│ │ │ ├── Creator.php
│ │ │ ├── Moderator.php
│ │ │ ├── Participant.php
│ │ │ └── CollaboratorService.php
│ │ │ ├── Forum
│ │ │ ├── PostId.php
│ │ │ ├── ForumId.php
│ │ │ ├── DiscussionId.php
│ │ │ ├── PostRepository.php
│ │ │ ├── DiscussionRepository.php
│ │ │ ├── ForumRepository.php
│ │ │ ├── ForumReopened.php
│ │ │ └── ForumClosed.php
│ │ │ ├── Tenant
│ │ │ └── Tenant.php
│ │ │ └── Calendar
│ │ │ ├── CalendarId.php
│ │ │ ├── CalendarEntryId.php
│ │ │ ├── RepeatType
│ │ │ ├── Daily.php
│ │ │ ├── Monthy.php
│ │ │ ├── Weekly.php
│ │ │ ├── Yearly.php
│ │ │ └── DoesNotRepeat.php
│ │ │ ├── AlarmUnitsType
│ │ │ ├── Days.php
│ │ │ ├── Hours.php
│ │ │ └── Minutes.php
│ │ │ ├── AlarmUnitsType.php
│ │ │ ├── CalendarRepository.php
│ │ │ ├── RepeatType.php
│ │ │ ├── CalendarEntryRepository.php
│ │ │ └── CalendarIdentityService.php
│ ├── Application
│ │ ├── Forum
│ │ │ └── Data
│ │ │ │ ├── ForumCommandResult.php
│ │ │ │ └── DiscussionCommandResult.php
│ │ └── Calendar
│ │ │ └── Data
│ │ │ └── CalendarCommandResult.php
│ ├── Port
│ │ └── Adapter
│ │ │ └── Service
│ │ │ ├── UserInRoleAdapter.php
│ │ │ └── CollaboratorTranslator.php
│ ├── Resources
│ │ └── bin
│ │ │ ├── db_setup.bat
│ │ │ └── db_setup.sh
│ └── Test
│ │ ├── Resources
│ │ └── config
│ │ │ └── collaboration-test.xml
│ │ ├── Application
│ │ ├── Forum
│ │ │ ├── CustomForumCommandResult.php
│ │ │ └── CustomDiscussionCommandResult.php
│ │ └── Calendar
│ │ │ └── DummyCalendarCommandResult.php
│ │ ├── Domain
│ │ └── Model
│ │ │ ├── Calendar
│ │ │ └── CalendarEntryScheduledSubscriber.php
│ │ │ ├── Forum
│ │ │ ├── AbstractForumTest.php
│ │ │ └── DiscussionStartedSubscriber.php
│ │ │ └── Collaborator
│ │ │ └── MockUserInRoleAdapter.php
│ │ └── StorageCleaner.php
└── AgilePm
│ └── Domain
│ └── Model
│ ├── ValueObject.php
│ ├── Discussion
│ └── DiscussionAvailability
│ │ ├── Ready.php
│ │ ├── Failed.php
│ │ ├── Requested.php
│ │ ├── NotRequested.php
│ │ ├── AddOnNotEnabled.php
│ │ └── DiscussionAvailavility.php
│ └── Entity.php
├── .gitignore
├── cli-config.php
└── phpunit.xml.dist
/README.md:
--------------------------------------------------------------------------------
1 | IDDD_Samples_PHP
2 | ================
3 |
--------------------------------------------------------------------------------
/var/cache/jms_serializer/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/_files/iddd_identity_access/app/logs/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/_files/iddd_identity_access/app/cache/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/serializer/SaasOvation\IdentityAccess\Domain\Model\Identity\TenantAdministratorRegistered.yml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Common/Domain/Model/Entity.php:
--------------------------------------------------------------------------------
1 |
2 | Require all denied
3 |
4 |
5 | Order deny,allow
6 | Deny from all
7 |
8 |
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Forum/ForumId.php:
--------------------------------------------------------------------------------
1 | create_iam.sql
8 | mysql -u root -p < create_iam.sql
9 | del /Q create_iam.sql
10 | echo Completed
11 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/bin/db_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # -------------------------------------------
3 | # IDDD Common database setup
4 | # -------------------------------------------
5 |
6 | echo Creating IDDD IdentityAccess database...
7 | cat ../sql/iam.sql > create_iam.sql
8 | cat ../../../Common/Resources/sql/common.sql >> create_iam.sql
9 | mysql -u root -p < create_iam.sql
10 | rm -f create_iam.sql
11 |
12 | echo Completed
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/serializer/Domain.Model.Identity.TenantProvisioned.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\IdentityAccess\Domain\Model\Identity\TenantProvisioned:
2 | exclusion_policy: NONE
3 |
4 | properties:
5 | tenantId:
6 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\TenantId
7 |
8 | eventVersion:
9 | type: integer
10 |
11 | occurredOn:
12 | type: DateTimeImmutable
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/ResourceTestCase.php:
--------------------------------------------------------------------------------
1 | eventTrackingTestCase->handledEvents()->clear();
10 | $this->eventTrackingTestCase->handledNotifications()->clear();
11 | }
12 |
13 | protected function listensTo()
14 | {
15 | return null; // receive all
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Common/Domain/Model/Comparable.php:
--------------------------------------------------------------------------------
1 | create_test_common.sql
12 | mysql -u root -p < create_test_common.sql
13 | del /Q create_test_common.sql
14 |
15 | echo Completed
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/_files/iddd_identity_access/app/Resources/views/base.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {% block title %}Welcome!{% endblock %}
6 | {% block stylesheets %}{% endblock %}
7 |
8 |
9 |
10 | {% block body %}{% endblock %}
11 | {% block javascripts %}{% endblock %}
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Common/Test/Domain/Model/Process/TestableTimeConstrainedProcessTimedOut.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Common/Resources/config/doctrine/SaasOvation.Common.Domain.Model.Process.ProcessId.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/DeactivateTenantCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
12 | }
13 |
14 | public function getTenantId()
15 | {
16 | return $this->tenantId;
17 | }
18 |
19 | public function setTenantId($tenantId)
20 | {
21 | $this->tenantId = $tenantId;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.TenantId.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Common/Domain/Model/ImplementsDomainEvent.php:
--------------------------------------------------------------------------------
1 | eventVersion;
22 | }
23 |
24 | public function occurredOn()
25 | {
26 | return $this->occurredOn;
27 | }
28 | }
--------------------------------------------------------------------------------
/src/Collaboration/Test/Resources/config/collaboration-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Common/Resources/config/serializer/Notification.Notification.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\Common\Notification\Notification:
2 | exclusion_policy: ALL
3 |
4 | properties:
5 | event:
6 | expose: true
7 |
8 | notificationId:
9 | type: integer
10 | expose: true
11 |
12 | occurredOn:
13 | type: DateTimeImmutable
14 | expose: true
15 |
16 | typeName:
17 | type: string
18 | expose: true
19 |
20 | version:
21 | type: integer
22 | expose: true
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Forum/PostRepository.php:
--------------------------------------------------------------------------------
1 | setId(-1);
17 | }
18 |
19 | protected function id()
20 | {
21 | return $this->id;
22 | }
23 |
24 | private function setId($anId)
25 | {
26 | $this->id = $anId;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Common/Domain/Model/Process/ProcessId.php:
--------------------------------------------------------------------------------
1 | create_test_common.sql
12 | cat "$DIR/../sql/common.sql" >> create_test_common.sql
13 | mysql -u${MYSQL_USER} -p${MYSQL_PASSWORD} < create_test_common.sql
14 | rm -f create_test_common.sql
15 |
16 | echo Completed
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/serializer/Domain.Model.Identity.PersonNameChanged.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\IdentityAccess\Domain\Model\Identity\PersonNameChanged:
2 | expose_policy: NONE
3 |
4 | properties:
5 | name:
6 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\FullName
7 |
8 | tenantId:
9 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\TenantId
10 |
11 | username:
12 | type: string
13 |
14 | eventVersion:
15 | type: integer
16 |
17 | occurredOn:
18 | type: DateTime
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Forum/DiscussionRepository.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
15 | }
16 |
17 | public function getTenantId()
18 | {
19 | return $this->tenantId;
20 | }
21 |
22 | public function setTenantId($tenantId)
23 | {
24 | $this->tenantId = $tenantId;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Common/Test/Domain/Model/TestAgilePMSlothMQExchangeListener.php:
--------------------------------------------------------------------------------
1 | confirmed = true;
17 | }
18 |
19 | public function internalOnlyTestConfirmation()
20 | {
21 | return $this->confirmed;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Collaborator/CollaboratorService.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Calendar/CalendarRepository.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Common/Domain/Model/Process/TimeConstrainedProcessTrackerRepository.php:
--------------------------------------------------------------------------------
1 | assertArgumentNotEmpty(
13 | $aPlainTextValue,
14 | 'Plain text value to encrypt must be provided.'
15 | );
16 |
17 | return md5($aPlainTextValue);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/serializer/Domain.Model.Identity.PersonContactInformationChanged.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\IdentityAccess\Domain\Model\Identity\PersonContactInformationChanged:
2 | exclusion_policy: NONE
3 |
4 | properties:
5 | contactInformation:
6 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\ContactInformation
7 |
8 | tenantId:
9 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\TenantId
10 |
11 | username:
12 | type: string
13 |
14 | eventVersion:
15 | type: integer
16 |
17 | occurredOn:
18 | type: DateTimeImmutable
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.Telephone.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Calendar/RepeatType.php:
--------------------------------------------------------------------------------
1 | exchangeName = $anExchangeName;
15 | }
16 |
17 | public function publish($aType, $aMessage)
18 | {
19 | SlothClient::instance()->publish($this->exchangeName(), $aType, $aMessage);
20 | }
21 |
22 | private function exchangeName()
23 | {
24 | return $this->exchangeName;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.EmailAddress.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/Common/Enum.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/serializer/Domain.Model.Identity.UserRegistered.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\IdentityAccess\Domain\Model\Identity\UserRegistered:
2 | expose_policy: NONE
3 |
4 | properties:
5 | emailAddress:
6 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\EmailAddress
7 |
8 | name:
9 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\FullName
10 |
11 | tenantId:
12 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\TenantId
13 |
14 | username:
15 | type: string
16 |
17 | eventVersion:
18 | type: integer
19 |
20 | occurredOn:
21 | type: DateTime
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/_files/iddd_identity_access/app/config/config_prod.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: config.yml }
3 |
4 | #framework:
5 | # validation:
6 | # cache: apc
7 |
8 | #doctrine:
9 | # orm:
10 | # metadata_cache_driver: apc
11 | # result_cache_driver: apc
12 | # query_cache_driver: apc
13 |
14 | monolog:
15 | handlers:
16 | main:
17 | type: fingers_crossed
18 | action_level: error
19 | handler: nested
20 | nested:
21 | type: stream
22 | path: "%kernel.logs_dir%/%kernel.environment%.log"
23 | level: debug
24 | console:
25 | type: console
26 |
--------------------------------------------------------------------------------
/src/Common/Resources/config/doctrine/SaasOvation.Common.Domain.Model.IdentifiedDomainObject.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/serializer/Domain.Model.Access.UserAssignedToRole.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\IdentityAccess\Domain\Model\Access\UserAssignedToRole:
2 | exclusion_policy: NONE
3 |
4 | properties:
5 | emailAddress:
6 | type: string
7 |
8 | firstName:
9 | type: string
10 |
11 | lastName:
12 | type: string
13 |
14 | roleName:
15 | type: string
16 |
17 | tenantId:
18 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\TenantId
19 |
20 | username:
21 | type: string
22 |
23 | eventVersion:
24 | type: integer
25 |
26 | occurredOn:
27 | type: DateTimeImmutable
--------------------------------------------------------------------------------
/src/Common/Resources/config/doctrine/SaasOvation.Common.Test.Domain.Model.Process.TestableTimeConstrainedProcess.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.Common.Domain.Model.IdentifiedDomainObject.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.FullName.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/TenantActivated.php:
--------------------------------------------------------------------------------
1 | occurredOn = new DateTimeImmutable();
21 | $this->tenantId = $aTenantId;
22 | }
23 |
24 | public function tenantId()
25 | {
26 | return $this->tenantId;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/TenantDeactivated.php:
--------------------------------------------------------------------------------
1 | occurredOn = new DateTimeImmutable();
21 | $this->tenantId = $aTenantId;
22 | }
23 |
24 | public function tenantId()
25 | {
26 | return $this->tenantId;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/TenantProvisioned.php:
--------------------------------------------------------------------------------
1 | occurredOn = new DateTimeImmutable();
21 | $this->tenantId = $aTenantId;
22 | }
23 |
24 | public function tenantId()
25 | {
26 | return $this->tenantId;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/serializer/Domain.Model.Identity.ContactInformation.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\IdentityAccess\Domain\Model\Identity\ContactInformation:
2 | exclusion_policy: NONE
3 |
4 | properties:
5 | emailAddress:
6 | type: string
7 |
8 | postalAddressCity:
9 | type: string
10 |
11 | postalAddressCountryCode:
12 | type: string
13 |
14 | postalAddressPostalCode:
15 | type: string
16 |
17 | postalAddressStreetAddress:
18 | type: string
19 |
20 | postalAddressStateProvince:
21 | type: string
22 |
23 | primaryTelephone:
24 | type: string
25 |
26 | secondaryTelephone:
27 | type: string
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Calendar/CalendarEntryRepository.php:
--------------------------------------------------------------------------------
1 | setEntityManager($anEntityManager);
17 | }
18 |
19 | protected function entityManager()
20 | {
21 | return $this->entityManager;
22 | }
23 |
24 | private function setEntityManager(EntityManager $anEntityManager)
25 | {
26 | $this->entityManager = $anEntityManager;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Common/Resources/sql/test_common.sql:
--------------------------------------------------------------------------------
1 | DROP DATABASE IF EXISTS iddd_common_test;
2 | CREATE DATABASE iddd_common_test;
3 | USE iddd_common_test;
4 | SET FOREIGN_KEY_CHECKS=0;
5 |
6 | CREATE TABLE `tbl_testable_time_constrained_process` (
7 | `id` bigint(20) NOT NULL auto_increment,
8 | `allowable_duration` bigint(20) NOT NULL,
9 | `confirm1` tinyint(1) NOT NULL,
10 | `confirm2` tinyint(1) NOT NULL,
11 | `description` varchar(200),
12 | `process_id_id` varchar(36) NOT NULL,
13 | `process_completion_type` varchar(50) NOT NULL,
14 | `start_time` datetime NOT NULL,
15 | `tenant_id` varchar(36) NOT NULL,
16 | `timed_out_date` datetime,
17 | `concurrency_version` int(11) NOT NULL,
18 | PRIMARY KEY (`id`)
19 | ) ENGINE=InnoDB;
20 |
--------------------------------------------------------------------------------
/src/Common/Notification/NotificationLogInfo.php:
--------------------------------------------------------------------------------
1 | notificationLogId = $aNotificationLogId;
20 | $this->totalLogged = $aTotalLogged;
21 | }
22 |
23 | public function notificationLogId()
24 | {
25 | return $this->notificationLogId;
26 | }
27 |
28 | public function totalLogged()
29 | {
30 | return $this->totalLogged;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Common/Event/Sourcing/DispatchableDomainEvent.php:
--------------------------------------------------------------------------------
1 | domainEvent = $aDomainEvent;
22 | $this->eventId = $anEventId;
23 | }
24 |
25 | public function domainEvent()
26 | {
27 | return $this->domainEvent;
28 | }
29 |
30 | public function eventId()
31 | {
32 | return $this->eventId;
33 | }
34 | }
--------------------------------------------------------------------------------
/src/Common/Port/Adapter/Persistence/Doctrine/EntityManagerFactory.php:
--------------------------------------------------------------------------------
1 | identityApplicationService()->tenant($aTenantId);
18 |
19 | if (null === $aTenant) {
20 | throw new NotFoundHttpException();
21 | }
22 |
23 | return $aTenant;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.GroupMember.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Collaboration/Test/Application/Forum/CustomForumCommandResult.php:
--------------------------------------------------------------------------------
1 | forumId = $aForumId;
15 | }
16 |
17 | public function resultingDiscussionId($aDiscussionId)
18 | {
19 | $this->discussionId = $aDiscussionId;
20 | }
21 |
22 | public function getForumId()
23 | {
24 | return $this->forumId;
25 | }
26 |
27 | public function getDiscussionId()
28 | {
29 | return $this->discussionId;
30 | }
31 | }
--------------------------------------------------------------------------------
/src/IdentityAccess/Resource/APIBundle/Controller/AbstractResource.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/TenantResourceTest.php:
--------------------------------------------------------------------------------
1 | tenantAggregate();
12 |
13 | $client = static::createClient();
14 |
15 | $client->request(
16 | 'GET',
17 | sprintf('/tenants/%s', $tenant->tenantId()->id())
18 | );
19 |
20 | $reader = RepresentationReader::fromString(
21 | $client->getResponse()->getContent()
22 | );
23 |
24 | $this->assertEquals($tenant->name(), $reader->stringValue('name'));
25 | $this->assertTrue($reader->booleanValue('active'));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/AgilePm/Domain/Model/Entity.php:
--------------------------------------------------------------------------------
1 | setConcurrencyVersion(0);
19 | }
20 |
21 | /**
22 | * @return int
23 | */
24 | public function concurrencyVersion()
25 | {
26 | return $this->concurrencyVersion;
27 | }
28 |
29 | /**
30 | * @param int $aConcurrencyVersion
31 | */
32 | private function setConcurrencyVersion($aConcurrencyVersion)
33 | {
34 | $this->concurrencyVersion = (int) $aConcurrencyVersion;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Common/Test/Port/Adapter/Persistence/LevelDB/Level.php:
--------------------------------------------------------------------------------
1 | id = $anId;
25 | $this->name = $aName;
26 | $this->value = $aValue;
27 | }
28 |
29 | public function id()
30 | {
31 | return $this->id;
32 | }
33 |
34 | public function name()
35 | {
36 | return $this->name;
37 | }
38 |
39 | public function value()
40 | {
41 | return $this->value;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Common/Port/Adapter/Messaging/RabbitMQ/CustomTextMessageListener.php:
--------------------------------------------------------------------------------
1 | exchangeListener = $anExchangeListener;
13 |
14 | parent::__construct($aType);
15 | }
16 |
17 | public function handleMessage(
18 | $aType,
19 | $aMessageId,
20 | DateTimeInterface $aTimestamp,
21 | $aTextMessage,
22 | $aDeliveryTag,
23 | $isRedelivery
24 | ) {
25 | $this->exchangeListener->filteredDispatch($aType, $aTextMessage);
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Common/Test/Domain/Model/DomainEventSubscriber.php:
--------------------------------------------------------------------------------
1 | handledEvents = $events;
19 | }
20 |
21 | public function handleEvent(DomainEvent $aDomainEvent)
22 | {
23 | $this->handledEvents->add(get_class($aDomainEvent));
24 | }
25 |
26 | public function subscribedToEventType()
27 | {
28 | return DomainEvent::class;
29 | }
30 | }
--------------------------------------------------------------------------------
/src/Common/Serializer/ObjectSerializer.php:
--------------------------------------------------------------------------------
1 | serializer()->deserialize($aSerialization, $aType, 'json');
24 |
25 | return $domainEvent;
26 | }
27 |
28 | public function serialize($anObject)
29 | {
30 | return $this->serializer()->serialize($anObject, 'json');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/serializer/Domain.Model.Identity.TenantAdministratorRegistered.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\IdentityAccess\Domain\Model\Identity\TenantAdministratorRegistered:
2 | exclusion_policy: NONE
3 |
4 | properties:
5 | administratorName:
6 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\FullName
7 |
8 | emailAddress:
9 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\EmailAddress
10 |
11 | temporaryPassword:
12 | type: string
13 |
14 | tenantId:
15 | type: SaasOvation\IdentityAccess\Domain\Model\Identity\TenantId
16 |
17 | tenantName:
18 | type: string
19 |
20 | username:
21 | type: string
22 |
23 | eventVersion:
24 | type: integer
25 |
26 | occurredOn:
27 | type: DateTimeImmutable
--------------------------------------------------------------------------------
/src/Common/Test/Notification/MockPublishedNotificationTrackerStore.php:
--------------------------------------------------------------------------------
1 | setHibernateSession($aDoctrineEntityManager);
17 | }
18 |
19 | public function doctrineEntityManager()
20 | {
21 | return $this->doctrineEntityManager;
22 | }
23 |
24 | public function hasDoctrineEntityManager()
25 | {
26 | return null !== $this->doctrineEntityManager();
27 | }
28 |
29 | private function setHibernateSession(EntityManager $aDoctrineEntityManager)
30 | {
31 | $this->doctrineEntityManager = $aDoctrineEntityManager;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Common/Resources/config/doctrine/SaasOvation.Common.Event.StoredEvent.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resource/APIBundle/Controller/GroupsController.php:
--------------------------------------------------------------------------------
1 | identityApplicationService()->group($tenantId, $groupName);
20 |
21 | if (null === $group) {
22 | throw new NotFoundHttpException();
23 | }
24 |
25 | return $group;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Common/Domain/Model/ConcurrencySafeEntity.php:
--------------------------------------------------------------------------------
1 | concurrencyVersion;
17 | }
18 |
19 | public function setConcurrencyVersion($aVersion)
20 | {
21 | $this->failWhenConcurrencyViolation($aVersion);
22 | $this->concurrencyVersion = $aVersion;
23 | }
24 |
25 | public function failWhenConcurrencyViolation($aVersion)
26 | {
27 | if ($aVersion != $this->concurrencyVersion()) {
28 | throw new RuntimeException(
29 | 'Concurrency Violation: Stale data detected. Entity was already modified.'
30 | );
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/cli-config.php:
--------------------------------------------------------------------------------
1 | container) {
13 | $this->buildAndCompileServiceContainer(
14 | [
15 | __DIR__ . '/src/IdentityAccess/Resources/config',
16 | ],
17 | [
18 | 'identityaccess.xml',
19 | 'identityaccess-application.xml',
20 | 'doctrine.xml',
21 | ]
22 | );
23 | }
24 |
25 | return $this->container->get($aServiceId);
26 | }
27 | }
28 |
29 | $builder = new ServiceContainerBuilder();
30 |
31 | return ConsoleRunner::createHelperSet($builder->get('doctrine.orm.entity_manager'));
--------------------------------------------------------------------------------
/src/Common/Test/CommonTestCase.php:
--------------------------------------------------------------------------------
1 | reset();
15 |
16 | $this->buildAndCompileServiceContainer(
17 | [
18 | __DIR__ . '/../Resources/config',
19 | ],
20 | [
21 | 'common.xml',
22 | 'common-doctrine.xml',
23 | ]
24 | );
25 |
26 | $this->container->get('doctrine.orm.entity_manager')->beginTransaction();
27 | }
28 |
29 | protected function tearDown()
30 | {
31 | $this->container->get('doctrine.orm.entity_manager')->rollback();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Common/Test/Domain/Model/BaseTestExchangeListener.php:
--------------------------------------------------------------------------------
1 | eventTrackingTestCase = $anEventTrackingTestCase;
18 |
19 | parent::__construct();
20 | }
21 |
22 | public function filteredDispatch($aType, $aTextMessage)
23 | {
24 | $notification = NotificationReader::fromString($aTextMessage);
25 | $this->eventTrackingTestCase->handledNotifications()->set($notification->notificationIdAsString(), $aType);
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Common/Port/Adapter/Persistence/EventSourcing/LevelDB/StreamKeyProvider.php:
--------------------------------------------------------------------------------
1 | streamName = $aStreamName;
20 | $this->streamVersion = $aStartingStreamVersion;
21 | }
22 |
23 | public function nextReferenceKey()
24 | {
25 | $key = $this->compositeReferenceKeyFrom($this->streamName, $this->streamVersion);
26 |
27 | ++$this->streamVersion;
28 |
29 | return $key;
30 | }
31 |
32 | public function primaryResourceName()
33 | {
34 | return $this->streamName;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/GroupProvisioned.php:
--------------------------------------------------------------------------------
1 | name = $aName;
26 | $this->occurredOn = new DateTimeImmutable();
27 | $this->tenantId = $aTenantId;
28 | }
29 |
30 | public function name()
31 | {
32 | return $this->name;
33 | }
34 |
35 | public function tenantId()
36 | {
37 | return $this->tenantId;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Common/Domain/Model/Process/Process.php:
--------------------------------------------------------------------------------
1 | get('accessApplicationService');
17 | }
18 |
19 | public static function identityApplicationService()
20 | {
21 | return self::$container->get('identityApplicationService');
22 | }
23 |
24 | public static function notificationApplicationService()
25 | {
26 | return self::$container->get('notificationApplicationService');
27 | }
28 |
29 | public static function setContainer(ContainerInterface $aServiceContainer)
30 | {
31 | self::$container = $aServiceContainer;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Common/Notification/NotificationSerializer.php:
--------------------------------------------------------------------------------
1 | serializer()->serialize($aNotification, 'json');
26 | }
27 |
28 | public function deserialize($aSerialization, $aType)
29 | {
30 | return $this->serializer()->deserialize($aSerialization, $aType, 'format');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/GroupResourceTest.php:
--------------------------------------------------------------------------------
1 | group1Aggregate();
13 | DomainRegistry::groupRepository()->add($group);
14 |
15 | $client = static::createClient();
16 | $client->request(
17 | 'GET', sprintf('/tenants/%s/groups/%s', $group->tenantId()->id(), $group->name())
18 | );
19 |
20 | $aResponse = $client->getResponse()->getContent();
21 | $reader = RepresentationReader::fromString($aResponse);
22 |
23 | $this->assertEquals($group->tenantId()->id(), $reader->stringValue('tenant_id.id'));
24 | $this->assertEquals($group->name(), $reader->stringValue('name'));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/UserPasswordChanged.php:
--------------------------------------------------------------------------------
1 | occurredOn = new DateTimeImmutable();
26 | $this->tenantId = $aTenantId;
27 | $this->username = $aUsername;
28 | }
29 |
30 | public function tenantId()
31 | {
32 | return $this->tenantId;
33 | }
34 |
35 | public function username()
36 | {
37 | return $this->username;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Common/Resources/config/doctrine/SaasOvation.Common.Notification.PublishedNotificationTracker.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Collaboration/Test/Domain/Model/Calendar/CalendarEntryScheduledSubscriber.php:
--------------------------------------------------------------------------------
1 | calendarEntryId = $aDomainEvent->calendarEntryId();
20 | }
21 |
22 | public function subscribedToEventType()
23 | {
24 | return CalendarEntryScheduled::class;
25 | }
26 |
27 | public function getCalendarEntryId()
28 | {
29 | return $this->calendarEntryId;
30 | }
31 | }
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Access/RoleProvisioned.php:
--------------------------------------------------------------------------------
1 | name = $aName;
27 | $this->occurredOn = new DateTimeImmutable();
28 | $this->tenantId = $aTenantId;
29 | }
30 |
31 | public function name()
32 | {
33 | return $this->name;
34 | }
35 |
36 | public function tenantId()
37 | {
38 | return $this->tenantId;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.PostalAddress.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.RegistrationInvitation.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Common/Resources/config/serializer/Domain.Model.Process.TimeConstrainedProcessTracker.yml:
--------------------------------------------------------------------------------
1 | SaasOvation\Common\Domain\Model\Process\TimeConstrainedProcessTracker:
2 | exclusion_policy: NONE
3 |
4 | properties:
5 | allowableDuration:
6 | type: integer
7 |
8 | completed:
9 | type: boolean
10 |
11 | concurrencyVersion:
12 | type: integer
13 |
14 | description:
15 | type: string
16 |
17 | processId:
18 | type: SaasOvation\Common\Domain\Model\Process\ProcessId
19 |
20 | processInformedOfTimeout:
21 | type: boolean
22 |
23 | processTimedOutEventType:
24 | type: string
25 |
26 | retryCount:
27 | type: integer
28 |
29 | tenantId:
30 | type: string
31 |
32 | timeConstrainedProcessTrackerId:
33 | type: integer
34 |
35 | timeoutOccursOn:
36 | type: integer
37 |
38 | totalRetriesPermitted:
39 | type: integer
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Access.Role.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/_files/iddd_identity_access/app/console:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
19 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
20 |
21 | if ($debug) {
22 | Debug::enable();
23 | }
24 |
25 | $kernel = new AppKernel($env, $debug);
26 | $application = new Application($kernel);
27 | $application->run($input);
28 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.Common.Notification.PublishedNotificationTracker.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.Group.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Common/Port/Adapter/Persistence/EventSourcing/DefaultEventStream.php:
--------------------------------------------------------------------------------
1 | setEvents($anEventsList);
23 | $this->setVersion($aVersion);
24 | }
25 |
26 | public function events()
27 | {
28 | return $this->events;
29 | }
30 |
31 | public function version()
32 | {
33 | return $this->version;
34 | }
35 |
36 | private function setEvents(Collection $anEventsList)
37 | {
38 | $this->events = $anEventsList;
39 | }
40 |
41 | private function setVersion($aVersion)
42 | {
43 | $this->version = $aVersion;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resource/APIBundle/DependencyInjection/Configuration.php:
--------------------------------------------------------------------------------
1 | root('saas_ovation_identity_access_api');
22 |
23 | // Here you should define the parameters that are allowed to
24 | // configure your bundle. See the documentation linked above for
25 | // more information on that topic.
26 |
27 | return $treeBuilder;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Common/Test/Event/AnotherTestableDomainEvent.php:
--------------------------------------------------------------------------------
1 | setEventVersion(1);
21 | $this->setOccurredOn(new DateTimeImmutable());
22 | $this->setValue($aValue);
23 | }
24 |
25 | public function value()
26 | {
27 | return $this->value;
28 | }
29 |
30 | private function setEventVersion($eventVersion)
31 | {
32 | $this->eventVersion = $eventVersion;
33 | }
34 |
35 | private function setOccurredOn(DateTimeImmutable $occurredOn)
36 | {
37 | $this->occurredOn = $occurredOn;
38 | }
39 |
40 | private function setValue($value)
41 | {
42 | $this->value = $value;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/AuthenticateUserCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
14 | $this->username = $aUsername;
15 | $this->password = $aPassword;
16 | }
17 |
18 | public function getTenantId() {
19 | return $this->tenantId;
20 | }
21 |
22 | public function setTenantId($tenantId)
23 | {
24 | $this->tenantId = $tenantId;
25 | }
26 |
27 | public function getUsername()
28 | {
29 | return $this->username;
30 | }
31 |
32 | public function setUsername($username)
33 | {
34 | $this->username = $username;
35 | }
36 |
37 | public function getPassword()
38 | {
39 | return $this->password;
40 | }
41 |
42 | public function setPassword($password)
43 | {
44 | $this->password = $password;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/Collaboration/Test/Application/Forum/CustomDiscussionCommandResult.php:
--------------------------------------------------------------------------------
1 | discussionId = $aDiscussionId;
16 | }
17 |
18 | public function resultingPostId($aPostId)
19 | {
20 | $this->postId = $aPostId;
21 | }
22 |
23 | public function resultingInReplyToPostId($aReplyToPostId)
24 | {
25 | $this->inReplyToPostId = $aReplyToPostId;
26 | }
27 |
28 | public function getDiscussionId()
29 | {
30 | return $this->discussionId;
31 | }
32 |
33 | public function getPostId()
34 | {
35 | return $this->postId;
36 | }
37 |
38 | public function getInReplyToPostId()
39 | {
40 | return $this->inReplyToPostId;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/_files/iddd_identity_access/app/config/config_dev.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: config.yml }
3 |
4 | framework:
5 | router:
6 | resource: "%kernel.root_dir%/config/routing_dev.yml"
7 | strict_requirements: true
8 | profiler: { only_exceptions: false }
9 |
10 | web_profiler:
11 | toolbar: %debug_toolbar%
12 | intercept_redirects: %debug_redirects%
13 |
14 | monolog:
15 | handlers:
16 | main:
17 | type: stream
18 | path: "%kernel.logs_dir%/%kernel.environment%.log"
19 | level: debug
20 | console:
21 | type: console
22 | bubble: false
23 | # uncomment to get logging in your browser
24 | # you may have to allow bigger header sizes in your Web server configuration
25 | #firephp:
26 | # type: firephp
27 | # level: info
28 | #chromephp:
29 | # type: chromephp
30 | # level: info
31 |
32 | assetic:
33 | use_controller: %use_assetic_controller%
34 |
35 | #swiftmailer:
36 | # delivery_address: me@example.com
37 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/_files/iddd_identity_access/web/app.php:
--------------------------------------------------------------------------------
1 | unregister();
14 | $apcLoader->register(true);
15 | */
16 |
17 | require_once __DIR__.'/../app/AppKernel.php';
18 | //require_once __DIR__.'/../app/AppCache.php';
19 |
20 | $kernel = new AppKernel('prod', false);
21 | $kernel->loadClassCache();
22 | //$kernel = new AppCache($kernel);
23 |
24 | // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
25 | //Request::enableHttpMethodParameterOverride();
26 | $request = Request::createFromGlobals();
27 | $response = $kernel->handle($request);
28 | $response->send();
29 | $kernel->terminate($request, $response);
30 |
--------------------------------------------------------------------------------
/src/Common/Event/Sourcing/EventStreamId.php:
--------------------------------------------------------------------------------
1 | setStreamName($aStreamName);
20 | $this->setStreamVersion($aStreamVersion);
21 | }
22 |
23 | public function streamName()
24 | {
25 | return $this->streamName;
26 | }
27 |
28 | public function streamVersion()
29 | {
30 | return $this->streamVersion;
31 | }
32 |
33 | public function withStreamVersion($aStreamVersion)
34 | {
35 | return new EventStreamId($this->streamName(), $aStreamVersion);
36 | }
37 |
38 | private function setStreamName($aStreamName)
39 | {
40 | $this->streamName = $aStreamName;
41 | }
42 |
43 | private function setStreamVersion($aStreamVersion)
44 | {
45 | $this->streamVersion = $aStreamVersion;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/AssignUserToRoleCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
14 | $this->username = $aUsername;
15 | $this->roleName = $aRoleName;
16 | }
17 |
18 | public function getTenantId()
19 | {
20 | return $this->tenantId;
21 | }
22 |
23 | public function setTenantId($tenantId)
24 | {
25 | $this->tenantId = $tenantId;
26 | }
27 |
28 | public function getUsername()
29 | {
30 | return $this->username;
31 | }
32 |
33 | public function setUsername($username)
34 | {
35 | $this->username = $username;
36 | }
37 |
38 | public function getRoleName()
39 | {
40 | return $this->roleName;
41 | }
42 |
43 | public function setRoleName($rolename)
44 | {
45 | $this->roleName = $rolename;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/AddUserToGroupCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
14 | $this->groupName = $groupName;
15 | $this->username = $username;
16 | }
17 |
18 | public function getGroupName()
19 | {
20 | return $this->groupName;
21 | }
22 |
23 | public function setGroupName($groupName)
24 | {
25 | $this->groupName = $groupName;
26 | }
27 |
28 | public function getTenantId()
29 | {
30 | return $this->tenantId;
31 | }
32 |
33 | public function setTenantId($tenantId)
34 | {
35 | $this->tenantId = $tenantId;
36 | }
37 |
38 | public function getUsername()
39 | {
40 | return $this->username;
41 | }
42 |
43 | public function setUsername($username)
44 | {
45 | $this->username = $username;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/RemoveUserFromGroupCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
14 | $this->groupName = $groupName;
15 | $this->username = $username;
16 | }
17 |
18 | public function getGroupName()
19 | {
20 | return $this->groupName;
21 | }
22 |
23 | public function setGroupName($groupName)
24 | {
25 | $this->groupName = $groupName;
26 | }
27 |
28 | public function getTenantId()
29 | {
30 | return $this->tenantId;
31 | }
32 |
33 | public function setTenantId($tenantId)
34 | {
35 | $this->tenantId = $tenantId;
36 | }
37 |
38 | public function getUsername()
39 | {
40 | return $this->username;
41 | }
42 |
43 | public function setUsername($username)
44 | {
45 | $this->username = $username;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Common/Test/Notification/NotificationPublisherCreationTest.php:
--------------------------------------------------------------------------------
1 | assertNotNull($eventStore);
17 |
18 | $publishedNotificationTrackerStore = new DoctrinePublishedNotificationTrackerStore(
19 | $this->container->get('doctrine.orm.entity_manager'),
20 | 'unit.test'
21 | );
22 |
23 | $notificationPublisher = new RabbitMQNotificationPublisher(
24 | $eventStore,
25 | $publishedNotificationTrackerStore,
26 | 'unit.test'
27 | );
28 |
29 | $this->assertNotNull($notificationPublisher);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Common/Test/Domain/Model/Process/TestableTimeConstrainedProcessTimedOutSubscriber.php:
--------------------------------------------------------------------------------
1 | timeConstrainedProcessTest = $timeConstrainedProcessTest;
21 | }
22 |
23 | public function handleEvent(DomainEvent $aDomainEvent)
24 | {
25 | $this->timeConstrainedProcessTest->setReceived(true);
26 | $this->timeConstrainedProcessTest->process()->informTimeout($aDomainEvent->occurredOn());
27 | }
28 |
29 | public function subscribedToEventType()
30 | {
31 | return TestableTimeConstrainedProcessTimedOut::class;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/ChangePrimaryTelephoneCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
14 | $this->username = $username;
15 | $this->telephone = $telephone;
16 | }
17 |
18 | public function getTenantId()
19 | {
20 | return $this->tenantId;
21 | }
22 |
23 | public function setTenantId($tenantId)
24 | {
25 | $this->tenantId = $tenantId;
26 | }
27 |
28 | public function getUsername()
29 | {
30 | return $this->username;
31 | }
32 |
33 | public function setUsername($username)
34 | {
35 | $this->username = $username;
36 | }
37 |
38 | public function getTelephone()
39 | {
40 | return $this->telephone;
41 | }
42 |
43 | public function setTelephone($telephone)
44 | {
45 | $this->telephone = $telephone;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/ChangeSecondaryTelephoneCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
14 | $this->username = $username;
15 | $this->telephone = $telephone;
16 | }
17 |
18 | public function getTenantId()
19 | {
20 | return $this->tenantId;
21 | }
22 |
23 | public function setTenantId($tenantId)
24 | {
25 | $this->tenantId = $tenantId;
26 | }
27 |
28 | public function getUsername()
29 | {
30 | return $this->username;
31 | }
32 |
33 | public function setUsername($username)
34 | {
35 | $this->username = $username;
36 | }
37 |
38 | public function getTelephone()
39 | {
40 | return $this->telephone;
41 | }
42 |
43 | public function setTelephone($telephone)
44 | {
45 | $this->telephone = $telephone;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.Person.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.User.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resource/APIBundle/Resources/config/routes.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
13 |
14 |
18 |
19 |
23 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/ProvisionGroupCommand.php:
--------------------------------------------------------------------------------
1 | description = $description;
14 | $this->groupName = $groupName;
15 | $this->tenantId = $tenantId;
16 | }
17 |
18 | public function getDescription()
19 | {
20 | return $this->description;
21 | }
22 |
23 | public function setDescription($description)
24 | {
25 | $this->description = $description;
26 | }
27 |
28 | public function getGroupName()
29 | {
30 | return $this->groupName;
31 | }
32 |
33 | public function setGroupName($groupName)
34 | {
35 | $this->groupName = $groupName;
36 | }
37 |
38 | public function getTenantId()
39 | {
40 | return $this->tenantId;
41 | }
42 |
43 | public function setTenantId($tenantId)
44 | {
45 | $this->tenantId = $tenantId;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/ChangeEmailAddressCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
14 | $this->username = $username;
15 | $this->emailAddress = $emailAddress;
16 | }
17 |
18 | public function getTenantId()
19 | {
20 | return $this->tenantId;
21 | }
22 |
23 | public function setTenantId($tenantId)
24 | {
25 | $this->tenantId = $tenantId;
26 | }
27 |
28 | public function getUsername()
29 | {
30 | return $this->username;
31 | }
32 |
33 | public function setUsername($username)
34 | {
35 | $this->username = $username;
36 | }
37 |
38 | public function getEmailAddress()
39 | {
40 | return $this->emailAddress;
41 | }
42 |
43 | public function setEmailAddress($emailAddress)
44 | {
45 | $this->emailAddress = $emailAddress;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Calendar/CalendarIdentityService.php:
--------------------------------------------------------------------------------
1 | calendarRepository = $aCalendarRepository;
20 | $this->calendarEntryRepository = $aCalendarEntryRepository;
21 | }
22 |
23 | public function nextCalendarId()
24 | {
25 | return $this->calendarRepository()->nextIdentity();
26 | }
27 |
28 | public function nextCalendarEntryId()
29 | {
30 | return $this->calendarEntryRepository()->nextIdentity();
31 | }
32 |
33 | private function calendarRepository()
34 | {
35 | return $this->calendarRepository;
36 | }
37 |
38 | private function calendarEntryRepository()
39 | {
40 | return $this->calendarEntryRepository;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/PersonNameChanged.php:
--------------------------------------------------------------------------------
1 | name = $aName;
31 | $this->occurredOn = new DateTimeImmutable();
32 | $this->tenantId = $aTenantId;
33 | $this->username = $aUsername;
34 | }
35 |
36 | public function name()
37 | {
38 | return $this->name;
39 | }
40 |
41 | public function tenantId()
42 | {
43 | return $this->tenantId;
44 | }
45 |
46 | public function username()
47 | {
48 | return $this->username;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Common/Event/EventSerializer.php:
--------------------------------------------------------------------------------
1 | setSerializeNull(true);
29 |
30 | $serialization = $this->serializer()->serialize($aDomainEvent, 'json', $context);
31 |
32 | return $serialization;
33 | }
34 |
35 | public function deserialize($aSerialization, $aType)
36 | {
37 | $domainEvent = $this->serializer()->deserialize($aSerialization, $aType, 'json');
38 |
39 | return $domainEvent;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Common/Test/Domain/Model/Process/TestableTimeConstrainedProcess.php:
--------------------------------------------------------------------------------
1 | confirm1 = true;
24 |
25 | $this->completeProcess(ProcessCompletionType::NotCompleted());
26 | }
27 |
28 | public function confirm2()
29 | {
30 | $this->confirm2 = true;
31 |
32 | $this->completeProcess(ProcessCompletionType::CompletedNormally());
33 | }
34 |
35 | protected function completenessVerified()
36 | {
37 | return $this->confirm1 && $this->confirm2;
38 | }
39 |
40 | protected function processTimedOutEventType()
41 | {
42 | return TestableTimeConstrainedProcessTimedOut::class;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/GroupUserAdded.php:
--------------------------------------------------------------------------------
1 | groupName = $aGroupName;
31 | $this->occurredOn = new DateTimeImmutable();
32 | $this->tenantId = $aTenantId;
33 | $this->username = $aUsername;
34 | }
35 |
36 | public function groupName()
37 | {
38 | return $this->groupName;
39 | }
40 |
41 | public function tenantId()
42 | {
43 | return $this->tenantId;
44 | }
45 |
46 | public function username()
47 | {
48 | return $this->username;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/GroupUserRemoved.php:
--------------------------------------------------------------------------------
1 | groupName = $aGroupName;
31 | $this->occurredOn = new DateTimeImmutable();
32 | $this->tenantId = $aTenantId;
33 | $this->username = $aUsername;
34 | }
35 |
36 | public function groupName()
37 | {
38 | return $this->groupName;
39 | }
40 |
41 | public function tenantId()
42 | {
43 | return $this->tenantId;
44 | }
45 |
46 | public function username()
47 | {
48 | return $this->username;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Common/Test/Domain/Model/Process/TestableTimeConstrainedProcessRepository.php:
--------------------------------------------------------------------------------
1 | entityManager()->persist($aTestableTimeConstrainedProcess);
13 | $this->entityManager()->flush($aTestableTimeConstrainedProcess);
14 | }
15 |
16 | public function processOfId(ProcessId $aProcessId)
17 | {
18 | $query = $this->entityManager()->createQuery(
19 | 'SELECT ttcp
20 | FROM SaasOvation\Common\Test\Domain\Model\Process\TestableTimeConstrainedProcess ttcp
21 | WHERE ttcp.processId = ?1'
22 | );
23 |
24 | $query->setParameter(1, $aProcessId);
25 |
26 | return $query->getSingleResult();
27 | }
28 |
29 | public function getEntityManager()
30 | {
31 | return $this->entityManager();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Common/Test/Event/TestableDomainEvent.php:
--------------------------------------------------------------------------------
1 | setId($anId);
27 | $this->setName($aName);
28 | $this->setOccurredOn(new DateTimeImmutable());
29 | }
30 |
31 | public function id()
32 | {
33 | return $this->id;
34 | }
35 |
36 | public function name()
37 | {
38 | return $this->name;
39 | }
40 |
41 | private function setId($id)
42 | {
43 | $this->id = $id;
44 | }
45 |
46 | private function setName($name)
47 | {
48 | $this->name = $name;
49 | }
50 |
51 | private function setOccurredOn(DateTimeInterface $occurredOn)
52 | {
53 | $this->occurredOn = $occurredOn;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/Common/Resources/config/doctrine/SaasOvation.Common.Domain.Model.Process.AbstractProcess.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/GroupGroupAdded.php:
--------------------------------------------------------------------------------
1 | groupName = $aGroupName;
31 | $this->nestedGroupName = $aNestedGroupName;
32 | $this->occurredOn = new DateTimeImmutable();
33 | $this->tenantId = $aTenantId;
34 | }
35 |
36 | public function groupName()
37 | {
38 | return $this->groupName;
39 | }
40 |
41 | public function nestedGroupName()
42 | {
43 | return $this->nestedGroupName;
44 | }
45 |
46 | public function tenantId()
47 | {
48 | return $this->tenantId;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Common/Test/Media/RepresentationReaderTest.php:
--------------------------------------------------------------------------------
1 | assertEquals('Author', $reader->stringValue('role'));
26 | $this->assertEquals('zoe', $reader->stringValue('username'));
27 | $this->assertEquals('A94A8298-43B8-4DA0-9917-13FFF9E116ED', $reader->stringValue('tenantId'));
28 | $this->assertEquals('Zoe', $reader->stringValue('firstName'));
29 | $this->assertEquals('Doe', $reader->stringValue('lastName'));
30 | $this->assertEquals('zoe@saasovation.com', $reader->stringValue('emailAddress'));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/GroupGroupRemoved.php:
--------------------------------------------------------------------------------
1 | groupName = $aGroupName;
31 | $this->nestedGroupName = $aNestedGroupName;
32 | $this->occurredOn = new DateTimeImmutable();
33 | $this->tenantId = $aTenantId;
34 | }
35 |
36 | public function groupName()
37 | {
38 | return $this->groupName;
39 | }
40 |
41 | public function nestedGroupName()
42 | {
43 | return $this->nestedGroupName;
44 | }
45 |
46 | public function tenantId()
47 | {
48 | return $this->tenantId;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | src/*/Test
22 | src/IdentityAccess/Test/Resource/_files/iddd_identity_access/src/*/*Bundle/Tests
23 | src/IdentityAccess/Test/Resource/_files/iddd_identity_access/src/*/Bundle/*Bundle/Tests
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/RemoveGroupFromGroupCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
14 | $this->parentGroupName = $parentGroupName;
15 | $this->childGroupName = $childGroupName;
16 | }
17 |
18 | public function getTenantId()
19 | {
20 | return $this->tenantId;
21 | }
22 |
23 | public function setTenantId($tenantId)
24 | {
25 | $this->tenantId = $tenantId;
26 | }
27 |
28 | public function getChildGroupName()
29 | {
30 | return $this->childGroupName;
31 | }
32 |
33 | public function setChildGroupName($childGroupName)
34 | {
35 | $this->childGroupName = $childGroupName;
36 | }
37 |
38 | public function getParentGroupName()
39 | {
40 | return $this->parentGroupName;
41 | }
42 |
43 | public function setParentGroupName($parentGroupName)
44 | {
45 | $this->parentGroupName = $parentGroupName;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Common/Test/Event/EventSerializerTest.php:
--------------------------------------------------------------------------------
1 | serialize(new TestableDomainEvent(1, null));
15 |
16 | $this->assertContains('id', $serializedEvent);
17 | $this->assertContains('occurred_on', $serializedEvent);
18 | $this->assertNotContains("\n", $serializedEvent);
19 | $this->assertContains('null', $serializedEvent);
20 | }
21 |
22 | public function testDeserializeDefault()
23 | {
24 | $serializer = EventSerializer::instance();
25 |
26 | $serializedEvent = $serializer->serialize(new TestableDomainEvent(1, null));
27 |
28 | $event = $serializer->deserialize($serializedEvent, TestableDomainEvent::class);
29 |
30 | $this->assertContains('null', $serializedEvent);
31 | $this->assertEquals(1, $event->id());
32 | $this->assertNull($event->name());
33 | $this->assertNotNull($event->occurredOn());
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Forum/ForumReopened.php:
--------------------------------------------------------------------------------
1 | exclusiveOwner = $anExclusiveOwner;
32 | $this->forumId = $aForumId;
33 | $this->occurredOn = new DateTimeImmutable();
34 | $this->tenant = $aTenant;
35 | }
36 |
37 | public function exclusiveOwner()
38 | {
39 | return $this->exclusiveOwner;
40 | }
41 |
42 | public function forumId()
43 | {
44 | return $this->forumId;
45 | }
46 |
47 | public function tenant()
48 | {
49 | return $this->tenant;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Access/GroupAssignedToRole.php:
--------------------------------------------------------------------------------
1 | groupName = $aGroupName;
32 | $this->occurredOn = new DateTimeImmutable();
33 | $this->roleName = $aRoleName;
34 | $this->tenantId = $aTenantId;
35 | }
36 |
37 | public function groupName()
38 | {
39 | return $this->groupName;
40 | }
41 |
42 | public function roleName()
43 | {
44 | return $this->roleName;
45 | }
46 |
47 | public function tenantId()
48 | {
49 | return $this->tenantId;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Access/GroupUnassignedFromRole.php:
--------------------------------------------------------------------------------
1 | groupName = $aGroupName;
32 | $this->occurredOn = new DateTimeImmutable();
33 | $this->roleName = $aRoleName;
34 | $this->tenantId = $aTenantId;
35 | }
36 |
37 | public function groupName()
38 | {
39 | return $this->groupName;
40 | }
41 |
42 | public function roleName()
43 | {
44 | return $this->roleName;
45 | }
46 |
47 | public function tenantId()
48 | {
49 | return $this->tenantId;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/Common/Port/Adapter/Persistence/LevelDB/AbstractLevelDBRepository.php:
--------------------------------------------------------------------------------
1 | openDatabase($aDirectoryPath);
22 | }
23 |
24 | protected function database()
25 | {
26 | return $this->database;
27 | }
28 |
29 | protected function databasePath()
30 | {
31 | return $this->databasePath;
32 | }
33 |
34 | private function setDatabase(LevelDB $aDatabase)
35 | {
36 | $this->database = $aDatabase;
37 | }
38 |
39 | private function setDatabasePath($aDatabasePath)
40 | {
41 | $this->databasePath = $aDatabasePath;
42 | }
43 |
44 | private function openDatabase($aDirectoryPath)
45 | {
46 | $levelDBProvider = LevelDBProvider::instance();
47 |
48 | $db = $levelDBProvider->databaseFrom($aDirectoryPath);
49 |
50 | $this->setDatabase($db);
51 | $this->setDatabasePath($aDirectoryPath);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/UserEnablementChanged.php:
--------------------------------------------------------------------------------
1 | enablement = $anEnablement;
34 | $this->occurredOn = new DateTimeImmutable();
35 | $this->tenantId = $aTenantId;
36 | $this->username = $aUsername;
37 | }
38 |
39 | public function enablement()
40 | {
41 | return $this->enablement;
42 | }
43 |
44 | public function tenantId()
45 | {
46 | return $this->tenantId;
47 | }
48 |
49 | public function username()
50 | {
51 | return $this->username;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/Common/Test/Event/TestableNavigableDomainEvent.php:
--------------------------------------------------------------------------------
1 | setNestedEvent(new TestableDomainEvent($anId, $aName));
22 | $this->setOccurredOn(new DateTimeImmutable());
23 | }
24 |
25 | public function eventVersion()
26 | {
27 | return $this->eventVersion;
28 | }
29 |
30 | public function nestedEvent()
31 | {
32 | return $this->nestedEvent;
33 | }
34 |
35 | public function occurredOn()
36 | {
37 | return $this->occurredOn;
38 | }
39 |
40 | private function setNestedEvent(TestableDomainEvent $nestedEvent)
41 | {
42 | $this->nestedEvent = $nestedEvent;
43 | }
44 |
45 | private function setOccurredOn(DateTimeInterface $occurredOn)
46 | {
47 | $this->occurredOn = $occurredOn;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Collaboration/Domain/Model/Forum/ForumClosed.php:
--------------------------------------------------------------------------------
1 | exclusiveOwner = $anExclusiveOwner;
32 | $this->forumId = $aForumId;
33 | $this->occurredOn = new DateTimeImmutable();
34 | $this->tenant = $aTenant;
35 | }
36 |
37 | public function exclusiveOwner()
38 | {
39 | return $this->exclusiveOwner;
40 | }
41 |
42 | public function forumId()
43 | {
44 | return $this->forumId;
45 | }
46 |
47 | public function tenant()
48 | {
49 | return $this->tenant;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/Collaboration/Test/Domain/Model/Forum/AbstractForumTest.php:
--------------------------------------------------------------------------------
1 | nextIdentity(),
20 | new Creator('jdoe', 'John Doe', 'jdoe@saasovation.com'),
21 | new Moderator('jdoe', 'John Doe', 'jdoe@saasovation.com'),
22 | 'John Doe Does DDD',
23 | 'A set of discussions about DDD for anonymous developers.',
24 | null
25 | );
26 | }
27 |
28 | protected function setUp()
29 | {
30 | DomainEventPublisher::instance()->reset();
31 |
32 | parent::setUp();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Collaboration/Test/Domain/Model/Collaborator/MockUserInRoleAdapter.php:
--------------------------------------------------------------------------------
1 | toCollaboratorFromRepresentation(
27 | CollaboratorServiceTest::$USER_IN_ROLE_REPRESENTATION,
28 | $aCollaboratorClass
29 | );
30 | } catch (Exception $e) {
31 | throw new RuntimeException('Cannot adapt ' . $aRoleName, $e->getCode(), $e);
32 | }
33 |
34 | return $collaborator;
35 | }
36 | }
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/UserRepository.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 | ../src/*/*Bundle/Tests
13 | ../src/*/Bundle/*Bundle/Tests
14 |
15 |
16 |
17 |
22 |
23 |
24 |
25 | ../src
26 |
27 | ../src/*/*Bundle/Resources
28 | ../src/*/*Bundle/Tests
29 | ../src/*/Bundle/*Bundle/Resources
30 | ../src/*/Bundle/*Bundle/Tests
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Resource/_files/iddd_identity_access/web/app_dev.php:
--------------------------------------------------------------------------------
1 | handle($request);
28 | $response->send();
29 | $kernel->terminate($request, $response);
30 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Access/UserUnassignedFromRole.php:
--------------------------------------------------------------------------------
1 | occurredOn = new DateTimeImmutable();
35 | $this->roleName = $aRoleName;
36 | $this->tenantId = $aTenantId;
37 | $this->username = $aUsername;
38 | }
39 |
40 | public function roleName()
41 | {
42 | return $this->roleName;
43 | }
44 |
45 | public function tenantId()
46 | {
47 | return $this->tenantId;
48 | }
49 |
50 | public function username()
51 | {
52 | return $this->username;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resource/APIBundle/Controller/CurrentNotificationResource.php:
--------------------------------------------------------------------------------
1 | notificationApplicationService()->currentNotificationLog();
28 |
29 | if (null === $currentNotificationLog) {
30 | throw new NotFoundHttpException();
31 | }
32 |
33 | return $this->handleView(View::create($currentNotificationLog, 200));
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Common/Test/Port/Adapter/Persistence/LevelDB/LevelDBTest.php:
--------------------------------------------------------------------------------
1 | database;
24 | }
25 |
26 | protected function setUp()
27 | {
28 | $this->database = LevelDBProvider::instance()->databaseFrom(self::$TEST_DATABASE);
29 |
30 | DomainEventPublisher::instance()->reset();
31 | }
32 |
33 | protected function tearDown()
34 | {
35 | LevelDBProvider::instance()->close(self::$TEST_DATABASE);
36 | LevelDB::destroy(self::$TEST_DATABASE);
37 |
38 | try {
39 | LevelDBUnitOfWork::current()->rollback();
40 | } catch (Exception $e) {
41 | // no-op
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/GenericDomainEventSubscriber.php:
--------------------------------------------------------------------------------
1 | eventStore = $eventStore;
19 | }
20 |
21 | public function handleEvent(DomainEvent $aDomainEvent)
22 | {
23 | $this->store($aDomainEvent);
24 | }
25 |
26 | public function subscribedToEventType()
27 | {
28 | return DomainEvent::class; // all domain events
29 | }
30 |
31 | /**
32 | * Stores aDomainEvent to the event store.
33 | *
34 | * @param DomainEvent $aDomainEvent The DomainEvent to store
35 | */
36 | private function store(DomainEvent $aDomainEvent)
37 | {
38 | $this->eventStore()->append($aDomainEvent);
39 | }
40 |
41 | /**
42 | * Answers my EventStore.
43 | *
44 | * @return EventStore
45 | */
46 | private function eventStore()
47 | {
48 | return $this->eventStore;
49 | }
50 | }
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/PersonContactInformationChanged.php:
--------------------------------------------------------------------------------
1 | contactInformation = $aContactInformation;
31 | $this->occurredOn = new DateTimeImmutable();
32 | $this->tenantId = $aTenantId;
33 | $this->username = $aUsername;
34 | }
35 |
36 | public function contactInformation()
37 | {
38 | return $this->contactInformation;
39 | }
40 |
41 | public function tenantId()
42 | {
43 | return $this->tenantId;
44 | }
45 |
46 | public function username()
47 | {
48 | return $this->username;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Common/Test/Port/Adapter/Persistence/LevelDB/TestableTimeConstrainedProcessTimedOutSubscriber.php:
--------------------------------------------------------------------------------
1 | levelDBTimeConstrainedProcessTrackerRepositoryTest = $levelDBTimeConstrainedProcessTrackerRepositoryTest;
19 | }
20 |
21 | public function handleEvent(DomainEvent $aDomainEvent)
22 | {
23 | $this->levelDBTimeConstrainedProcessTrackerRepositoryTest->setReceived(true);
24 | $this->levelDBTimeConstrainedProcessTrackerRepositoryTest->process()->informTimeout($aDomainEvent->occurredOn());
25 | }
26 |
27 | public function subscribedToEventType() {
28 | return TestableTimeConstrainedProcessTimedOut::class;
29 | }
30 | }
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/ChangeUserPersonalNameCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
15 | $this->username = $username;
16 | $this->firstName = $aFirstName;
17 | $this->lastName = $aLastName;
18 | }
19 |
20 | public function getTenantId() {
21 | return $this->tenantId;
22 | }
23 |
24 | public function setTenantId($tenantId) {
25 | $this->tenantId = $tenantId;
26 | }
27 |
28 | public function getUsername() {
29 | return $this->username;
30 | }
31 |
32 | public function setUsername($username) {
33 | $this->username = $username;
34 | }
35 |
36 | public function getFirstName() {
37 | return $this->firstName;
38 | }
39 |
40 | public function setFirstName($firstName) {
41 | $this->firstName = $firstName;
42 | }
43 |
44 | public function getLastName() {
45 | return $this->lastName;
46 | }
47 |
48 | public function setLastName($lastName) {
49 | $this->lastName = $lastName;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/Collaboration/Test/Domain/Model/Forum/DiscussionStartedSubscriber.php:
--------------------------------------------------------------------------------
1 | discussionId = $aDomainEvent->discussionId();
19 | $this->tenant = $aDomainEvent->tenant();
20 | $this->forumId = $aDomainEvent->forumId();
21 | $this->subject = $aDomainEvent->subject();
22 | }
23 |
24 | public function subscribedToEventType()
25 | {
26 | return DiscussionStarted::class;
27 | }
28 |
29 | public function getDiscussionId()
30 | {
31 | return $this->discussionId;
32 | }
33 |
34 | public function getForumId()
35 | {
36 | return $this->forumId;
37 | }
38 |
39 | public function getSubject()
40 | {
41 | return $this->subject;
42 | }
43 |
44 | public function getTenant()
45 | {
46 | return $this->tenant;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resource/APIBundle/Controller/NotificationsController.php:
--------------------------------------------------------------------------------
1 | notificationApplicationService()->currentNotificationLog();
20 |
21 | if (null === $currentNotificationLog) {
22 | throw new NotFoundHttpException();
23 | }
24 |
25 | return $currentNotificationLog;
26 | }
27 |
28 | /**
29 | * @View
30 | * @Cache(maxage="3600")
31 | */
32 | public function getNotificationAction($notificationId)
33 | {
34 | $notificationLog = $this->notificationApplicationService()->notificationLog($notificationId);
35 |
36 | if (null === $notificationLog) {
37 | throw new NotFoundHttpException();
38 | }
39 |
40 | return $notificationLog;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Common/Test/BuildsServiceContainer.php:
--------------------------------------------------------------------------------
1 | container = new ContainerBuilder();
28 |
29 | $fileLocator = new FileLocator($paths);
30 |
31 | $loader = new DelegatingLoader(
32 | new LoaderResolver([
33 | new XmlFileLoader($this->container, $fileLocator)]
34 | )
35 | );
36 |
37 | foreach ($files as $aResource) {
38 | $loader->load($aResource);
39 | }
40 |
41 | $this->container->compile();
42 | }
43 | }
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/AddGroupToGroupCommand.php:
--------------------------------------------------------------------------------
1 | tenantId = $tenantId;
25 | $this->parentGroupName = $parentGroupName;
26 | $this->childGroupName = $childGroupName;
27 | }
28 |
29 | public function getTenantId()
30 | {
31 | return $this->tenantId;
32 | }
33 |
34 | public function setTenantId($tenantId)
35 | {
36 | $this->tenantId = $tenantId;
37 | }
38 |
39 | public function getChildGroupName()
40 | {
41 | return $this->childGroupName;
42 | }
43 |
44 | public function setChildGroupName($childGroupName)
45 | {
46 | $this->childGroupName = $childGroupName;
47 | }
48 |
49 | public function getParentGroupName()
50 | {
51 | return $this->parentGroupName;
52 | }
53 |
54 | public function setParentGroupName($parentGroupName)
55 | {
56 | $this->parentGroupName = $parentGroupName;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/Collaboration/Port/Adapter/Service/CollaboratorTranslator.php:
--------------------------------------------------------------------------------
1 | stringValue('username');
15 | $firstName = $reader->stringValue('firstName');
16 | $lastName = $reader->stringValue('lastName');
17 | $emailAddress = $reader->stringValue('emailAddress');
18 |
19 | return $this->newCollaborator(
20 | $username,
21 | $firstName,
22 | $lastName,
23 | $emailAddress,
24 | $aCollaboratorClass
25 | );
26 | }
27 |
28 | private function newCollaborator(
29 | $aUsername,
30 | $aFirstName,
31 | $aLastName,
32 | $aEmailAddress,
33 | $aCollaboratorClass
34 | ) {
35 | $aReflectedCollaboratorClass = new ReflectionClass($aCollaboratorClass);
36 |
37 | return $aReflectedCollaboratorClass->newInstance(
38 | $aUsername,
39 | trim($aFirstName . ' ' . $aLastName),
40 | $aEmailAddress
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Common/Port/Adapter/Persistence/EventSourcing/LevelDB/LoggableJournalEntry.php:
--------------------------------------------------------------------------------
1 | setPrimaryResourceName($aPrimaryResourceName);
25 | $this->setReferenceKey($aReferenceKey);
26 | $this->setValue($aValue);
27 | }
28 |
29 | public function primaryResourceName()
30 | {
31 | return $this->primaryResourceName;
32 | }
33 |
34 | public function referenceKey()
35 | {
36 | return $this->referenceKey;
37 | }
38 |
39 | public function value()
40 | {
41 | return $this->value;
42 | }
43 |
44 | private function setPrimaryResourceName($aPrimaryResourceName)
45 | {
46 | $this->primaryResourceName = $aPrimaryResourceName;
47 | }
48 |
49 | private function setReferenceKey($aReferenceKey)
50 | {
51 | $this->referenceKey = $aReferenceKey;
52 | }
53 |
54 | private function setValue($aValue)
55 | {
56 | $this->value = $aValue;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Test/Domain/Model/Identity/FullNameTest.php:
--------------------------------------------------------------------------------
1 | withChangedFirstName(self::$FIRST_NAME);
19 | $this->assertEquals(self::$FIRST_NAME . ' ' . self::$LAST_NAME, $name->asFormattedName());
20 | }
21 |
22 | public function testChangedLastName()
23 | {
24 | $name = new FullName(self::$FIRST_NAME, self::$LAST_NAME);
25 | $name = $name->withChangedLastName(self::$MARRIED_LAST_NAME);
26 | $this->assertEquals(self::$FIRST_NAME . ' ' . self::$MARRIED_LAST_NAME, $name->asFormattedName());
27 | }
28 |
29 | public function testFormattedName()
30 | {
31 | $name = new FullName(self::$FIRST_NAME, self::$LAST_NAME);
32 | $this->assertEquals(self::$FIRST_NAME . ' ' . self::$LAST_NAME, $name->asFormattedName());
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Common/Domain/Model/AbstractId.php:
--------------------------------------------------------------------------------
1 | id;
20 | }
21 |
22 | public function equals($anObject)
23 | {
24 | $equalObjects = false;
25 |
26 | if (null !== $anObject && get_class($this) === get_class($anObject)) {
27 | $equalObjects = $this->id() === $anObject->id();
28 | }
29 |
30 | return $equalObjects;
31 | }
32 |
33 | public function __toString()
34 | {
35 | return get_class($this) . " [id=" . $this->id . "]";
36 | }
37 |
38 | public function __construct($anId)
39 | {
40 | $this->setId($anId);
41 | }
42 |
43 | protected function validateId($anId)
44 | {
45 | // implemented by subclasses for validation.
46 | // throws a runtime exception if invalid.
47 | }
48 |
49 | private function setId($anId)
50 | {
51 | $this->assertArgumentNotEmpty($anId, 'The basic identity is required.');
52 | $this->assertArgumentLength($anId, 36, 'The basic identity must be 36 characters.');
53 |
54 | $this->validateId($anId);
55 |
56 | $this->id = $anId;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/Common/Resources/config/common-doctrine.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | true
8 |
9 | Resources/config/doctrine
10 |
11 |
12 | pdo_mysql
13 | root
14 | ones2502
15 | iddd_common_test
16 |
17 |
18 |
19 |
20 |
24 | %database.params%
25 | %doctrine.mapping.paths%
26 | %doctrine.is_dev_mode%
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/identityaccess-doctrine.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | true
8 |
9 | ../IdentityAccess/Resources/config/doctrine
10 |
11 |
12 | pdo_mysql
13 | root
14 | ones2502
15 | iddd_iam
16 |
17 |
18 |
19 |
20 |
24 | %database.params%
25 | %doctrine.mapping.paths%
26 | %doctrine.is_dev_mode%
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Collaboration/Test/StorageCleaner.php:
--------------------------------------------------------------------------------
1 | dataSource = $aDataSource;
33 |
34 | parent::__construct();
35 | }
36 |
37 | public function clean()
38 | {
39 | $this->eventStore()->purge();
40 |
41 | try {
42 |
43 | foreach (static::$tablesToClean as $tableName) {
44 | $statement = $this->dataSource->prepare('delete from ' . $tableName);
45 | $statement->execute();
46 | $statement->closeCursor();
47 | }
48 |
49 | } catch (Exception $e) {
50 | throw new RuntimeException('Cannot delete tbl_dispatcher_last_event because: ' . $e->getMessage(), $e->getCode(), $e);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/Common/Port/Adapter/Persistence/EventSourcing/LevelDB/JournalKeyProvider.php:
--------------------------------------------------------------------------------
1 | referenceKeyFrom($aKeyPart1 . static::$ES_KEY_DELIMITER . $aKeyPart2);
16 |
17 | return $referenceKey;
18 | }
19 |
20 | public function firstKeyPart($aCompositeKey)
21 | {
22 | return substr($aCompositeKey, 0, strpos($aCompositeKey, static::$ES_KEY_DELIMITER));
23 | }
24 |
25 | public function lastKeyPart($aCompositeKey)
26 | {
27 | return substr($aCompositeKey, strrpos($aCompositeKey, static::$ES_KEY_DELIMITER) + 1);
28 | }
29 |
30 | public function nextReferenceKey()
31 | {
32 | throw new BadMethodCallException('Must be implemented by subclass.');
33 | }
34 |
35 | public function primaryResourceName()
36 | {
37 | throw new BadMethodCallException('Must be implemented by subclass.');
38 | }
39 |
40 | public function referenceKeyFrom($aKey)
41 | {
42 | $referenceKey = static::$ES_REFERENCE_PREFIX_KEY . $aKey;
43 |
44 | return $referenceKey;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Application/Command/ProvisionRoleCommand.php:
--------------------------------------------------------------------------------
1 | description = $description;
15 | $this->roleName = $roleName;
16 | $this->supportsNesting = $supportsNesting;
17 | $this->tenantId = $tenantId;
18 | }
19 |
20 | public function getDescription()
21 | {
22 | return $this->description;
23 | }
24 |
25 | public function setDescription($description)
26 | {
27 | $this->description = $description;
28 | }
29 |
30 | public function getTenantId()
31 | {
32 | return $this->tenantId;
33 | }
34 |
35 | public function setTenantId($tenantId)
36 | {
37 | $this->tenantId = $tenantId;
38 | }
39 |
40 | public function getRoleName()
41 | {
42 | return $this->roleName;
43 | }
44 |
45 | public function setRoleName($roleName)
46 | {
47 | $this->roleName = $roleName;
48 | }
49 |
50 | public function isSupportsNesting()
51 | {
52 | return $this->supportsNesting;
53 | }
54 |
55 | public function setSupportsNesting($supportsNesting)
56 | {
57 | $this->supportsNesting = $supportsNesting;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/Collaboration/Test/Application/Calendar/DummyCalendarCommandResult.php:
--------------------------------------------------------------------------------
1 | calendarId = $aCalendarId;
18 | }
19 |
20 | public function getCalendarId()
21 | {
22 | return $this->calendarId;
23 | }
24 |
25 | public function setShouldThrowExceptionOnResultingCalendarEntryIdMethodCall($throw)
26 | {
27 | $this->shouldThrowExceptionOnResultingCalendarEntryIdMethodCall = $throw;
28 | }
29 |
30 | public function resultingCalendarEntryId($aCalendarEntryId)
31 | {
32 | if ($this->shouldThrowExceptionOnResultingCalendarEntryIdMethodCall) {
33 | throw new BadMethodCallException('Should not be reached.');
34 | }
35 |
36 | $this->calendarEntryId = $aCalendarEntryId;
37 | }
38 |
39 | public function setCalendarEntryId($calendarEntryId)
40 | {
41 | $this->calendarEntryId = $calendarEntryId;
42 | }
43 |
44 | public function getCalendarEntryId()
45 | {
46 | return $this->calendarEntryId;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.Tenant.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Domain/Model/Identity/UserRegistered.php:
--------------------------------------------------------------------------------
1 | emailAddress = $anEmailAddress;
40 | $this->name = $aName;
41 | $this->occurredOn = new DateTimeImmutable();
42 | $this->tenantId = $aTenantId;
43 | $this->username = $aUsername;
44 | }
45 |
46 | public function emailAddress()
47 | {
48 | return $this->emailAddress;
49 | }
50 |
51 | public function name()
52 | {
53 | return $this->name;
54 | }
55 |
56 | public function tenantId()
57 | {
58 | return $this->tenantId;
59 | }
60 |
61 | public function username()
62 | {
63 | return $this->username;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/IdentityAccess/Resources/config/doctrine/SaasOvation.IdentityAccess.Domain.Model.Identity.ContactInformation.dcm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------