Example #1
0
        public void ImportHouseNumberStatusFromCrab(
            CrabHouseNumberStatusId houseNumberStatusId,
            CrabHouseNumberId houseNumberId,
            CrabAddressStatus addressStatus,
            CrabLifetime lifetime,
            CrabTimestamp timestamp,
            CrabOperator @operator,
            CrabModification?modification,
            CrabOrganisation?organisation)
        {
            GuardRemoved(modification);

            var legacyEvent = new AddressHouseNumberStatusWasImportedFromCrab(
                houseNumberStatusId,
                houseNumberId,
                addressStatus,
                lifetime,
                timestamp,
                @operator,
                modification,
                organisation);

            ApplyStatusChangesFor(_houseNumberStatusChronicle, legacyEvent);

            ApplyAddressCompletion();

            ApplyChange(legacyEvent);
        }
 public ImportHouseNumberStatusFromCrab(
     CrabHouseNumberStatusId houseNumberStatusId,
     CrabHouseNumberId houseNumberId,
     CrabAddressStatus addressStatus,
     CrabLifetime lifetime,
     CrabTimestamp timestamp,
     CrabOperator @operator,
     CrabModification?modification,
     CrabOrganisation?organisation)
 {
     HouseNumberStatusId = houseNumberStatusId;
     HouseNumberId       = houseNumberId;
     AddressStatus       = addressStatus;
     Lifetime            = lifetime;
     Timestamp           = timestamp;
     Operator            = @operator;
     Modification        = modification;
     Organisation        = organisation;
 }
Example #3
0
        public void WithRemovedStatusWhenStatusInUseAndSameLifetimeOfPreviouslyRemovedStatus(AddressId addressId,
                                                                                             AddressWasRegistered addressWasRegistered,
                                                                                             AddressWasProposed addressWasProposed,
                                                                                             AddressWasOfficiallyAssigned addressWasOfficiallyAssigned,
                                                                                             AddressHouseNumberStatusWasImportedFromCrab addressHouseNumberStatusWasImportedFromCrab,
                                                                                             AddressStatusWasRemoved addressStatusWasRemoved,
                                                                                             AddressHouseNumberStatusWasImportedFromCrab addressHouseNumberStatusWasImportedFromCrabDelete,
                                                                                             ImportHouseNumberStatusFromCrab importHouseNumberStatusFromCrab,
                                                                                             CrabLifetime lifetime)
        {
            var statusId = new CrabHouseNumberStatusId(1);

            addressHouseNumberStatusWasImportedFromCrab = addressHouseNumberStatusWasImportedFromCrab
                                                          .WithHouseNumberStatusId(statusId)
                                                          .WithStatus(CrabAddressStatus.Proposed)
                                                          .WithBeginDate(lifetime.BeginDateTime);
            addressHouseNumberStatusWasImportedFromCrabDelete = addressHouseNumberStatusWasImportedFromCrabDelete
                                                                .WithHouseNumberStatusId(statusId)
                                                                .WithStatus(CrabAddressStatus.Proposed)
                                                                .WithCrabModification(CrabModification.Delete)
                                                                .WithBeginDate(lifetime.BeginDateTime);

            importHouseNumberStatusFromCrab = importHouseNumberStatusFromCrab
                                              .WithLifetime(lifetime)
                                              .WithStatus(CrabAddressStatus.InUse);

            Assert(new Scenario()
                   .Given(addressId,
                          addressWasRegistered,
                          addressWasProposed,
                          addressWasOfficiallyAssigned,
                          addressHouseNumberStatusWasImportedFromCrab,
                          addressStatusWasRemoved,
                          addressHouseNumberStatusWasImportedFromCrabDelete
                          )
                   .When(importHouseNumberStatusFromCrab)
                   .Then(addressId,
                         new AddressBecameCurrent(addressId),
                         importHouseNumberStatusFromCrab.ToLegacyEvent()));
        }
Example #4
0
 public static ImportHouseNumberStatusFromCrab WithStatusId(this ImportHouseNumberStatusFromCrab command, CrabHouseNumberStatusId statusId)
 {
     return(new ImportHouseNumberStatusFromCrab(
                statusId,
                command.HouseNumberId,
                command.AddressStatus,
                command.Lifetime,
                command.Timestamp,
                command.Operator,
                command.Modification,
                command.Organisation));
 }
Example #5
0
 public static AddressHouseNumberStatusWasImportedFromCrab WithHouseNumberStatusId(this AddressHouseNumberStatusWasImportedFromCrab @event, CrabHouseNumberStatusId statusId)
 {
     return(new AddressHouseNumberStatusWasImportedFromCrab(
                statusId,
                new CrabHouseNumberId(@event.HouseNumberId),
                @event.AddressStatus,
                new CrabLifetime(@event.BeginDateTime, @event.EndDateTime),
                new CrabTimestamp(@event.Timestamp),
                new CrabOperator(@event.Operator),
                @event.Modification,
                @event.Organisation
                ));
 }