public void ImportSubaddressPositionFromCrab( CrabAddressPositionId addressPositionId, CrabSubaddressId subaddressId, WkbGeometry addressPosition, CrabAddressPositionOrigin addressPositionOrigin, CrabAddressNature addressNature, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { if (IsRemoved && modification != CrabModification.Delete) { return; } var legacyEvent = new AddressSubaddressPositionWasImportedFromCrab( addressPositionId, subaddressId, addressPosition, addressPositionOrigin, addressNature, lifetime, timestamp, @operator, modification, organisation); ApplyPositionChangeFor <AddressSubaddressPositionWasImportedFromCrab, int>(_crabSubaddressPositionEvents, legacyEvent); ApplyAddressCompletion(); ApplyChange(legacyEvent); }
public void ImportSubaddressStatusFromCrab( CrabSubaddressStatusId subaddressStatusId, CrabSubaddressId subaddressId, CrabAddressStatus addressStatus, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { if (IsRemoved && modification != CrabModification.Delete) { return; } var legacyEvent = new AddressSubaddressStatusWasImportedFromCrab( subaddressStatusId, subaddressId, addressStatus, lifetime, timestamp, @operator, modification, organisation); ApplyStatusChangesFor(_subAddressStatusChronicle, legacyEvent); ApplyAddressCompletion(); ApplyChange(legacyEvent); }
public AssignPersistentLocalIdForCrabSubaddressId( CrabSubaddressId subaddressId, PersistentLocalId persistentLocalId, PersistentLocalIdAssignmentDate assignmentDate) { SubaddressId = subaddressId; PersistentLocalId = persistentLocalId; AssignmentDate = assignmentDate; }
public ImportSubaddressStatusFromCrab( CrabSubaddressStatusId subaddressStatusId, CrabSubaddressId subaddressId, CrabAddressStatus addressStatus, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { SubaddressStatusId = subaddressStatusId; SubaddressId = subaddressId; AddressStatus = addressStatus; Lifetime = lifetime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public AddressSubaddressStatusWasImportedFromCrab( CrabSubaddressStatusId subaddressStatusId, CrabSubaddressId subaddressId, CrabAddressStatus addressStatus, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { SubaddressStatusId = subaddressStatusId; SubaddressId = subaddressId; AddressStatus = addressStatus; BeginDateTime = lifetime.BeginDateTime; EndDateTime = lifetime.EndDateTime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public ImportSubaddressFromCrab( CrabSubaddressId subaddressId, CrabHouseNumberId houseNumberId, BoxNumber boxNumber, CrabBoxNumberType boxNumberType, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { SubaddressId = subaddressId; HouseNumberId = houseNumberId; BoxNumber = boxNumber; Lifetime = lifetime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; BoxNumberType = boxNumberType; }
public AddressSubaddressWasImportedFromCrab( CrabSubaddressId subaddressId, CrabHouseNumberId houseNumberId, BoxNumber boxNumber, CrabBoxNumberType boxNumberType, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { SubaddressId = subaddressId; HouseNumberId = houseNumberId; BoxNumber = boxNumber; BoxNumberType = boxNumberType; BeginDateTime = lifetime.BeginDateTime; EndDateTime = lifetime.EndDateTime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public void ImportSubaddressFromCrab( CrabSubaddressId subaddressId, CrabHouseNumberId houseNumberId, BoxNumber boxNumber, CrabBoxNumberType boxNumberType, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { GuardRemoved(modification); var addressId = AddressId.CreateFor(subaddressId); if (_addressCollection.Contains(AddressId.CreateFor(houseNumberId)) && !_addressCollection.Contains(addressId) && modification != CrabModification.Delete && !lifetime.EndDateTime.HasValue) { ApplyChange(new ParcelAddressWasAttached(_parcelId, addressId)); } else if (_addressCollection.Contains(addressId) && (modification == CrabModification.Delete || lifetime.EndDateTime.HasValue)) { ApplyChange(new ParcelAddressWasDetached(_parcelId, addressId)); } ApplyChange(new AddressSubaddressWasImportedFromCrab( subaddressId, houseNumberId, boxNumber, boxNumberType, lifetime, timestamp, @operator, modification, organisation)); }
public ImportSubaddressMailCantonFromCrab( CrabHouseNumberMailCantonId houseNumberMailCantonId, CrabHouseNumberId houseNumberId, CrabSubaddressId subaddressId, CrabMailCantonId mailCantonId, CrabMailCantonCode mailCantonCode, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { HouseNumberMailCantonId = houseNumberMailCantonId; HouseNumberId = houseNumberId; SubaddressId = subaddressId; MailCantonId = mailCantonId; Lifetime = lifetime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; MailCantonCode = mailCantonCode; }
public ImportSubaddressPositionFromCrab( CrabAddressPositionId addressPositionId, CrabSubaddressId subaddressId, WkbGeometry addressPosition, CrabAddressNature addressNature, CrabAddressPositionOrigin addressPositionOrigin, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { AddressPositionId = addressPositionId; SubaddressId = subaddressId; AddressPosition = addressPosition; AddressNature = addressNature; AddressPositionOrigin = addressPositionOrigin; Lifetime = lifetime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public ImportHouseNumberSubaddressFromCrab( CrabHouseNumberId houseNumberId, CrabSubaddressId subaddressId, CrabStreetNameId streetNameId, HouseNumber houseNumber, GrbNotation grbNotation, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { HouseNumberId = houseNumberId; SubaddressId = subaddressId; StreetNameId = streetNameId; HouseNumber = houseNumber; GrbNotation = grbNotation; Lifetime = lifetime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public void ImportSubaddressFromCrab( CrabSubaddressId subaddressId, CrabHouseNumberId houseNumberId, BoxNumber boxNumber, CrabBoxNumberType boxNumberType, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { GuardRemoved(modification); if (modification == CrabModification.Delete) { if (!IsRemoved) { ApplyChange(new AddressWasRemoved(_addressId)); } } else { if (_boxNumber != boxNumber) { if (string.IsNullOrEmpty(boxNumber) && _boxNumber != null) { ApplyChange(new AddressBoxNumberWasRemoved(_addressId)); } else if (modification != CrabModification.Correction) { ApplyChange(new AddressBoxNumberWasChanged(_addressId, boxNumber)); } else { ApplyChange(new AddressBoxNumberWasCorrected(_addressId, boxNumber)); } } EvaluateRetirement(lifetime, modification); } if (_coupledHouseNumberId != null && _coupledHouseNumberId != houseNumberId && !IsRemoved) { var lastEvent = _lastHouseNumberEventsForSubaddress[houseNumberId]; ApplyHouseNumberChange(new CrabStreetNameId(lastEvent.StreetNameId), new HouseNumber(lastEvent.HouseNumber), modification); ApplyPostalCodeChangeFor( _lastHouseNumberMailCantonEventsForSubaddress.ContainsKey(houseNumberId) ? _lastHouseNumberMailCantonEventsForSubaddress[houseNumberId] : null, modification); } ApplyChange(new AddressSubaddressWasImportedFromCrab( subaddressId, houseNumberId, boxNumber, boxNumberType, lifetime, timestamp, @operator, modification, organisation)); }
public static AddressId CreateFor(CrabSubaddressId crabSubaddressId) => new AddressId(crabSubaddressId.CreateDeterministicId());
public RequestPersistentLocalIdForCrabSubaddressId( CrabSubaddressId subaddressId) { SubaddressId = subaddressId; }
public static ImportSubaddressFromCrab WithSubaddressId(this ImportSubaddressFromCrab command, CrabSubaddressId subaddressId) { return(new ImportSubaddressFromCrab( command.CaPaKey, subaddressId, command.HouseNumberId, command.BoxNumber, command.BoxNumberType, command.Lifetime, command.Timestamp, command.Operator, command.Modification, command.Organisation)); }