Inheritance: IDomainEvent
Beispiel #1
0
 void IHandleClientStateTransitions.When(ClientRegistered @event)
 {
     Identity = @event.ClientId;
     identityNumber = @event.IdentityNumber;
     clientName = @event.ClientName;
     primaryContactNumber = @event.PrimaryContactNumber;
     dateOfBirth = @event.IdentityNumber.GetDateOfBirth();
 }
        public void When(ClientRegistered @event)
        {
            var clientModel = new ClientModel
            {
                DateOfBirth = @event.IdentityNumber.GetDateOfBirth(),
                IdentityNumber = @event.IdentityNumber.Number,
                FirstName = @event.ClientName.FirstName,
                Surname = @event.ClientName.Surname,
                PrimaryContactNumber = @event.PrimaryContactNumber.Number,
                IsDeceased = false
            };

            repository.Add(clientModel);
            Logger.Verbose(@event.ToString());
        }
        public void When(ClientRegistered @event)
        {
            var accountStatus = repository.Get<AccountStatusLookup>((int)AccountStatusType.Unknown);

            var clientView = new ClientView
            {
                AccountNumber = string.Empty,
                AccountRecency = 0,
                AccountStatus = accountStatus,
                IsDeceased = false,
                DateOfBirth = @event.IdentityNumber.GetDateOfBirth(),
                FirstName = @event.ClientName.FirstName,
                Surname = @event.ClientName.Surname,
                IdentityNumber = @event.IdentityNumber.Number,
                PrimaryContactNumber = @event.PrimaryContactNumber.Number
            };

            repository.Add(clientView);
        }