diff --git a/.github/workflows/prlinked.yml b/.github/workflows/prlinked.yml deleted file mode 100644 index 84037c86..00000000 --- a/.github/workflows/prlinked.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Move Linked Issues - -on: - pull_request: - types: - - opened - - synchronize - - reopened - -jobs: - get-date: - runs-on: ubuntu-latest - outputs: - project_name_prefix: ${{ steps.format_date.outputs.formatted_date }} - steps: - - name: Get PR creation date - id: format_date - run: | - # Extract the month and year from the PR creation date - PR_DATE="${{ github.event.pull_request.created_at }}" - FORMATTED_DATE=$(date -d "$PR_DATE" "+%B %Y") # Format to Month Year - - # Debugging: print out the formatted date - echo "Formatted Date: ${FORMATTED_DATE} Sprint" - - # Set output using the Environment File method - echo "formatted_date=${FORMATTED_DATE} Sprint" >> $GITHUB_OUTPUT # Set the output for later jobs - - debug-date: - needs: get-date - runs-on: ubuntu-latest - steps: - - name: Debug the outputs - run: | - echo "PR Number: ${{ github.event.pull_request.number }}" - echo "Project Column Name: Review" - echo "Project Name Prefix (from get-date job output): ${{ needs.get-date.outputs.project_name_prefix }}" # Access the output correctly - - move-issues: - needs: get-date - uses: TransactionProcessing/org-ci-workflows/.github/workflows/move-linked-issue.yml@main - with: - pr_number: ${{ github.event.pull_request.number }} - project_column_name: "Review" - project_name_prefix: ${{ needs.get-date.outputs.project_name_prefix }} # Access the output from get-date job - secrets: - gh_token: ${{ secrets.GH_TOKEN }} diff --git a/TransactionProcessor.Aggregates.Tests/MerchantAggregateTests.cs b/TransactionProcessor.Aggregates.Tests/MerchantAggregateTests.cs index a5bfa0bb..9cc3efd0 100644 --- a/TransactionProcessor.Aggregates.Tests/MerchantAggregateTests.cs +++ b/TransactionProcessor.Aggregates.Tests/MerchantAggregateTests.cs @@ -114,7 +114,7 @@ public void MerchantAggregate_AddAddress_AddressIsAdded(){ aggregate.Create(TestData.EstateId, TestData.MerchantName, TestData.DateMerchantCreated, TestData.AddressModel, TestData.ContactModel, TestData.SettlementScheduleModel); - Address newAddress = new(Guid.Empty, TestData.MerchantAddressLine1, + Address newAddress = Address.Create(Guid.Empty, TestData.MerchantAddressLine1, TestData.MerchantAddressLine2, TestData.MerchantAddressLine3, TestData.MerchantAddressLine4, @@ -577,7 +577,7 @@ public void MerchantAggregate_UpdateAddress_AddressIsAdded(){ Merchant merchantModel = aggregate.GetMerchant(); Address? address = merchantModel.Addresses.ShouldHaveSingleItem(); - Address newAddress = new(address.AddressId, TestData.MerchantAddressLine1Update, TestData.MerchantAddressLine2Update, TestData.MerchantAddressLine3Update, TestData.MerchantAddressLine4Update, TestData.MerchantTownUpdate, TestData.MerchantRegionUpdate, TestData.MerchantPostalCodeUpdate, TestData.MerchantCountryUpdate); + Address newAddress = Address.Create(address.AddressId, TestData.MerchantAddressLine1Update, TestData.MerchantAddressLine2Update, TestData.MerchantAddressLine3Update, TestData.MerchantAddressLine4Update, TestData.MerchantTownUpdate, TestData.MerchantRegionUpdate, TestData.MerchantPostalCodeUpdate, TestData.MerchantCountryUpdate); Result result = aggregate.UpdateAddress(newAddress); result.IsSuccess.ShouldBeTrue(); @@ -598,7 +598,7 @@ public void MerchantAggregate_UpdateAddress_MerchantNotCreated_ErrorThrown() { MerchantAggregate aggregate = MerchantAggregate.Create(TestData.MerchantId); - Address newAddress = new(Guid.NewGuid(), TestData.MerchantAddressLine1Update, TestData.MerchantAddressLine2Update, TestData.MerchantAddressLine3Update, TestData.MerchantAddressLine4Update, TestData.MerchantTownUpdate, TestData.MerchantRegionUpdate, TestData.MerchantPostalCodeUpdate, TestData.MerchantCountryUpdate); + Address newAddress = Address.Create(Guid.NewGuid(), TestData.MerchantAddressLine1Update, TestData.MerchantAddressLine2Update, TestData.MerchantAddressLine3Update, TestData.MerchantAddressLine4Update, TestData.MerchantTownUpdate, TestData.MerchantRegionUpdate, TestData.MerchantPostalCodeUpdate, TestData.MerchantCountryUpdate); Result result = aggregate.UpdateAddress(newAddress); result.IsFailed.ShouldBeTrue(); result.Status.ShouldBe(ResultStatus.Invalid); @@ -610,7 +610,7 @@ public void MerchantAggregate_UpdateAddress_AddressNotFound_NoErrorThrown(){ aggregate.Create(TestData.EstateId, TestData.MerchantName, TestData.DateMerchantCreated, TestData.AddressModel, TestData.ContactModel, TestData.SettlementScheduleModel); - Address newAddress = new(Guid.NewGuid(), TestData.MerchantAddressLine1Update, TestData.MerchantAddressLine2Update, TestData.MerchantAddressLine3Update, TestData.MerchantAddressLine4Update, TestData.MerchantTownUpdate, TestData.MerchantRegionUpdate, TestData.MerchantPostalCodeUpdate, TestData.MerchantCountryUpdate); + Address newAddress = Address.Create(Guid.NewGuid(), TestData.MerchantAddressLine1Update, TestData.MerchantAddressLine2Update, TestData.MerchantAddressLine3Update, TestData.MerchantAddressLine4Update, TestData.MerchantTownUpdate, TestData.MerchantRegionUpdate, TestData.MerchantPostalCodeUpdate, TestData.MerchantCountryUpdate); Result result = aggregate.UpdateAddress(newAddress); result.IsSuccess.ShouldBeTrue(); @@ -625,7 +625,7 @@ public void MerchantAggregate_UpdateAddress_UpdatedAddressHasNotChanges_NoErrorT Merchant merchantModel = aggregate.GetMerchant(); Address? address = merchantModel.Addresses.ShouldHaveSingleItem(); - Address newAddress = new (address.AddressId, address.AddressLine1, address.AddressLine2, address.AddressLine3, address.AddressLine4, address.Town, address.Region, address.PostalCode, address.Country); + Address newAddress = Address.Create(address.AddressId, address.AddressLine1, address.AddressLine2, address.AddressLine3, address.AddressLine4, address.Town, address.Region, address.PostalCode, address.Country); Result result = aggregate.UpdateAddress(newAddress); @@ -845,5 +845,48 @@ public void MerchantAggregate_RemoveContract_And_ReAdd_ContractIsReAdded() contractModel.ContractId.ShouldBe(TestData.ContractId); contractModel.IsDeleted.ShouldBeFalse(); } + + [Theory] + [InlineData("")] + [InlineData(null)] + public void Address_AddressLine1IsRequired_ErrorThrown(String addressLine1){ + Should.Throw(() => { + Address.Create(Guid.NewGuid(), addressLine1, TestData.MerchantAddressLine2, TestData.MerchantAddressLine3, TestData.MerchantAddressLine4, TestData.MerchantTown, TestData.MerchantRegion, TestData.MerchantPostalCode, TestData.MerchantCountry); + }); + } + + [Theory] + [InlineData("")] + [InlineData(null)] + public void Address_TownIsRequired_ErrorThrown(String town) + { + Should.Throw(() => { + Address.Create(Guid.NewGuid(), TestData.MerchantAddressLine1, TestData.MerchantAddressLine2, TestData.MerchantAddressLine3, TestData.MerchantAddressLine4, town, TestData.MerchantRegion, TestData.MerchantPostalCode, TestData.MerchantCountry); + }); + } + + + [Theory] + [InlineData("")] + [InlineData(null)] + public void Address_PostalCodeIsRequired_ErrorThrown(String postalCode) + { + Should.Throw(() => { + Address.Create(Guid.NewGuid(), TestData.MerchantAddressLine1, TestData.MerchantAddressLine2, TestData.MerchantAddressLine3, TestData.MerchantAddressLine4, TestData.MerchantTown, TestData.MerchantRegion, postalCode, TestData.MerchantCountry); + }); + } + + + + [Theory] + [InlineData("")] + [InlineData(null)] + public void Address_CountryIsRequired_ErrorThrown(String country) + { + Should.Throw(() => { + Address.Create(Guid.NewGuid(), TestData.MerchantAddressLine1, TestData.MerchantAddressLine2, TestData.MerchantAddressLine3, TestData.MerchantAddressLine4, TestData.MerchantTown, TestData.MerchantRegion, TestData.MerchantPostalCode, country); + }); + } + } } diff --git a/TransactionProcessor.Aggregates/MerchantAggregate.cs b/TransactionProcessor.Aggregates/MerchantAggregate.cs index c7000e82..b34f41be 100644 --- a/TransactionProcessor.Aggregates/MerchantAggregate.cs +++ b/TransactionProcessor.Aggregates/MerchantAggregate.cs @@ -379,7 +379,7 @@ public static Merchant GetMerchant(this MerchantAggregate aggregate) { merchantModel.Addresses = new(); foreach (KeyValuePair aggregateAddress in aggregate.Addresses) { - AddressModel address = new AddressModel(aggregateAddress.Key, aggregateAddress.Value.AddressLine1, aggregateAddress.Value.AddressLine2, aggregateAddress.Value.AddressLine3, aggregateAddress.Value.AddressLine4, aggregateAddress.Value.Town, aggregateAddress.Value.Region, aggregateAddress.Value.PostalCode, aggregateAddress.Value.Country); + AddressModel address = AddressModel.Create(aggregateAddress.Key, aggregateAddress.Value.AddressLine1, aggregateAddress.Value.AddressLine2, aggregateAddress.Value.AddressLine3, aggregateAddress.Value.AddressLine4, aggregateAddress.Value.Town, aggregateAddress.Value.Region, aggregateAddress.Value.PostalCode, aggregateAddress.Value.Country); merchantModel.Addresses.Add(address); } diff --git a/TransactionProcessor.BusinessLogic/Services/MerchantDomainService.cs b/TransactionProcessor.BusinessLogic/Services/MerchantDomainService.cs index 95dc0c15..c1af5881 100644 --- a/TransactionProcessor.BusinessLogic/Services/MerchantDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/MerchantDomainService.cs @@ -199,7 +199,7 @@ public async Task CreateMerchant(MerchantCommands.CreateMerchantCommand MerchantAggregate merchantAggregate = merchantResult.Data; // Build up the models for the Crete call - Address address = new Address(Guid.Empty, command.RequestDto.Address.AddressLine1, command.RequestDto.Address.AddressLine2, command.RequestDto.Address.AddressLine3, command.RequestDto.Address.AddressLine4, command.RequestDto.Address.Town, command.RequestDto.Address.Region, command.RequestDto.Address.PostalCode, command.RequestDto.Address.Country); + Address address = Address.Create(Guid.Empty, command.RequestDto.Address.AddressLine1, command.RequestDto.Address.AddressLine2, command.RequestDto.Address.AddressLine3, command.RequestDto.Address.AddressLine4, command.RequestDto.Address.Town, command.RequestDto.Address.Region, command.RequestDto.Address.PostalCode, command.RequestDto.Address.Country); Contact contact = new Contact(Guid.Empty, command.RequestDto.Contact.EmailAddress, command.RequestDto.Contact.ContactName, command.RequestDto.Contact.PhoneNumber); // Set the settlement schedule SettlementSchedule settlementSchedule = ConvertSettlementSchedule(command.RequestDto.SettlementSchedule); @@ -504,7 +504,7 @@ public async Task AddMerchantAddress(MerchantCommands.AddMerchantAddress if (result.IsFailed) return ResultHelpers.CreateFailure(result); - Address address = new(Guid.Empty, command.RequestDto.AddressLine1, command.RequestDto.AddressLine2, command.RequestDto.AddressLine3, command.RequestDto.AddressLine4, command.RequestDto.Town, command.RequestDto.Region, command.RequestDto.PostalCode, command.RequestDto.Country); + Address address = Address.Create(Guid.Empty, command.RequestDto.AddressLine1, command.RequestDto.AddressLine2, command.RequestDto.AddressLine3, command.RequestDto.AddressLine4, command.RequestDto.Town, command.RequestDto.Region, command.RequestDto.PostalCode, command.RequestDto.Country); Result stateResult = merchantAggregate.AddAddress(address); if (stateResult.IsFailed) @@ -542,7 +542,7 @@ public async Task UpdateMerchantAddress(MerchantCommands.UpdateMerchantA if (result.IsFailed) return ResultHelpers.CreateFailure(result); - Address address = new(command.AddressId, command.RequestDto.AddressLine1, command.RequestDto.AddressLine2, command.RequestDto.AddressLine3, command.RequestDto.AddressLine4, command.RequestDto.Town, command.RequestDto.Region, command.RequestDto.PostalCode, command.RequestDto.Country); + Address address = Address.Create(command.AddressId, command.RequestDto.AddressLine1, command.RequestDto.AddressLine2, command.RequestDto.AddressLine3, command.RequestDto.AddressLine4, command.RequestDto.Town, command.RequestDto.Region, command.RequestDto.PostalCode, command.RequestDto.Country); Result stateResult = merchantAggregate.UpdateAddress(address); if (stateResult.IsFailed) diff --git a/TransactionProcessor.IntegrationTesting.Helpers/SpecflowExtensions.cs b/TransactionProcessor.IntegrationTesting.Helpers/SpecflowExtensions.cs index 9276157e..e767b793 100644 --- a/TransactionProcessor.IntegrationTesting.Helpers/SpecflowExtensions.cs +++ b/TransactionProcessor.IntegrationTesting.Helpers/SpecflowExtensions.cs @@ -1050,7 +1050,10 @@ public static List ToCreateEstateRequests(this DataTableRow "Region"), Country = ReqnrollTableHelper.GetStringRowValue(tableRow, - "Country") + "Country"), + PostalCode = + ReqnrollTableHelper.GetStringRowValue(tableRow, + "PostalCode") }, SettlementSchedule = schedule, MerchantId = Guid.NewGuid() diff --git a/TransactionProcessor.IntegrationTests/Features/Contract.feature b/TransactionProcessor.IntegrationTests/Features/Contract.feature index a59c4014..b14c97e8 100644 --- a/TransactionProcessor.IntegrationTests/Features/Contract.feature +++ b/TransactionProcessor.IntegrationTests/Features/Contract.feature @@ -46,9 +46,9 @@ Background: Scenario: Get Merchant Contracts Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant2.co.uk | Test Estate 2 | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 1 | testcontact1@merchant2.co.uk | Test Estate 2 | Given I create a contract with the following values | EstateName | OperatorName | ContractDescription | diff --git a/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs b/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs index 6943098c..0ca8d499 100644 --- a/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs @@ -267,6 +267,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -276,6 +277,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -285,6 +287,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant2.co.uk", diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature index aec2c1f7..d9f6f99d 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature @@ -34,14 +34,14 @@ Background: | Test Estate 1 | Test Operator 1 | Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | - | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 4 | testcontact4@merchant2.co.uk | Test Estate 1 | - | Test Merchant 5 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 5 | testcontact5@merchant2.co.uk | Test Estate 1 | - | Test Merchant 6 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 6 | testcontact6@merchant2.co.uk | Test Estate 1 | - | Test Merchant 7 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 7 | testcontact7@merchant2.co.uk | Test Estate 1 | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | TE57 3NG | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | + | Test Merchant 4 | Address Line 1 | TestTown | Test Region | TE57 4NG | United Kingdom | Test Contact 4 | testcontact4@merchant2.co.uk | Test Estate 1 | + | Test Merchant 5 | Address Line 1 | TestTown | Test Region | TE57 5NG | United Kingdom | Test Contact 5 | testcontact5@merchant2.co.uk | Test Estate 1 | + | Test Merchant 6 | Address Line 1 | TestTown | Test Region | TE57 6NG | United Kingdom | Test Contact 6 | testcontact6@merchant2.co.uk | Test Estate 1 | + | Test Merchant 7 | Address Line 1 | TestTown | Test Region | TE57 7NG | United Kingdom | Test Contact 7 | testcontact7@merchant2.co.uk | Test Estate 1 | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index 0fa793aa..c6455e27 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -204,6 +204,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -213,6 +214,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -222,6 +224,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 2", "testcontact2@merchant2.co.uk", @@ -231,6 +234,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 3NG", "United Kingdom", "Test Contact 3", "testcontact3@merchant2.co.uk", @@ -240,6 +244,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 4NG", "United Kingdom", "Test Contact 4", "testcontact4@merchant2.co.uk", @@ -249,6 +254,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 5NG", "United Kingdom", "Test Contact 5", "testcontact5@merchant2.co.uk", @@ -258,6 +264,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 6NG", "United Kingdom", "Test Contact 6", "testcontact6@merchant2.co.uk", @@ -267,6 +274,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 7NG", "United Kingdom", "Test Contact 7", "testcontact7@merchant2.co.uk", diff --git a/TransactionProcessor.IntegrationTests/Features/Merchant.feature b/TransactionProcessor.IntegrationTests/Features/Merchant.feature index e212a915..c07949e3 100644 --- a/TransactionProcessor.IntegrationTests/Features/Merchant.feature +++ b/TransactionProcessor.IntegrationTests/Features/Merchant.feature @@ -54,8 +54,8 @@ Scenario: Get Invalid Merchant Scenario: Create Merchant When I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Weekly | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Weekly | When I assign the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | | Test Operator 1 | Test Merchant 1 | 00000001 | 10000001 | Test Estate 1 | @@ -103,10 +103,10 @@ Scenario: Create Merchant | -100 | LastMonth | Test Merchant 1 | Test Estate 1 | Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | - | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | TE57 3NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | Test Merchant 4 | Address Line 1 | TestTown | Test Region | TE57 4NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | When I set the merchants settlement schedule | MerchantName | EstateName | SettlementSchedule | @@ -117,12 +117,12 @@ Scenario: Create Merchant @PRTest Scenario: Get Merchants for Estate Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant2.co.uk | Test Estate 1 | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant3.co.uk | Test Estate 1 | - | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant4.co.uk | Test Estate 2 | - | Test Merchant 5 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant5.co.uk | Test Estate 2 | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 1 | testcontact1@merchant2.co.uk | Test Estate 1 | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | TE57 3NG | United Kingdom | Test Contact 1 | testcontact1@merchant3.co.uk | Test Estate 1 | + | Test Merchant 4 | Address Line 1 | TestTown | Test Region | TE57 4NG | United Kingdom | Test Contact 1 | testcontact1@merchant4.co.uk | Test Estate 2 | + | Test Merchant 5 | Address Line 1 | TestTown | Test Region | TE57 5NG | United Kingdom | Test Contact 1 | testcontact1@merchant5.co.uk | Test Estate 2 | When I assign the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | @@ -155,8 +155,8 @@ Scenario: Get Merchants for Estate @PRTest Scenario: Update Merchant When I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Weekly | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Weekly | When I assign the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | | Test Operator 1 | Test Merchant 1 | 00000001 | 10000001 | Test Estate 1 | @@ -173,8 +173,8 @@ Scenario: Update Merchant | UpdateMerchantName | SettlementSchedule | EstateName | MerchantName | | Update Merchant 1 | Monthly | Test Estate 1 | Test Merchant 1 | When I update the merchants address with the following details - | AddressLine1 | AddressLine2 | AddressLine3 | AddressLine4 | Town | Region | Country | EstateName | MerchantName | - | Address Line 1U | Address Line 2 | Address Line 3 | Address Line 4 | TestTownU | Test RegionU | United KingdomU | Test Estate 1 | Test Merchant 1 | + | AddressLine1 | AddressLine2 | AddressLine3 | AddressLine4 | Town | Region | PostalCode | Country | EstateName | MerchantName | + | Address Line 1U | Address Line 2 | Address Line 3 | Address Line 4 | TestTownU | Test RegionU | TE57 2NG | United KingdomU | Test Estate 1 | Test Merchant 1 | When I update the merchants contact with the following details | ContactName | EmailAddress | PhoneNumber | EstateName | MerchantName | | Test Contact 1U | testcontact1update@merchant1.co.uk | 12345678 | Test Estate 1 | Test Merchant 1 | diff --git a/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs b/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs index aef29bb1..23f71737 100644 --- a/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs @@ -311,6 +311,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -321,6 +322,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -516,6 +518,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -525,6 +528,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -534,6 +538,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 3NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -543,6 +548,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 4NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -603,6 +609,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -612,6 +619,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -621,6 +629,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant2.co.uk", @@ -630,6 +639,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 3NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant3.co.uk", @@ -639,6 +649,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 4NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant4.co.uk", @@ -648,6 +659,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 5NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant5.co.uk", @@ -806,6 +818,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -816,6 +829,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -898,6 +912,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "AddressLine4", "Town", "Region", + "PostalCode", "Country", "EstateName", "MerchantName"}); @@ -908,6 +923,7 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa "Address Line 4", "TestTownU", "Test RegionU", + "TE57 2NG", "United KingdomU", "Test Estate 1", "Test Merchant 1"}); diff --git a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature index d3afa433..d6c0fe8c 100644 --- a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature @@ -52,10 +52,10 @@ Background: | Test Estate 2 | Safaricom | Safaricom Contract | Variable Topup | Percentage | Merchant Commission | 0.85 | Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 2 | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | TE57 3NG | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 2 | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | diff --git a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs index 7420f227..39030005 100644 --- a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs @@ -283,6 +283,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -292,6 +293,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -301,6 +303,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 2", "testcontact2@merchant2.co.uk", @@ -310,6 +313,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 3NG", "United Kingdom", "Test Contact 3", "testcontact3@merchant2.co.uk", diff --git a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature index f8a057c4..bbdc6e16 100644 --- a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature +++ b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature @@ -44,8 +44,8 @@ Background: | Test Estate 1 | Voucher | Hospital 1 Contract | 10 KES | 10 KES | | Voucher | Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | diff --git a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs index 590c03bb..bd99f46d 100644 --- a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs @@ -236,6 +236,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -245,6 +246,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature index 534b338a..19d3cf25 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature @@ -78,11 +78,11 @@ Background: | Test Estate 1 | PataPawa PrePay | PataPawa PrePay Contract | Pre Pay Bill Pay | Percentage | Merchant Commission | 0.50 | Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant3.co.uk | Test Estate 1 | - | Test Merchant 4 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 4 | testcontact4@merchant4.co.uk | Test Estate 1 | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | TE57 3NG | United Kingdom | Test Contact 3 | testcontact3@merchant3.co.uk | Test Estate 1 | + | Test Merchant 4 | Address Line 1 | TestTown | Test Region | TE57 4NG | United Kingdom | Test Contact 4 | testcontact4@merchant4.co.uk | Test Estate 1 | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs index 6ae2d4b1..e5341550 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs @@ -386,6 +386,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -395,6 +396,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -404,6 +406,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 2", "testcontact2@merchant2.co.uk", @@ -413,6 +416,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 3NG", "United Kingdom", "Test Contact 3", "testcontact3@merchant3.co.uk", @@ -422,6 +426,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 4NG", "United Kingdom", "Test Contact 4", "testcontact4@merchant4.co.uk", diff --git a/TransactionProcessor.IntegrationTests/Features/Settlement.feature b/TransactionProcessor.IntegrationTests/Features/Settlement.feature index 4fa24d21..660f5657 100644 --- a/TransactionProcessor.IntegrationTests/Features/Settlement.feature +++ b/TransactionProcessor.IntegrationTests/Features/Settlement.feature @@ -53,10 +53,10 @@ Background: Scenario: Get Pending Settlement Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Immediate | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | Weekly | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | Monthly | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Immediate | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | Weekly | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | TE57 3NG | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 1 | Monthly | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | @@ -122,9 +122,9 @@ Scenario: Get Pending Settlement @PRTest Scenario: Process Settlement Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Immediate | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | Weekly | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Immediate | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | Weekly | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | diff --git a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs index 3d8f2a8e..ed6bac4a 100644 --- a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs @@ -313,6 +313,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -323,6 +324,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -333,6 +335,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 2", "testcontact2@merchant2.co.uk", @@ -343,6 +346,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 3NG", "United Kingdom", "Test Contact 3", "testcontact3@merchant2.co.uk", @@ -742,6 +746,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -752,6 +757,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -762,6 +768,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 2", "testcontact2@merchant2.co.uk", diff --git a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature index 4ef3906d..749e1f07 100644 --- a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature +++ b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature @@ -52,10 +52,10 @@ Background: | Test Estate 2 | Safaricom | Safaricom Contract | Variable Topup | Percentage | Merchant Commission | 0.85 | Merchant | Given I create the following merchants - | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | - | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Weekly | - | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | Weekly | - | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 2 | Monthly | + | MerchantName | AddressLine1 | Town | Region | PostalCode | Country | ContactName | EmailAddress | EstateName | SettlementSchedule | + | Test Merchant 1 | Address Line 1 | TestTown | Test Region | TE57 1NG | United Kingdom | Test Contact 1 | testcontact1@merchant1.co.uk | Test Estate 1 | Weekly | + | Test Merchant 2 | Address Line 1 | TestTown | Test Region | TE57 2NG | United Kingdom | Test Contact 2 | testcontact2@merchant2.co.uk | Test Estate 1 | Weekly | + | Test Merchant 3 | Address Line 1 | TestTown | Test Region | TE57 3NG | United Kingdom | Test Contact 3 | testcontact3@merchant2.co.uk | Test Estate 2 | Monthly | Given I have assigned the following operator to the merchants | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName | diff --git a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs index 4e8b16dd..92dcad46 100644 --- a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs @@ -286,6 +286,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AddressLine1", "Town", "Region", + "PostalCode", "Country", "ContactName", "EmailAddress", @@ -296,6 +297,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 1NG", "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk", @@ -306,6 +308,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 2NG", "United Kingdom", "Test Contact 2", "testcontact2@merchant2.co.uk", @@ -316,6 +319,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Address Line 1", "TestTown", "Test Region", + "TE57 3NG", "United Kingdom", "Test Contact 3", "testcontact3@merchant2.co.uk", diff --git a/TransactionProcessor.Models/Merchant/Address.cs b/TransactionProcessor.Models/Merchant/Address.cs index c6fb0355..9a3a0680 100644 --- a/TransactionProcessor.Models/Merchant/Address.cs +++ b/TransactionProcessor.Models/Merchant/Address.cs @@ -2,5 +2,62 @@ namespace TransactionProcessor.Models.Merchant { - public record Address(Guid AddressId, String AddressLine1, String AddressLine2, String AddressLine3, String AddressLine4, String Town, String Region, String PostalCode, String Country); + public record Address + { + public Guid AddressId { get; } + public String AddressLine1 { get; } + public String? AddressLine2 { get; } + public String? AddressLine3 { get; } + public String? AddressLine4 { get; } + public String Town { get; } + public String? Region { get; } + public String PostalCode { get; } + public String Country { get; } + + private Address(Guid addressId, + String addressLine1, + String? addressLine2, + String? addressLine3, + String? addressLine4, + String town, + String? region, + String postalCode, + String country) + { + AddressId = addressId; + AddressLine1 = addressLine1; + AddressLine2 = addressLine2; + AddressLine3 = addressLine3; + AddressLine4 = addressLine4; + Town = town; + Region = region; + PostalCode = postalCode; + Country = country; + } + + public static Address Create(Guid addressId, + String addressLine1, + String? addressLine2, + String? addressLine3, + String? addressLine4, + String town, + String? region, + String postalCode, + String country) + { + if (String.IsNullOrWhiteSpace(addressLine1)) + throw new ArgumentException("AddressLine1 is required"); + + if (String.IsNullOrWhiteSpace(town)) + throw new ArgumentException("Town is required"); + + if (String.IsNullOrWhiteSpace(postalCode)) + throw new ArgumentException("PostalCode is required"); + + if (String.IsNullOrWhiteSpace(country)) + throw new ArgumentException("Country is required"); + + return new Address(addressId, addressLine1, addressLine2, addressLine3, addressLine4,town, region, postalCode, country); + } + } } \ No newline at end of file diff --git a/TransactionProcessor.Repository/ModelFactory.cs b/TransactionProcessor.Repository/ModelFactory.cs index bcbf90ec..dce72a9a 100644 --- a/TransactionProcessor.Repository/ModelFactory.cs +++ b/TransactionProcessor.Repository/ModelFactory.cs @@ -105,7 +105,7 @@ private static List ConvertFrom(List ConvertFrom(List merchantAddresses) { List addresses = new List(); if (merchantAddresses != null && merchantAddresses.Any()) { - merchantAddresses.ForEach(ma => addresses.Add(new MerchantAddressModel(ma.AddressId, ma.AddressLine1, ma.AddressLine2, ma.AddressLine3, ma.AddressLine4, ma.Town, ma.Region, ma.PostalCode, ma.Country))); + merchantAddresses.ForEach(ma => addresses.Add(MerchantAddressModel.Create(ma.AddressId, ma.AddressLine1, ma.AddressLine2, ma.AddressLine3, ma.AddressLine4, ma.Town, ma.Region, ma.PostalCode, ma.Country))); } return addresses; diff --git a/TransactionProcessor.Testing/TestData.cs b/TransactionProcessor.Testing/TestData.cs index fdff59de..bd29e26b 100644 --- a/TransactionProcessor.Testing/TestData.cs +++ b/TransactionProcessor.Testing/TestData.cs @@ -145,7 +145,7 @@ public class TestData MerchantName = TestData.MerchantName, SettlementSchedule = Models.Merchant.SettlementSchedule.Immediate, Addresses = new List{ - new Models.Merchant.Address(Guid.NewGuid(), MerchantAddressLine1,MerchantAddressLine2, + Models.Merchant.Address.Create(Guid.NewGuid(), MerchantAddressLine1,MerchantAddressLine2, MerchantAddressLine3,MerchantAddressLine4, MerchantTown,MerchantRegion, MerchantPostalCode, MerchantCountry) }, @@ -165,7 +165,7 @@ public class TestData MerchantName = TestData.MerchantName, SettlementSchedule = Models.Merchant.SettlementSchedule.Immediate, Addresses = new List{ - new Models.Merchant.Address(Guid.NewGuid(), MerchantAddressLine1,MerchantAddressLine2, + Models.Merchant.Address.Create(Guid.NewGuid(), MerchantAddressLine1,MerchantAddressLine2, MerchantAddressLine3,MerchantAddressLine4, MerchantTown,MerchantRegion, MerchantPostalCode, MerchantCountry) }, @@ -184,7 +184,7 @@ public class TestData MerchantName = TestData.MerchantName, SettlementSchedule = Models.Merchant.SettlementSchedule.Immediate, Addresses = new List{ - new Models.Merchant.Address(Guid.NewGuid(), MerchantAddressLine1,MerchantAddressLine2, + Models.Merchant.Address.Create(Guid.NewGuid(), MerchantAddressLine1,MerchantAddressLine2, MerchantAddressLine3,MerchantAddressLine4, MerchantTown,MerchantRegion, MerchantPostalCode, MerchantCountry) }, @@ -2102,7 +2102,7 @@ public static DataTransferObjects.Requests.Contract.AddTransactionFeeForProductT MerchantStatementDate = TestData.StatementCreateDate }; - public static Models.Merchant.Address AddressModel => new (Guid.Empty, AddressLine1, AddressLine2, AddressLine3, AddressLine4, Town, Region, PostCode, Country); + public static Models.Merchant.Address AddressModel => Models.Merchant.Address.Create(Guid.Empty, AddressLine1, AddressLine2, AddressLine3, AddressLine4, Town, Region, PostCode, Country); public static Models.Merchant.Contact ContactModel => new(Guid.Empty, ContactEmail, ContactName, ContactPhone);