diff --git a/NVDSuppressions.xml b/NVDSuppressions.xml index 296a940c..4d323872 100644 --- a/NVDSuppressions.xml +++ b/NVDSuppressions.xml @@ -253,7 +253,7 @@ ^pkg:generic/dotnet\-getdocument@.*$ CVE-2023-36558 - + ^pkg:generic/Azure\.Identity@.*$ CVE-2024-35255 - + ^pkg:generic/Elasticsearch\.Net@.*$ CVE-2020-7009 - CVE-2020-7014 + CVE-2020-7014 CVE-2023-31418 CVE-2023-31419 CVE-2023-46673 @@ -534,4 +534,238 @@ ^pkg:generic/Elasticsearch\.Net@.*$ CVE-2023-46674 + + + + + ^pkg:generic/ProtoBufJsonConverter@.*$ + CVE-2020-12762 + CVE-2013-6370 + CVE-2013-6371 + + + + + + ^pkg:generic/JsonConverter\.Newtonsoft\.Json@.*$ + CVE-2020-12762 + CVE-2013-6370 + CVE-2013-6371 + + + + + + ^pkg:generic/NJsonSchema\.Extensions@.*$ + CVE-2021-3918 + + + + + + + ^pkg:generic/Handlebars\.Net\.Helpers@.*$ + CVE-2020-7661 + CVE-2022-21195 + + + + + + ^pkg:generic/WireMock\.Net@.*$ + CVE-2020-27853 + CVE-2021-41093 + CVE-2021-41100 + CVE-2022-23610 + CVE-2022-31122 + CVE-2020-15258 + CVE-2018-8909 + CVE-2021-41119 + CVE-2021-32665 + CVE-2021-32666 + CVE-2022-23625 + CVE-2022-31009 + CVE-2023-22737 + CVE-2021-41101 + CVE-2022-43673 + CVE-2021-21301 + CVE-2021-32755 + + + + + + ^pkg:generic/WireMock\.Net@.*$ + CVE-2018-9116 + CVE-2023-41329 + CVE-2018-9117 + + + + + + ^pkg:generic/WireMock\.Net\.Abstractions@.*$ + CVE-2018-9116 + CVE-2018-9117 + + + + + + ^pkg:generic/WireMock\.Net\.Abstractions@.*$ + CVE-2023-41329 + + + + + + ^pkg:generic/WireMock\.Net\.Abstractions@.*$ + CVE-2020-27853 + CVE-2021-41093 + CVE-2020-15258 + CVE-2018-8909 + CVE-2021-32665 + CVE-2021-32666 + CVE-2022-23625 + CVE-2022-23625 + CVE-2022-31009 + CVE-2023-22737 + CVE-2022-43673 + CVE-2021-21301 + CVE-2021-32755 + + + + + + ^pkg:generic/WireMock\.Net\.OpenApiParser@.*$ + CVE-2020-27853 + CVE-2021-41093 + CVE-2020-15258 + CVE-2018-8909 + CVE-2021-32665 + CVE-2021-32665 + CVE-2021-32666 + CVE-2022-23625 + CVE-2022-31009 + CVE-2023-22737 + CVE-2022-43673 + CVE-2021-21301 + CVE-2021-32755 + + + + + + ^pkg:generic/WireMock\.Net\.OpenApiParser@.*$ + CVE-2018-9116 + CVE-2023-41329 + CVE-2018-9117 + + + + + + ^pkg:generic/WireMock\.Org\.Abstractions@.*$ + CVE-2020-27853 + CVE-2021-41093 + CVE-2020-15258 + CVE-2018-8909 + CVE-2021-32665 + CVE-2021-32666 + CVE-2022-23625 + CVE-2022-31009 + CVE-2023-22737 + CVE-2021-41101 + CVE-2022-43673 + CVE-2021-21301 + CVE-2021-32755 + + + + + + ^pkg:generic/WireMock\.Org\.Abstractions@.*$ + CVE-2018-9116 + CVE-2023-41329 + CVE-2018-9117 + + + + + + ^pkg:generic/JsonConverter\.Abstractions@.*$ + CVE-2020-12762 + CVE-2013-6370 + CVE-2013-6371 + + + + + + CVE-2017-11770 + + + + + + ^pkg:generic/GraphQL.NewtonsoftJson@.*$ + CVE-2024-21907 + + + + + + ^pkg:generic/YamlDotNet@.*$ + CVE-2018-1000210 + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f3082a7e..72ce1db6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -452,7 +452,6 @@ stages: value : $[ dependencies.DevDeployTerraform.outputs['DevDeployTerraform.TerraformDeploy.mockWebApp'] ] - name : mockWebAppResourceGroup value : $[ dependencies.DevDeployTerraform.outputs['DevDeployTerraform.TerraformDeploy.mockWebAppResourceGroupName'] ] - displayName: "Dev Functional Automated Tests" workspace: clean: all diff --git a/src/UKHO.ERPFacade.API/ConfigurationFiles/SapActions.json b/src/UKHO.ERPFacade.API/ConfigurationFiles/SapActions.json index e881b23e..3b8e5581 100644 --- a/src/UKHO.ERPFacade.API/ConfigurationFiles/SapActions.json +++ b/src/UKHO.ERPFacade.API/ConfigurationFiles/SapActions.json @@ -12,129 +12,120 @@ "AttributeDataType": "bool", "AttributeName": "Status.IsNewCell", "AttributeValue": "True" + }, + { + "AttributeDataType": "bool", + "AttributeName": "ContentChange", + "AttributeValue": "True" } ] } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": true, "Section": "Product", - "JsonPropertyName": "Agency", + "JsonPropertyName": "ProductName", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "ProviderCode", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "Size", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "Title", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "EditionNumber", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "UpdateNumber", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": true, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": true, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -149,129 +140,120 @@ "AttributeDataType": "bool", "AttributeName": "IsNewUnitOfSale", "AttributeValue": "True" + }, + { + "AttributeDataType": "string", + "AttributeName": "UnitOfSaleType", + "AttributeValue": "unit" } ] } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": false, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "Agency", + "Section": "UnitOfSale", + "JsonPropertyName": "UnitName", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": true, - "Section": "Product", + "Section": "UnitOfSale", "JsonPropertyName": "ProviderCode", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitSize", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "Title", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitType", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -279,131 +261,112 @@ "ActionNumber": 3, "Action": "ASSIGN CELL TO AVCS UNIT OF SALE", "Product": "AVCS UNIT", - "Rules": [ - { - "Conditions": [ - ] - } - ], + "Rules": [], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": false, - "Section": "Product", - "JsonPropertyName": "Agency", + "Section": "UnitOfSale", + "JsonPropertyName": "", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": false, - "Section": "Product", - "JsonPropertyName": "ProviderCode", + "Section": "UnitOfSale", + "JsonPropertyName": "", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": false, - "Section": "Product", - "JsonPropertyName": "Size", + "Section": "UnitOfSale", + "JsonPropertyName": "", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -414,128 +377,119 @@ "Rules": [ { "Conditions": [ + { + "AttributeDataType": "bool", + "AttributeName": "ContentChange", + "AttributeValue": "True" + } ] } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": true, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Agency", + "JsonPropertyName": "", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ProviderCode", + "JsonPropertyName": "", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Size", + "JsonPropertyName": "", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -546,128 +500,119 @@ "Rules": [ { "Conditions": [ + { + "AttributeDataType": "bool", + "AttributeName": "ContentChange", + "AttributeValue": "True" + } ] } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitName", + "JsonPropertyName": "", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": true, "Section": "Product", - "JsonPropertyName": "AdditionalCoverage", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Agency", + "JsonPropertyName": "", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ProviderCode", + "JsonPropertyName": "", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Size", + "JsonPropertyName": "", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -684,127 +629,122 @@ "AttributeValue": "False" } ] + }, + { + "Conditions": [ + { + "AttributeDataType": "bool", + "AttributeName": "Status.IsNewCell", + "AttributeValue": "False" + } + ] } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": true, "Section": "Product", - "JsonPropertyName": "Agency", + "JsonPropertyName": "ProductName", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "ProviderCode", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "Size", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -817,131 +757,127 @@ "Conditions": [ { "AttributeDataType": "bool", - "AttributeName": "ContentChange", + "AttributeName": "IsNewUnitOfSale", "AttributeValue": "False" + }, + { + "AttributeDataType": "bool", + "AttributeName": "Status", + "AttributeValue": "ForSale" + }, + { + "AttributeDataType": "string", + "AttributeName": "UnitOfSaleType", + "AttributeValue": "unit" } ] } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": false, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "Agency", + "Section": "UnitOfSale", + "JsonPropertyName": "UnitName", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": true, - "Section": "Product", + "Section": "UnitOfSale", "JsonPropertyName": "ProviderCode", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitSize", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -961,143 +897,115 @@ "AttributeDataType": "bool", "AttributeName": "ContentChange", "AttributeValue": "True" - }, - { - "AttributeDataType": "string", - "AttributeName": "Status.StatusName", - "AttributeValue": "Update | New Edition | Re-issue" - } - ] - }, - { - "Conditions": [ - { - "AttributeDataType": "string", - "AttributeName": "Status.StatusName", - "AttributeValue": "Suspended" } ] } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Agency", + "JsonPropertyName": "", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ProviderCode", + "JsonPropertyName": "", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Size", + "JsonPropertyName": "", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "EditionNumber", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": true, "Section": "Product", "JsonPropertyName": "UpdateNumber", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": true, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": true, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -1105,131 +1013,112 @@ "ActionNumber": 9, "Action": "REMOVE ENC CELL FROM AVCS UNIT OF SALE", "Product": "AVCS UNIT", - "Rules": [ - { - "Conditions": [ - ] - } - ], + "Rules": [], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Agency", + "JsonPropertyName": "", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ProviderCode", + "JsonPropertyName": "", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Size", + "JsonPropertyName": "", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -1244,129 +1133,120 @@ "AttributeDataType": "string", "AttributeName": "Status.StatusName", "AttributeValue": "Cancellation Update" + }, + { + "AttributeDataType": "bool", + "AttributeName": "ContentChange", + "AttributeValue": "True" } ] } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Agency", + "JsonPropertyName": "", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ProviderCode", + "JsonPropertyName": "", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Size", + "JsonPropertyName": "", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] }, @@ -1386,124 +1266,110 @@ } ], "Attributes": [ - { - "IsRequired": true, - "Section": "Product", - "JsonPropertyName": "ProductType", - "XmlNodeName": "PRODTYPE", - "SortingOrder": 1 - }, - { - "IsRequired": false, - "Section": "Product", - "JsonPropertyName": "ProductName", - "XmlNodeName": "CHILDCELL", - "SortingOrder": 2 - }, { "IsRequired": true, "Section": "UnitOfSale", "JsonPropertyName": "UnitName", "XmlNodeName": "PRODUCTNAME", - "SortingOrder": 3 + "SortingOrder": 1 }, { "IsRequired": false, "Section": "Product", "JsonPropertyName": "", "XmlNodeName": "CANCELLED", - "SortingOrder": 4 + "SortingOrder": 2 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ReplacedBy", + "JsonPropertyName": "", "XmlNodeName": "REPLACEDBY", - "SortingOrder": 5 + "SortingOrder": 3 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Agency", + "JsonPropertyName": "", "XmlNodeName": "AGENCY", - "SortingOrder": 6 + "SortingOrder": 4 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "ProviderCode", + "JsonPropertyName": "", "XmlNodeName": "PROVIDER", - "SortingOrder": 7 + "SortingOrder": 5 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Size", + "JsonPropertyName": "", "XmlNodeName": "ENCSIZE", - "SortingOrder": 8 + "SortingOrder": 6 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "Title", + "JsonPropertyName": "", "XmlNodeName": "TITLE", - "SortingOrder": 9 + "SortingOrder": 7 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "EditionNumber", + "JsonPropertyName": "", "XmlNodeName": "EDITIONNO", - "SortingOrder": 10 + "SortingOrder": 8 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "UpdateNumber", + "JsonPropertyName": "", "XmlNodeName": "UPDATENO", - "SortingOrder": 11 + "SortingOrder": 9 }, { "IsRequired": false, "Section": "UnitOfSale", - "JsonPropertyName": "UnitType", + "JsonPropertyName": "", "XmlNodeName": "UNITTYPE", - "SortingOrder": 12 + "SortingOrder": 10 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "WEEKNO", - "SortingOrder": 13 + "SortingOrder": 11 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "", "XmlNodeName": "VALIDFROM", - "SortingOrder": 14 + "SortingOrder": 12 }, { "IsRequired": true, "Section": "UkhoWeekNumber", "JsonPropertyName": "CurrentWeekAlphaCorrection", "XmlNodeName": "CORRECTION", - "SortingOrder": 15 + "SortingOrder": 13 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "ACTIVEKEY", - "SortingOrder": 16 + "SortingOrder": 14 }, { "IsRequired": false, "Section": "Product", - "JsonPropertyName": "Permit", + "JsonPropertyName": "", "XmlNodeName": "NEXTKEY", - "SortingOrder": 17 + "SortingOrder": 15 } ] } diff --git a/src/UKHO.ERPFacade.API/Controllers/WebhookController.cs b/src/UKHO.ERPFacade.API/Controllers/WebhookController.cs index d20e1a2a..91a2217b 100644 --- a/src/UKHO.ERPFacade.API/Controllers/WebhookController.cs +++ b/src/UKHO.ERPFacade.API/Controllers/WebhookController.cs @@ -1,5 +1,4 @@ -using System.Xml; -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Newtonsoft.Json; @@ -83,35 +82,34 @@ public virtual async Task NewEncContentPublishedEventReceived([Fr { _logger.LogInformation(EventIds.NewEncContentPublishedEventReceived.ToEventId(), "ERP Facade webhook has received new enccontentpublished event from EES."); - string correlationId = encEventJson.SelectToken(CorrelationIdKey)?.Value(); + var correlationId = encEventJson.SelectToken(CorrelationIdKey)?.Value(); if (string.IsNullOrEmpty(correlationId)) { - _logger.LogWarning(EventIds.CorrelationIdMissingInEvent.ToEventId(), "CorrelationId is missing in ENC content published event."); + _logger.LogWarning(EventIds.CorrelationIdMissingInEvent.ToEventId(), "CorrelationId is missing in enccontentpublished event."); return new BadRequestObjectResult(StatusCodes.Status400BadRequest); } - _logger.LogInformation(EventIds.StoreEncContentPublishedEventInAzureTable.ToEventId(), "Storing the received ENC content published event in azure table."); + _logger.LogInformation(EventIds.AddingEntryForEncContentPublishedEventInAzureTable.ToEventId(), "Adding/Updating entry for enccontentpublished event in azure table."); await _azureTableReaderWriter.UpsertEntity(correlationId); - _logger.LogInformation(EventIds.UploadEncContentPublishedEventInAzureBlob.ToEventId(), "Uploading the received ENC content published event in blob storage."); + _logger.LogInformation(EventIds.UploadEncContentPublishedEventInAzureBlobStarted.ToEventId(), "Uploading enccontentpublished event payload in blob storage."); await _azureBlobEventWriter.UploadEvent(encEventJson.ToString(), correlationId, EncEventFileName); - _logger.LogInformation(EventIds.UploadedEncContentPublishedEventInAzureBlob.ToEventId(), "ENC content published event is uploaded in blob storage successfully."); + _logger.LogInformation(EventIds.UploadEncContentPublishedEventInAzureBlobCompleted.ToEventId(), "The enccontentpublished event payload is uploaded in blob storage successfully."); - XmlDocument sapPayload = _encContentSapMessageBuilder.BuildSapMessageXml(JsonConvert.DeserializeObject(encEventJson.ToString()), correlationId); + var sapPayload = _encContentSapMessageBuilder.BuildSapMessageXml(JsonConvert.DeserializeObject(encEventJson.ToString())); - _logger.LogInformation(EventIds.UploadSapXmlPayloadInAzureBlobStarted.ToEventId(), "Uploading the SAP xml payload in blob storage."); + _logger.LogInformation(EventIds.UploadSapXmlPayloadInAzureBlobStarted.ToEventId(), "Uploading the SAP XML payload in blob storage."); await _azureBlobEventWriter.UploadEvent(sapPayload.ToIndentedString(), correlationId, SapXmlPayloadFileName); - _logger.LogInformation(EventIds.UploadSapXmlPayloadInAzureBlobCompleted.ToEventId(), "SAP xml payload is uploaded in blob storage successfully."); + _logger.LogInformation(EventIds.UploadSapXmlPayloadInAzureBlobCompleted.ToEventId(), "SAP XML payload is uploaded in blob storage successfully."); - HttpResponseMessage response = await _sapClient.PostEventData(sapPayload, _sapConfig.Value.SapEndpointForEncEvent, _sapConfig.Value.SapServiceOperationForEncEvent, _sapConfig.Value.SapUsernameForEncEvent, _sapConfig.Value.SapPasswordForEncEvent); + var response = await _sapClient.PostEventData(sapPayload, _sapConfig.Value.SapEndpointForEncEvent, _sapConfig.Value.SapServiceOperationForEncEvent, _sapConfig.Value.SapUsernameForEncEvent, _sapConfig.Value.SapPasswordForEncEvent); if (!response.IsSuccessStatusCode) { - _logger.LogError(EventIds.ErrorOccuredInSap.ToEventId(), "An error occured while processing your request in SAP. | {StatusCode}", response.StatusCode); - throw new ERPFacadeException(EventIds.ErrorOccuredInSap.ToEventId()); + throw new ERPFacadeException(EventIds.RequestToSapFailed.ToEventId(), $"An error occurred while sending a request to SAP. | {response.StatusCode}"); } - _logger.LogInformation(EventIds.EncUpdatePushedToSap.ToEventId(), "ENC update has been sent to SAP successfully. | {StatusCode}", response.StatusCode); + _logger.LogInformation(EventIds.EncUpdateSentToSap.ToEventId(), "ENC update has been sent to SAP successfully. | {StatusCode}", response.StatusCode); await _azureTableReaderWriter.UpdateRequestTimeEntity(correlationId); @@ -144,8 +142,8 @@ public virtual async Task RecordOfSalePublishedEventReceived([Fro { _logger.LogInformation(EventIds.RecordOfSalePublishedEventReceived.ToEventId(), "ERP Facade webhook has received record of sale event from EES."); - string correlationId = recordOfSaleEventJson.SelectToken(CorrelationIdKey)?.Value(); - string eventId = recordOfSaleEventJson.SelectToken(EventIdKey)?.Value(); + var correlationId = recordOfSaleEventJson.SelectToken(CorrelationIdKey)?.Value(); + var eventId = recordOfSaleEventJson.SelectToken(EventIdKey)?.Value(); if (string.IsNullOrEmpty(correlationId)) { @@ -193,7 +191,7 @@ public virtual async Task LicenceUpdatedPublishedEventReceived([F { _logger.LogInformation(EventIds.LicenceUpdatedEventPublishedEventReceived.ToEventId(), "ERP Facade webhook has received new licence updated publish event from EES."); - string correlationId = licenceUpdatedEventJson.SelectToken(CorrelationIdKey)?.Value(); + var correlationId = licenceUpdatedEventJson.SelectToken(CorrelationIdKey)?.Value(); if (string.IsNullOrEmpty(correlationId)) { @@ -208,18 +206,17 @@ public virtual async Task LicenceUpdatedPublishedEventReceived([F await _azureBlobEventWriter.UploadEvent(licenceUpdatedEventJson.ToString(), LicenceUpdatedContainerName, correlationId + '/' + LicenceUpdatedEventFileName); _logger.LogInformation(EventIds.UploadedLicenceUpdatedPublishedEventInAzureBlob.ToEventId(), "Licence updated published event is uploaded in blob storage successfully."); - XmlDocument sapPayload = _licenceUpdatedSapMessageBuilder.BuildLicenceUpdatedSapMessageXml(JsonConvert.DeserializeObject(licenceUpdatedEventJson.ToString()), correlationId); + var sapPayload = _licenceUpdatedSapMessageBuilder.BuildLicenceUpdatedSapMessageXml(JsonConvert.DeserializeObject(licenceUpdatedEventJson.ToString()), correlationId); _logger.LogInformation(EventIds.UploadLicenceUpdatedSapXmlPayloadInAzureBlob.ToEventId(), "Uploading the SAP xml payload for licence updated event in blob storage."); await _azureBlobEventWriter.UploadEvent(sapPayload.ToIndentedString(), LicenceUpdatedContainerName, correlationId + '/' + SapXmlPayloadFileName); _logger.LogInformation(EventIds.UploadedLicenceUpdatedSapXmlPayloadInAzureBlob.ToEventId(), "SAP xml payload for licence updated event is uploaded in blob storage successfully."); - HttpResponseMessage response = await _sapClient.PostEventData(sapPayload, _sapConfig.Value.SapEndpointForRecordOfSale, _sapConfig.Value.SapServiceOperationForRecordOfSale, _sapConfig.Value.SapUsernameForRecordOfSale, _sapConfig.Value.SapPasswordForRecordOfSale); + var response = await _sapClient.PostEventData(sapPayload, _sapConfig.Value.SapEndpointForRecordOfSale, _sapConfig.Value.SapServiceOperationForRecordOfSale, _sapConfig.Value.SapUsernameForRecordOfSale, _sapConfig.Value.SapPasswordForRecordOfSale); if (!response.IsSuccessStatusCode) { - _logger.LogError(EventIds.ErrorOccurredInSapForLicenceUpdatedPublishedEvent.ToEventId(), "An error occurred while sending licence updated event data to SAP. | {StatusCode}", response.StatusCode); - throw new ERPFacadeException(EventIds.ErrorOccurredInSapForLicenceUpdatedPublishedEvent.ToEventId()); + throw new ERPFacadeException(EventIds.ErrorOccurredInSapForLicenceUpdatedPublishedEvent.ToEventId(), $"An error occurred while sending licence updated event data to SAP. | {response.StatusCode}"); } _logger.LogInformation(EventIds.LicenceUpdatedPublishedEventUpdatePushedToSap.ToEventId(), "The licence updated event data has been sent to SAP successfully. | {StatusCode}", response.StatusCode); diff --git a/src/UKHO.ERPFacade.API/Filters/CorrelationIdMiddleware.cs b/src/UKHO.ERPFacade.API/Filters/CorrelationIdMiddleware.cs index d402f168..8fa9586f 100644 --- a/src/UKHO.ERPFacade.API/Filters/CorrelationIdMiddleware.cs +++ b/src/UKHO.ERPFacade.API/Filters/CorrelationIdMiddleware.cs @@ -25,16 +25,16 @@ public async Task InvokeAsync(HttpContext httpContext) if (!string.IsNullOrWhiteSpace(bodyAsText)) { - JToken bodyAsJson = JToken.Parse(bodyAsText); + var bodyAsJson = JToken.Parse(bodyAsText); if (bodyAsJson is JArray) { - JArray requestJArray = JArray.Parse(bodyAsText); + var requestJArray = JArray.Parse(bodyAsText); if (!string.IsNullOrEmpty(requestJArray.First.SelectToken(CorrIdKey)?.Value())) correlationId = requestJArray.First.SelectToken(CorrIdKey)?.Value(); } if (bodyAsJson is JObject) { - JObject requestJObject = JObject.Parse(bodyAsText); + var requestJObject = JObject.Parse(bodyAsText); correlationId = requestJObject.SelectToken(CorrelationIdKey)?.Value(); } } diff --git a/src/UKHO.ERPFacade.API/Filters/LoggingMiddleware.cs b/src/UKHO.ERPFacade.API/Filters/LoggingMiddleware.cs index 5c0dfcc1..a59bd8d1 100644 --- a/src/UKHO.ERPFacade.API/Filters/LoggingMiddleware.cs +++ b/src/UKHO.ERPFacade.API/Filters/LoggingMiddleware.cs @@ -1,4 +1,5 @@ using System.Net; +using Microsoft.AspNetCore.Mvc; using UKHO.ERPFacade.Common.Exceptions; using UKHO.ERPFacade.Common.Logging; @@ -7,7 +8,6 @@ namespace UKHO.ERPFacade.API.Filters public class LoggingMiddleware { private readonly RequestDelegate _next; - private readonly ILogger _logger; public LoggingMiddleware(RequestDelegate next, ILogger logger) @@ -20,25 +20,39 @@ public async Task InvokeAsync(HttpContext httpContext) { try { + // Proceed with the next middleware in the pipeline await _next(httpContext); } + catch (ERPFacadeException exception) + { + await HandleExceptionAsync(httpContext, exception, exception.EventId, exception.Message, exception.MessageArguments); + } catch (Exception exception) { - var exceptionType = exception.GetType(); - var correlationId = httpContext!.Request.Headers[CorrelationIdMiddleware.XCorrelationIdHeaderKey].FirstOrDefault()!; + await HandleExceptionAsync(httpContext, exception, EventIds.UnhandledException.ToEventId(), exception.Message); + } + } - if (exceptionType == typeof(ERPFacadeException)) - { - EventIds eventId = (EventIds)((ERPFacadeException)exception).EventId.Id; - _logger.LogError(eventId.ToEventId(), exception, eventId.ToString() + ". | _X-Correlation-ID : {_X-Correlation-ID}", correlationId); - } - else + private async Task HandleExceptionAsync(HttpContext httpContext, Exception exception, EventId eventId, string message, params object[] messageArgs) + { + httpContext.Response.ContentType = "application/json"; + httpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError; + + var correlationId = httpContext!.Request.Headers[CorrelationIdMiddleware.XCorrelationIdHeaderKey].FirstOrDefault()!; + + _logger.LogError(eventId, exception, message, messageArgs); + + var problemDetails = new ProblemDetails + { + Status = httpContext.Response.StatusCode, + Extensions = { - _logger.LogError(EventIds.UnhandledException.ToEventId(), exception, "Exception occured while processing ErpFacade API." + " | _X-Correlation-ID : {_X-Correlation-ID}", correlationId); - } + ["correlationId"] = correlationId, + }, + Detail = message + }; - httpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError; - } + await httpContext.Response.WriteAsJsonAsync(problemDetails); } } } diff --git a/src/UKHO.ERPFacade.API/Helpers/EncContentSapMessageBuilder.cs b/src/UKHO.ERPFacade.API/Helpers/EncContentSapMessageBuilder.cs index b817e42a..900e9fa0 100644 --- a/src/UKHO.ERPFacade.API/Helpers/EncContentSapMessageBuilder.cs +++ b/src/UKHO.ERPFacade.API/Helpers/EncContentSapMessageBuilder.cs @@ -5,6 +5,8 @@ using UKHO.ERPFacade.Common.Models; using UKHO.ERPFacade.Common.Providers; using UKHO.ERPFacade.Common.PermitDecryption; +using UKHO.ERPFacade.Common.Exceptions; +using System; namespace UKHO.ERPFacade.API.Helpers { @@ -32,6 +34,7 @@ public class EncContentSapMessageBuilder : IEncContentSapMessageBuilder private const string ReplacedBy = "REPLACEDBY"; private const string ChildCell = "CHILDCELL"; private const string ProdType = "PRODTYPE"; + private const string ProdTypeValue = "S57"; private const string UnitOfSaleSection = "UnitOfSale"; private const string UnitSaleType = "unit"; private const string EncCell = "ENC CELL"; @@ -46,6 +49,13 @@ public class EncContentSapMessageBuilder : IEncContentSapMessageBuilder private const string IsCorrectionFalse = "N"; private const string ActiveKey = "ACTIVEKEY"; private const string NextKey = "NEXTKEY"; + private const string UnitOfSaleStatusForSale = "ForSale"; + private const string Agency = "AGENCY"; + private const string CreateEncCell = "CREATE ENC CELL"; + private const string UpdateCell = "UPDATE ENC CELL EDITION UPDATE NUMBER"; + private const string Permit = "permit"; + private const int MaxXmlNodeLength = 250; + private const int MaxAgencyXmlNodeLength = 2; public EncContentSapMessageBuilder(ILogger logger, IXmlHelper xmlHelper, @@ -66,478 +76,403 @@ IPermitDecryption permitDecryption /// /// Generate SAP message xml file. /// - /// - /// + /// /// XmlDocument - public XmlDocument BuildSapMessageXml(EncEventPayload eventData, string correlationId) + public XmlDocument BuildSapMessageXml(EncEventPayload eventData) { string sapXmlTemplatePath = Path.Combine(Environment.CurrentDirectory, SapXmlPath); - //Check whether template file exists or not + // Check if SAP XML payload template exists if (!_fileSystemHelper.IsFileExists(sapXmlTemplatePath)) { - _logger.LogError(EventIds.SapXmlTemplateNotFound.ToEventId(), "The SAP message xml template does not exist."); - throw new FileNotFoundException(); + throw new ERPFacadeException(EventIds.SapXmlTemplateNotFound.ToEventId(), "The SAP XML payload template does not exist."); } - var ukhoWeekNumber = eventData.Data.UkhoWeekNumber; + var soapXml = _xmlHelper.CreateXmlDocument(sapXmlTemplatePath); - XmlDocument soapXml = _xmlHelper.CreateXmlDocument(sapXmlTemplatePath); + var actionItemNode = soapXml.SelectSingleNode(XpathActionItems); - XmlNode IM_MATINFONode = soapXml.SelectSingleNode(XpathImMatInfo); - XmlNode actionItemNode = soapXml.SelectSingleNode(XpathActionItems); + _logger.LogInformation(EventIds.GenerationOfSapXmlPayloadStarted.ToEventId(), "Generation of SAP XML payload started."); + + // Build SAP actions for ENC Cell + BuildEncCellActions(eventData, soapXml, actionItemNode); + + // Build SAP actions for Units + BuildUnitActions(eventData, soapXml, actionItemNode); + + // Finalize SAP XML message + FinalizeSapXmlMessage(soapXml, eventData.Data.CorrelationId, actionItemNode); + + _logger.LogInformation(EventIds.GenerationOfSapXmlPayloadCompleted.ToEventId(), "Generation of SAP XML payload completed."); + + return soapXml; + } + + private void BuildEncCellActions(EncEventPayload eventData, XmlDocument soapXml, XmlNode actionItemNode) + { + _logger.LogInformation(EventIds.EncCellSapActionGenerationStarted.ToEventId(), "Building ENC cell SAP actions."); - bool isConditionSatisfied = false; - _logger.LogInformation(EventIds.BuildingSapActionStarted.ToEventId(), "Building SAP actions."); foreach (var product in eventData.Data.Products) { - //Actions for ENC CELL foreach (var action in _sapActionConfig.Value.SapActions.Where(x => x.Product == EncCell)) { - XmlElement actionNode; + var unitOfSale = GetUnitOfSale(action.ActionNumber, eventData.Data.UnitsOfSales, product); + + if (!ValidateActionRules(action, product)) + continue; + switch (action.ActionNumber) { - case 1: - case 6: - case 8: - case 10: - var unitOfSale = GetUnitOfSaleForEncCell(eventData.Data.UnitsOfSales, product); - foreach (var rules in action.Rules) + case 1://CREATE ENC CELL + case 10://CANCEL ENC CELL + if (unitOfSale is null) { - foreach (var conditions in rules.Conditions) - { - object jsonFieldValue = CommonHelper.ParseXmlNode(conditions.AttributeName, product, product.GetType()); - if (jsonFieldValue != null! && IsValidValue(jsonFieldValue.ToString(), conditions.AttributeValue)) - { - isConditionSatisfied = true; - } - else - { - isConditionSatisfied = false; - break; - } - } - if (isConditionSatisfied) break; + throw new ERPFacadeException(EventIds.UnitOfSaleNotFoundException.ToEventId(), $"Required unit not found in event payload to generate {action.Action} action for {product.ProductName}."); } + BuildAndAppendActionNode(soapXml, product, unitOfSale, action, eventData, actionItemNode, product.ProductName); + break; - if (isConditionSatisfied) + case 4://REPLACED WITH ENC CELL + if (product.ReplacedBy.Any() && unitOfSale is null) { - actionNode = BuildAction(soapXml, product, unitOfSale, action, ukhoWeekNumber); - actionItemNode.AppendChild(actionNode); - _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); - isConditionSatisfied = false; + throw new ERPFacadeException(EventIds.UnitOfSaleNotFoundException.ToEventId(), $"Required unit not found in event payload to generate {action.Action} action for {product.ProductName}."); } - break; - - case 4: - var unitOfSaleForReplace = GetUnitOfSaleForEncCell(eventData.Data.UnitsOfSales, product); foreach (var replacedProduct in product.ReplacedBy) { - actionNode = BuildAction(soapXml, product, unitOfSaleForReplace, action, ukhoWeekNumber, null, replacedProduct); - actionItemNode.AppendChild(actionNode); - _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); + BuildAndAppendActionNode(soapXml, product, unitOfSale, action, eventData, actionItemNode, product.ProductName, replacedProduct); } break; - case 5: - var unitOfSaleForCoverage = GetUnitOfSaleForEncCell(eventData.Data.UnitsOfSales, product); + case 5://ADDITIONAL COVERAGE ENC CELL foreach (var additionalCoverageProduct in product.AdditionalCoverage) { - actionNode = BuildAction(soapXml, product, unitOfSaleForCoverage, action, ukhoWeekNumber, null, additionalCoverageProduct); - actionItemNode.AppendChild(actionNode); - _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); + BuildAndAppendActionNode(soapXml, product, null, action, eventData, actionItemNode, product.ProductName, additionalCoverageProduct); } break; - } - } - - //Actions for AVCS UNIT - foreach (var action in _sapActionConfig.Value.SapActions.Where(x => x.Product == AvcsUnit)) - { - foreach (var inUnitOfSale in product.InUnitsOfSale) - { - var unitofSale = eventData.Data.UnitsOfSales.Where(x => x.UnitName == inUnitOfSale).FirstOrDefault(); - XmlElement actionNode; - switch (action.ActionNumber) - { - case 11: - foreach (var rules in action.Rules) - { - foreach (var conditions in rules.Conditions) - { - object jsonFieldValue = CommonHelper.ParseXmlNode(conditions.AttributeName, unitofSale, unitofSale.GetType()); - if (jsonFieldValue != null! && IsValidValue(jsonFieldValue.ToString(), conditions.AttributeValue)) - { - isConditionSatisfied = true; - } - else - { - isConditionSatisfied = false; - break; - } - } - } - if (isConditionSatisfied) - { - actionNode = BuildAction(soapXml, product, unitofSale, action, ukhoWeekNumber); - actionItemNode.AppendChild(actionNode); - _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); - - isConditionSatisfied = false; - } - break; - - case 7: - foreach (var rules in action.Rules) - { - foreach (var conditions in rules.Conditions) - { - object jsonFieldValue = CommonHelper.ParseXmlNode(conditions.AttributeName, product, product.GetType()); - if (jsonFieldValue != null! && IsValidValue(jsonFieldValue.ToString(), conditions.AttributeValue)) - { - isConditionSatisfied = true; - } - else - { - isConditionSatisfied = false; - break; - } - } - } - if (isConditionSatisfied) - { - actionNode = BuildAction(soapXml, product, unitofSale, action, ukhoWeekNumber); - actionItemNode.AppendChild(actionNode); - _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); - - isConditionSatisfied = false; - } - break; - } + case 6://CHANGE ENC CELL + case 8://UPDATE ENC CELL EDITION UPDATE NUMBER + if (unitOfSale is not null) + BuildAndAppendActionNode(soapXml, product, unitOfSale, action, eventData, actionItemNode, product.ProductName); + break; } } } + } - //Avcs Unit actions for Create AVCS Unit, Add and Remove products - foreach (var action in _sapActionConfig.Value.SapActions.Where(x => x.Product == AvcsUnit)) + private void BuildUnitActions(EncEventPayload eventData, XmlDocument soapXml, XmlNode actionItemNode) + { + foreach (var unitOfSale in eventData.Data.UnitsOfSales) { - foreach (var unitOfSale in eventData.Data.UnitsOfSales) + foreach (var action in _sapActionConfig.Value.SapActions.Where(x => x.Product == AvcsUnit)) { - XmlElement actionNode; + if (!ValidateActionRules(action, unitOfSale)) + continue; + switch (action.ActionNumber) { - case 2: - foreach (var rules in action.Rules) - { - foreach (var conditions in rules.Conditions) - { - object jsonFieldValue = CommonHelper.ParseXmlNode(conditions.AttributeName, unitOfSale, unitOfSale.GetType()); - if (jsonFieldValue != null! && IsValidValue(jsonFieldValue.ToString(), conditions.AttributeValue)) - { - isConditionSatisfied = true; - } - else - { - isConditionSatisfied = false; - break; - } - } - } - if (isConditionSatisfied) - { - var product = eventData.Data.Products.Where(x => x.InUnitsOfSale.Contains(unitOfSale.UnitName) - && unitOfSale.UnitOfSaleType == UnitSaleType).FirstOrDefault(); - - actionNode = BuildAction(soapXml, product, unitOfSale, action, ukhoWeekNumber); - actionItemNode.AppendChild(actionNode); - _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); - - isConditionSatisfied = false; - } + case 2://CREATE AVCS UNIT OF SALE + case 7://CHANGE AVCS UNIT OF SALE + case 11://CANCEL AVCS UNIT OF SALE + BuildAndAppendActionNode(soapXml, null, unitOfSale, action, eventData, actionItemNode); break; - case 3: + case 3://ASSIGN CELL TO AVCS UNIT OF SALE foreach (var addProduct in unitOfSale.CompositionChanges.AddProducts) { - var product = eventData.Data.Products.Where(x => x.ProductName == addProduct).FirstOrDefault(); - - actionNode = BuildAction(soapXml, product, unitOfSale, action, ukhoWeekNumber, addProduct); - actionItemNode.AppendChild(actionNode); - _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); + BuildAndAppendActionNode(soapXml, null, unitOfSale, action, eventData, actionItemNode, addProduct, null); } break; - case 9: + case 9://REMOVE ENC CELL FROM AVCS UNIT OF SALE foreach (var removeProduct in unitOfSale.CompositionChanges.RemoveProducts) { - var product = eventData.Data.Products.Where(x => x.ProductName == removeProduct).FirstOrDefault(); - - actionNode = BuildAction(soapXml, product, unitOfSale, action, ukhoWeekNumber); - actionItemNode.AppendChild(actionNode); - _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); + BuildAndAppendActionNode(soapXml, null, unitOfSale, action, eventData, actionItemNode, removeProduct, null); } break; } } } + } - XmlNode xmlNode = SortXmlPayload(actionItemNode); - - XmlNode noOfActions = soapXml.SelectSingleNode(XpathNoOfActions); - XmlNode corrId = soapXml.SelectSingleNode(XpathCorrId); - XmlNode recDate = soapXml.SelectSingleNode(XpathRecDate); - XmlNode recTime = soapXml.SelectSingleNode(XpathRecTime); + private void FinalizeSapXmlMessage(XmlDocument soapXml, string correlationId, XmlNode actionItemNode) + { + var xmlNode = SortXmlPayload(actionItemNode); - corrId.InnerText = correlationId; - noOfActions.InnerText = xmlNode.ChildNodes.Count.ToString(); - recDate.InnerText = DateTime.UtcNow.ToString(RecDateFormat); - recTime.InnerText = DateTime.UtcNow.ToString(RecTimeFormat); + SetXmlNodeValue(soapXml, XpathCorrId, correlationId); + SetXmlNodeValue(soapXml, XpathNoOfActions, xmlNode.ChildNodes.Count.ToString()); + SetXmlNodeValue(soapXml, XpathRecDate, DateTime.UtcNow.ToString(RecDateFormat)); + SetXmlNodeValue(soapXml, XpathRecTime, DateTime.UtcNow.ToString(RecTimeFormat)); + var IM_MATINFONode = soapXml.SelectSingleNode(XpathImMatInfo); IM_MATINFONode.AppendChild(xmlNode); - - return soapXml; } - private XmlElement BuildAction(XmlDocument soapXml, Product product, UnitOfSale unitOfSale, SapAction action, UkhoWeekNumber ukhoWeekNumber, string childCell = null, string replacedByOrAddCoverageProduct = null) + /// + /// Returns primary unit of sale for given product to get ProductName for ENC cell SAP actions. + /// + /// + /// + /// + /// + private UnitOfSale? GetUnitOfSale(int actionNumber, List listOfUnitOfSales, Product product) { - XmlElement itemNode = soapXml.CreateElement(Item); - - XmlElement actionNumberNode = soapXml.CreateElement(ActionNumber); - actionNumberNode.InnerText = action.ActionNumber.ToString(); - - XmlElement actionNode = soapXml.CreateElement(Action); - actionNode.InnerText = action.Action.ToString(); - - XmlElement productNode = soapXml.CreateElement(Product); - productNode.InnerText = action.Product.ToString(); - - itemNode.AppendChild(actionNumberNode); - itemNode.AppendChild(actionNode); - itemNode.AppendChild(productNode); + return actionNumber switch + { + //Case 1 : CREATE ENC CELL + 1 => listOfUnitOfSales.FirstOrDefault(x => x.UnitOfSaleType == UnitSaleType && + x.Status == UnitOfSaleStatusForSale && + x.CompositionChanges.AddProducts.Contains(product.ProductName)), + + //Case 4 : REPLACED WITH ENC CELL + //Case 10 : CANCEL ENC CELL + 4 or 10 => listOfUnitOfSales.FirstOrDefault(x => x.UnitOfSaleType == UnitSaleType && + x.CompositionChanges.RemoveProducts.Contains(product.ProductName)), + + //Case 6 : CHANGE ENC CELL + //Case 8 : UPDATE ENC CELL EDITION UPDATE NUMBER + 6 or 8 => listOfUnitOfSales.FirstOrDefault(x => x.UnitOfSaleType == UnitSaleType && + x.Status == UnitOfSaleStatusForSale && + product.InUnitsOfSale.Contains(x.UnitName)), + _ => null, + }; + } - List<(int sortingOrder, XmlElement itemNode)> actionAttributeList = new(); + /// + /// Returns true if given product/unit satisfies rules for given action. + /// + /// + /// + /// + private bool ValidateActionRules(SapAction action, object obj) + { + bool isConditionSatisfied = false; - PermitKey? permitKey = action.ActionNumber is 1 or 8 ? _permitDecryption.GetPermitKeys(product.Permit) : null; + //Return true if no rules for SAP action. + if (action.Rules == null!) return true; - foreach (var node in action.Attributes.Where(x => x.Section == ProductSection)) + foreach (var rules in action.Rules) { - XmlElement itemSubNode = soapXml.CreateElement(node.XmlNodeName); - - if (node.IsRequired) + foreach (var conditions in rules.Conditions) { - if (node.XmlNodeName == ReplacedBy && replacedByOrAddCoverageProduct != null) - { - itemSubNode.InnerText = GetXmlNodeValue(replacedByOrAddCoverageProduct.ToString()); - } - else if (node.XmlNodeName == ChildCell && childCell != null) - { - itemSubNode.InnerText = GetXmlNodeValue(childCell.ToString()); - } - else if (node.XmlNodeName == ActiveKey) - { - itemSubNode.InnerText = string.Empty; - if (permitKey != null && !string.IsNullOrEmpty(permitKey.ActiveKey)) - { - itemSubNode.InnerText = permitKey.ActiveKey; - } - } - else if (node.XmlNodeName == NextKey) + object jsonFieldValue = CommonHelper.ParseXmlNode(conditions.AttributeName, obj, obj.GetType()); + + if (jsonFieldValue != null! && jsonFieldValue.ToString() == conditions.AttributeValue) { - itemSubNode.InnerText = string.Empty; - if (permitKey != null && !string.IsNullOrEmpty(permitKey.NextKey)) - { - itemSubNode.InnerText = permitKey.NextKey; - } + isConditionSatisfied = true; } else { - object jsonFieldValue = CommonHelper.ParseXmlNode(node.JsonPropertyName, product, product.GetType()); - itemSubNode.InnerText = GetXmlNodeValue(jsonFieldValue.ToString(), node.XmlNodeName); + isConditionSatisfied = false; + break; } } - else - { - itemSubNode.InnerText = string.Empty; - } - actionAttributeList.Add((node.SortingOrder, itemSubNode)); + if (isConditionSatisfied) break; } + return isConditionSatisfied; + } - foreach (var node in action.Attributes.Where(x => x.Section == UnitOfSaleSection)) - { - XmlElement itemSubNode = soapXml.CreateElement(node.XmlNodeName); + private void BuildAndAppendActionNode(XmlDocument soapXml, Product product, UnitOfSale unitOfSale, SapAction action, EncEventPayload eventData, XmlNode actionItemNode, string childCell = null, string replacedBy = null) + { + _logger.LogInformation(EventIds.BuildingSapActionStarted.ToEventId(), "Building SAP action {ActionName}.", action.Action); + var actionNode = BuildAction(soapXml, product, unitOfSale, action, eventData.Data.UkhoWeekNumber, childCell, replacedBy); + actionItemNode.AppendChild(actionNode); + _logger.LogInformation(EventIds.SapActionCreated.ToEventId(), "SAP action {ActionName} created.", action.Action); + } - if (node.IsRequired) - { - if (unitOfSale != null) - { - object jsonFieldValue = CommonHelper.ParseXmlNode(node.JsonPropertyName, unitOfSale, unitOfSale.GetType()); - itemSubNode.InnerText = GetXmlNodeValue(jsonFieldValue.ToString()); - } - else - { - itemSubNode.InnerText = string.Empty; - } - } - else - { - itemSubNode.InnerText = string.Empty; - } - actionAttributeList.Add((node.SortingOrder, itemSubNode)); + private XmlElement BuildAction(XmlDocument soapXml, Product product, UnitOfSale unitOfSale, SapAction action, UkhoWeekNumber ukhoWeekNumber, string childCell, string replacedBy = null) + { + DecryptedPermit decryptedPermit = null; + + // Create main item node + var itemNode = soapXml.CreateElement(nameof(Item)); + + // Add basic action-related nodes + AppendChildNode(itemNode, soapXml, ActionNumber, action.ActionNumber.ToString()); + AppendChildNode(itemNode, soapXml, Action, action.Action.ToString()); + AppendChildNode(itemNode, soapXml, Product, action.Product.ToString()); + AppendChildNode(itemNode, soapXml, ProdType, ProdTypeValue); + + // Add child cell node + AppendChildNode(itemNode, soapXml, ChildCell, childCell); + + List<(int sortingOrder, XmlElement node)> actionAttributes = new(); + + // Get permit keys for New cell and Updated cell + if (product != null! && !IsPropertyNullOrEmpty(Permit, product.Permit) && (action.Action == CreateEncCell || action.Action == UpdateCell)) + { + decryptedPermit = _permitDecryption.Decrypt(product.Permit); } - foreach (var node in action.Attributes.Where(x => x.Section == UkhoWeekNumberSection)) + // Process ProductSection attributes + ProcessAttributes(action.Action, action.Attributes.Where(x => x.Section == ProductSection), soapXml, product, actionAttributes, decryptedPermit, replacedBy); + + // Process UnitOfSaleSection attributes + ProcessAttributes(action.Action, action.Attributes.Where(x => x.Section == UnitOfSaleSection), soapXml, unitOfSale, actionAttributes, null, null); + + // Process UkhoWeekNumberSection attributes + ProcessUkhoWeekNumberAttributes(action.Action, action.Attributes.Where(x => x.Section == UkhoWeekNumberSection), soapXml, ukhoWeekNumber, actionAttributes); + + // Sort and append attributes to SAP action + foreach (var (sortingOrder, node) in actionAttributes.OrderBy(x => x.sortingOrder)) { - XmlElement itemSubNode = soapXml.CreateElement(node.XmlNodeName); + itemNode.AppendChild(node); + } + + return itemNode; + } - if (node.IsRequired) + private void AppendChildNode(XmlElement parentNode, XmlDocument doc, string nodeName, string value) + { + var childNode = doc.CreateElement(nodeName); + childNode.InnerText = value ?? string.Empty; + parentNode.AppendChild(childNode); + } + + private void ProcessAttributes(string action, IEnumerable attributes, XmlDocument soapXml, object source, List<(int, XmlElement)> actionAttributes, DecryptedPermit decryptedPermit = null, string replacedBy = null) + { + foreach (var attribute in attributes) + { + try { - if (IsValidWeekNumber(ukhoWeekNumber)) + var attributeNode = soapXml.CreateElement(attribute.XmlNodeName); + + if (attribute.IsRequired) { - switch (node.XmlNodeName) + switch (attribute.XmlNodeName) { - case ValidFrom: - string weekDate = _weekDetailsProvider.GetDateOfWeek( - ukhoWeekNumber.Year, ukhoWeekNumber.Week, ukhoWeekNumber.CurrentWeekAlphaCorrection); - itemSubNode.InnerText = GetXmlNodeValue(weekDate); + case ReplacedBy: + if (!IsPropertyNullOrEmpty(attribute.JsonPropertyName, replacedBy)) attributeNode.InnerText = GetXmlNodeValue(replacedBy.ToString(), attribute.XmlNodeName); break; - - case WeekNo: - string weekData = GetUkhoWeekNumberData(ukhoWeekNumber); - itemSubNode.InnerText = GetXmlNodeValue(weekData); + case ActiveKey: + attributeNode.InnerText = string.Empty; + if (decryptedPermit != null && !string.IsNullOrEmpty(decryptedPermit.ActiveKey)) attributeNode.InnerText = GetXmlNodeValue(decryptedPermit.ActiveKey, attribute.XmlNodeName); break; - - case Correction: - itemSubNode.InnerText = ukhoWeekNumber.CurrentWeekAlphaCorrection ? GetXmlNodeValue(IsCorrectionTrue) : GetXmlNodeValue(IsCorrectionFalse); + case NextKey: + attributeNode.InnerText = string.Empty; + if (decryptedPermit != null && !string.IsNullOrEmpty(decryptedPermit.NextKey)) attributeNode.InnerText = GetXmlNodeValue(decryptedPermit.NextKey, attribute.XmlNodeName); + break; + default: + var jsonFieldValue = CommonHelper.ParseXmlNode(attribute.JsonPropertyName, source, source.GetType()).ToString(); + if (!IsPropertyNullOrEmpty(attribute.JsonPropertyName, jsonFieldValue)) + { + attributeNode.InnerText = GetXmlNodeValue(jsonFieldValue.ToString(), attribute.XmlNodeName); + } break; } } else { - _logger.LogError(EventIds.InvalidUkhoWeekNumber.ToEventId(), "Invalid UkhoWeekNumber field received in enccontentpublished event."); - itemSubNode.InnerText = string.Empty; + attributeNode.InnerText = string.Empty; } + actionAttributes.Add((attribute.SortingOrder, attributeNode)); } - else + catch (Exception ex) { - itemSubNode.InnerText = string.Empty; + throw new ERPFacadeException(EventIds.BuildingSapActionInformationException.ToEventId(), $"Error while generating SAP action information. | Action : {action} | XML Attribute : {attribute.XmlNodeName} | ErrorMessage : {ex.Message}"); } - actionAttributeList.Add((node.SortingOrder, itemSubNode)); } - - var sortedActionAttributeList = actionAttributeList.OrderBy(x => x.sortingOrder).ToList(); - - foreach (var itemAttribute in sortedActionAttributeList) - { - itemNode.AppendChild(itemAttribute.itemNode); - } - - return itemNode; } - private XmlNode SortXmlPayload(XmlNode actionItemNode) + private void ProcessUkhoWeekNumberAttributes(string action, IEnumerable attributes, XmlDocument soapXml, UkhoWeekNumber ukhoWeekNumber, List<(int, XmlElement)> actionAttributes) { - List actionItemList = new(); - int sequenceNumber = 1; - - foreach (XmlNode subNode in actionItemNode) + if (ukhoWeekNumber == null) { - actionItemList.Add(subNode); + throw new ERPFacadeException(EventIds.RequiredSectionNotFoundException.ToEventId(), $"UkhoWeekNumber section not found in enccontentpublished event payload while creating {action} action."); } - var sortedActionItemList = actionItemList.Cast().OrderBy(x => Convert.ToInt32(x.SelectSingleNode(ActionNumber).InnerText)).ToList(); - - foreach (XmlNode actionItem in sortedActionItemList) + foreach (var attribute in attributes) { - actionItem.SelectSingleNode(ActionNumber).InnerText = sequenceNumber.ToString(); - sequenceNumber++; - } + try + { + var attributeNode = soapXml.CreateElement(attribute.XmlNodeName); - foreach (XmlNode actionItem in sortedActionItemList) - { - actionItemNode.AppendChild(actionItem); + if (attribute.IsRequired) + { + if (ukhoWeekNumber.Year.HasValue && ukhoWeekNumber.Week.HasValue && ukhoWeekNumber.CurrentWeekAlphaCorrection.HasValue) + { + switch (attribute.XmlNodeName) + { + case ValidFrom: + var validFrom = _weekDetailsProvider.GetDateOfWeek(ukhoWeekNumber.Year.Value, ukhoWeekNumber.Week.Value, ukhoWeekNumber.CurrentWeekAlphaCorrection.Value); + attributeNode.InnerText = GetXmlNodeValue(validFrom, attribute.XmlNodeName); + break; + case WeekNo: + var weekNo = string.Join("", ukhoWeekNumber.Year, ukhoWeekNumber.Week.Value.ToString("D2")); + attributeNode.InnerText = GetXmlNodeValue(weekNo, attribute.XmlNodeName); + break; + case Correction: + attributeNode.InnerText = GetXmlNodeValue(ukhoWeekNumber.CurrentWeekAlphaCorrection.Value ? IsCorrectionTrue : IsCorrectionFalse, attribute.XmlNodeName); + break; + } + } + else + { + throw new ERPFacadeException(EventIds.EmptyEventJsonPropertyException.ToEventId(), $"Required details are missing in enccontentpublished event payload. | Property Name : {attribute.JsonPropertyName}"); + } + } + actionAttributes.Add((attribute.SortingOrder, attributeNode)); + } + catch (Exception ex) + { + throw new ERPFacadeException(EventIds.BuildingSapActionInformationException.ToEventId(), $"Error while generating SAP action information. | Action : {action} | XML Attribute : {attribute.XmlNodeName} | ErrorMessage : {ex.Message}"); + } } - return actionItemNode; } - private string GetXmlNodeValue(string fieldValue, string xmlNodeName = null) + private void SetXmlNodeValue(XmlDocument xmlDoc, string xPath, string value) { - if (!string.IsNullOrWhiteSpace(fieldValue)) + var node = xmlDoc.SelectSingleNode(xPath); + if (node != null) { - if (xmlNodeName == ProdType) - { - return GetProdType(fieldValue); - } - - return fieldValue.Substring(0, Math.Min(250, fieldValue.Length)); + node.InnerText = value; } - return string.Empty; } - private string GetProdType(string prodType) + private string GetXmlNodeValue(string fieldValue, string xmlNodeName = null) { - if (!string.IsNullOrEmpty(prodType)) - { - var parts = prodType.Split(' ').ToList(); - return parts.Count > 1 ? parts[1] : parts[0]; - } - return string.Empty; + // Return first 2 characters if the node is Agency, else limit other nodes to 250 characters + return xmlNodeName == Agency ? CommonHelper.ToSubstring(fieldValue, 0, MaxAgencyXmlNodeLength) : CommonHelper.ToSubstring(fieldValue, 0, MaxXmlNodeLength); } - private bool IsValidValue(string jsonFieldValue, string attributeValue) + private XmlNode SortXmlPayload(XmlNode actionItemNode) { - if (attributeValue.Contains('|')) + // Extract all action item nodes + var actionItems = actionItemNode.Cast().ToList(); + int sequenceNumber = 1; + + // Sort based on the ActionNumber + var sortedActionItems = actionItems + .OrderBy(node => Convert.ToInt32(node.SelectSingleNode(ActionNumber)?.InnerText ?? "0")) + .ToList(); + + // Update the sequence number in the sorted list + foreach (XmlNode actionItem in sortedActionItems) { - string[] values = attributeValue.Split('|'); - foreach (string value in values) + var actionNumberNode = actionItem.SelectSingleNode(ActionNumber); + if (actionNumberNode != null) { - if (jsonFieldValue == value.Trim()) - { - return true; - } + actionNumberNode.InnerText = sequenceNumber.ToString(); + sequenceNumber++; } - return false; } - else + + // Clear existing children and append sorted action items + actionItemNode.RemoveAll(); + foreach (XmlNode actionItem in sortedActionItems) { - return jsonFieldValue == attributeValue; + actionItemNode.AppendChild(actionItem); } + return actionItemNode; } - private UnitOfSale GetUnitOfSaleForEncCell(List listOfUnitOfSales, Product product) + private bool IsPropertyNullOrEmpty(string propertyName, string propertyValue) { - UnitOfSale unitOfSale = new(); - var unitOfSales = listOfUnitOfSales.Where(x => x.UnitOfSaleType == UnitSaleType && product.InUnitsOfSale.Contains(x.UnitName)).ToList(); - if (unitOfSales.Any()) + if (string.IsNullOrEmpty(propertyValue)) { - if (unitOfSales.Count > 1) - { - unitOfSale = unitOfSales.Where(x => x.CompositionChanges.AddProducts.Contains(product.ProductName)).FirstOrDefault(); - } - else - { - unitOfSale = unitOfSales.FirstOrDefault(); - } + throw new ERPFacadeException(EventIds.EmptyEventJsonPropertyException.ToEventId(), $"Required details are missing in enccontentpublished event payload. | Property Name : {propertyName}"); } - return unitOfSale!; - } - - private string GetUkhoWeekNumberData(UkhoWeekNumber ukhoWeekNumber) - { - var validWeek = ukhoWeekNumber.Week.ToString("D2"); - var weekNumber = string.Join("", ukhoWeekNumber.Year, validWeek); - - return weekNumber; - } - - private bool IsValidWeekNumber(UkhoWeekNumber ukhoWeekNumber) - { - bool isValid = ukhoWeekNumber != null!; - if (!isValid) return isValid; - - if (ukhoWeekNumber.Week == 0 || ukhoWeekNumber.Year == 0) isValid = false; - - return isValid; + else return false; } } } diff --git a/src/UKHO.ERPFacade.API/Helpers/IEncContentSapMessageBuilder.cs b/src/UKHO.ERPFacade.API/Helpers/IEncContentSapMessageBuilder.cs index 654790f1..09405251 100644 --- a/src/UKHO.ERPFacade.API/Helpers/IEncContentSapMessageBuilder.cs +++ b/src/UKHO.ERPFacade.API/Helpers/IEncContentSapMessageBuilder.cs @@ -5,6 +5,6 @@ namespace UKHO.ERPFacade.API.Helpers { public interface IEncContentSapMessageBuilder { - XmlDocument BuildSapMessageXml(EncEventPayload eventData, string correlationId); + XmlDocument BuildSapMessageXml(EncEventPayload eventData); } } diff --git a/src/UKHO.ERPFacade.API/Program.cs b/src/UKHO.ERPFacade.API/Program.cs index a51770a2..f7882407 100644 --- a/src/UKHO.ERPFacade.API/Program.cs +++ b/src/UKHO.ERPFacade.API/Program.cs @@ -38,26 +38,21 @@ internal static void Main(string[] args) SapActionConfiguration sapActionConfiguration; IHttpContextAccessor httpContextAccessor = new HttpContextAccessor(); - WebApplicationBuilder builder = WebApplication.CreateBuilder(args); - IConfiguration configuration = builder.Configuration; - IWebHostEnvironment webHostEnvironment = builder.Environment; + var builder = WebApplication.CreateBuilder(args); + var configuration = builder.Configuration; + var webHostEnvironment = builder.Environment; - builder.Host.ConfigureAppConfiguration((hostingContext, config) => - { - config.SetBasePath(webHostEnvironment.ContentRootPath) + builder.Configuration.SetBasePath(webHostEnvironment.ContentRootPath) .AddJsonFile("appsettings.json", false, true) .AddJsonFile($"appsettings.{webHostEnvironment.EnvironmentName}.json", true, true) - .AddJsonFile("ConfigurationFiles/ScenarioRules.json", true, true) - .AddJsonFile("ConfigurationFiles/ActionNumbers.json", true, true) .AddJsonFile("ConfigurationFiles/SapActions.json", true, true) #if DEBUG //Add development overrides configuration .AddJsonFile("appsettings.local.overrides.json", true, true) #endif .AddEnvironmentVariables(); - }); - string kvServiceUri = configuration["KeyVaultSettings:ServiceUri"]; + var kvServiceUri = configuration["KeyVaultSettings:ServiceUri"]; if (!string.IsNullOrWhiteSpace(kvServiceUri)) { var secretClient = new SecretClient(new Uri(kvServiceUri), new DefaultAzureCredential( @@ -74,27 +69,26 @@ internal static void Main(string[] args) eventHubLoggingConfiguration = configuration.GetSection("EventHubLoggingConfiguration").Get()!; - builder.Host.ConfigureLogging(logging => - { - logging.ClearProviders(); - if (!string.IsNullOrWhiteSpace(eventHubLoggingConfiguration.ConnectionString)) + builder.Logging + .ClearProviders() + .AddEventHub(config => { - void ConfigAdditionalValuesProvider(IDictionary additionalValues) + if (!string.IsNullOrWhiteSpace(eventHubLoggingConfiguration.ConnectionString)) { - if (httpContextAccessor.HttpContext != null) + void ConfigAdditionalValuesProvider(IDictionary additionalValues) { - additionalValues["_Environment"] = eventHubLoggingConfiguration.Environment; - additionalValues["_System"] = eventHubLoggingConfiguration.System; - additionalValues["_Service"] = eventHubLoggingConfiguration.Service; - additionalValues["_NodeName"] = eventHubLoggingConfiguration.NodeName; - additionalValues["_RemoteIPAddress"] = httpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString(); - additionalValues["_User-Agent"] = httpContextAccessor.HttpContext.Request.Headers["User-Agent"].FirstOrDefault() ?? string.Empty; - additionalValues["_AssemblyVersion"] = Assembly.GetExecutingAssembly().GetCustomAttributes().Single().Version; - additionalValues["_X-Correlation-ID"] = httpContextAccessor.HttpContext.Request.Headers?[CorrelationIdMiddleware.XCorrelationIdHeaderKey].FirstOrDefault() ?? string.Empty; + if (httpContextAccessor.HttpContext != null) + { + additionalValues["_Environment"] = eventHubLoggingConfiguration.Environment; + additionalValues["_System"] = eventHubLoggingConfiguration.System; + additionalValues["_Service"] = eventHubLoggingConfiguration.Service; + additionalValues["_NodeName"] = eventHubLoggingConfiguration.NodeName; + additionalValues["_RemoteIPAddress"] = httpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString(); + additionalValues["_User-Agent"] = httpContextAccessor.HttpContext.Request.Headers.UserAgent.FirstOrDefault() ?? string.Empty; + additionalValues["_AssemblyVersion"] = Assembly.GetExecutingAssembly().GetCustomAttributes().Single().Version; + additionalValues["_X-Correlation-ID"] = httpContextAccessor.HttpContext.Request.Headers?[CorrelationIdMiddleware.XCorrelationIdHeaderKey].FirstOrDefault() ?? string.Empty; + } } - } - logging.AddEventHub(config => - { config.Environment = eventHubLoggingConfiguration.Environment; config.DefaultMinimumLogLevel = (LogLevel)Enum.Parse(typeof(LogLevel), eventHubLoggingConfiguration.MinimumLoggingLevel, true); @@ -106,9 +100,8 @@ void ConfigAdditionalValuesProvider(IDictionary additionalValues config.Service = eventHubLoggingConfiguration.Service; config.NodeName = eventHubLoggingConfiguration.NodeName; config.AdditionalValuesProvider = ConfigAdditionalValuesProvider; - }); - } - }); + } + }); builder.Services.AddLogging(loggingBuilder => { @@ -136,20 +129,16 @@ void ConfigAdditionalValuesProvider(IDictionary additionalValues options.Authority = $"{azureAdConfiguration.MicrosoftOnlineLoginUrl}{azureAdConfiguration.TenantId}"; }); - builder.Services.AddAuthorization(options => - { - options.DefaultPolicy = new AuthorizationPolicyBuilder() + builder.Services.AddAuthorizationBuilder() + .SetDefaultPolicy(new AuthorizationPolicyBuilder() .RequireAuthenticatedUser() .AddAuthenticationSchemes("AzureAD") - .Build(); - }); + .Build()); - builder.Services.AddAuthorization(options => - { - options.AddPolicy("EncContentPublishedWebhookCaller", policy => policy.RequireRole("EncContentPublishedWebhookCaller")); - options.AddPolicy("RecordOfSaleWebhookCaller", policy => policy.RequireRole("RecordOfSaleWebhookCaller")); - options.AddPolicy("LicenceUpdatedWebhookCaller", policy => policy.RequireRole("LicenceUpdatedWebhookCaller")); - }); + builder.Services.AddAuthorizationBuilder() + .AddPolicy("EncContentPublishedWebhookCaller", policy => policy.RequireRole("EncContentPublishedWebhookCaller")) + .AddPolicy("RecordOfSaleWebhookCaller", policy => policy.RequireRole("RecordOfSaleWebhookCaller")) + .AddPolicy("LicenceUpdatedWebhookCaller", policy => policy.RequireRole("LicenceUpdatedWebhookCaller")); // The following line enables Application Insights telemetry collection. var options = new ApplicationInsightsServiceOptions { ConnectionString = configuration.GetValue("ApplicationInsights:ConnectionString") }; @@ -203,6 +192,8 @@ void ConfigAdditionalValuesProvider(IDictionary additionalValues app.UseCorrelationIdMiddleware(); + app.UseLoggingMiddleware(); + app.MapControllers(); app.UseAuthorization(); diff --git a/src/UKHO.ERPFacade.Common/Exceptions/ERPFacadeException.cs b/src/UKHO.ERPFacade.Common/Exceptions/ERPFacadeException.cs index c5bd5087..8215cb68 100644 --- a/src/UKHO.ERPFacade.Common/Exceptions/ERPFacadeException.cs +++ b/src/UKHO.ERPFacade.Common/Exceptions/ERPFacadeException.cs @@ -8,10 +8,13 @@ namespace UKHO.ERPFacade.Common.Exceptions public class ERPFacadeException : Exception { public EventId EventId { get; set; } + public object[] MessageArguments { get; set; } - public ERPFacadeException(EventId eventId) : base() + public ERPFacadeException(EventId eventId, string message, params object[] messageArguments) : base(message) { EventId = eventId; + MessageArguments = messageArguments ?? []; } } -} \ No newline at end of file +} + diff --git a/src/UKHO.ERPFacade.Common/HealthCheck/EESServiceHealthCheck.cs b/src/UKHO.ERPFacade.Common/HealthCheck/EESServiceHealthCheck.cs index d477c90a..01aab928 100644 --- a/src/UKHO.ERPFacade.Common/HealthCheck/EESServiceHealthCheck.cs +++ b/src/UKHO.ERPFacade.Common/HealthCheck/EESServiceHealthCheck.cs @@ -37,9 +37,9 @@ public async Task CheckHealthAsync(HealthCheckContext context if (!response.IsSuccessStatusCode) { _logger.LogError(EventIds.EESIsUnhealthy.ToEventId(), "EES is Unhealthy"); - return HealthCheckResult.Unhealthy(data: healthCheckData, description:description); + return HealthCheckResult.Unhealthy(data: healthCheckData, description: description); } - + _logger.LogDebug(EventIds.EESIsHealthy.ToEventId(), "EES is Healthy"); return HealthCheckResult.Healthy(data: healthCheckData, description: description); } diff --git a/src/UKHO.ERPFacade.Common/HealthCheck/SapServiceHealthCheck.cs b/src/UKHO.ERPFacade.Common/HealthCheck/SapServiceHealthCheck.cs index 05ba55e3..f0656615 100644 --- a/src/UKHO.ERPFacade.Common/HealthCheck/SapServiceHealthCheck.cs +++ b/src/UKHO.ERPFacade.Common/HealthCheck/SapServiceHealthCheck.cs @@ -74,7 +74,7 @@ public async Task CheckHealthAsync(HealthCheckContext context } catch (Exception ex) { - _logger.LogError(EventIds.ErrorOccuredInSap.ToEventId(), "An error occurred while processing your request in SAP. | {Message}", ex.Message); + _logger.LogError(EventIds.RequestToSapFailed.ToEventId(), "An error occurred while processing your request in SAP. | {Message}", ex.Message); return HealthCheckResult.Unhealthy(exception: ex, data: healthCheckData, description: description); } } diff --git a/src/UKHO.ERPFacade.Common/HttpClients/EESClient.cs b/src/UKHO.ERPFacade.Common/HttpClients/EESClient.cs index a992abf9..f736db55 100644 --- a/src/UKHO.ERPFacade.Common/HttpClients/EESClient.cs +++ b/src/UKHO.ERPFacade.Common/HttpClients/EESClient.cs @@ -1,13 +1,12 @@ using System.Diagnostics.CodeAnalysis; -using Microsoft.Extensions.Options; -using UKHO.ERPFacade.Common.Configuration; namespace UKHO.ERPFacade.Common.HttpClients { [ExcludeFromCodeCoverage] public class EESClient : IEESClient { - private readonly HttpClient _httpClient; + private readonly HttpClient _httpClient; + public EESClient(HttpClient httpClient) { _httpClient = httpClient; @@ -15,7 +14,7 @@ public EESClient(HttpClient httpClient) public async Task Get(string url) { - return await _httpClient.GetAsync(url); + return await _httpClient.GetAsync(url); } } } diff --git a/src/UKHO.ERPFacade.Common/IO/Azure/AzureTableReaderWriter.cs b/src/UKHO.ERPFacade.Common/IO/Azure/AzureTableReaderWriter.cs index 267a3f78..48c46b9e 100644 --- a/src/UKHO.ERPFacade.Common/IO/Azure/AzureTableReaderWriter.cs +++ b/src/UKHO.ERPFacade.Common/IO/Azure/AzureTableReaderWriter.cs @@ -14,10 +14,10 @@ namespace UKHO.ERPFacade.Common.IO.Azure public class AzureTableReaderWriter : IAzureTableReaderWriter { private readonly ILogger _logger; - private readonly IOptions _azureStorageConfig; - private const string ErpFacadeTableName = "encevents"; + private readonly IOptions _azureStorageConfig; + private const string ErpFacadeTableName = "encevents"; private const string LicenceUpdateTableName = "licenceupdatedevents"; - private const string RecordOfSaleTableName = "recordofsaleevents"; + private const string RecordOfSaleTableName = "recordofsaleevents"; private enum Statuses { @@ -30,7 +30,7 @@ public AzureTableReaderWriter(ILogger logger, IOptions erpFacadeWebjobConfig) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); - _azureStorageConfig = azureStorageConfig ?? throw new ArgumentNullException(nameof(azureStorageConfig)); + _azureStorageConfig = azureStorageConfig ?? throw new ArgumentNullException(nameof(azureStorageConfig)); } public async Task UpsertEntity(string correlationId) @@ -47,22 +47,22 @@ public async Task UpsertEntity(string correlationId) PartitionKey = Guid.NewGuid().ToString(), Timestamp = DateTime.UtcNow, CorrelationId = correlationId, - RequestDateTime = null + RequestDateTime = null }; await tableClient.AddEntityAsync(eESEvent, CancellationToken.None); - _logger.LogInformation(EventIds.AddedEncContentPublishedEventInAzureTable.ToEventId(), "ENC content published event is added in azure table successfully."); + _logger.LogInformation(EventIds.AddedEntryForEncContentPublishedEventInAzureTable.ToEventId(), "New enccontentpublished event entry is added in azure table successfully."); } else { - _logger.LogWarning(EventIds.ReceivedDuplicateEncContentPublishedEvent.ToEventId(), "Duplicate ENC content published event received."); + _logger.LogWarning(EventIds.ReceivedDuplicateEncContentPublishedEvent.ToEventId(), "Duplicate enccontentpublished event received."); existingEntity.Timestamp = DateTime.UtcNow; await tableClient.UpdateEntityAsync(existingEntity, ETag.All, TableUpdateMode.Replace); - _logger.LogInformation(EventIds.UpdatedEncContentPublishedEventInAzureTable.ToEventId(), "Existing ENC content published event is updated in azure table successfully."); + _logger.LogInformation(EventIds.UpdatedEncContentPublishedEventInAzureTable.ToEventId(), "Existing enccontentpublished event entry is updated in azure table successfully."); } } @@ -110,7 +110,7 @@ public async Task GetEntity(string correlationId) } return records.FirstOrDefault(); } - + public async Task UpdateRequestTimeEntity(string correlationId) { TableClient tableClient = GetTableClient(ErpFacadeTableName); @@ -119,9 +119,9 @@ public async Task UpdateRequestTimeEntity(string correlationId) { existingEntity.RequestDateTime = DateTime.UtcNow; await tableClient.UpdateEntityAsync(existingEntity, ETag.All, TableUpdateMode.Replace); - _logger.LogInformation(EventIds.UpdateRequestTimeEntitySuccessful.ToEventId(), "RequestDateTime is updated in azure table successfully."); + _logger.LogInformation(EventIds.UpdateRequestTimeEntitySuccessful.ToEventId(), "SAP request time for {CorrelationId} is updated in azure table successfully.", correlationId); } - } + } public IList GetAllEntityForEESTable() { @@ -214,7 +214,7 @@ public async Task UpdateLicenceUpdatedEventStatus(string correlationId) { existingEntity.Status = Statuses.Complete.ToString(); await tableClient.UpdateEntityAsync(existingEntity, ETag.All, TableUpdateMode.Replace); - + _logger.LogInformation(EventIds.UpdatedStatusOfLicenceUpdatedPublishedEventInAzureTable.ToEventId(), "Status of existing licence updated published event updated in azure table successfully."); } } @@ -226,7 +226,7 @@ public string GetEntityStatus(string correlationId) TableClient tableClient = GetTableClient(RecordOfSaleTableName); var entities = tableClient.Query(filter: TableClient.CreateQueryFilter($"CorrelationId eq {correlationId}"), maxPerPage: 1); - + foreach (var entity in entities) { status = entity.Status; diff --git a/src/UKHO.ERPFacade.Common/IO/CommonHelper.cs b/src/UKHO.ERPFacade.Common/IO/CommonHelper.cs index 48a14791..91fe7ae5 100644 --- a/src/UKHO.ERPFacade.Common/IO/CommonHelper.cs +++ b/src/UKHO.ERPFacade.Common/IO/CommonHelper.cs @@ -108,5 +108,10 @@ public static string RemoveNullFields(this string xml) } return xmldoc.InnerXml; } + + public static string ToSubstring(string value, int startIndex, int length) + { + return value.Substring(startIndex, Math.Min(length, value.Length)); + } } } diff --git a/src/UKHO.ERPFacade.Common/Logging/EventIds.cs b/src/UKHO.ERPFacade.Common/Logging/EventIds.cs index 86060a50..3a8799e2 100644 --- a/src/UKHO.ERPFacade.Common/Logging/EventIds.cs +++ b/src/UKHO.ERPFacade.Common/Logging/EventIds.cs @@ -34,14 +34,14 @@ public enum EventIds CorrelationIdMissingInEvent = 940005, /// - /// 940006 - Storing the received ENC content published event in azure table. + /// 940006 - Adding or Updating entry for enccontentpublished event in azure table. /// - StoreEncContentPublishedEventInAzureTable = 940006, + AddingEntryForEncContentPublishedEventInAzureTable = 940006, /// /// 940007 - ENC content published event in added in azure table successfully. /// - AddedEncContentPublishedEventInAzureTable = 940007, + AddedEntryForEncContentPublishedEventInAzureTable = 940007, /// /// 940008 - Duplicate ENC contect published event received. @@ -56,663 +56,387 @@ public enum EventIds /// /// 940010 - Uploading the received ENC content published event in blob storage. /// - UploadEncContentPublishedEventInAzureBlob = 940010, + UploadEncContentPublishedEventInAzureBlobStarted = 940010, /// /// 940011 - ENC content published event is uploaded in blob storage successfully. /// - UploadedEncContentPublishedEventInAzureBlob = 940011, + UploadEncContentPublishedEventInAzureBlobCompleted = 940011, /// - /// 940012 - Error occured while connecting SAP + /// 940012 - Request to SAP failed /// - ErrorOccuredInSap = 940012, + RequestToSapFailed = 940012, /// - /// 940013 - ENC Update pushed to SAP + /// 940013 - ENC Update sent to SAP /// - EncUpdatePushedToSap = 940013, + EncUpdateSentToSap = 940013, /// - /// 940014 - Webjob started to process the incomplete transactions. + /// 940014 - Updated RequestTime entity successfully in Azure Table /// - WebjobProcessEventStarted = 940014, + UpdateRequestTimeEntitySuccessful = 940014, /// - /// 940015 - Webjob completed to process the incomplete transactions. + /// 940015 - Sap Xml Template Not Found /// - WebjobProcessEventCompleted = 940015, + SapXmlTemplateNotFound = 940015, /// - /// 940016 - Callback from SAP is timed out. + /// 940016 - Generation of SAP xml payload started /// - WebjobCallbackTimeoutEventFromSAP = 940016, + GenerationOfSapXmlPayloadStarted = 940016, /// - /// 940017 - Empty or null RequestDateTime Column in Azure Table. + /// 940017 - Sap Action Created /// - EmptyRequestDateTime = 940017, + SapActionCreated = 940017, /// - /// 940018 - Updated RequestTime entity successfully in Azure Table + /// 940018 - Generation of SAP xml payload completed /// - UpdateRequestTimeEntitySuccessful = 940018, + GenerationOfSapXmlPayloadCompleted = 940018, /// - /// 940019 - Updated ResponseTime entity successfully in Azure Table + /// 940019 - Azure Table Not Found /// - UpdateResponseTimeEntitySuccessful = 940019, + AzureTableNotFound = 940019, /// - /// 940020 - Updated entity successfully in Azure Table + /// 940020 - Sap Health Check Xml Template Not Found /// - UpdateEntitySuccessful = 940020, + SapHealthCheckXmlTemplateNotFound = 940020, /// - /// 940021 - CorrelationId is missing in price information payload recieved from SAP. + /// 940021 - SAP Health Check Request Sent To SAP /// - CorrelationIdMissingInSAPPriceInformationPayload = 940021, + SapHealthCheckRequestSentToSap = 940021, /// - /// 940022 - Invalid SAP callback. Request from ERP Facade to SAP not found for CorrelationId. + /// 940022 - Uploading the SAP xml payload in blob storage. /// - ERPFacadeToSAPRequestNotFound = 940022, + UploadSapXmlPayloadInAzureBlobStarted = 940022, /// - /// 940023 - Valid SAP callback for CorrelationId. + /// 940023 - SAP xml payload is uploaded in blob storage successfully. /// - ERPFacadeToSAPRequestFound = 940023, + UploadSapXmlPayloadInAzureBlobCompleted = 940023, /// - /// 940024 - No Scenario Found + /// 940024 - Deleted EES entity successfully from Azure Table /// - NoScenarioFound = 940024, + DeletedEESEntitySuccessful = 940024, /// - /// 940025 - Sap Xml Template Not Found + /// 940025 - Fetching all EES entities from Azure Table. /// - SapXmlTemplateNotFound = 940025, + FetchEESEntities = 940025, /// - /// 940026 - Building Sap Actions Started + /// 940026 - Deleted container successfully. /// - BuildingSapActionStarted = 940026, + DeletedContainerSuccessful = 940026, /// - /// 940027 - Sap Action Created + /// 940027 - Webjob started cleanup process. /// - SapActionCreated = 940027, + WebjobCleanUpEventStarted = 940027, /// - /// 940028 - Identifying Scenario Started + /// 940028 - Webjob completed cleanup process. /// - IdentifyScenarioStarted = 940028, + WebjobCleanUpEventCompleted = 940028, /// - /// 940029 - Scenario Identified + /// 940029 - Error occurred while connecting EES /// - ScenarioIdentified = 940029, + ErrorOccurredInEES = 940029, /// - /// 940030 - Azure Table Not Found + /// 940030 - EES Health Check Request Sent To EES /// - AzureTableNotFound = 940030, + EESHealthCheckRequestSentToEES = 940030, /// - /// 940031 - Environment Name + /// 940031 - SAP Is Healthy /// - EnvironmentName = 940031, + SAPIsHealthy = 940031, /// - /// 940032 - UnitOfSale price information payload received from SAP + /// 940032 - SAP Is Unhealty /// - SapUnitsOfSalePriceInformationPayloadReceived = 940032, + SAPIsUnhealthy = 940032, /// - /// 940033 - Downloading existing ees event from azure blob storage + /// 940033 - EES Is Healthy /// - DownloadEncEventPayloadStarted = 940033, + EESIsHealthy = 940033, /// - /// 940034 - Downloaded existing ees event from azure blob storage successfully + /// 940034 - EES Is Unhealty /// - DownloadEncEventPayloadCompleted = 940034, + EESIsUnhealthy = 940034, /// - /// 940035 - No price information found in incoming SAP event + /// 940035 - Record of Sale published event options call started. /// - NoDataFoundInSAPPriceInformationPayload = 940035, + RecordOfSalePublishedEventOptionsCallStarted = 940035, /// - /// 940036 - Building unit of sale price event started + /// 940036 - Record of Sale published event options call completed. /// - AppendingUnitofSalePricesToEncEvent = 940036, + RecordOfSalePublishedEventOptionsCallCompleted = 940036, /// - /// 940037 - Unit of sale price event created + /// 940037 - Record of Sale published event received by ERP Facade webhook. /// - UnitsOfSaleUpdatedEventPayloadCreated = 940037, + RecordOfSalePublishedEventReceived = 940037, /// - /// 940038 - UnitsOfSale updated event exceeds the size limit of 1 MB + /// 940038 - Storing the received Record of sale published event in azure table. /// - UnitsOfSaleUpdatedEventSizeLimit = 940038, + StoreRecordOfSalePublishedEventInAzureTable = 940038, /// - /// 940039 - Sap Health Check Xml Template Not Found + /// 940039 - Record of sale published event in added in azure table successfully. /// - SapHealthCheckXmlTemplateNotFound = 940039, + AddedRecordOfSalePublishedEventInAzureTable = 940039, /// - /// 940040 - SAP Health Check Request Sent To SAP + /// 940040 - Duplicate Record of sale published event received. /// - SapHealthCheckRequestSentToSap = 940040, + ReceivedDuplicateRecordOfSalePublishedEvent = 940040, /// - /// 940041 - Uploading the SAP xml payload in blob storage. + /// 940041 - Existing Record of sale published event updated in azure table successfully. /// - UploadSapXmlPayloadInAzureBlobStarted = 940041, + UpdatedRecordOfSalePublishedEventInAzureTable = 940041, /// - /// 940042 - SAP xml payload is uploaded in blob storage successfully. + /// 940042 - Uploading the received Record of sale published event in blob storage. /// - UploadSapXmlPayloadInAzureBlobCompleted = 940042, + UploadRecordOfSalePublishedEventInAzureBlob = 940042, /// - /// 940043 - UnitsOfSale updated event Pushed To EES + /// 940043 - Record of sale published event is uploaded in blob storage successfully. /// - UnitsOfSaleUpdatedEventPushedToEES = 940043, + UploadedRecordOfSalePublishedEventInAzureBlob = 940043, /// - /// 940044 - Attempting to send cloudEvent to Enterprise Event Service + /// 940044 - CorrelationId is missing in Record of sale published event. /// - StartingEnterpriseEventServiceEventPublisher = 940044, + CorrelationIdMissingInRecordOfSaleEvent = 940044, /// - /// 940045 - Successfully sent cloudEvent to Enterprise Event Service + /// 940045 - Licence updated published event options call started. /// - EnterpriseEventServiceEventPublisherSuccess = 940045, + LicenceUpdatedEventOptionsCallStarted = 940045, /// - /// 940046 - Failed to send event cloudEvent to the enterprise event service + /// 940046 - Licence updated published event options call completed. /// - EnterpriseEventServiceEventPublisherFailure = 940046, + LicenceUpdatedEventOptionsCallCompleted = 940046, /// - /// 940047 - Webjob started building pricechange event + /// 940047 - Licence updated published event received by ERP Facade webhook. /// - WebjobStartedBuildingPriceChangeEvent = 940047, + LicenceUpdatedEventPublishedEventReceived = 940047, /// - /// 940048 - Updated Price change status entity successfully in Azure Table + /// 940048 - CorrelationId is missing in Licence updated published event. /// - UpdatedPriceChangeStatusEntitySuccessful = 940048, + CorrelationIdMissingInLicenceUpdatedEvent = 940048, /// - /// 940049 - Updated Price master status entity successfully in Azure Table + /// 940049 - Storing the received Licence updated published event in azure table. /// - UpdatedPriceChangeMasterStatusEntitySuccessful = 940049, + StoreLicenceUpdatedPublishedEventInAzureTable = 940049, /// - /// 940050 - Downloading the price change information event from blob storage. + /// 940050 - Uploading the received Licence updated published event in blob storage. /// - DownloadBulkPriceInformationEventFromAzureBlob = 940050, + UploadLicenceUpdatedPublishedEventInAzureBlob = 940050, /// - /// 940051 - Sliced event is uploaded in blob storage successfully. + /// 940051 - Licence updated published event is uploaded in blob storage successfully. /// - UploadedSlicedEventInAzureBlob = 940051, + UploadedLicenceUpdatedPublishedEventInAzureBlob = 940051, /// - /// 940052 - Sliced event is uploaded in blob storage successfully for incomplete unit prices. + /// 940052 - Licence updated published event in added in azure table successfully. /// - UploadedSlicedEventInAzureBlobForUnitPrices = 940052, + AddedLicenceUpdatedPublishedEventInAzureTable = 940052, /// - /// 940053 - Bulk price information payload received from SAP + /// 940053 - Duplicate Licence updated published event received. /// - SapBulkPriceInformationPayloadReceived = 940053, + ReceivedDuplicateLicenceUpdatedPublishedEvent = 940053, /// - /// 940054 - Storing the received Bulk price information event in azure table. + /// 940054 - Existing Licence updated published event updated in azure table successfully. /// - StoreBulkPriceInformationEventInAzureTable = 940054, + UpdatedLicenceUpdatedPublishedEventInAzureTable = 940054, /// - /// 940055 - Uploading the received Bulk price information event in blob storage. + /// 940055 - Status of existing record of sale published event updated in azure table successfully. /// - UploadBulkPriceInformationEventInAzureBlob = 940055, + UpdatedStatusOfRecordOfSalePublishedEventInAzureTable = 940055, /// - /// 940056 - Bulk price information event is uploaded in blob storage successfully. + /// 940056 - Status of existing licence updated published event updated in azure table successfully. /// - UploadedBulkPriceInformationEventInAzureBlob = 940056, + UpdatedStatusOfLicenceUpdatedPublishedEventInAzureTable = 940056, /// - /// 940057 - Bulk price information event in added in azure table successfully. + /// 940057 - The record of sale event data has been sent to SAP successfully. /// - AddedBulkPriceInformationEventInAzureTable = 940057, + RecordOfSalePublishedEventDataPushedToSap = 940057, /// - /// 940058 - Webjob started to process the publishing price changes. + /// 940058 - The licence updated event data has been sent to SAP successfully. /// - WebjobPublishingPriceChangesEventStarted = 940058, + LicenceUpdatedPublishedEventUpdatePushedToSap = 940058, /// - /// 940059 - Webjob completed processing the publishing price changes. + /// 940059 - An error occurred while sending record of sale published event data to SAP. /// - WebjobPublishingPriceChangesEventCompleted = 940059, + ErrorOccurredInSapForRecordOfSalePublishedEvent = 940059, /// - /// 940060 - Unit Price Change event in added in azure table successfully. + /// 940060 - An error occurred while sending licence updated event data to SAP. /// - AddedUnitPriceChangeEventInAzureTable = 940060, + ErrorOccurredInSapForLicenceUpdatedPublishedEvent = 940060, /// - /// 940061 - UnitsOfSale NotFound In SAP PriceInformation Payload + /// 940061 - Uploading Sap Xml payload for licence updated event in Azure blob. /// - UnitsOfSaleNotFoundInSAPPriceInformationPayload = 940061, + UploadLicenceUpdatedSapXmlPayloadInAzureBlob = 940061, /// - /// 940062 - Uploading the received Price information event in blob storage. + /// 940062 - SAP xml payload for licence updated event is uploaded in blob storage successfully. /// - UploadPriceInformationEventInAzureBlob = 940062, + UploadedLicenceUpdatedSapXmlPayloadInAzureBlob = 940062, /// - /// 940063 - Price information event is uploaded in blob storage successfully. + /// 940063 - Creating licence updated Sap Xml payload. /// - UploadedPriceInformationEventInAzureBlob = 940063, + CreatingLicenceUpdatedSapPayload = 940063, /// - /// 940064 - Fetching master entities from azure table. + /// 940064 - Licence updated SAP xml payload created. /// - FetchMasterEntities = 940064, + CreatedLicenceUpdatedSapPayload = 940064, /// - /// 940065 - Fetching create date of blob. + /// 940065 - Licence updated SAP message xml template does not exist. /// - FetchBlobCreateDate = 940065, + LicenceUpdatedSapXmlTemplateNotFound = 940065, /// - /// 940066 - Deleted Price master entity successfully from Azure Table + /// 940066 - The record of sale SAP message xml template does not exist. /// - DeletedPriceChangeMasterEntitySuccessful = 940066, + RecordOfSaleSapXmlTemplateNotFound = 940066, /// - /// 940067 - Deleted unit price change entity successfully from Azure Table + /// 940067 - Creating the record of sale SAP Payload. /// - DeletedUnitPriceChangeEntitySuccessful = 940067, + CreatingRecordOfSaleSapPayload = 940067, /// - /// 940068 - Deleted EES entity successfully from Azure Table + /// 940068 - The record of sale SAP payload created. /// - DeletedEESEntitySuccessful = 940068, + CreatedRecordOfSaleSapPayload = 940068, /// - /// 940069 - Fetching all blob present inside the container. + /// 940069 - Uploading Sap Xml payload for record of sale event in Azure blob. /// - FetchBlobsFromContainer = 940069, + UploadRecordOfSaleSapXmlPayloadInAzureBlob = 940069, /// - /// 940070 - Deleted blob from storage container successfully. + /// 940070 - SAP xml payload for record of sale event is uploaded in blob storage successfully. /// - DeletedBlobSuccessful = 940070, + UploadedRecordOfSaleSapXmlPayloadInAzureBlob = 940070, /// - /// 940071 - Fetching all EES entities from Azure Table. + /// 940071 - Adding record of sale event payload in Azure Queue storage. /// - FetchEESEntities = 940071, + AddMessageToAzureQueue = 940071, /// - /// 940072 - Deleted container successfully. + /// 940072 - Record of sale event payload is added in queue storage successfully. /// - DeletedContainerSuccessful = 940072, + AddedMessageToAzureQueue = 940072, /// - /// 940073 - Webjob started cleanup process. + /// 940073 - Webjob started for merging record of sale events. /// - WebjobCleanUpEventStarted = 940073, + WebjobForEventAggregationStarted = 940073, /// - /// 940074 - Webjob completed cleanup process. + /// 940074 - Webjob completed for merging record of sale events. /// - WebjobCleanUpEventCompleted = 940074, + WebjobForEventAggregationCompleted = 940074, /// - /// 940075 - Error occured while connecting EES + /// 940075 - Webjob started downloading record of sale events from blob. /// - ErrorOccuredInEES = 940075, + DownloadRecordOfSaleEventFromAzureBlob = 940075, /// - /// 940076 - Uploading the pricechange event payload json in blob storage. + /// 940076 - All related events are not present in Azure blob. /// - UploadPriceChangeEventPayloadInAzureBlob = 940076, + AllRelatedEventsAreNotPresentInBlob = 940076, /// - /// 940077 - pricechange event payload json is uploaded in blob storage successfully. + /// 940077 - The record has been completed already. /// - UploadedPriceChangeEventPayloadInAzureBlob = 940077, + RequestAlreadyCompleted = 940077, /// - /// 940079 - pricechange event created + /// 940078 - Exception occurred while processing Event aggregation WebJob. /// - PriceChangeEventPayloadCreated = 940079, + UnhandledWebJobException = 940078, /// - /// 940080 - Uploading the UnitsOfSale updated event payload json in blob storage. + /// 940079 - Dequeue count of message. /// - UploadUnitsOfSaleUpdatedEventPayloadInAzureBlob = 940080, + MessageDequeueCount = 940079, /// - /// 940081 - UnitsOfSale updated event payload json is uploaded in blob storage successfully. + /// 940080 - Exception occurred while decrypting the permit string. /// - UploadedUnitsOfSaleUpdatedEventPayloadInAzureBlob = 940081, + PermitDecryptionException = 940080, /// - /// 940082 - Updated PublishDateTime entity successfully in Azure Table + /// 940081 - Unit of Sale not found. /// - UpdatePublishDateTimeEntitySuccessful = 940082, + UnitOfSaleNotFoundException = 940081, /// - /// 940083 - Error occurred while connecting EES + /// 940082 - ENC cell SAP action generation started. /// - ErrorOccurredInEES = 940083, + EncCellSapActionGenerationStarted = 940082, /// - /// 940084 - EES Health Check Request Sent To EES + /// 940083 - SAP action generation started. /// - EESHealthCheckRequestSentToEES = 940084, + BuildingSapActionStarted = 940083, /// - /// 940085 - SAP Is Healthy + /// 940084 - Required SAP property value is found empty enccontentpublished event. /// - SAPIsHealthy = 940085, + EmptyEventJsonPropertyException = 940084, /// - /// 940086 - SAP Is Unhealty + /// 940085 - Error while generating SAP action information. /// - SAPIsUnhealthy = 940086, + BuildingSapActionInformationException = 940085, /// - /// 940087 - EES Is Healthy + /// 940086 - Required section not found in JSON payload. /// - EESIsHealthy = 940087, - - /// - /// 940088 - EES Is Unhealty - /// - EESIsUnhealthy = 940088, - - /// - /// 940089 - Failed to connect to the enterprise event service - /// - EnterpriseEventServiceEventConnectionFailure = 940089, - - /// - /// 940090 - Count of products to be sliced - /// - ProductsToSliceCount = 940090, - - /// - /// 940091 - Count of products that are published and unpublished - /// - ProductsPublishedUnpublishedCount = 940091, - - /// - /// 940092 - Count of unpublished products - /// - ProductsUnpublishedCount = 940092, - - /// - /// 940093 - Uploading the Sliced Price information event in blob storage. - /// - UploadSlicedPriceInformationEventInAzureBlob = 940093, - - /// - /// 940094 - Sliced Price information event is uploaded in blob storage successfully. - /// - UploadedSlicedPriceInformationEventInAzureBlob = 940094, - - /// - /// 940095 - Count of pending products to be sliced - /// - PendingProductsToSliceCount = 940095, - - /// - /// 940096 - Record of Sale published event options call started. - /// - RecordOfSalePublishedEventOptionsCallStarted = 940096, - - /// - /// 940097 - Record of Sale published event options call completed. - /// - RecordOfSalePublishedEventOptionsCallCompleted = 940097, - - /// - /// 940098 - Record of Sale published event received by ERP Facade webhook. - /// - RecordOfSalePublishedEventReceived = 940098, - - /// - /// 940099 - Storing the received Record of sale published event in azure table. - /// - StoreRecordOfSalePublishedEventInAzureTable = 940099, - - /// - /// 940100 - Record of sale published event in added in azure table successfully. - /// - AddedRecordOfSalePublishedEventInAzureTable = 940100, - - /// - /// 940101 - Duplicate Record of sale published event received. - /// - ReceivedDuplicateRecordOfSalePublishedEvent = 940101, - - /// - /// 940102 - Existing Record of sale published event updated in azure table successfully. - /// - UpdatedRecordOfSalePublishedEventInAzureTable = 940102, - - /// - /// 940103 - Uploading the received Record of sale published event in blob storage. - /// - UploadRecordOfSalePublishedEventInAzureBlob = 940103, - - /// - /// 940104 - Record of sale published event is uploaded in blob storage successfully. - /// - UploadedRecordOfSalePublishedEventInAzureBlob = 940104, - - /// - /// 940105 - CorrelationId is missing in Record of sale published event. - /// - CorrelationIdMissingInRecordOfSaleEvent = 940105, - - /// - /// 940106 - Licence updated published event options call started. - /// - LicenceUpdatedEventOptionsCallStarted = 940106, - - /// - /// 940107 - Licence updated published event options call completed. - /// - LicenceUpdatedEventOptionsCallCompleted = 940107, - - /// - /// 940108 - Licence updated published event received by ERP Facade webhook. - /// - LicenceUpdatedEventPublishedEventReceived = 940108, - - /// - /// 940109 - CorrelationId is missing in Licence updated published event. - /// - CorrelationIdMissingInLicenceUpdatedEvent = 940109, - - /// - /// 940110 - Storing the received Licence updated published event in azure table. - /// - StoreLicenceUpdatedPublishedEventInAzureTable = 940110, - - /// - /// 940111 - Uploading the received Licence updated published event in blob storage. - /// - UploadLicenceUpdatedPublishedEventInAzureBlob = 940111, - - /// - /// 940112 - Licence updated published event is uploaded in blob storage successfully. - /// - UploadedLicenceUpdatedPublishedEventInAzureBlob = 940112, - - /// - /// 940113 - Licence updated published event in added in azure table successfully. - /// - AddedLicenceUpdatedPublishedEventInAzureTable = 940113, - - /// - /// 940114 - Duplicate Licence updated published event received. - /// - ReceivedDuplicateLicenceUpdatedPublishedEvent = 940114, - - /// - /// 940115 - Existing Licence updated published event updated in azure table successfully. - /// - UpdatedLicenceUpdatedPublishedEventInAzureTable = 940115, - - /// - /// 940116 - Status of existing record of sale published event updated in azure table successfully. - /// - UpdatedStatusOfRecordOfSalePublishedEventInAzureTable = 940116, - - /// - /// 940117 - Status of existing licence updated published event updated in azure table successfully. - /// - UpdatedStatusOfLicenceUpdatedPublishedEventInAzureTable = 940117, - - /// - /// 940118 - The record of sale event data has been sent to SAP successfully. - /// - RecordOfSalePublishedEventDataPushedToSap = 940118, - - /// - /// 940119 - The licence updated event data has been sent to SAP successfully. - /// - LicenceUpdatedPublishedEventUpdatePushedToSap = 940119, - - /// - /// 940120 - An error occurred while sending record of sale published event data to SAP. - /// - ErrorOccurredInSapForRecordOfSalePublishedEvent = 940120, - - /// - /// 940121 - An error occurred while sending licence updated event data to SAP. - /// - ErrorOccurredInSapForLicenceUpdatedPublishedEvent = 940121, - - /// - /// 940122 - Uploading Sap Xml payload for licence updated event in Azure blob. - /// - UploadLicenceUpdatedSapXmlPayloadInAzureBlob = 940122, - - /// - /// 940123 - SAP xml payload for licence updated event is uploaded in blob storage successfully. - /// - UploadedLicenceUpdatedSapXmlPayloadInAzureBlob = 940123, - - /// - /// 940124 - Creating licence updated Sap Xml payload. - /// - CreatingLicenceUpdatedSapPayload = 940124, - - /// - /// 940125 - Licence updated SAP xml payload created. - /// - CreatedLicenceUpdatedSapPayload = 940125, - - /// - /// 940126 - Licence updated SAP message xml template does not exist. - /// - LicenceUpdatedSapXmlTemplateNotFound = 940126, - - /// - /// 940127 - The record of sale SAP message xml template does not exist. - /// - RecordOfSaleSapXmlTemplateNotFound = 940127, - - /// - /// 940128 - Creating the record of sale SAP Payload. - /// - CreatingRecordOfSaleSapPayload = 940128, - - /// - /// 940129 - The record of sale SAP payload created. - /// - CreatedRecordOfSaleSapPayload = 940129, - - /// - /// 940130 - Uploading Sap Xml payload for record of sale event in Azure blob. - /// - UploadRecordOfSaleSapXmlPayloadInAzureBlob = 940130, - - /// - /// 940131 - SAP xml payload for record of sale event is uploaded in blob storage successfully. - /// - UploadedRecordOfSaleSapXmlPayloadInAzureBlob = 940131, - - /// - /// 940132 - Adding record of sale event payload in Azure Queue storage. - /// - AddMessageToAzureQueue = 940132, - - /// - /// 940133 - Record of sale event payload is added in queue storage successfully. - /// - AddedMessageToAzureQueue = 940133, - - /// - /// 940134 - Webjob started for merging record of sale events. - /// - WebjobForEventAggregationStarted = 940134, - - /// - /// 940135 - Webjob completed for merging record of sale events. - /// - WebjobForEventAggregationCompleted = 940135, - - /// - /// 940136 - Webjob started downloading record of sale events from blob. - /// - DownloadRecordOfSaleEventFromAzureBlob = 940136, - - /// - /// 940137 - All related events are not present in Azure blob. - /// - AllRelatedEventsAreNotPresentInBlob = 940137, - - /// - /// 940138 - The record has been completed already. - /// - RequestAlreadyCompleted = 940138, - - /// - /// 940139 - Exception occured while processing Event aggregation WebJob. - /// - UnhandledWebJobException = 940139, - - /// - /// 940140 - Dequeue count of message. - /// - MessageDequeueCount = 940140, - - /// - /// 940141 - Invalid UkhoWeekNumber field in enccontentpublished event from EES. - /// - InvalidUkhoWeekNumber = 940141, - - /// - /// 940141 - Exception occured while decrypting the permit string. - /// - PermitDecryptionException = 940142 - + RequiredSectionNotFoundException = 940086 } /// diff --git a/src/UKHO.ERPFacade.Common/Models/PermitKey.cs b/src/UKHO.ERPFacade.Common/Models/DecryptedPermit.cs similarity index 86% rename from src/UKHO.ERPFacade.Common/Models/PermitKey.cs rename to src/UKHO.ERPFacade.Common/Models/DecryptedPermit.cs index 6dfa4883..fa0d6867 100644 --- a/src/UKHO.ERPFacade.Common/Models/PermitKey.cs +++ b/src/UKHO.ERPFacade.Common/Models/DecryptedPermit.cs @@ -3,7 +3,7 @@ namespace UKHO.ERPFacade.Common.Models { [ExcludeFromCodeCoverage] - public class PermitKey + public class DecryptedPermit { public string ActiveKey { get; set; } public string NextKey { get; set; } diff --git a/src/UKHO.ERPFacade.Common/Models/EESEvent.cs b/src/UKHO.ERPFacade.Common/Models/EESEvent.cs index 622c377c..15f2cdb6 100644 --- a/src/UKHO.ERPFacade.Common/Models/EESEvent.cs +++ b/src/UKHO.ERPFacade.Common/Models/EESEvent.cs @@ -6,9 +6,6 @@ namespace UKHO.ERPFacade.Common.Models [ExcludeFromCodeCoverage] public class Product { - [JsonProperty("productType")] - public string ProductType { get; set; } - [JsonProperty("dataSetName")] public string DataSetName { get; set; } @@ -25,10 +22,10 @@ public class Product public int UsageBand { get; set; } [JsonProperty("editionNumber")] - public int EditionNumber { get; set; } + public int? EditionNumber { get; set; } [JsonProperty("updateNumber")] - public int UpdateNumber { get; set; } + public int? UpdateNumber { get; set; } [JsonProperty("mayAffectHoldings")] public bool MayAffectHoldings { get; set; } @@ -48,9 +45,6 @@ public class Product [JsonProperty("size")] public string Size { get; set; } - [JsonProperty("agency")] - public string Agency { get; set; } - [JsonProperty("bundle")] public List Bundle { get; set; } @@ -111,6 +105,12 @@ public class UnitOfSale [JsonProperty("compositionChanges")] public CompositionChanges CompositionChanges { get; set; } + + [JsonProperty("providerCode")] + public string ProviderCode { get; set; } + + [JsonProperty("providerName")] + public string ProviderName { get; set; } } [ExcludeFromCodeCoverage] @@ -168,11 +168,8 @@ public class S63 [JsonProperty("hash")] public string Hash { get; set; } - [JsonProperty("location")] - public string Location { get; set; } - [JsonProperty("fileSize")] - public string FileSize { get; set; } + public int FileSize { get; set; } [JsonProperty("compression")] public bool Compression { get; set; } @@ -190,11 +187,8 @@ public class Signature [JsonProperty("hash")] public string Hash { get; set; } - [JsonProperty("location")] - public string Location { get; set; } - [JsonProperty("fileSize")] - public string FileSize { get; set; } + public int FileSize { get; set; } } [ExcludeFromCodeCoverage] @@ -206,11 +200,8 @@ public class AncillaryFile [JsonProperty("hash")] public string Hash { get; set; } - [JsonProperty("location")] - public string Location { get; set; } - [JsonProperty("fileSize")] - public string FileSize { get; set; } + public int FileSize { get; set; } } [ExcludeFromCodeCoverage] diff --git a/src/UKHO.ERPFacade.Common/Models/EncEventPayload.cs b/src/UKHO.ERPFacade.Common/Models/EncEventPayload.cs index b638c433..236baa10 100644 --- a/src/UKHO.ERPFacade.Common/Models/EncEventPayload.cs +++ b/src/UKHO.ERPFacade.Common/Models/EncEventPayload.cs @@ -51,12 +51,12 @@ public class EesEventData public class UkhoWeekNumber { [JsonProperty("year")] - public int Year { get; set; } + public int? Year { get; set; } [JsonProperty("week")] - public int Week { get; set; } + public int? Week { get; set; } [JsonProperty("currentWeekAlphaCorrection")] - public bool CurrentWeekAlphaCorrection { get; set; } + public bool? CurrentWeekAlphaCorrection { get; set; } } } diff --git a/src/UKHO.ERPFacade.Common/PermitDecryption/IPermitDecryption.cs b/src/UKHO.ERPFacade.Common/PermitDecryption/IPermitDecryption.cs index 9c863c1e..7db12737 100644 --- a/src/UKHO.ERPFacade.Common/PermitDecryption/IPermitDecryption.cs +++ b/src/UKHO.ERPFacade.Common/PermitDecryption/IPermitDecryption.cs @@ -4,6 +4,6 @@ namespace UKHO.ERPFacade.Common.PermitDecryption { public interface IPermitDecryption { - PermitKey GetPermitKeys(string permit); + DecryptedPermit Decrypt(string permit); } } diff --git a/src/UKHO.ERPFacade.Common/PermitDecryption/PermitDecryption.cs b/src/UKHO.ERPFacade.Common/PermitDecryption/PermitDecryption.cs index ba444b15..b3cbeb24 100644 --- a/src/UKHO.ERPFacade.Common/PermitDecryption/PermitDecryption.cs +++ b/src/UKHO.ERPFacade.Common/PermitDecryption/PermitDecryption.cs @@ -20,27 +20,27 @@ public PermitDecryption(ILogger logger, IOptions + + + + + e61f5a69-c5a8-465b-6e56-08dccb3abf10 + 7 + 20240920 + 014134 + UKHO + + + 1 + REPLACED WITH ENC CELL + ENC CELL + S57 + GB50382B + GB50382B + + GB100160 + + + + + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202432</WEEKNO> + <VALIDFROM>20240808</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>GB100160</CHILDCELL> + <PRODUCTNAME>GB100160</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>GB</AGENCY> + <PROVIDER>1</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202432</WEEKNO> + <VALIDFROM>20240808</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>GB100160</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>GB</AGENCY> + <PROVIDER>1</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202432</WEEKNO> + <VALIDFROM>20240808</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>4</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>GB50382B</CHILDCELL> + <PRODUCTNAME>GB50382B</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202432</WEEKNO> + <VALIDFROM>20240808</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>5</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>GB50382B</CHILDCELL> + <PRODUCTNAME>PAYSF</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202432</WEEKNO> + <VALIDFROM>20240808</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>6</ACTIONNUMBER> + <ACTION>CANCEL ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>GB50382B</CHILDCELL> + <PRODUCTNAME>GB50382B</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202432</WEEKNO> + <VALIDFROM>20240808</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>7</ACTIONNUMBER> + <ACTION>CANCEL AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>GB50382B</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202432</WEEKNO> + <VALIDFROM>20240808</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement.xml new file mode 100644 index 00000000..c1211c72 Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.xml new file mode 100644 index 00000000..fcf7b262 Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement_AND_UpdateCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement_AND_UpdateCell.xml new file mode 100644 index 00000000..b556bdf6 Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithNewCellReplacement_AND_UpdateCell.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithoutCellReplacement.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithoutCellReplacement.xml new file mode 100644 index 00000000..19c958ab --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CancelCellWithoutCellReplacement.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>8b25f4e8-d31c-4305-9cff-08dcc128489e</CORRID> + <NOOFACTIONS>4</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>014725</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>GB50382B</CHILDCELL> + <PRODUCTNAME>GB50382B</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>GB50382B</CHILDCELL> + <PRODUCTNAME>PAYSF</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CANCEL ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>GB50382B</CHILDCELL> + <PRODUCTNAME>GB50382B</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>4</ACTIONNUMBER> + <ACTION>CANCEL AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>GB50382B</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChange.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChange.xml new file mode 100644 index 00000000..f53b0ea1 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChange.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>323bcab6-7192-4025-d372-08dcd31236c8</CORRID> + <NOOFACTIONS>4</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>014823</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U421213</CHILDCELL> + <PRODUCTNAME>1U421213</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>medium</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U421222</CHILDCELL> + <PRODUCTNAME>1U421222</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>medium</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U421213</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>4</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U421222</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChangeWithNewCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChangeWithNewCell.xml new file mode 100644 index 00000000..bee419fa --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChangeWithNewCell.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>62d4c8a3-56f1-4f4f-d35d-08dcd31236c8</CORRID> + <NOOFACTIONS>2</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>015038</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>US5AK1XQ</CHILDCELL> + <PRODUCTNAME>US5AK1XQ</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>US</AGENCY> + <PROVIDER>1</PROVIDER> + <ENCSIZE>medium</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>US5AK1XQ</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>US</AGENCY> + <PROVIDER>1</PROVIDER> + <ENCSIZE>medium</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChange_AND_SuspendCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChange_AND_SuspendCell.xml new file mode 100644 index 00000000..6e0ca8b7 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/CellMetadataChange_AND_SuspendCell.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>81998956-d6ae-4ac5-d369-08dcd31236c8</CORRID> + <NOOFACTIONS>5</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>014929</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U322260</CHILDCELL> + <PRODUCTNAME>1U322260</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U422220</CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U422220</CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>4</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U322260</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>5</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MoveCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MoveCell.xml new file mode 100644 index 00000000..209f5e9a --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MoveCell.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>c4a72836-dad4-4011-d362-08dcd31236c8</CORRID> + <NOOFACTIONS>5</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>101220</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U319200</CHILDCELL> + <PRODUCTNAME>1U319210</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U319200</CHILDCELL> + <PRODUCTNAME>1U319210</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U319200</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>4</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U319210</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>5</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U319200</CHILDCELL> + <PRODUCTNAME>1U319200</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MoveCell_AND_SuspendCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MoveCell_AND_SuspendCell.xml new file mode 100644 index 00000000..0566538e --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MoveCell_AND_SuspendCell.xml @@ -0,0 +1,192 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>480f1d52-1f24-46f4-d36d-08dcd31236c8</CORRID> + <NOOFACTIONS>8</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>015252</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U320200</CHILDCELL> + <PRODUCTNAME>1U319230</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U320200</CHILDCELL> + <PRODUCTNAME>1U319230</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U422220</CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>4</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U422220</CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>5</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U319230</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>6</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U320200</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>7</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>8</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U320200</CHILDCELL> + <PRODUCTNAME>1U320200</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MultipleCellsInSingleUnit.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MultipleCellsInSingleUnit.xml new file mode 100644 index 00000000..18e4eb8e --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/MultipleCellsInSingleUnit.xml @@ -0,0 +1,236 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>5b2ff20c-9e36-43d4-d36e-08dcd31236c8</CORRID> + <NOOFACTIONS>10</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>015355</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U318200</CHILDCELL> + <PRODUCTNAME>1U420243</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U318210</CHILDCELL> + <PRODUCTNAME>1U420243</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U318220</CHILDCELL> + <PRODUCTNAME>1U420243</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>4</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U318200</CHILDCELL> + <PRODUCTNAME>1U318200</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>5</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U318210</CHILDCELL> + <PRODUCTNAME>1U318210</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>6</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U318220</CHILDCELL> + <PRODUCTNAME>1U318220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>7</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U318200</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>8</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U318210</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>9</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U318220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>10</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U420243</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell.xml new file mode 100644 index 00000000..bb524fb6 Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_CancelCellWithNewCellReplacement.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_CancelCellWithNewCellReplacement.xml new file mode 100644 index 00000000..445e70da Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_CancelCellWithNewCellReplacement.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_MoveCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_MoveCell.xml new file mode 100644 index 00000000..bff5e537 Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_MoveCell.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_UoSMetadataChange.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_UoSMetadataChange.xml new file mode 100644 index 00000000..a7647443 Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_UoSMetadataChange.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_UpdateCell_AND_CellMetadataChange.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_UpdateCell_AND_CellMetadataChange.xml new file mode 100644 index 00000000..a3f0435b Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/NewCell_AND_UpdateCell_AND_CellMetadataChange.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/Re-issue.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/Re-issue.xml new file mode 100644 index 00000000..a5bc9672 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/Re-issue.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>ft-1bdfc9dd-9f4c-4c52-a32e-b2a924b7d5b6</CORRID> + <NOOFACTIONS>4</NOOFACTIONS> + <RECDATE>20241006</RECDATE> + <RECTIME>053558</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>CREATE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>GB1REISS</CHILDCELL> + <PRODUCTNAME>GB1REISS</PRODUCTNAME> + <CANCELLED></CANCELLED> + <REPLACEDBY></REPLACEDBY> + <AGENCY>GB</AGENCY> + <PROVIDER>1</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE>Not specified + 10 + 3 + + 202409 + 20240229 + N + ThisWillBeRetrievedFromKeyVaultBeforeAssertion + ThisWillBeRetrievedFromKeyVaultBeforeAssertion + + + 2 + CREATE AVCS UNIT OF SALE + AVCS UNIT + S57 + + GB1REISS + + + GB + 1 + large + Not specified + + + AVCS Units Overview + 202409 + 20240229 + N + + + + + 3 + ASSIGN CELL TO AVCS UNIT OF SALE + AVCS UNIT + S57 + GB1REISS + GB1REISS + + + + + + + + + + 202409 + 20240229 + N + + + + + 4 + ASSIGN CELL TO AVCS UNIT OF SALE + AVCS UNIT + S57 + GB1REISS + PAYSF + + + + + + + + + + 202409 + 20240229 + N + + + + + + + + diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/SuspendCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/SuspendCell.xml new file mode 100644 index 00000000..e8db52c0 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/SuspendCell.xml @@ -0,0 +1,82 @@ + + + + + + ce255314-285c-4334-d367-08dcd31236c8 + 3 + 20240920 + 020436 + UKHO + + + 1 + CHANGE ENC CELL + ENC CELL + S57 + 1U422220 + 1U422220 + + + 1U + 2 + large + + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U422220</CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/SuspendCell_AND_WithdrawCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/SuspendCell_AND_WithdrawCell.xml new file mode 100644 index 00000000..90484aaf --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/SuspendCell_AND_WithdrawCell.xml @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>adc4f2cd-88b9-4405-d368-08dcd31236c8</CORRID> + <NOOFACTIONS>6</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>020613</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U422220</CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CHANGE ENC CELL</ACTION> + <PRODUCT>ENC CELL</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U422220</CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U422220</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>2</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>4</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U661901</CHILDCELL> + <PRODUCTNAME>1U661901</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>5</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U661901</CHILDCELL> + <PRODUCTNAME>PAYSF</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>6</ACTIONNUMBER> + <ACTION>CANCEL AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U661901</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UoSMetadataChange.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UoSMetadataChange.xml new file mode 100644 index 00000000..d4032ca6 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UoSMetadataChange.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>d3a2fc8c-aa69-42a9-6e5a-08dccb3abf10</CORRID> + <NOOFACTIONS>1</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>101350</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>CHANGE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U319210</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY>1U</AGENCY> + <PROVIDER>1</PROVIDER> + <ENCSIZE>large</ENCSIZE> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202432</WEEKNO> + <VALIDFROM>20240808</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCell.xml new file mode 100644 index 00000000..f1103eec Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCell.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCellWithNewEdition.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCellWithNewEdition.xml new file mode 100644 index 00000000..04b28401 Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCellWithNewEdition.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCellsWithDifferentStatusName.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCellsWithDifferentStatusName.xml new file mode 100644 index 00000000..de516683 Binary files /dev/null and b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/UpdateCellsWithDifferentStatusName.xml differ diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/WithdrawCell.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/WithdrawCell.xml new file mode 100644 index 00000000..74fa0217 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/WithdrawCell.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="utf-16"?> +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID>adc4f2cd-88b9-4405-d368-08dcd31236c8</CORRID> + <NOOFACTIONS>3</NOOFACTIONS> + <RECDATE>20240920</RECDATE> + <RECTIME>101534</RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>1</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U661901</CHILDCELL> + <PRODUCTNAME>1U661901</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL>1U661901</CHILDCELL> + <PRODUCTNAME>PAYSF</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + <Item> + <ACTIONNUMBER>3</ACTIONNUMBER> + <ACTION>CANCEL AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>1U661901</PRODUCTNAME> + <CANCELLED /> + <REPLACEDBY /> + <AGENCY /> + <PROVIDER /> + <ENCSIZE /> + <TITLE /> + <EDITIONNO /> + <UPDATENO /> + <UNITTYPE /> + <WEEKNO>202431</WEEKNO> + <VALIDFROM>20240801</VALIDFROM> + <CORRECTION>N</CORRECTION> + <ACTIVEKEY /> + <NEXTKEY /> + </Item> + </ACTIONITEMS> + </IM_MATINFO> + </Z_ADDS_MAT_INFO> + </soap:Body> +</soap:Envelope> \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/2NewCells.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/2NewCells.JSON new file mode 100644 index 00000000..d60b6b35 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/2NewCells.JSON @@ -0,0 +1,227 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "e7bd473c-a573-4905-9541-77218df10b1b", + "time": "2024-09-13T10:22:26.1824904+00:00", + "subject": "US5AK2AX,US5AK9DI", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-e4c9d333-b133-4133-a0aa-08dccb35b407", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5AK2AX.000", + "productName": "US5AK2AX", + "title": "Burnett Inlet AK", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-02", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 56.1, + "southLimit": 56.025, + "eastLimit": -132.45, + "westLimit": -132.6 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK2AX" + ], + "s63": { + "name": "US5AK2AX.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "CD8C994B" + }, + "signature": { + "name": "USMAK2AX.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US206AXA.TXT", + "hash": "5DB4326DAA120A113B5EC826F77160415F6CBBAC21C838FFB4678E5828826EA1", + "fileSize": 5102 + } + ] + }, + { + "dataSetName": "US5AK9DI.000", + "productName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-11", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK9DI" + ], + "s63": { + "name": "US5AK9DI.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8A46B83F" + }, + "signature": { + "name": "USMAK9DI.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US213DIA.TXT", + "hash": "4E3E678781D95F476C0D099375A71A81FC5570C9D92C6DFFC93EF2C11A029632", + "fileSize": 4008 + }, + { + "name": "US213DIB.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK2AX", + "title": "Burnett Inlet AK", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 56.1, + "southLimit": 56.025, + "eastLimit": -132.45, + "westLimit": -132.6 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK2AX" + ], + "removeProducts": [] + } + }, + { + "unitName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK2AX", + "US5AK9DI" + ], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/3AdditionalCoverageCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/3AdditionalCoverageCell.JSON new file mode 100644 index 00000000..e4d638c8 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/3AdditionalCoverageCell.JSON @@ -0,0 +1,128 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "e06f6c0f-5f31-4346-9fd3-6ebefcaadce8", + "time": "2024-09-16T10:23:48.8468685+00:00", + "subject": "RU4O5XQ0", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-05334dd0-db09-47a7-9cee-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "RU4O5XQ0.000", + "productName": "RU4O5XQ0", + "title": "Sea of Okhotsk - Shelikhov Gulf - Nayakhanskaya and Varkhalamskaya Inlet", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B4" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-13", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [ + "RU4O0KS9", + "RU4O0YF0", + "RU4O0YK0" + ], + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386746, + "southLimit": 61.6953413, + "eastLimit": 159.5691864, + "westLimit": 158.8358531 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "RU4O5XQ0", + "PAYSF" + ], + "s63": { + "name": "RU4O5XQ0.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "867BA7C2" + }, + "signature": { + "name": "RULO5XQ0.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "RU4O5XQ0", + "title": "Nayakhanskaya-Varkhalamskaya", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386749, + "southLimit": 61.6953416, + "eastLimit": 159.5691747, + "westLimit": 158.8358414 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/3AdditionalCoverageCell_AND_CancelCellWithNewCellReplacement.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/3AdditionalCoverageCell_AND_CancelCellWithNewCellReplacement.JSON new file mode 100644 index 00000000..204ffe8d --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/3AdditionalCoverageCell_AND_CancelCellWithNewCellReplacement.JSON @@ -0,0 +1,295 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "af43f91e-bb8a-4fc6-a376-4919fb601baa", + "time": "2024-09-16T10:27:19.4261971+00:00", + "subject": "PA5AM111,PA5CP007,RU4O5XQ0", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-05334dd0-db09-47a7-9cee-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "PA5AM111.001", + "productName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "scale": 12000, + "usageBand": 5, + "editionNumber": 8, + "updateNumber": 1, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-16", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "PA5CP007" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "PA5AM111.001", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "78094592" + }, + "signature": { + "name": "PAMAM111.001", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "PA5CP007.000", + "productName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "scale": 10000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-06-24", + "isNewCell": true + }, + "replaces": [ + "PA5AM111" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "PA5CP007" + ], + "s63": { + "name": "PA5CP007.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "97348E72" + }, + "signature": { + "name": "PAMCP007.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "RU4O5XQ0.000", + "productName": "RU4O5XQ0", + "title": "Sea of Okhotsk - Shelikhov Gulf - Nayakhanskaya and Varkhalamskaya Inlet", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B4" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-13", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [ + "RU4O0KS9", + "RU4O0YF0", + "RU4O0YK0" + ], + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386746, + "southLimit": 61.6953413, + "eastLimit": 159.5691864, + "westLimit": 158.8358531 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "RU4O5XQ0", + "PAYSF" + ], + "s63": { + "name": "RU4O5XQ0.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "867BA7C2" + }, + "signature": { + "name": "RULO5XQ0.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "PA5AM111" + ] + } + }, + { + "unitName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [] + } + }, + { + "unitName": "RU4O5XQ0", + "title": "Nayakhanskaya-Varkhalamskaya", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386749, + "southLimit": 61.6953416, + "eastLimit": 159.5691747, + "westLimit": 158.8358414 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [ + "PA5AM111" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/AdditionalCoverageWithNewEdition.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/AdditionalCoverageWithNewEdition.JSON new file mode 100644 index 00000000..27250b36 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/AdditionalCoverageWithNewEdition.JSON @@ -0,0 +1,126 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "681eb9ee-2b1e-408f-95c6-3e2dcc33a721", + "time": "2024-09-16T10:06:58.8441514+00:00", + "subject": "RU4O5XQ0", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-05334dd0-db09-47a7-9cee-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "RU4O5XQ0.000", + "productName": "RU4O5XQ0", + "title": "Sea of Okhotsk - Shelikhov Gulf - Nayakhanskaya and Varkhalamskaya Inlet", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B4" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-13", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [ + "RU4O0YF0" + ], + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386746, + "southLimit": 61.6953413, + "eastLimit": 159.5691864, + "westLimit": 158.8358531 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "RU4O5XQ0", + "PAYSF" + ], + "s63": { + "name": "RU4O5XQ0.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "867BA7C2" + }, + "signature": { + "name": "RULO5XQ0.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "RU4O5XQ0", + "title": "Nayakhanskaya-Varkhalamskaya", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386749, + "southLimit": 61.6953416, + "eastLimit": 159.5691747, + "westLimit": 158.8358414 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithExistingCellReplacement.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithExistingCellReplacement.JSON new file mode 100644 index 00000000..6f434c3a --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithExistingCellReplacement.JSON @@ -0,0 +1,264 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "b5c7a0fe-7459-432b-bdd0-9229b63b87ee", + "time": "2024-09-11T13:13:07.9481962+00:00", + "subject": "GB100160,GB50382B", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-e61f5a69-c5a8-465b-6e56-08dccb3abf10", + "ukhoWeekNumber": { + "year": 2024, + "week": 32, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "GB100160.000", + "productName": "GB100160", + "title": "British Isles", + "scale": 1500000, + "usageBand": 1, + "editionNumber": 54, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-05-20", + "isNewCell": false + }, + "replaces": [ + "GB50382B" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 62.8339046, + "southLimit": 48.16669, + "eastLimit": 3.4164755, + "westLimit": -13.78663 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "GB100160", + "PAYSF" + ], + "s63": { + "name": "GB100160.000", + "hash": "D59D6E3CC8058A6FB2E4B0576FEF912801CDB0D5F0DD5D1B18B23DCE16EDEEB9", + "fileSize": 1318248, + "compression": true, + "s57Crc": "9C30F721" + }, + "signature": { + "name": "GBI00160.000", + "hash": "FB37D9A565437278A2A72F311885C9BBCA7B30B494B3DD48ADA55624B29FB946", + "fileSize": 874 + }, + "ancillaryFiles": [ + { + "name": "GBDEEPWR.TXT", + "hash": "1159C9F4E5618C0F5280D96625413C8EFF35DB7C53A7DC72B7FC39C844EE2125", + "fileSize": 128 + }, + { + "name": "GBN00905.TXT", + "hash": "699DDF31E5BCD5D553A5BFB235D14F8BFE526A9AE8B0630A7A2C393292B51E94", + "fileSize": 348 + }, + { + "name": "GBN00903.TXT", + "hash": "570319BB2F318EA7B5DBBF2DFCCA5349DEE2A37C0513A393F9BF2EF1841BD629", + "fileSize": 305 + }, + { + "name": "GB114_18.TXT", + "hash": "FE1216B9D0119AA35713DB71A25E32C853D669448CF5E30278B8686DCCE465F2", + "fileSize": 140 + }, + { + "name": "GBD3A002.TXT", + "hash": "0B62ABAED81556475005823A79071580410E15A9C9E7E6472DD88249477B88EA", + "fileSize": 265 + }, + { + "name": "GBDARWIN.TXT", + "hash": "2B0EFEE39BD48CDCA8FD6518966850518E53E9DD2C851381F936730A4930A085", + "fileSize": 141 + }, + { + "name": "GB114_34.TXT", + "hash": "F6BC3DEDEB0BADD25CD1B2FB83AEEC6A7861159B04B57C7AC8695C9A93FE5C6A", + "fileSize": 150 + }, + { + "name": "GB5500MR.TXT", + "hash": "E893DCDD6BB4DF54A7E394E80CD9758FE6C92BD11B22B5507FDE72A2DB89DBF0", + "fileSize": 263 + }, + { + "name": "GBN00904.TXT", + "hash": "81B1518737304F274F8DCE4094CE6A42D628061BACC45867B233D1F718DE7A9E", + "fileSize": 303 + }, + { + "name": "GBG1DXXX.TXT", + "hash": "0DD997E018EBBC272E8965DC8265DAF51A78B83AEB8EF400C6E09381128EE4AA", + "fileSize": 376 + }, + { + "name": "GB062_36.TXT", + "hash": "1608AEBF1AB7BF68ACA9FB5768D0ABEF6B313A0F028FE3D297E15E829F40942E", + "fileSize": 170 + } + ] + }, + { + "dataSetName": "GB50382B.003", + "productName": "GB50382B", + "title": "Warkworth Harbour", + "scale": 12000, + "usageBand": 5, + "editionNumber": 6, + "updateNumber": 3, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "small", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "GB100160" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 55.3600388, + "southLimit": 55.3050432, + "eastLimit": -1.5116288, + "westLimit": -1.6166183 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "GB50382B.003", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "D3821E07" + }, + "signature": { + "name": "GBM0382B.003", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "GB100160", + "title": "British Isles", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Overview", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 62.8339046, + "southLimit": 48.16669, + "eastLimit": 3.4164755, + "westLimit": -13.78663 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "GB50382B", + "title": "Warkworth Harbour", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 55.3600388, + "southLimit": 55.3050432, + "eastLimit": -1.5116288, + "westLimit": -1.6166183 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "GB50382B" + ] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "GB50382B" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement.JSON new file mode 100644 index 00000000..8f1d3f60 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement.JSON @@ -0,0 +1,334 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "2e7a5a1c-f86d-4ec9-8623-a885b6d40c3a", + "time": "2024-09-13T09:56:57.4064515+00:00", + "subject": "US5NY28M,US5NY6HU,US5NY6HV", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-21e3517a-ff12-4f82-9d05-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5NY28M.002", + "productName": "US5NY28M", + "title": "Oswego Harbor", + "scale": 10000, + "usageBand": 5, + "editionNumber": 16, + "updateNumber": 2, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "small", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-07", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "US5NY6HU", + "US5NY6HV" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 43.4970538, + "southLimit": 43.4299118, + "eastLimit": -76.4792537, + "westLimit": -76.5562608 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "US5NY28M.002", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "E6F9DCCE" + }, + "signature": { + "name": "USMNY28M.002", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "US5NY6HU.000", + "productName": "US5NY6HU", + "title": "Lake Ontario - Oswego Harbor NY", + "scale": 12000, + "usageBand": 5, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-15", + "isNewCell": true + }, + "replaces": [ + "US5NY28M" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 43.5, + "southLimit": 43.425, + "eastLimit": -76.5, + "westLimit": -76.575 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5NY6HU" + ], + "s63": { + "name": "US5NY6HU.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "F7069025" + }, + "signature": { + "name": "USMNY6HU.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US386HUD.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + }, + { + "name": "US386HUA.TXT", + "hash": "01D5B3B4408AEC496FD57FD3286CF7B95AC6A035B081671DFD1D02BADA526548", + "fileSize": 5267 + }, + { + "name": "US386HUC.TXT", + "hash": "A70F53C099FC942C4CE2240CEB5BE6FBCDCFD6098AA4673DC9E55FB024822AEB", + "fileSize": 329 + }, + { + "name": "US386HUB.TXT", + "hash": "1E8A7357C00BCA2BD384B678BD6B7392150FFD471A220B836BCD0446E64DCBC5", + "fileSize": 838 + } + ] + }, + { + "dataSetName": "US5NY6HV.000", + "productName": "US5NY6HV", + "title": "Lake Ontario - Oswego NY", + "scale": 12000, + "usageBand": 5, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-15", + "isNewCell": true + }, + "replaces": [ + "US5NY28M" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 43.5, + "southLimit": 43.425, + "eastLimit": -76.425, + "westLimit": -76.5 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5NY6HV" + ], + "s63": { + "name": "US5NY6HV.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "FF05E6A0" + }, + "signature": { + "name": "USMNY6HV.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US386HVA.TXT", + "hash": "FF434E362FF07B5EF7A2296DE77197453C5CBF6851A66DCBB4E255F574E9D235", + "fileSize": 4701 + }, + { + "name": "US386HVC.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + }, + { + "name": "US386HVB.TXT", + "hash": "1E8A7357C00BCA2BD384B678BD6B7392150FFD471A220B836BCD0446E64DCBC5", + "fileSize": 838 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5NY28M", + "title": "Oswego Harbor", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 43.4970538, + "southLimit": 43.4299118, + "eastLimit": -76.4792537, + "westLimit": -76.5562608 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "US5NY28M" + ] + } + }, + { + "unitName": "US5NY6HU", + "title": "Lake Ontario - Oswego Harbor NY", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 43.5, + "southLimit": 43.425, + "eastLimit": -76.5, + "westLimit": -76.575 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5NY6HU" + ], + "removeProducts": [] + } + }, + { + "unitName": "US5NY6HV", + "title": "Lake Ontario - Oswego NY", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 43.5, + "southLimit": 43.425, + "eastLimit": -76.425, + "westLimit": -76.5 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5NY6HV" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5NY6HU", + "US5NY6HV" + ], + "removeProducts": [ + "US5NY28M" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.JSON new file mode 100644 index 00000000..1e85d780 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.JSON @@ -0,0 +1,398 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "dea610c3-3b8b-4a47-b6b0-b0e8fe153bea", + "time": "2024-09-16T09:31:22.7263574+00:00", + "subject": "1U319240,1U420242,PA5AM111,PA5CP007", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-c48874d4-255e-4257-6680-08dcd62fd4ae", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U319240.013", + "productName": "1U319240", + "title": "TAIWAN STRAIT SOUTH OF WUQIU ISLETS", + "scale": 180000, + "usageBand": 3, + "editionNumber": 5, + "updateNumber": 13, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2024-06-23", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 25, + "southLimit": 24, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U319240", + "PAYSF" + ], + "s63": { + "name": "1U319240.013", + "hash": "0CD79A00512E436C41562C27701013DFA62588BD7B2DCAE8A258630C99DE523C", + "fileSize": 1320, + "compression": true, + "s57Crc": "B0D40934" + }, + "signature": { + "name": "1UK19240.013", + "hash": "3BA3986CEC4E532CD0D26A487852430F2D4524CEF28A3C34DF0E2D44F3788428", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U420242.001", + "productName": "1U420242", + "title": "TAICHUNG TO TONGXIAO", + "scale": 45000, + "usageBand": 4, + "editionNumber": 5, + "updateNumber": 1, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2024-06-28", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 24.5, + "southLimit": 24, + "eastLimit": 121, + "westLimit": 120.5 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "1U320210" + ], + "s63": { + "name": "1U420242.001", + "hash": "382E1123A2379052D76B8FB0496C0C78F875A75A2C26BC14BF28ED69D209DEF0", + "fileSize": 1920, + "compression": true, + "s57Crc": "BE6A157F" + }, + "signature": { + "name": "1UL20242.001", + "hash": "DF76C99F294029C6C140EE07CD6F0B5A67857C3A7137A3DBA09A98140520C87E", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "PA5AM111.001", + "productName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "scale": 12000, + "usageBand": 5, + "editionNumber": 8, + "updateNumber": 1, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-16", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "PA5CP007" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "PA5AM111.001", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "78094592" + }, + "signature": { + "name": "PAMAM111.001", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "PA5CP007.000", + "productName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "scale": 10000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-06-24", + "isNewCell": true + }, + "replaces": [ + "PA5AM111" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "PA5CP007" + ], + "s63": { + "name": "PA5CP007.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "97348E72" + }, + "signature": { + "name": "PAMCP007.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "PA5AM111" + ] + } + }, + { + "unitName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [] + } + }, + { + "unitName": "1U319240", + "title": "SOUTH OF WUQIU ISLETS", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 25, + "southLimit": 24, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "1U320210", + "title": "WATERS SOUTHWARD OF TAIWAN", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21, + "eastLimit": 121, + "westLimit": 120 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "1U420242" + ], + "removeProducts": [] + } + }, + { + "unitName": "1U420242", + "title": "TAICHUNG TO TONGXIAO", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 24.5, + "southLimit": 24, + "eastLimit": 121, + "westLimit": 120.5 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "1U420242" + ] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [ + "PA5AM111" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement_AND_UpdateCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement_AND_UpdateCell.JSON new file mode 100644 index 00000000..b7178ecf --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithNewCellReplacement_AND_UpdateCell.JSON @@ -0,0 +1,291 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "09531718-b83e-4de7-b0f4-b2f428298742", + "time": "2024-09-15T07:36:05.8545619+00:00", + "subject": "BR400304,PA5AM111,PA5CP007", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-8fa72b0a-4200-4363-9d00-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "BR400304.000", + "productName": "BR400304", + "title": "De Mosqueiro a Vila do Conde", + "scale": 45000, + "usageBand": 4, + "editionNumber": 14, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-09", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": -1, + "southLimit": -1.8333333, + "eastLimit": -48.4166667, + "westLimit": -49.0166667 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "BR400304", + "PAYSF" + ], + "s63": { + "name": "BR400304.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "2C842B6D" + }, + "signature": { + "name": "BRL00304.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "PA5AM111.001", + "productName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "scale": 12000, + "usageBand": 5, + "editionNumber": 8, + "updateNumber": 1, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-16", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "PA5CP007" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "PA5AM111.001", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "78094592" + }, + "signature": { + "name": "PAMAM111.001", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "PA5CP007.000", + "productName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "scale": 10000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-06-24", + "isNewCell": true + }, + "replaces": [ + "PA5AM111" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "PA5CP007" + ], + "s63": { + "name": "PA5CP007.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "97348E72" + }, + "signature": { + "name": "PAMCP007.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "PA5AM111" + ] + } + }, + { + "unitName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [] + } + }, + { + "unitName": "BR400304", + "title": "De Mosqueiro a Abaetuba", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": -1, + "southLimit": -1.8333333, + "eastLimit": -48.4166667, + "westLimit": -49.0166667 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [ + "PA5AM111" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithoutCellReplacement.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithoutCellReplacement.JSON new file mode 100644 index 00000000..5c5425d7 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CancelCellWithoutCellReplacement.JSON @@ -0,0 +1,125 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "7241b5a4-a828-4b11-911a-3914694d123b", + "time": "2024-09-17T07:56:32.3496106+00:00", + "subject": "GB50382B", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-8b25f4e8-d31c-4305-9cff-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "GB50382B.003", + "productName": "GB50382B", + "title": "Warkworth Harbour", + "scale": 12000, + "usageBand": 5, + "editionNumber": 6, + "updateNumber": 3, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "small", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 55.3600388, + "southLimit": 55.3050432, + "eastLimit": -1.5116288, + "westLimit": -1.6166183 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "GB50382B.003", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "D3821E07" + }, + "signature": { + "name": "GBM0382B.003", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "GB50382B", + "title": "Warkworth Harbour", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 55.3600388, + "southLimit": 55.3050432, + "eastLimit": -1.5116288, + "westLimit": -1.6166183 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "GB50382B" + ] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "GB50382B" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChange.JSON new file mode 100644 index 00000000..a9e83e8f --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChange.JSON @@ -0,0 +1,203 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "2b9b1178-194c-43dc-9e32-1733b5e62b05", + "time": "2024-09-15T15:52:53.3005882+00:00", + "subject": "1U421213,1U421222", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-323bcab6-7192-4025-d372-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U421213.003", + "productName": "1U421213", + "title": "SOUTHEAST WATERS OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 3, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2024-07-08", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21.5, + "eastLimit": 122, + "westLimit": 121.5 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U421213", + "PAYSF" + ], + "s63": { + "name": "1U421213.003", + "hash": "18884659F1430AA2EDE07CE0366CD52ED6FA4158330058D5BE822DC69708DAE5", + "fileSize": 2024, + "compression": true, + "s57Crc": "63C49A3C" + }, + "signature": { + "name": "1UL21213.003", + "hash": "32129885068E2FCDB05CC2AFF9A7B19328D6F2389319C0C9FA8A8E512074D967", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U421222.008", + "productName": "1U421222", + "title": "LANYU AND APPROACHES", + "scale": 45000, + "usageBand": 4, + "editionNumber": 3, + "updateNumber": 8, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2023-10-30", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122, + "westLimit": 121.5 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U421222", + "PAYSF" + ], + "s63": { + "name": "1U421222.008", + "hash": "76971ACB6D958E43EBF70CBE27386E322528BB689F288A2EFBB325298399E4FD", + "fileSize": 1512, + "compression": true, + "s57Crc": "D8D4279E" + }, + "signature": { + "name": "1UL21222.008", + "hash": "4D19D82A0E9913F92FDD727F1862C0992B178A4BC2DE413D4844F49C00F6A648", + "fileSize": 874 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "1U421213", + "title": "SOUTHEAST WATERS OF LANYU", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21.5, + "eastLimit": 122, + "westLimit": 121.5 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "1U421222", + "title": "LANYU AND APPROACHES", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122, + "westLimit": 121.5 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChangeWithNewCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChangeWithNewCell.JSON new file mode 100644 index 00000000..111e0e00 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChangeWithNewCell.JSON @@ -0,0 +1,135 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "70b9d449-62e1-4d95-84d4-d1df8a15f070", + "time": "2024-09-13T11:13:32.5900085+00:00", + "subject": "US5AK1XQ", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-62d4c8a3-56f1-4f4f-d35d-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5AK1XQ.000", + "productName": "US5AK1XQ", + "title": "Taiya Inlet_Metadata change", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-02", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 59.4, + "southLimit": 59.325, + "eastLimit": -135.3, + "westLimit": -135.45 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK1XQ" + ], + "s63": { + "name": "US5AK1XQ.000", + "hash": "9DBA1277C5F56B8409A378F4000CFFEE67ECAB653B161139C13446628D19F846", + "fileSize": 20192, + "compression": true, + "s57Crc": "2023F179" + }, + "signature": { + "name": "USMAK1XQ.000", + "hash": "F41B56E423F2D554743EE0C6B39448FECE1700F2E95420230ECC07E49E749BE9", + "fileSize": 874 + }, + "ancillaryFiles": [ + { + "name": "US205XQB.TXT", + "hash": "A39F51F5602B32C345CDD50683D495C7DC43E1FB69DD464957D5F08F4A16897D", + "fileSize": 172 + }, + { + "name": "US205XQA.TXT", + "hash": "242E80518D8C5DFF3F6A163ECAFA50E7A671258AA5B8FEA90258E77E1B7E48E4", + "fileSize": 4748 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK1XQ", + "title": "Taiya Inlet", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 59.4, + "southLimit": 59.325, + "eastLimit": -135.3, + "westLimit": -135.45 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChange_AND_SuspendCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChange_AND_SuspendCell.JSON new file mode 100644 index 00000000..be040ce6 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/CellMetadataChange_AND_SuspendCell.JSON @@ -0,0 +1,258 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "3d81eadb-f5ca-493d-8eae-b00e66215453", + "time": "2024-09-15T15:05:24.6477601+00:00", + "subject": "1U322260,1U422220", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-81998956-d6ae-4ac5-d369-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U322260.000", + "productName": "1U322260", + "title": "East China Sea 26N 122E TEST", + "scale": 180000, + "usageBand": 3, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2022-04-06", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 27, + "southLimit": 26, + "eastLimit": 123, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U322260", + "PAYSF" + ], + "s63": { + "name": "1U322260.000", + "hash": "04E590943F121648929B327A53BC8F65947B07931CD1F52036EBAFEF5AA3D0BA", + "fileSize": 15168, + "compression": true, + "s57Crc": "5D73932C" + }, + "signature": { + "name": "1UK22260.000", + "hash": "BAAE11566441C6B1B1B206E04627069313634A363BFA1C380786C3E1BA8DAD9D", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U422220.000", + "productName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Suspended", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U422220", + "PAYSF" + ], + "s63": { + "name": "1U422220.000", + "hash": "EC1CCB8B60E700DCD01EB64381041ED5AE6EA7BB7BB43412A06CE7C5E11DFBDE", + "fileSize": 24464, + "compression": true, + "s57Crc": "D1DAE0F9" + }, + "signature": { + "name": "1UL22220.000", + "hash": "5A1FACDA6749F4702ED8E781269E7767D83F9DEFBD367DBD9CFD697DEED1EE7C", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U422220.001", + "productName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 1, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Suspended", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U422220", + "PAYSF" + ], + "s63": { + "name": "1U422220.001", + "hash": "5B47E3E84BADA31DB935F30C0368B62C07C6238CDB9E9FA35DAA93A4C0C02502", + "fileSize": 1592, + "compression": true, + "s57Crc": "0074B3C0" + }, + "signature": { + "name": "1UL22220.001", + "hash": "51C62DA431BAACA9F86725CFD333F38025BF54E629AA6D0A8BFBE4B16F94B2EF", + "fileSize": 874 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "1U322260", + "title": "East China Sea 26N 122E", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 27, + "southLimit": 26, + "eastLimit": 123, + "westLimit": 122 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID10_UpdateSimple.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID10_UpdateSimple.JSON deleted file mode 100644 index 445a02f6..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID10_UpdateSimple.JSON +++ /dev/null @@ -1,231 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "US4FL1YE", - "datacontenttype": "application/json", - "data": { - "correlationId": "3674e4a4-1d62-4f56-b359-230518simpleupdate002", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": true - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US4FL1YE.001", - "productName": "US4FL1YE", - "title": "Some Title", - "scale": 90000, - "usageBand": 1, - "editionNumber": 4, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "mdeium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "US4FL1YE", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB302409.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB302409.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US4FL1YE", - "title": "Unit Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID11_updateOneCellWithNewEditionStatus.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID11_updateOneCellWithNewEditionStatus.JSON deleted file mode 100644 index e7eb53b4..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID11_updateOneCellWithNewEditionStatus.JSON +++ /dev/null @@ -1,231 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "UK45TRI", - "datacontenttype": "application/json", - "data": { - "correlationId": "3699e4a4-1d62-4f56-b359-230518neweditn002", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "UK45TRI.001", - "productName": "UK45TRI", - "title": "Some Title", - "scale": 90000, - "usageBand": 1, - "editionNumber": 4, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "mdeium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "UK45TRI", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB302409.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB302409.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "UK45TRI", - "title": "Unit Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID12_updateOneCellWithReIssueStatus.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID12_updateOneCellWithReIssueStatus.JSON deleted file mode 100644 index 0acae56a..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID12_updateOneCellWithReIssueStatus.JSON +++ /dev/null @@ -1,231 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "UK45TRI", - "datacontenttype": "application/json", - "data": { - "correlationId": "367999a4-1d92-4f56-b449-230518reissue002", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "UK45TRI.001", - "productName": "UK45TRI", - "title": "Some Title", - "scale": 90000, - "usageBand": 1, - "editionNumber": 4, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "mdeium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "Re-issue", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "UK45TRI", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB302409.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB302409.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "UK45TRI", - "title": "Unit Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID13_updateTwoCellsWithDifferentStatusName.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID13_updateTwoCellsWithDifferentStatusName.JSON deleted file mode 100644 index dc69cb9a..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID13_updateTwoCellsWithDifferentStatusName.JSON +++ /dev/null @@ -1,375 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "UK45TRI, SD3401P", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1fff-4f56-b359-230518multiupdate002", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "UK45TRI.001", - "productName": "UK45TRI", - "title": "Some Title", - "scale": 90000, - "usageBand": 1, - "editionNumber": 4, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "mdeium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "UK45TRI", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB302409.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB302409.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "SD3401P.001", - "productName": "SD3401P", - "title": "SAUDI ARENA", - "scale": 90000, - "usageBand": 1, - "editionNumber": 4, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "mdeium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "USA", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "SD3401P", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB302409.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB302409.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "UK45TRI", - "title": "Unit Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "SD3401P", - "title": "SAUDI ARENA", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID14_moveOneCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID14_moveOneCell.JSON deleted file mode 100644 index 438ab3e5..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID14_moveOneCell.JSON +++ /dev/null @@ -1,210 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-ddd1-4f56-b359-69e178d87810", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": true - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "MX545010" - ] - } - }, - { - "unitName": "MX509226", - "title": "Playa del Carmen", - "unitType": "AVCS Units Coastal", - "unitOfSaleType": "unit", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitOfSaleType": "folio", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "unitOfSaleType": "folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID15_oneNewCellAndOneMoveOneCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID15_oneNewCellAndOneMoveOneCell.JSON deleted file mode 100644 index 301b511d..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID15_oneNewCellAndOneMoveOneCell.JSON +++ /dev/null @@ -1,333 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "MX545010,PH5CATIC", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-4f56-cmovenew-003", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "PH5CATIC.001", - "productName": "PH5CATIC", - "title": "Somewhere Lovely and Warm", - "scale": 100000, - "usageBand": 2, - "editionNumber": 4, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 21.0, - "southLimit": 23.0, - "eastLimit": 118.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "MX545010" - ] - } - }, - { - "unitName": "MX509226", - "title": "Playa del Carmen", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010", - "PH5CATIC" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "PH5CATIC" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "PH5CATIC" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID16_newCell_updateCell_metadataChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID16_newCell_updateCell_metadataChange.JSON deleted file mode 100644 index 264c9dda..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID16_newCell_updateCell_metadataChange.JSON +++ /dev/null @@ -1,465 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-19T12:08:03.4880776Z", - "subject": "NCR3042,UK45TRI,MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-4f56-b359-4301mix", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "NCR3042.001", - "productName": "NCR3042", - "title": "NCR3042 TITLE", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "NCR3042", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "UK45TRI.001", - "productName": "UK45TRI", - "title": "Some Title", - "scale": 90000, - "usageBand": 1, - "editionNumber": 4, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "mdeium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "UK45TRI", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB302409.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB302409.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "UK45TRI", - "title": "Unit Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "NCR3042", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "NCR3042" - ], - "removeProducts": [] - } - }, - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "", - "unitSize": "medium", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "unitOfSaleType": "folio", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "NCR3042" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "unitOfSaleType": "folio", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "NCR3042" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID17_newCell_and_CancelReplace.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID17_newCell_and_CancelReplace.JSON deleted file mode 100644 index 1309a60a..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID17_newCell_and_CancelReplace.JSON +++ /dev/null @@ -1,449 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT,MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "54321-1d62-4f56-b359-mixx2002", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "US5AK83M Title", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ - "US4AK6NT" - ], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5AK83M", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "US4AK6NT - Title", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NT", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "MX545010 Title", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "US5AK83M UOS Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT" - ], - "removeProducts": [] - } - }, - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "MX545010" - ], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "MX545010" - ], - "removeProducts": [ - "US5AK83M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID18_CancelReplace_UpdateCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID18_CancelReplace_UpdateCell.JSON deleted file mode 100644 index c1c517f2..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID18_CancelReplace_UpdateCell.JSON +++ /dev/null @@ -1,572 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT,US4AK6NU,UK45TRI", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-updt1-b001-crupdt001", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "St. Michael Bay", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ - "US4AK6NT", - "US4AK6NU" - ], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5AK83M", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NT", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NU.001", - "productName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NU", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NU.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NU.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NU_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "UK45TRI.001", - "productName": "UK45TRI", - "title": "Some Title", - "scale": 90000, - "usageBand": 1, - "editionNumber": 4, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "mdeium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "UK45TRI", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB302409.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB302409.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT" - ], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "UK45TRI", - "title": "UK45TRI UOS Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID19_CR_metadata_move.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID19_CR_metadata_move.JSON deleted file mode 100644 index ad1ebbb4..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID19_CR_metadata_move.JSON +++ /dev/null @@ -1,589 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-29T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NU,MX545010,TXM450", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-4f56-b359-mix29001", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "St. Michael Bay", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ - "US4AK6NU" - ], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5AK83M", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - } - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NU.001", - "productName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NU", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NU.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NU.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NU_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "TXM450.001", - "productName": "TXM450", - "title": "TXM50 PRD TITLE", - "scale": 90000, - "usageBand": 5, - "editionNumber": 2, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "TXM450", - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "isNewUnitOfSale": false, - "status": "NotForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS UNITS COASTAL", - "unitSize": "medium", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "TXM450", - "title": "txm450 UOS Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "TXM450" - ] - } - }, - { - "unitName": "MX509226", - "title": "Playa del Carmen", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "TXM450" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "unitSize": "large", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID20_newEditionAdditionalCoverageV_01.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID20_newEditionAdditionalCoverageV_01.JSON deleted file mode 100644 index 217c1630..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID20_newEditionAdditionalCoverageV_01.JSON +++ /dev/null @@ -1,178 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "DE416080", - "datacontenttype": "application/json", - "data": { - "correlationId": "abcs-cor0012-newedition-20101", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "DE416080.001", - "productName": "DE416080", - "title": "Greifswalder Bodden", - "scale": 100000, - "usageBand": 4, - "editionNumber": 11, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "large", - "medium", - "small" - ], - "size": "medium", - "agency": "DE", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [ - "DK4LIMFW" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24, - "southLimit": 22, - "eastLimit": 120, - "westLimit": 119 - } - }, - "inUnitsOfSale": [ - "DE416080", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "DE416080", - "title": "Greifswalder Bodden Unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "unitOfSaleType": "unit", - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "unitOfSaleType": "folio", - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "DE416080" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "unitOfSaleType": "folio", - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "DE416080" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID21_cancelAndReplaceV_03.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID21_cancelAndReplaceV_03.JSON deleted file mode 100644 index b6c75407..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID21_cancelAndReplaceV_03.JSON +++ /dev/null @@ -1,429 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT,US4AK6NU", - "datacontenttype": "application/json", - "data": { - "correlationId": "ascd-34ds1-cadskj3-20311", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "St. Michael Bay", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ - "US4AK6NT", - "US4AK6NU" - ], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5AK83M", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NT", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NU.001", - "productName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NU", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NU.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NU.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NU_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT" - ], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitSize": "large", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID22_Cell_Moves_Unit_and_New_CellV_03.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID22_Cell_Moves_Unit_and_New_CellV_03.JSON deleted file mode 100644 index 65077e45..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID22_Cell_Moves_Unit_and_New_CellV_03.JSON +++ /dev/null @@ -1,317 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "MX545010,PH5CATIC", - "datacontenttype": "application/json", - "data": { - "correlationId": "abcd-3hd921-ffd3-2001", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "PH5CATIC.001", - "productName": "PH5CATIC", - "title": "Somewhere Lovely and Warm", - "scale": 100000, - "usageBand": 2, - "editionNumber": 4, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 21.0, - "southLimit": 23.0, - "eastLimit": 118.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "MX545010" - ] - } - }, - { - "unitName": "MX509226", - "title": "Playa del Carmen", - "unitOfSaleType": "unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010", - "PH5CATIC" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "PH5CATIC" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "PH5CATIC" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID23_Cell_MoveV_03.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID23_Cell_MoveV_03.JSON deleted file mode 100644 index b34f71cb..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID23_Cell_MoveV_03.JSON +++ /dev/null @@ -1,210 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "abcs-xsw312-dsjnb3d-2111", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "MX545010" - ] - } - }, - { - "unitName": "MX509226", - "title": "Playa del Carmen", - "unitOfSaleType": "unit", - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "unitSize": "large", - "unitType": "AVCS Folio Transit", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID24_Metadata_ChangeV_03.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID24_Metadata_ChangeV_03.JSON deleted file mode 100644 index 165423b7..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID24_Metadata_ChangeV_03.JSON +++ /dev/null @@ -1,180 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "abcd-a25110-eew8362-s1w8jn", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID25_Mixed_scenario1V_03.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID25_Mixed_scenario1V_03.JSON deleted file mode 100644 index d0a4d458..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID25_Mixed_scenario1V_03.JSON +++ /dev/null @@ -1,538 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5HPWEC,US5HPWED,US5VA32M,US5VA51M", - "datacontenttype": "application/json", - "data": { - "correlationId": "cbdhg-27g1d-328djd1b8-sdss", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5HPWEC.001", - "productName": "US5HPWEC", - "title": "Appomattox River and James River at Hopewell", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5VA32M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5HPWEC", - "PAYSF" - ], - "s63": { - "name": "xxxxxxx1.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "xxxxxxx2.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "xxxxxxx3.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US5HPWED.001", - "productName": "US5HPWED", - "title": "James River - Jordan Point", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5VA32M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5HPWED", - "PAYSF" - ], - "s63": { - "name": "xxxxxxx1.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "xxxxxxx2.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "xxxxxxx3.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US5VA32M.001", - "productName": "US5VA32M", - "title": "James River Jordan Point to Richmond", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ - "US5HPWEC", - "US5HPWED" - ], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5VA32M", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US5VA51M.001", - "productName": "US5VA51M", - "title": "James River  Jamestown Island to Jordan Point", - "scale": 12000, - "usageBand": 5, - "editionNumber": 30, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US5VA51M", - "US5HPWEC", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5HPWEC", - "title": "Appomattox River and James River at Hopewell", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "US5HPWEC", - "US5VA51M" - ], - "removeProducts": [] - } - }, - { - "unitName": "US5HPWED", - "unitSize": "large", - "title": "James River - Jordan Point", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US5HPWED" - ], - "removeProducts": [] - } - }, - { - "unitName": "US5VA32M", - "title": "James River Jordan Point to Richmond", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5VA32M" - ] - } - }, - { - "unitName": "US5VA51M", - "title": "James River  Jamestown Island to Jordan Point", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5VA51M" - ] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5VA32M", - "US5VA51M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US5HPWEC", - "US5HPWED" - ], - "removeProducts": [ - "US5VA32M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID26_New_CellV_03.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID26_New_CellV_03.JSON deleted file mode 100644 index 8f8c1778..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID26_New_CellV_03.JSON +++ /dev/null @@ -1,186 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "dhegtq-1321131-213114f", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": true, - "unitOfSaleType": "unit", - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "unitOfSaleType": "folio", - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "unitOfSaleType": "folio", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID27_supplier_Defined_ReleasabilitySet_V_01.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID27_supplier_Defined_ReleasabilitySet_V_01.JSON deleted file mode 100644 index 10eec32e..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID27_supplier_Defined_ReleasabilitySet_V_01.JSON +++ /dev/null @@ -1,351 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "DE416075,DE5NOBRB", - "datacontenttype": "application/json", - "data": { - "correlationId": "bgde1-37abc-su34-30001", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": true - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "DE416075.001", - "productName": "DE416075", - "title": "Sassnitz Approach", - "scale": 90000, - "usageBand": 4, - "editionNumber": 10, - "updateNumber": 1, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "DE", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "DE416075", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB111111.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB311111.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "DE5NOBRB.001", - "productName": "DE5NOBRB", - "title": "Brunsbuettel", - "scale": 90000, - "usageBand": 5, - "editionNumber": 10, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "DE", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "DE5NOBRB", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB111111.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB311111.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "DE416075", - "title": "Sassnitz Approach Unit Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "DE5NOBRB", - "title": "Brunsbuettel Unit Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID28_simpleSuspendedScenario.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID28_simpleSuspendedScenario.JSON deleted file mode 100644 index 35dd5fdf..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID28_simpleSuspendedScenario.JSON +++ /dev/null @@ -1,231 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "UK45TRI", - "datacontenttype": "application/json", - "data": { - "traceId": "3699e4a4-1d62-4f56-b3591-230518neweditn002", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "UK45TRI.001", - "productName": "UK45TRI", - "title": "Some Title", - "scale": 90000, - "usageBand": 1, - "editionNumber": 4, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "mdeium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M2;B1" - } - ], - "status": { - "statusName": "Suspended", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2020-07-16T19:20:30.45+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "inUnitsOfSale": [ - "UK45TRI", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "GB302409.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "GB302409.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "UK45TRI", - "title": "Unit Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "_ENUM": [ - "large", - "medium", - "small" - ], - "unitType": "AVCS Units Coastal", - "_ENUM": [ - "AVCS Units Overview", - "AVCS Units General", - "AVCS Units Coastal", - "AVCS Units Approach", - "AVCS Units Harbour", - "AVCS Units Berthing" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID29_simpleWithdrawnScenario.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID29_simpleWithdrawnScenario.JSON deleted file mode 100644 index 388d76a7..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID29_simpleWithdrawnScenario.JSON +++ /dev/null @@ -1,194 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "TWP3401 - SIMPLE WITHDRAWN", - "datacontenttype": "application/json", - "data": { - "correlationId": "simp-withdw-sc21012", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "TWP3401.001", - "productName": "TWP3401", - "title": "Appomattox River and James River at Hopewell", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Withdrawn", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "TWP3401", - "RMC0221", - "PAYSF" - ], - "s63": { - "name": "xxxxxxx1.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "xxxxxxx2.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "xxxxxxx3.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "TWP3401", - "title": "Appomattox River and James River at Hopewell", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "TWP3401" - ], - "removeProducts": [] - } - }, - { - "unitName": "RMC0221", - "title": "Removed UoS Title", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "TWP3401" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "TWP3401" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID2_WebhookPayload_Invalid.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID2_WebhookPayload_Invalid.JSON deleted file mode 100644 index bfffa512..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID2_WebhookPayload_Invalid.JSON +++ /dev/null @@ -1,186 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "ab", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitType": "AVCS Units Coastal", - "unitOfSaleType": "unit", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "unitOfSaleType": "folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "unitOfSaleType": "folio", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID30_Suspend_and_WithdrawV01.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID30_Suspend_and_WithdrawV01.JSON deleted file mode 100644 index f76e0991..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID30_Suspend_and_WithdrawV01.JSON +++ /dev/null @@ -1,294 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "GB50734D,GB50782L", - "datacontenttype": "application/json", - "data": { - "correlationId": "dsae-ewae4-2i001", - "correlationId": "367ce4a4-1d62-4f56-b359-230510new003", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "GB50734D.001", - "productName": "GB50734D", - "title": "Some ENC Withdrawn Cell Title", - "scale": 100000, - "usageBand": 5, - "editionNumber": 10, - "updateNumber": 2, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "GB", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Withdrawn", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "GB507", - "AVCSO" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "GB50782L.001", - "productName": "GB50782L", - "title": "Some ENC Suspended Cell Title", - "scale": 100000, - "usageBand": 5, - "editionNumber": 7, - "updateNumber": 4, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "GB", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Suspended", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "GB50782L", - "AVCSO" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "GB507", - "title": "GB Unit Title", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "NotForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "unitOfSaleType": "unit", - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "GB50734D" - ] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "GB50734D" - ] - } - }, - { - "unitName": "GB50782L", - "title": "GB Unit Title", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "unitOfSaleType": "unit", - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID31_metadataAndSuspended.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID31_metadataAndSuspended.JSON deleted file mode 100644 index 15631b23..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID31_metadataAndSuspended.JSON +++ /dev/null @@ -1,192 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-19T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "467ce4a4-1d62-4f56-b359-230518metadatachange003", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Suspended", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "medium", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "Isla Clarion", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "Isla Clarion", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Online Folio", - "unitSize": "medium", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID32_moveAndSuspended.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID32_moveAndSuspended.JSON deleted file mode 100644 index cb140f3a..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID32_moveAndSuspended.JSON +++ /dev/null @@ -1,218 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-ddd1-4f56-b359-69e178d87810", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Suspended", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "unitOfSaleType": "unit", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "MX545010" - ] - } - }, - { - "unitName": "MX509226", - "title": "Playa del Carmen", - "unitType": "AVCS Units Coastal", - "unitOfSaleType": "unit", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "unitOfSaleType": "folio", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID33_NewCell_With2UoS_But_only1_having_addProduct.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID33_NewCell_With2UoS_But_only1_having_addProduct.JSON deleted file mode 100644 index 408c9c56..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID33_NewCell_With2UoS_But_only1_having_addProduct.JSON +++ /dev/null @@ -1,211 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "datacontenttype": "application/json", - "data": { - "correlationId": "dhegtq-1321131-213114f", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "TEMP901", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": true, - "unitOfSaleType": "unit", - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "TEMP901", - "title": "TEMP901 UoS With No addProducts", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "unitOfSaleType": "unit", - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "unitOfSaleType": "folio", - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "unitOfSaleType": "folio", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID34_Cancel&Replace_With_NewCells_having_2UoS_With_addProductValue.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID34_Cancel&Replace_With_NewCells_having_2UoS_With_addProductValue.JSON deleted file mode 100644 index 65a480e3..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID34_Cancel&Replace_With_NewCells_having_2UoS_With_addProductValue.JSON +++ /dev/null @@ -1,485 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT,US4AK6NU", - "datacontenttype": "application/json", - "data": { - "correlationId": "ascd-34ds1-cadskj3-20311", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "St. Michael Bay", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ - "US4AK6NT", - "US4AK6NU" - ], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5AK83M", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NT", - "SART101", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NU.001", - "productName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NU", - "ZARR101", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NU.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NU.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NU_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "SART101", - "title": "SART 101 6NTs SECOND UOS", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT" - ], - "removeProducts": [] - } - }, - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT" - ], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "ZARR101", - "title": "ZARR101 - 6NUs UOS", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitSize": "large", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID35_Cancel&Replace_With_CancelCell_having_2UoS_but_onlyOneAsTypeUnit.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID35_Cancel&Replace_With_CancelCell_having_2UoS_but_onlyOneAsTypeUnit.JSON deleted file mode 100644 index 3366ecfe..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID35_Cancel&Replace_With_CancelCell_having_2UoS_but_onlyOneAsTypeUnit.JSON +++ /dev/null @@ -1,461 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT,US4AK6NU", - "datacontenttype": "application/json", - "data": { - "correlationId": "ascd-34ds1-cadskj3-20311", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "St. Michael Bay", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ - "US4AK6NT", - "US4AK6NU" - ], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5AK83M", - "SWOP102", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NT", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NU.001", - "productName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NU", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NU.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NU.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NU_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "SWOP102", - "title": "SWOP102 UoS With salesType Unit", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT" - ], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitSize": "large", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID36_MoveAndSuspended_With_2UoS_But1_Having_addProductsValue.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID36_MoveAndSuspended_With_2UoS_But1_Having_addProductsValue.JSON deleted file mode 100644 index 08104270..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID36_MoveAndSuspended_With_2UoS_But1_Having_addProductsValue.JSON +++ /dev/null @@ -1,216 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-ddd1-4f56-b359-69e178d87810", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Suspended", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "unitOfSaleType": "unit", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "MX509226", - "title": "Playa del Carmen", - "unitType": "AVCS Units Coastal", - "unitOfSaleType": "unit", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "unitOfSaleType": "folio", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID37_CreateUoSHavingMultipleItemsInAddProducts.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID37_CreateUoSHavingMultipleItemsInAddProducts.JSON deleted file mode 100644 index 9f5ab55a..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID37_CreateUoSHavingMultipleItemsInAddProducts.JSON +++ /dev/null @@ -1,317 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "MX545010,FR5009C", - "datacontenttype": "application/json", - "data": { - "correlationId": "abcd-3hd921-ffd3-1003s", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "FR5009C.001", - "productName": "FR5009C", - "title": "Somewhere Lovely and Warm", - "scale": 100000, - "usageBand": 2, - "editionNumber": 4, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "FR", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 21.0, - "southLimit": 23.0, - "eastLimit": 118.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": false, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "MX509226", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "MX545010" - ] - } - }, - { - "unitName": "MX509226", - "title": "Playa del Carmen", - "unitOfSaleType": "unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010", - "FR5009C" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "FR5009C" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitOfSaleType": "folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "FR5009C" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID38_3AdditionalCoverageCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID38_3AdditionalCoverageCell.JSON deleted file mode 100644 index 77640b0c..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID38_3AdditionalCoverageCell.JSON +++ /dev/null @@ -1,175 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "DE416080", - "datacontenttype": "application/json", - "data": { - "correlationId": "abcd-3hd921-ffd3-1004s", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "DE416080.001", - "productName": "DE416080", - "title": "Greifswalder Bodden", - "scale": 100000, - "usageBand": 4, - "editionNumber": 11, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "DE", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [ "DK4LIMFW", "DK4LIMFX", "DK4LIMFY" ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ "DE416080", "AVCSO", "PAYSF" ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "DE416080", - "title": "Greifswalder Bodden Unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "unitOfSaleType": "unit", - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ "DE416080" ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ "DE416080" ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID39_1AdditionalCoverageWith1CancelledCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID39_1AdditionalCoverageWith1CancelledCell.JSON deleted file mode 100644 index 4cccf18d..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID39_1AdditionalCoverageWith1CancelledCell.JSON +++ /dev/null @@ -1,289 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "DE416080", - "datacontenttype": "application/json", - "data": { - "correlationId": "abcd-3hd921-ffd3-1005s", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "DE416080.001", - "productName": "DE416080", - "title": "Greifswalder Bodden", - "scale": 100000, - "usageBand": 4, - "editionNumber": 11, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "DE", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [ - "DK4LIMFW" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "DE416080", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [ - "DE416080" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NT", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "DE416080", - "title": "Greifswalder Bodden Unit", - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "unitOfSaleType": "unit", - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID3_1NewCellScenario.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID3_1NewCellScenario.JSON deleted file mode 100644 index 62d46a21..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID3_1NewCellScenario.JSON +++ /dev/null @@ -1,190 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-19T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-4f56-b359-230510new003", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": true - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitOfSaleType": "folio", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitSize": "large", - "unitOfSaleType": "folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID40_1AdditionalCoverageWithReplacedCellAnd1CancelledCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID40_1AdditionalCoverageWithReplacedCellAnd1CancelledCell.JSON deleted file mode 100644 index cd1ef546..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID40_1AdditionalCoverageWithReplacedCellAnd1CancelledCell.JSON +++ /dev/null @@ -1,299 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT", - "datacontenttype": "application/json", - "data": { - "correlationId": "abcd-3hd921-ffd3-1006s", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "St. Michael Bay", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ "US4AK6NT" ], - "additionalCoverage": [ "DK4LIMFW" ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ "US5AK83M", "AVCSO", "PAYSF" ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [ "US5AK83M" ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ "US4AK6NT", "AVCSO", "PAYSF" ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - - ], - "removeProducts": [ - - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - - ], - "removeProducts": [ - - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID4_2NewCellScenario.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID4_2NewCellScenario.JSON deleted file mode 100644 index 8c19be39..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID4_2NewCellScenario.JSON +++ /dev/null @@ -1,313 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT,US4AK6NU", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-4f56-b359-230510new004", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NT", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NU.001", - "productName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NU", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NU.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NU.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NU_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT" - ], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID5_1NewCellWoNewAVCSUnit.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID5_1NewCellWoNewAVCSUnit.JSON deleted file mode 100644 index 3a183737..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID5_1NewCellWoNewAVCSUnit.JSON +++ /dev/null @@ -1,198 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-4f56-b359-newcell20001", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": true - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitType": "AVCS Units Coastal", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "MX545010" - ], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID6_2CellsReplace1CellsCancel.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID6_2CellsReplace1CellsCancel.JSON deleted file mode 100644 index cf5b7a29..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID6_2CellsReplace1CellsCancel.JSON +++ /dev/null @@ -1,428 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT,US4AK6NU", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-4f56-b359-canrepcell20001", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "St. Michael Bay", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [ - "US4AK6NT", - "US4AK6NU" - ], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5AK83M", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NT.001", - "productName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NT", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NT.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NT.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NT_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "US4AK6NU.001", - "productName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "scale": 12000, - "usageBand": 6, - "editionNumber": 8, - "updateNumber": 2, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "1", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": true - }, - "replaces": [ - "US5AK83M" - ], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 63, - "southLimit": 63, - "eastLimit": 162, - "westLimit": 161 - } - }, - "inUnitsOfSale": [ - "US4AK6NU", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US4AK6NU.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US4AK6NU.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "US4AK6NU_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "US4AK6NT", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT" - ], - "removeProducts": [] - } - }, - { - "unitName": "US4AK6NU", - "title": "Norton Sound - Alaska", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "ForSale", - "isNewUnitOfSale": true, - "geographicLimit": { - "boundingBox": { - "northLimit": 22.643255, - "southLimit": 22.4625767, - "eastLimit": 120.34972, - "westLimit": 120.219475 - } - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NU" - ], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [ - "US4AK6NT", - "US4AK6NU" - ], - "removeProducts": [ - "US5AK83M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID7_1CellCancel.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID7_1CellCancel.JSON deleted file mode 100644 index a1d6ade0..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID7_1CellCancel.JSON +++ /dev/null @@ -1,197 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2020-10-13T12:08:03.4880776Z", - "subject": "US5AK83M,US4AK6NT,US4AK6NU", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1d62-4f56-b359-canrepcell10001", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "US5AK83M.001", - "productName": "US5AK83M", - "title": "St. Michael Bay", - "scale": 90000, - "usageBand": 5, - "editionNumber": 0, - "updateNumber": 1, - "mayAffectHoldings": true, - "contentChange": true, - "permit": "permitString", - "providerCode": "2", - "providerName": "ICE", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "small", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "US", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Cancellation Update", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "US5AK83M", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "US5AK83M.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "US5AK83M.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GB123_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GB125_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GB162_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "US5AK83M", - "title": "St. Michael Bay", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Units Coastal", - "status": "NotForSale", - "isNewUnitOfSale": false, - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "unitType": "AVCS Online Folio", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [ - "US5AK83M" - ] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID8_2CellMetadataChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID8_2CellMetadataChange.JSON deleted file mode 100644 index 77cea717..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID8_2CellMetadataChange.JSON +++ /dev/null @@ -1,323 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-18T12:08:03.4880776Z", - "subject": "MX545010, MX545012", - "datacontenttype": "application/json", - "data": { - "correlationId": "367ce4a4-1drr-4f56-b359-59e165699231", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": true - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - }, - { - "productType": "ENC S57", - "dataSetName": "MX545012.001", - "productName": "MX545012", - "title": "Isla Clarion - II", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX1", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "Re-issue", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545012", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitType": "AVCS Units Coastal", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "MX545012", - "title": "Isla Clarion-II", - "unitType": "AVCS Units Coastal", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "AVCS Online Folio Some Title", - "unitSize": "large", - "unitType": "AVCS Online Folio", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "World Folio", - "unitType": "AVCS Folio Transit", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "large", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID9_MetadataChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID9_MetadataChange.JSON deleted file mode 100644 index c4d33618..00000000 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID9_MetadataChange.JSON +++ /dev/null @@ -1,192 +0,0 @@ -{ - "specversion": "1.0", - "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.1", - "source": "https://encpublishing.ukho.gov.uk", - "id": "2f03a25f-28b3-46ea-b009-5943250a9a41", - "time": "2023-05-19T12:08:03.4880776Z", - "subject": "MX545010", - "datacontenttype": "application/json", - "data": { - "correlationId": "467ce4a4-1d62-4f56-b359-230518metadatachange003", - "ukhoWeekNumber": { - "year": 2024, - "week": 3, - "currentWeekAlphaCorrection": false - }, - "products": [ - { - "productType": "ENC S57", - "dataSetName": "MX545010.001", - "productName": "MX545010", - "title": "Isla Clarion", - "scale": 90000, - "usageBand": 5, - "editionNumber": 1, - "updateNumber": 0, - "mayAffectHoldings": false, - "contentChange": false, - "permit": "permitString", - "providerCode": "2", - "providerName": "PRIMAR", - "_ENUM": [ - "ICE", - "ICE_GB", - "ICE_UK", - "PRIMAR", - "VAR Unique", - "VAR" - ], - "size": "medium", - "_ENUM": [ - "large", - "medium", - "small" - ], - "agency": "MX", - "bundle": [ - { - "bundleType": "DVD", - "_ENUM": [ - "DVD" - ], - "location": "M1;B1" - } - ], - "status": { - "statusName": "New Edition", - "_ENUM": [ - "New Edition", - "Re-issue", - "Update", - "Cancellation Update", - "Withdrawn", - "Suspended" - ], - "statusDate": "2023-03-03T00:00:00.00+01:00", - "isNewCell": false - }, - "replaces": [], - "replacedBy": [], - "additionalCoverage": [], - "geographicLimit": { - "boundingBox": { - "northLimit": 24.0, - "southLimit": 22.0, - "eastLimit": 120.0, - "westLimit": 119.0 - } - }, - "inUnitsOfSale": [ - "MX545010", - "AVCSO", - "PAYSF" - ], - "s63": { - "name": "XXXXXXXX.001", - "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", - "fileSize": "4500", - "compression": true, - "s57Crc": "5C06E104" - }, - "signature": { - "name": "XXXXXXXX.001", - "hash": "fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9", - "location": "0ecf2f38-a876-4d77-bd0e-0d901d3a0e73", - "fileSize": "2500" - }, - "ancillaryFiles": [ - { - "name": "GBXXXXXXXX_04.TXT", - "hash": "d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b", - "location": "2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5", - "fileSize": "1240" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b", - "location": "1ad0f9c3-8c93-495a-99a1-06a36410faa9", - "fileSize": "1360" - }, - { - "name": "GBXXXXXXXX_01.TXT", - "hash": "81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6", - "location": "eb443aad-394c-4eb0-b391-415a261605a1", - "fileSize": "1360" - } - ] - } - ], - "unitsOfSale": [ - { - "unitName": "MX545010", - "title": "Isla Clarion", - "unitOfSaleType": "unit", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Units Coastal", - "unitSize": "medium", - "status": "ForSale", - "_ENUM": [ - "ForSale", - "NotForSale" - ], - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": { - "northLimit": 24.146815, - "southLimit": 22.581615, - "eastLimit": 120.349635, - "westLimit": 119.39142 - } - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "AVCSO", - "title": "Isla Clarion", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitSize": "medium", - "unitType": "AVCS Folio Transit", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - }, - { - "unitName": "PAYSF", - "title": "Isla Clarion", - "unitOfSaleType": "folio", - "_ENUM": [ - "unit", - "folio" - ], - "unitType": "AVCS Folio Transit", - "unitSize": "medium", - "status": "ForSale", - "isNewUnitOfSale": false, - "geographicLimit": { - "boundingBox": {} - }, - "compositionChanges": { - "addProducts": [], - "removeProducts": [] - } - } - ] - } -} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MandatoryAttributeValidation.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MandatoryAttributeValidation.JSON new file mode 100644 index 00000000..204ffe8d --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MandatoryAttributeValidation.JSON @@ -0,0 +1,295 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "af43f91e-bb8a-4fc6-a376-4919fb601baa", + "time": "2024-09-16T10:27:19.4261971+00:00", + "subject": "PA5AM111,PA5CP007,RU4O5XQ0", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-05334dd0-db09-47a7-9cee-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "PA5AM111.001", + "productName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "scale": 12000, + "usageBand": 5, + "editionNumber": 8, + "updateNumber": 1, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-16", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "PA5CP007" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "PA5AM111.001", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "78094592" + }, + "signature": { + "name": "PAMAM111.001", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "PA5CP007.000", + "productName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "scale": 10000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-06-24", + "isNewCell": true + }, + "replaces": [ + "PA5AM111" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "PA5CP007" + ], + "s63": { + "name": "PA5CP007.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "97348E72" + }, + "signature": { + "name": "PAMCP007.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "RU4O5XQ0.000", + "productName": "RU4O5XQ0", + "title": "Sea of Okhotsk - Shelikhov Gulf - Nayakhanskaya and Varkhalamskaya Inlet", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B4" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-13", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [ + "RU4O0KS9", + "RU4O0YF0", + "RU4O0YK0" + ], + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386746, + "southLimit": 61.6953413, + "eastLimit": 159.5691864, + "westLimit": 158.8358531 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "RU4O5XQ0", + "PAYSF" + ], + "s63": { + "name": "RU4O5XQ0.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "867BA7C2" + }, + "signature": { + "name": "RULO5XQ0.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "PA5AM111" + ] + } + }, + { + "unitName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [] + } + }, + { + "unitName": "RU4O5XQ0", + "title": "Nayakhanskaya-Varkhalamskaya", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386749, + "southLimit": 61.6953416, + "eastLimit": 159.5691747, + "westLimit": 158.8358414 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [ + "PA5AM111" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MoveCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MoveCell.JSON new file mode 100644 index 00000000..798d2d68 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MoveCell.JSON @@ -0,0 +1,152 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "3477185e-06f9-45e1-96fa-b037530dd23b", + "time": "2024-09-15T07:20:59.9766833+00:00", + "subject": "1U319200", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-c4a72836-dad4-4011-d362-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U319200.003", + "productName": "1U319200", + "title": "South China Sea 20N 119E", + "scale": 180000, + "usageBand": 3, + "editionNumber": 1, + "updateNumber": 3, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2023-10-22", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "1U319210" + ], + "s63": { + "name": "1U319200.003", + "hash": "9A3C2DDB319C6E2ADAAF201051DDBD1967F1060DA3C5750B149CAF9DF8109CDA", + "fileSize": 1248, + "compression": true, + "s57Crc": "713B246A" + }, + "signature": { + "name": "1UK19200.003", + "hash": "CA2386DF926CED5A4C9A5B338C17A917B56C146BF5EE7BD0573E3AA8284A9BF1", + "fileSize": 874 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "1U319200", + "title": "South China Sea 20N 119E", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "1U319200" + ] + } + }, + { + "unitName": "1U319210", + "title": "SOUTHEAST OF TAIWAN STRAIT", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "1U319200" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MoveCell_AND_SuspendCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MoveCell_AND_SuspendCell.JSON new file mode 100644 index 00000000..8feb637e --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MoveCell_AND_SuspendCell.JSON @@ -0,0 +1,286 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "e8169781-6694-4525-bdfe-5c8357644260", + "time": "2024-09-15T15:14:13.9851356+00:00", + "subject": "1U320200,1U422220", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-480f1d52-1f24-46f4-d36d-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U320200.000", + "productName": "1U320200", + "title": "SOUTH CHINA SEA 20N 120E", + "scale": 180000, + "usageBand": 3, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2023-04-08", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 121, + "westLimit": 120 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "1U319230" + ], + "s63": { + "name": "1U320200.000", + "hash": "59ECC9B5B74F104BD215C178F497F6A6472FF83205ADCC97A53329DFCAE67576", + "fileSize": 83096, + "compression": true, + "s57Crc": "0BFBF8F2" + }, + "signature": { + "name": "1UK20200.000", + "hash": "49C651BE74FCD2F12F8648F5B1160C39D6769DE0E9DA97D73D22EDF083D08EDA", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U422220.000", + "productName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Suspended", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U422220", + "PAYSF" + ], + "s63": { + "name": "1U422220.000", + "hash": "EC1CCB8B60E700DCD01EB64381041ED5AE6EA7BB7BB43412A06CE7C5E11DFBDE", + "fileSize": 24464, + "compression": true, + "s57Crc": "D1DAE0F9" + }, + "signature": { + "name": "1UL22220.000", + "hash": "5A1FACDA6749F4702ED8E781269E7767D83F9DEFBD367DBD9CFD697DEED1EE7C", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U422220.001", + "productName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 1, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Suspended", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U422220", + "PAYSF" + ], + "s63": { + "name": "1U422220.001", + "hash": "5B47E3E84BADA31DB935F30C0368B62C07C6238CDB9E9FA35DAA93A4C0C02502", + "fileSize": 1592, + "compression": true, + "s57Crc": "0074B3C0" + }, + "signature": { + "name": "1UL22220.001", + "hash": "51C62DA431BAACA9F86725CFD333F38025BF54E629AA6D0A8BFBE4B16F94B2EF", + "fileSize": 874 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "1U319230", + "title": "PENGHU ISLANDS AND PASSAGES", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 24, + "southLimit": 23, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "1U320200" + ], + "removeProducts": [] + } + }, + { + "unitName": "1U320200", + "title": "SOUTH CHINA SEA 20N 120E", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 121, + "westLimit": 120 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "1U320200" + ] + } + }, + { + "unitName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MultipleCellsInSingleUnit.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MultipleCellsInSingleUnit.JSON new file mode 100644 index 00000000..2f61c625 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/MultipleCellsInSingleUnit.JSON @@ -0,0 +1,313 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "c2629852-244f-468a-9f29-cdffcd887419", + "time": "2024-09-15T15:39:20.0447528+00:00", + "subject": "1U318200,1U318210,1U318220", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-5b2ff20c-9e36-43d4-d36e-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U318200.000", + "productName": "1U318200", + "title": "SOUTH CHINA SEA 20N 118E", + "scale": 180000, + "usageBand": 3, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2021-09-23", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 119, + "westLimit": 118 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U318200", + "PAYSF", + "1U420243" + ], + "s63": { + "name": "1U318200.000", + "hash": "353C8AF05F6545ED3854481B38A859A451C83CFB186703F82EF0B0B7FF95EF61", + "fileSize": 19672, + "compression": true, + "s57Crc": "7F64CA4B" + }, + "signature": { + "name": "1UK18200.000", + "hash": "8AB9C8D058E867CE958EA06DEF80956294B27E5BF48B517312908194041DE321", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U318210.005", + "productName": "1U318210", + "title": "BETWEEN DONGSHA AND KAOHSIUNG", + "scale": 180000, + "usageBand": 3, + "editionNumber": 1, + "updateNumber": 5, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2024-07-08", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21, + "eastLimit": 119, + "westLimit": 118 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U318210", + "PAYSF", + "1U420243" + ], + "s63": { + "name": "1U318210.005", + "hash": "7B4F2D2D120580DFD2EB80BBF98A400325963521C39262CB09594D011760C27E", + "fileSize": 1216, + "compression": true, + "s57Crc": "8EAEF9B0" + }, + "signature": { + "name": "1UK18210.005", + "hash": "BD348FE73FB49D00646BD0522C9A144D3994FA32578EBD1CB70BFEF1940F088C", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U318220.000", + "productName": "1U318220", + "title": "South China Sea Taiwan Bank", + "scale": 180000, + "usageBand": 3, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2023-08-24", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 23, + "southLimit": 22, + "eastLimit": 119, + "westLimit": 118 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U318220", + "PAYSF", + "1U420243" + ], + "s63": { + "name": "1U318220.000", + "hash": "9BDC34BBCE75137B95624BAA46E100E018BFA43C905E2266D3B7F5D0E039F3D3", + "fileSize": 109664, + "compression": true, + "s57Crc": "0DE0BA19" + }, + "signature": { + "name": "1UK18220.000", + "hash": "F6AD0C76FCDF4B344AED7677A078E7C9725EEFE1BFEC55399A5324CCC53D19AB", + "fileSize": 874 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "1U318200", + "title": "SOUTH CHINA SEA 20N 118E", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 119, + "westLimit": 118 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "1U318210", + "title": "BETWEEN DONGSHA AND KAOHSIUNG", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21, + "eastLimit": 119, + "westLimit": 118 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "1U318220", + "title": "South China Sea Taiwan Bank", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 23, + "southLimit": 22, + "eastLimit": 119, + "westLimit": 118 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "1U420243", + "title": "Tongxiao To Jiugang Roadstead", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 25, + "southLimit": 24.5, + "eastLimit": 121, + "westLimit": 120.5 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "1U318200", + "1U318210", + "1U318220" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell.JSON new file mode 100644 index 00000000..68a313ed --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell.JSON @@ -0,0 +1,139 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "f206ec1c-0b83-43a2-b11c-cca1d981c2a4", + "time": "2024-09-13T05:34:42.4904747+00:00", + "subject": "US5AK9DI", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-5004bc72-5beb-42c1-5037-08dcc74c342e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5AK9DI.000", + "productName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-11", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK9DI" + ], + "s63": { + "name": "US5AK9DI.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8A46B83F" + }, + "signature": { + "name": "USMAK9DI.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US213DIA.TXT", + "hash": "4E3E678781D95F476C0D099375A71A81FC5570C9D92C6DFFC93EF2C11A029632", + "fileSize": 4008 + }, + { + "name": "US213DIB.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_CancelCellWithNewCellReplacement.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_CancelCellWithNewCellReplacement.JSON new file mode 100644 index 00000000..c42f7a3f --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_CancelCellWithNewCellReplacement.JSON @@ -0,0 +1,315 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "7f2dc818-ba2a-4425-a2a5-a0506c919721", + "time": "2024-09-16T09:23:01.1723887+00:00", + "subject": "GB4DEWRB,PA5AM111,PA5CP007", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-8fa72b0a-4200-4363-9d00-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "GB4DEWRB.000", + "productName": "GB4DEWRB", + "title": "Blyth", + "scale": 22000, + "usageBand": 4, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-06-25", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 55.2, + "southLimit": 55.1, + "eastLimit": -1.4, + "westLimit": -1.6 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "GB4DEWRB" + ], + "s63": { + "name": "GB4DEWRB.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8E514740" + }, + "signature": { + "name": "GBLDEWRB.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "GBC8XXXX.TXT", + "hash": "B9F8D94A0D29EA8C3900888A1DF074C52E54283EB5F426F41F23775A95336A83", + "fileSize": 316 + }, + { + "name": "GBG1DXXX.TXT", + "hash": "0DD997E018EBBC272E8965DC8265DAF51A78B83AEB8EF400C6E09381128EE4AA", + "fileSize": 376 + }, + { + "name": "GBZ1CXXX.TXT", + "hash": "08BFF1A5943B0F6D7E76357AEF42465A890FA75DB1ECEBC6029C56F20824BB66", + "fileSize": 183 + }, + { + "name": "GB1B0008.TXT", + "hash": "010FE195151EBBFD38967A4D2A3A421B9BF38D8C6A8C4454EAAF2EFADAE9D912", + "fileSize": 194 + } + ] + }, + { + "dataSetName": "PA5AM111.001", + "productName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "scale": 12000, + "usageBand": 5, + "editionNumber": 8, + "updateNumber": 1, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-16", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "PA5CP007" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "PA5AM111.001", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "78094592" + }, + "signature": { + "name": "PAMAM111.001", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "PA5CP007.000", + "productName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "scale": 10000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-06-24", + "isNewCell": true + }, + "replaces": [ + "PA5AM111" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "PA5CP007" + ], + "s63": { + "name": "PA5CP007.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "97348E72" + }, + "signature": { + "name": "PAMCP007.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "PA5AM111", + "title": "Bahia Manzanillo Port Terminals", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "PA5AM111" + ] + } + }, + { + "unitName": "PA5CP007", + "title": "Bah\u00EDa Manzanillo Port Terminal", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 9.4368333, + "southLimit": 9.3043269, + "eastLimit": -79.8700001, + "westLimit": -79.9022423 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "PA5CP007" + ], + "removeProducts": [] + } + }, + { + "unitName": "GB4DEWRB", + "title": "Blyth", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 55.2, + "southLimit": 55.1, + "eastLimit": -1.4, + "westLimit": -1.6 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "GB4DEWRB" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "GB4DEWRB", + "PA5CP007" + ], + "removeProducts": [ + "PA5AM111" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_MoveCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_MoveCell.JSON new file mode 100644 index 00000000..5d5b5604 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_MoveCell.JSON @@ -0,0 +1,241 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "b70ff9f9-6fac-4038-9514-ef30edfd37be", + "time": "2024-09-15T07:24:13.227929+00:00", + "subject": "1U319200,US5AK2AX", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-f0236332-2a45-49f3-d363-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U319200.003", + "productName": "1U319200", + "title": "South China Sea 20N 119E", + "scale": 180000, + "usageBand": 3, + "editionNumber": 1, + "updateNumber": 3, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2023-10-22", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "1U319210" + ], + "s63": { + "name": "1U319200.003", + "hash": "9A3C2DDB319C6E2ADAAF201051DDBD1967F1060DA3C5750B149CAF9DF8109CDA", + "fileSize": 1248, + "compression": true, + "s57Crc": "713B246A" + }, + "signature": { + "name": "1UK19200.003", + "hash": "CA2386DF926CED5A4C9A5B338C17A917B56C146BF5EE7BD0573E3AA8284A9BF1", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "US5AK2AX.000", + "productName": "US5AK2AX", + "title": "Burnett Inlet AK", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-02", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 56.1, + "southLimit": 56.025, + "eastLimit": -132.45, + "westLimit": -132.6 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK2AX" + ], + "s63": { + "name": "US5AK2AX.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "CD8C994B" + }, + "signature": { + "name": "USMAK2AX.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US206AXA.TXT", + "hash": "5DB4326DAA120A113B5EC826F77160415F6CBBAC21C838FFB4678E5828826EA1", + "fileSize": 5102 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK2AX", + "title": "Burnett Inlet AK", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 56.1, + "southLimit": 56.025, + "eastLimit": -132.45, + "westLimit": -132.6 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK2AX" + ], + "removeProducts": [] + } + }, + { + "unitName": "1U319200", + "title": "South China Sea 20N 119E", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "1U319200" + ] + } + }, + { + "unitName": "1U319210", + "title": "SOUTHEAST OF TAIWAN STRAIT", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "1U319200" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK2AX" + ], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_UoSMetadataChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_UoSMetadataChange.JSON new file mode 100644 index 00000000..f547da8e --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_UoSMetadataChange.JSON @@ -0,0 +1,173 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "d1c15863-ba42-49be-a5f5-70f27e746840", + "time": "2024-09-16T10:15:45.9956382+00:00", + "subject": "GB4DEWRB", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-4d530738-f1c0-4350-667e-08dcd62fd4ae", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "GB4DEWRB.000", + "productName": "GB4DEWRB", + "title": "Blyth", + "scale": 22000, + "usageBand": 4, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-06-25", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 55.2, + "southLimit": 55.1, + "eastLimit": -1.4, + "westLimit": -1.6 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "GB4DEWRB" + ], + "s63": { + "name": "GB4DEWRB.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8E514740" + }, + "signature": { + "name": "GBLDEWRB.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "GBC8XXXX.TXT", + "hash": "B9F8D94A0D29EA8C3900888A1DF074C52E54283EB5F426F41F23775A95336A83", + "fileSize": 316 + }, + { + "name": "GBG1DXXX.TXT", + "hash": "0DD997E018EBBC272E8965DC8265DAF51A78B83AEB8EF400C6E09381128EE4AA", + "fileSize": 376 + }, + { + "name": "GBZ1CXXX.TXT", + "hash": "08BFF1A5943B0F6D7E76357AEF42465A890FA75DB1ECEBC6029C56F20824BB66", + "fileSize": 183 + }, + { + "name": "GB1B0008.TXT", + "hash": "010FE195151EBBFD38967A4D2A3A421B9BF38D8C6A8C4454EAAF2EFADAE9D912", + "fileSize": 194 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "1U320210", + "title": "WATERS SOUTHWARD OF TAIWAN", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21, + "eastLimit": 121, + "westLimit": 120 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "GB4DEWRB", + "title": "Blyth", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 55.2, + "southLimit": 55.1, + "eastLimit": -1.4, + "westLimit": -1.6 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "GB4DEWRB" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "GB4DEWRB" + ], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_UpdateCell_AND_CellMetadataChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_UpdateCell_AND_CellMetadataChange.JSON new file mode 100644 index 00000000..c970c7a0 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/NewCell_AND_UpdateCell_AND_CellMetadataChange.JSON @@ -0,0 +1,307 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "3cd90e2d-9b62-4ce6-b741-2554e1cf957d", + "time": "2024-09-16T09:17:27.7563358+00:00", + "subject": "1U318200,BR400304,GB4DEWRB", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-da3fad32-b60a-4de6-6679-08dcd62fd4ae", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U318200.000", + "productName": "1U318200", + "title": "SOUTH CHINA SEA 20N 118E", + "scale": 180000, + "usageBand": 3, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2021-09-23", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 119, + "westLimit": 118 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U318200", + "PAYSF" + ], + "s63": { + "name": "1U318200.000", + "hash": "353C8AF05F6545ED3854481B38A859A451C83CFB186703F82EF0B0B7FF95EF61", + "fileSize": 19672, + "compression": true, + "s57Crc": "7F64CA4B" + }, + "signature": { + "name": "1UK18200.000", + "hash": "8AB9C8D058E867CE958EA06DEF80956294B27E5BF48B517312908194041DE321", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "BR400304.000", + "productName": "BR400304", + "title": "De Mosqueiro a Vila do Conde", + "scale": 45000, + "usageBand": 4, + "editionNumber": 14, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-09", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": -1, + "southLimit": -1.8333333, + "eastLimit": -48.4166667, + "westLimit": -49.0166667 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "BR400304", + "PAYSF" + ], + "s63": { + "name": "BR400304.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "2C842B6D" + }, + "signature": { + "name": "BRL00304.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "GB4DEWRB.000", + "productName": "GB4DEWRB", + "title": "Blyth", + "scale": 22000, + "usageBand": 4, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-06-25", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 55.2, + "southLimit": 55.1, + "eastLimit": -1.4, + "westLimit": -1.6 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "GB4DEWRB" + ], + "s63": { + "name": "GB4DEWRB.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8E514740" + }, + "signature": { + "name": "GBLDEWRB.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "GBC8XXXX.TXT", + "hash": "B9F8D94A0D29EA8C3900888A1DF074C52E54283EB5F426F41F23775A95336A83", + "fileSize": 316 + }, + { + "name": "GBG1DXXX.TXT", + "hash": "0DD997E018EBBC272E8965DC8265DAF51A78B83AEB8EF400C6E09381128EE4AA", + "fileSize": 376 + }, + { + "name": "GBZ1CXXX.TXT", + "hash": "08BFF1A5943B0F6D7E76357AEF42465A890FA75DB1ECEBC6029C56F20824BB66", + "fileSize": 183 + }, + { + "name": "GB1B0008.TXT", + "hash": "010FE195151EBBFD38967A4D2A3A421B9BF38D8C6A8C4454EAAF2EFADAE9D912", + "fileSize": 194 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "1U318200", + "title": "SOUTH CHINA SEA 20N 118E", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 21, + "southLimit": 20, + "eastLimit": 119, + "westLimit": 118 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "BR400304", + "title": "De Mosqueiro a Abaetuba", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": -1, + "southLimit": -1.8333333, + "eastLimit": -48.4166667, + "westLimit": -49.0166667 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "GB4DEWRB", + "title": "Blyth", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 55.2, + "southLimit": 55.1, + "eastLimit": -1.4, + "westLimit": -1.6 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "GB4DEWRB" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "GB4DEWRB" + ], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/Re-issue.json b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/Re-issue.json new file mode 100644 index 00000000..f3a645b2 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/Re-issue.json @@ -0,0 +1,125 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "00000000-0000-0000-0000-000000000000", + "time": "1970-01-01T00:00:00+00:00", + "subject": "NewChartIsAReissue", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-1bdfc9dd-9f4c-4c52-a32e-b2a924b7d5b6", + "ukhoWeekNumber": { + "year": 2024, + "week": 9, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "GB1REISS.000", + "productName": "GB1REISS", + "title": "Not specified", + "scale": 0, + "usageBand": 1, + "editionNumber": 10, + "updateNumber": 3, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-03-09", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 38, + "southLimit": 37, + "eastLimit": 140, + "westLimit": 139 + } + }, + "inUnitsOfSale": [ + "PAYSF", + "GB1REISS" + ], + "s63": { + "name": "GB1REISS.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "" + }, + "signature": { + "name": "GBIREISS.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "GB1REISS", + "title": "Not specified", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Overview", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 38, + "southLimit": 37, + "eastLimit": 140, + "westLimit": 139 + } + }, + "compositionChanges": { + "addProducts": [ + "GB1REISS" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "", + "unitType": "AVCS Folio Transit", + "providerCode": "", + "providerName": "", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + } + }, + "compositionChanges": { + "addProducts": [ + "GB1REISS" + ], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/SuspendCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/SuspendCell.JSON new file mode 100644 index 00000000..50e83f50 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/SuspendCell.JSON @@ -0,0 +1,179 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "b5a0a0bb-5960-4b09-8106-d8bbc13d4fe8", + "time": "2024-09-15T14:50:49.6732836+00:00", + "subject": "1U422220", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-ce255314-285c-4334-d367-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U422220.000", + "productName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Suspended", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U422220", + "PAYSF" + ], + "s63": { + "name": "1U422220.000", + "hash": "EC1CCB8B60E700DCD01EB64381041ED5AE6EA7BB7BB43412A06CE7C5E11DFBDE", + "fileSize": 24464, + "compression": true, + "s57Crc": "D1DAE0F9" + }, + "signature": { + "name": "1UL22220.000", + "hash": "5A1FACDA6749F4702ED8E781269E7767D83F9DEFBD367DBD9CFD697DEED1EE7C", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U422220.001", + "productName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 1, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Suspended", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U422220", + "PAYSF" + ], + "s63": { + "name": "1U422220.001", + "hash": "5B47E3E84BADA31DB935F30C0368B62C07C6238CDB9E9FA35DAA93A4C0C02502", + "fileSize": 1592, + "compression": true, + "s57Crc": "0074B3C0" + }, + "signature": { + "name": "1UL22220.001", + "hash": "51C62DA431BAACA9F86725CFD333F38025BF54E629AA6D0A8BFBE4B16F94B2EF", + "fileSize": 874 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/SuspendCell_AND_WithdrawCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/SuspendCell_AND_WithdrawCell.JSON new file mode 100644 index 00000000..f7558ead --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/SuspendCell_AND_WithdrawCell.JSON @@ -0,0 +1,259 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "637c52e2-d49c-4a78-97f8-66075ef90a25", + "time": "2024-09-15T14:53:46.0298641+00:00", + "subject": "1U422220,1U661901", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-adc4f2cd-88b9-4405-d368-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U422220.000", + "productName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Suspended", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U422220", + "PAYSF" + ], + "s63": { + "name": "1U422220.000", + "hash": "EC1CCB8B60E700DCD01EB64381041ED5AE6EA7BB7BB43412A06CE7C5E11DFBDE", + "fileSize": 24464, + "compression": true, + "s57Crc": "D1DAE0F9" + }, + "signature": { + "name": "1UL22220.000", + "hash": "5A1FACDA6749F4702ED8E781269E7767D83F9DEFBD367DBD9CFD697DEED1EE7C", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U422220.001", + "productName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 1, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Suspended", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "1U422220", + "PAYSF" + ], + "s63": { + "name": "1U422220.001", + "hash": "5B47E3E84BADA31DB935F30C0368B62C07C6238CDB9E9FA35DAA93A4C0C02502", + "fileSize": 1592, + "compression": true, + "s57Crc": "0074B3C0" + }, + "signature": { + "name": "1UL22220.001", + "hash": "51C62DA431BAACA9F86725CFD333F38025BF54E629AA6D0A8BFBE4B16F94B2EF", + "fileSize": 874 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "1U661901.002", + "productName": "1U661901", + "title": "MATSU NANGAN FU\u0027AO BAY", + "scale": 2500, + "usageBand": 6, + "editionNumber": 2, + "updateNumber": 2, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Withdrawn", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 26.1725, + "southLimit": 26.1525, + "eastLimit": 119.9445, + "westLimit": 119.93 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "1U661901.002", + "hash": "1E7D573F21F14E243B077382DE5C81DA53F9714E4E889B73BDB9C0CFD9983844", + "fileSize": 1224, + "compression": true, + "s57Crc": "DA9CE4FC" + }, + "signature": { + "name": "1UN61901.002", + "hash": "E3636ED6877B5B6BD3A7DAE790592E4B18E9B96668232ADB2AE510895923FBE1", + "fileSize": 874 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "1U661901", + "title": "MATSU NANGAN FUAO BAY", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Berthing", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 26.1725, + "southLimit": 26.1525, + "eastLimit": 119.9445, + "westLimit": 119.93 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "1U661901" + ] + } + }, + { + "unitName": "1U422220", + "title": "WATERS EASTWARD OF LANYU", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22.5, + "southLimit": 22, + "eastLimit": 122.5, + "westLimit": 122 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "1U661901" + ] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UoSMetadataChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UoSMetadataChange.JSON new file mode 100644 index 00000000..5ed9f502 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UoSMetadataChange.JSON @@ -0,0 +1,44 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "bc1d32d7-802a-47b2-9e3c-1c2ce7a99ec8", + "time": "2024-09-11T13:17:44.6924191+00:00", + "subject": "Units 1U319210", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-d3a2fc8c-aa69-42a9-6e5a-08dccb3abf10", + "ukhoWeekNumber": { + "year": 2024, + "week": 32, + "currentWeekAlphaCorrection": false + }, + "products": [], + "unitsOfSale": [ + { + "unitName": "1U319210", + "title": "SOUTHEAST OF TAIWAN STRAIT edit", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Coastal", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 22, + "southLimit": 21, + "eastLimit": 120, + "westLimit": 119 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCell.JSON new file mode 100644 index 00000000..05336809 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCell.JSON @@ -0,0 +1,124 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "6c475a0c-5b97-4ed7-a95d-3008e98f1520", + "time": "2024-09-16T10:03:04.1978804+00:00", + "subject": "AU421115", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-b28a8274-444a-4d5a-9d10-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "AU421115.003", + "productName": "AU421115", + "title": "Australia - Western Australia - Montebello Islands - Montebello Islands and Barrow Island", + "scale": 180000, + "usageBand": 4, + "editionNumber": 19, + "updateNumber": 3, + "mayAffectHoldings": false, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "small", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B7" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2024-07-17", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": -20, + "southLimit": -21, + "eastLimit": 116, + "westLimit": 115 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "AU421115", + "PAYSF" + ], + "s63": { + "name": "AU421115.003", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "9CED2216" + }, + "signature": { + "name": "AUL21115.003", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "AU421115", + "title": "Montebello and Barrow Islands", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": -20, + "southLimit": -21, + "eastLimit": 116, + "westLimit": 115 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCellWithNewEdition.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCellWithNewEdition.JSON new file mode 100644 index 00000000..a2432cf0 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCellWithNewEdition.JSON @@ -0,0 +1,145 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "62eb4f8d-565d-4278-bec9-089a55573bf0", + "time": "2024-09-15T07:07:57.2872564+00:00", + "subject": "AU5BNE02", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-381dacdd-59c5-4864-9cbf-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "AU5BNE02.000", + "productName": "AU5BNE02", + "title": "Australia - Queensland - Brisbane Moreton Bay Entrance to Main Channel", + "scale": 12000, + "usageBand": 5, + "editionNumber": 8, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B7" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-12", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": -26.6965181, + "southLimit": -27.1058175, + "eastLimit": 153.3234716, + "westLimit": 153.1289756 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "AU5BNE02", + "PAYSF" + ], + "s63": { + "name": "AU5BNE02.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "6BCE8243" + }, + "signature": { + "name": "AUMBNE02.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "AU714_02.TXT", + "hash": "EBBBC65BB11F9BADC9376E85EE554FA89585A2688A86060F755D6365EA6DD5F7", + "fileSize": 241 + }, + { + "name": "AU057_06.TXT", + "hash": "C18AF9B651C3CD2EE2A1BD5BA9AE1EBD0B9355628E7BA1F2E0918925D13837BE", + "fileSize": 326 + }, + { + "name": "AU168_04.TXT", + "hash": "7EE119E447FCF02FD43345800ACCD24AB87939F702F98051C369A31001B6E143", + "fileSize": 261 + }, + { + "name": "AU776_01.TXT", + "hash": "C34C13D3280DBCAC5B022900F3817893EEDBDD644C7AA87E0F5198FA64A9393C", + "fileSize": 232 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "AU5BNE02", + "title": "Moreton Bay Entrance Main Chan.", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": -26.6965181, + "southLimit": -27.1058175, + "eastLimit": 153.3234716, + "westLimit": 153.1289756 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCellsWithDifferentStatusName.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCellsWithDifferentStatusName.JSON new file mode 100644 index 00000000..f9dc2510 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/UpdateCellsWithDifferentStatusName.JSON @@ -0,0 +1,203 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "ffed075f-526c-4dbc-ab21-2930ae9f185c", + "time": "2024-09-16T10:04:24.3168914+00:00", + "subject": "AU421115,DE5NOLIS", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-b28a8274-444a-4d5a-9d10-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "AU421115.003", + "productName": "AU421115", + "title": "Australia - Western Australia - Montebello Islands - Montebello Islands and Barrow Island", + "scale": 180000, + "usageBand": 4, + "editionNumber": 19, + "updateNumber": 3, + "mayAffectHoldings": false, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "small", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B7" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2024-07-17", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": -20, + "southLimit": -21, + "eastLimit": 116, + "westLimit": 115 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "AU421115", + "PAYSF" + ], + "s63": { + "name": "AU421115.003", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "9CED2216" + }, + "signature": { + "name": "AUL21115.003", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "DE5NOLIS.000", + "productName": "DE5NOLIS", + "title": "List", + "scale": 4000, + "usageBand": 5, + "editionNumber": 3, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": true, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B8" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-10", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 55.0333333, + "southLimit": 55, + "eastLimit": 8.45, + "westLimit": 8.4333333 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "DE5NOLIS", + "PAYSF" + ], + "s63": { + "name": "DE5NOLIS.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "F776B698" + }, + "signature": { + "name": "DEMNOLIS.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "DE5NOLIS", + "title": "List", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 55.0333333, + "southLimit": 55, + "eastLimit": 8.45, + "westLimit": 8.4333333 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "AU421115", + "title": "Montebello and Barrow Islands", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": -20, + "southLimit": -21, + "eastLimit": 116, + "westLimit": 115 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID1_WebhookPayload.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/WebhookPayload.JSON similarity index 90% rename from tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID1_WebhookPayload.JSON rename to tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/WebhookPayload.JSON index 817865f0..c3baaf9b 100644 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/ID1_WebhookPayload.JSON +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/WebhookPayload.JSON @@ -7,7 +7,7 @@ "subject": "MX545010", "datacontenttype": "application/json", "data": { - "correlationId": "367ce4a4-1d62-4f56-b359-59e178dsk24", + "correlationId": "ft-367ce4a4-1d62-4f56-b359-59e178dsk24", "ukhoWeekNumber": { "year": 2024, "week": 3, @@ -15,7 +15,6 @@ }, "products": [ { - "productType": "ENC S57", "dataSetName": "MX545010.001", "productName": "MX545010", "title": "Isla Clarion", @@ -25,7 +24,7 @@ "updateNumber": 0, "mayAffectHoldings": true, "contentChange": false, - "permit": "permitString", + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", "providerCode": "1", "providerName": "ICE", "_ENUM": [ @@ -42,7 +41,6 @@ "medium", "small" ], - "agency": "MX", "bundle": [ { "bundleType": "DVD", @@ -74,7 +72,8 @@ "southLimit": 22.0, "eastLimit": 120.0, "westLimit": 119.0 - } + }, + "polygons": [] }, "inUnitsOfSale": [ "MX545010", @@ -85,7 +84,6 @@ "s63": { "name": "XXXXXXXX.001", "hash": "5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea", - "location": "8198201e-78ce-4af8-9145-ad68ba0472e2", "fileSize": "4500", "compression": true, "s57Crc": "5C06E104" @@ -125,6 +123,8 @@ "unitOfSaleType": "unit", "unitSize": "large", "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", "status": "ForSale", "_ENUM": [ "ForSale", @@ -137,7 +137,8 @@ "southLimit": 22.581615, "eastLimit": 120.349635, "westLimit": 119.39142 - } + }, + "polygons": [] }, "compositionChanges": { "addProducts": [], @@ -152,6 +153,8 @@ "unitOfSaleType": "unit", "unitSize": "large", "unitType": "AVCS Units Coastal", + "providerCode": "2", + "providerName": "PRIMAR", "status": "ForSale", "_ENUM": [ "ForSale", @@ -164,7 +167,8 @@ "southLimit": 22.581615, "eastLimit": 120.349635, "westLimit": 119.39142 - } + }, + "polygons": [] }, "compositionChanges": { "addProducts": [ @@ -179,10 +183,13 @@ "unitOfSaleType": "folio", "unitSize": "large", "unitType": "AVCS Online Folio", + "providerCode": "2", + "providerName": "PRIMAR", "status": "ForSale", "isNewUnitOfSale": false, "geographicLimit": { - "boundingBox": {} + "boundingBox": {}, + "polygons": [] }, "compositionChanges": { "addProducts": [], @@ -195,10 +202,13 @@ "unitOfSaleType": "folio", "unitSize": "large", "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", "status": "ForSale", "isNewUnitOfSale": false, "geographicLimit": { - "boundingBox": {} + "boundingBox": {}, + "polygons": [] }, "compositionChanges": { "addProducts": [], diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/WithdrawCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/WithdrawCell.JSON new file mode 100644 index 00000000..5ebc7b07 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/WithdrawCell.JSON @@ -0,0 +1,125 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "953e1a9b-f000-444c-bb9a-0859286a9405", + "time": "2024-09-15T14:52:32.7302361+00:00", + "subject": "1U661901", + "datacontenttype": "application/json", + "data": { + "correlationId": "ft-adc4f2cd-88b9-4405-d368-08dcd31236c8", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "1U661901.002", + "productName": "1U661901", + "title": "MATSU NANGAN FU\u0027AO BAY", + "scale": 2500, + "usageBand": 6, + "editionNumber": 2, + "updateNumber": 2, + "mayAffectHoldings": true, + "contentChange": false, + "permit": "ThisWillBeReplacedWithActualPermitFromKeyvault", + "providerCode": "2", + "providerName": "PRIMAR", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B2" + } + ], + "status": { + "statusName": "Withdrawn", + "statusDate": "2024-09-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 26.1725, + "southLimit": 26.1525, + "eastLimit": 119.9445, + "westLimit": 119.93 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "1U661901.002", + "hash": "1E7D573F21F14E243B077382DE5C81DA53F9714E4E889B73BDB9C0CFD9983844", + "fileSize": 1224, + "compression": true, + "s57Crc": "DA9CE4FC" + }, + "signature": { + "name": "1UN61901.002", + "hash": "E3636ED6877B5B6BD3A7DAE790592E4B18E9B96668232ADB2AE510895923FBE1", + "fileSize": 874 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "1U661901", + "title": "MATSU NANGAN FUAO BAY", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Berthing", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 26.1725, + "southLimit": 26.1525, + "eastLimit": 119.9445, + "westLimit": 119.93 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "1U661901" + ] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "2", + "providerName": "PRIMAR", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "1U661901" + ] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/WebhookScenarios.cs b/tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/WebhookScenarios.cs index 99d182b1..3b0260e7 100644 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/WebhookScenarios.cs +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/WebhookScenarios.cs @@ -12,6 +12,7 @@ public class WebhookScenarios { private WebhookEndpoint WebhookEndpoint { get; set; } private readonly ADAuthTokenProvider _authToken = new(); + private readonly string _projectDir = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory)); //for local //private readonly string _projectDir = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, "..\\..\\..")); @@ -55,74 +56,85 @@ public async Task WhenValidEventInNewEncContentPublishedEventReceivedWithTokenHa [Test, Order(1)] //New Cell - [TestCase("ID3_1NewCellScenario.JSON", "Y", "SamePermitKey", TestName = "WhenICallTheWebhookWithOneNewCellScenario_ThenWebhookReturns200Response")] - [TestCase("ID4_2NewCellScenario.JSON", "N", "DifferentPermitKey", TestName = "WhenICallTheWebhookWithTwoNewCellScenario_ThenWebhookReturns200Response")] - [TestCase("ID5_1NewCellWoNewAVCSUnit.JSON", "Y", "SamePermitKey", TestName = "WhenICallTheWebhookWithOneNewCellScenarioWithourAVCSUoS_ThenWebhookReturns200Response")] + [TestCase("NewCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithNewCellScenario_ThenWebhookReturns200Response")] + [TestCase("2NewCells.JSON", "PermitWithDifferentKey", TestName = "WhenICallTheWebhookWith2NewCellsScenario_ThenWebhookReturns200Response")] + + //Additional Coverage + [TestCase("3AdditionalCoverageCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWith3AdditionalCoverageCellScenario_ThenWebhookReturns200Response")] + [TestCase("3AdditionalCoverageCell_AND_CancelCellWithNewCellReplacement.JSON", "PermitWithDifferentKey", TestName = "WhenICallTheWebhookWith3AdditionalCoverageCell_AND_CancelCellWithNewCellReplacementScenario_ThenWebhookReturns200Response")] + [TestCase("AdditionalCoverageWithNewEdition.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithAdditionalCoverageWithNewEditionScenario_ThenWebhookReturns200Response")] - //Cancel & Replace - [TestCase("ID6_2CellsReplace1CellsCancel.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithTwoCellsReplacesOneCellScenario_ThenWebhookReturns200Response")] - [TestCase("ID7_1CellCancel.JSON", "N", TestName = "WhenICallTheWebhookWithOneCancelCellScenario_ThenWebhookReturns200Response")] + //Cancel and Replace + [TestCase("CancelCellWithExistingCellReplacement.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithCancelCellWithExistingCellReplacementScenario_ThenWebhookReturns200Response")] + [TestCase("CancelCellWithNewCellReplacement.JSON", "PermitWithDifferentKey", TestName = "WhenICallTheWebhookWithCancelCellWithNewCellReplacementScenario_ThenWebhookReturns200Response")] + [TestCase("CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithCancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCellScenario_ThenWebhookReturns200Response")] + [TestCase("CancelCellWithNewCellReplacement_AND_UpdateCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithCancelCellWithNewCellReplacement_AND_UpdateCellScenario_ThenWebhookReturns200Response")] + [TestCase("CancelCellWithoutCellReplacement.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithCancelCellWithoutCellReplacementScenario_ThenWebhookReturns200Response")] //Metadata Change - [TestCase("ID8_2CellMetadataChange.JSON", "Y", TestName = "WhenICallTheWebhookWith2CellMetadataChangeScenario_ThenWebhookReturns200Response")] - [TestCase("ID9_MetadataChange.JSON", "N", TestName = "WhenICallTheWebhookWithMetadataChangeScenario_ThenWebhookReturns200Response")] - - //Update - [TestCase("ID10_UpdateSimple.JSON", "Y", "SamePermitKey", TestName = "WhenICallTheWebhookWithSimpleUpdateScenarioHavingOneCellWithStatusNameAsUpdate_ThenWebhookReturns200Response")] - [TestCase("ID11_updateOneCellWithNewEditionStatus.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithSimpleUpdateScenarioHavingOneCellWithStatusNameAsNewEdition_ThenWebhookReturns200Response")] - [TestCase("ID12_updateOneCellWithReIssueStatus.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithSimpleUpdateScenarioHavingOneCellStatusNameAsReIssue_ThenWebhookReturns200Response")] - [TestCase("ID13_updateTwoCellsWithDifferentStatusName.JSON", "N", "DifferentPermitKey", TestName = "WhenICallTheWebhookWithSimpleUpdateScenarioHavingTwoCellsWithDifferentStatusName_ThenWebhookReturns200Response")] - - //Move Cell - [TestCase("ID14_moveOneCell.JSON", "Y", TestName = "WhenICallTheWebhookWithSimpleMoveCellScenario_ThenWebhookReturns200Response")] - [TestCase("ID15_oneNewCellAndOneMoveOneCell.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithOneNewCellAndOneMoveOneCellScenario_ThenWebhookReturns200Response")] - - //Mixed - [TestCase("ID16_newCell_updateCell_metadataChange.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMixScenarioHavingNewCellAndUpdateCellAndMetadataChange_ThenWebhookReturns200Response")] - [TestCase("ID17_newCell_and_CancelReplace.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMixScenarioHavingOneNewCellAndOneCancel&ReplaceCell_ThenWebhookReturns200Response")] - [TestCase("ID18_CancelReplace_UpdateCell.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMixScenarioHavingCancel&Replace_UpdateCell_ThenWebhookReturns200Response")] - [TestCase("ID19_CR_metadata_move.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMixScenarioHavingCancel&ReplaceAndMetadataChangeAndMoveCell_ThenWebhookReturns200Response")] - - //New Edition - [TestCase("ID20_newEditionAdditionalCoverageV_01.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithNewEditionAdditionalCoverageV01PayloadFile_ThenWebhookReturns200Response")] - - //V0.3S - [TestCase("ID21_cancelAndReplaceV_03.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithCancelAndReplaceV03PayloadFile_ThenWebhookReturns200Response")] - [TestCase("ID22_Cell_Moves_Unit_and_New_CellV_03.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithCellMoveAndNewCellV03PayloadFile_ThenWebhookReturns200Response")] - [TestCase("ID23_Cell_MoveV_03.JSON", "N", TestName = "WhenICallTheWebhookWithCellMoveV03PayloadFile_ThenWebhookReturns200Response")] - [TestCase("ID24_Metadata_ChangeV_03.JSON", "N", TestName = "WhenICallTheWebhookWithMetadataChangeV03PayloadFile_ThenWebhookReturns200Response")] - [TestCase("ID25_Mixed_scenario1V_03.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMixedScenario1V03PayloadFile_ThenWebhookReturns200Response")] - [TestCase("ID26_New_CellV_03.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithNewCellV03PayloadFile_ThenWebhookReturns200Response")] - - //Supplier Defined Releasability Set v0.1 - [TestCase("ID27_supplier_Defined_ReleasabilitySet_V_01.JSON", "Y", "SamePermitKe", TestName = "WhenICallTheWebhookWithSupplierDefinedReleasabilitySetV01_ThenWebhookReturns200Response")] - - //Suspended & Withdrawn - [TestCase("ID28_simpleSuspendedScenario.JSON", "N", "DifferentPermitKey", TestName = "WhenICallTheWebhookWithSimpleSuspendedScenario_ThenWebhookReturns200Response")] - [TestCase("ID29_simpleWithdrawnScenario.JSON", "N", TestName = "WhenICallTheWebhookWithSimpleWithdrawnScenario_ThenWebhookReturns200Response")] - [TestCase("ID30_Suspend_and_WithdrawV01.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithSuspendedAndWithdrawnScenario_ThenWebhookReturns200Response")] - [TestCase("ID31_metadataAndSuspended.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMetadataAndSuspendedMixScenario_ThenWebhookReturns200Response")] - [TestCase("ID32_moveAndSuspended.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMoveDataAndSuspendedMixScenario_ThenWebhookReturns200Response")] - - //Rule change unitType & addProducts - [TestCase("ID33_NewCell_With2UoS_But_only1_having_addProduct.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithNewCellScenarioWithMultipleUoSHavingUnitOfSalesTypeUnitButOnly1HavingValueInAddProducts_ThenWebhookReturns200Response")] - [TestCase("ID34_Cancel&Replace_With_NewCells_having_2UoS_With_addProductValue.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithCancel&ReplaceScenarioHavingMultipleUnitOfSalesTypeUnitAndValueInAddProducts_ThenWebhookReturns200Response")] - [TestCase("ID35_Cancel&Replace_With_CancelCell_having_2UoS_but_onlyOneAsTypeUnit.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithCancel&ReplaceWithCancelledCellHaving2UoSButOnly1IsOfTypeUnit_ThenWebhookReturns200Response")] - [TestCase("ID36_MoveAndSuspended_With_2UoS_But1_Having_addProductsValue.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMoveAndSuspendedWith2UoSButOnly1HavingValueInAddProduct_ThenWebhookReturns200Response")] - - // Rule change for create avcs unit of sale (having multiple products in addProducts) - [TestCase("ID37_CreateUoSHavingMultipleItemsInAddProducts.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithMoveAndNewCellScenarioWhereUoSHasMultipleValuesInAddProducts_ThenWebhookReturns200Response")] - - [TestCase("ID38_3AdditionalCoverageCell.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithThreeAdditionalCoverageCellScenario_ThenWebhookReturns200Response")] - [TestCase("ID39_1AdditionalCoverageWith1CancelledCell.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithOneAdditionalCoverageWithCancelledCellScenario_ThenWebhookReturns200Response")] - [TestCase("ID40_1AdditionalCoverageWithReplacedCellAnd1CancelledCell.JSON", "N", "SamePermitKey", TestName = "WhenICallTheWebhookWithOneAdditionalCoverageWithReplacedAndOneCancelledCellScenario_ThenWebhookReturns200Response")] - public async Task WhenValidEventInNewEncContentPublishedEventReceivedWithValidToken_ThenWebhookReturns200OkResponse1(string payloadJsonFileName, string correctionTag, string permitState = "permitString") + [TestCase("CellMetadataChange.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithCellMetadataChangeScenario_ThenWebhookReturns200Response")] + [TestCase("UoSMetadataChange.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithUoSMetadataChangeScenario_ThenWebhookReturns200Response")] + + //Cell Movement + [TestCase("MoveCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithMoveCellScenario_ThenWebhookReturns200Response")] + [TestCase("MultipleCellsInSingleUnit.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithMultipleCellsInSingleUnitScenario_ThenWebhookReturns200Response")] + + //Mixed Scenarios + [TestCase("NewCell_AND_CancelCellWithNewCellReplacement.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithNewCell_AND_CancelCellWithNewCellReplacementScenario_ThenWebhookReturns200Response")] + [TestCase("NewCell_AND_MoveCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithNewCell_AND_MoveCellScenario_ThenWebhookReturns200Response")] + [TestCase("NewCell_AND_UoSMetadataChange.JSON", "PermitWithDifferentKey", TestName = "WhenICallTheWebhookWithNewCell_AND_UoSMetadataChangeScenario_ThenWebhookReturns200Response")] + [TestCase("NewCell_AND_UpdateCell_AND_CellMetadataChange.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithNewCell_AND_UpdateCell_AND_CellMetadataChangeScenario_ThenWebhookReturns200Response")] + [TestCase("CellMetadataChange_AND_SuspendCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithCellMetadataChange_AND_SuspendCellScenario_ThenWebhookReturns200Response")] + [TestCase("CellMetadataChangeWithNewCell.JSON", "PermitWithDifferentKey", TestName = "WhenICallTheWebhookWithCellMetadataChangeWithNewCellScenario_ThenWebhookReturns200Response")] + [TestCase("MoveCell_AND_SuspendCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithMoveCell_AND_SuspendCellScenario_ThenWebhookReturns200Response")] + + //Suspend and Withdraw Scenarios + [TestCase("SuspendCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithSuspendCellScenario_ThenWebhookReturns200Response")] + [TestCase("SuspendCell_AND_WithdrawCell.JSON", "PermitWithDifferentKey", TestName = "WhenICallTheWebhookWithSuspendCell_AND_WithdrawCellScenario_ThenWebhookReturns200Response")] + [TestCase("WithdrawCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithWithdrawCellScenario_ThenWebhookReturns200Response")] + + //Update Scenarios + [TestCase("UpdateCell.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithUpdateCellScenario_ThenWebhookReturns200Response")] + [TestCase("UpdateCellsWithDifferentStatusName.JSON", "PermitWithDifferentKey", TestName = "WhenICallTheWebhookWithUpdateCellsWithDifferentStatusNameScenario_ThenWebhookReturns200Response")] + [TestCase("UpdateCellWithNewEdition.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithUpdateCellWithNewEditionScenario_ThenWebhookReturns200Response")] + + //Re-issue scenario + [TestCase("Re-issue.JSON", "PermitWithSameKey", TestName = "WhenICallTheWebhookWithReIssueScenario_ThenWebhookReturns200Response")] + + public async Task WhenValidEventInNewEncContentPublishedEventReceivedWithValidToken_ThenWebhookReturns200OkResponse(string payloadJsonFileName, string permitState) { Console.WriteLine("Scenario:" + payloadJsonFileName + "\n"); string filePath = Path.Combine(_projectDir, Config.TestConfig.PayloadFolder, payloadJsonFileName); string generatedXmlFolder = Path.Combine(_projectDir, Config.TestConfig.GeneratedXmlFolder); - RestResponse response = await WebhookEndpoint.PostWebhookResponseAsyncForXml(filePath, generatedXmlFolder, await _authToken.GetAzureADToken(false), correctionTag, permitState); + RestResponse response = await WebhookEndpoint.PostWebhookResponseAsyncForXml(filePath, generatedXmlFolder, await _authToken.GetAzureADToken(false), permitState ); response.StatusCode.Should().Be(System.Net.HttpStatusCode.OK); } + + [Test] + //Mandatory attribute validation scenarios + [TestCase("products.productName", 1, TestName = "WhenProductNameIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("unitsOfSale.unitName", 1, TestName = "WhenUnitNameIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("products.providerCode", 1, TestName = "WhenProductProviderCodeIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("unitsOfSale.providerCode", 1, TestName = "WhenUnitProviderCodeIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("products.size", 1, TestName = "WhenProductSizeIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("unitsOfSale.unitSize", 1, TestName = "WhenUnitSizeIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("products.title", 1, TestName = "WhenProductTitleIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("unitsOfSale.title", 1, TestName = "WhenUnitTitleIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("products.editionNumber", 1, TestName = "WhenProductEditionNumberIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("products.updateNumber", 1, TestName = "WhenProductUpdateNumberIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("unitsOfSale.unitType", 1, TestName = "WhenUnitTypeIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("year", 0, TestName = "WhenYearIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("week", 0, TestName = "WhenWeekIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("currentWeekAlphaCorrection", 0, TestName = "WhenAlphaCorrectionFlagIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + [TestCase("products.permit", 1, TestName = "WhenProductPermitIsEmptyOrNull_ThenWebhookShouldReturn500ResponseCode")] + public async Task WhenMandatoryAttributeIsEmptyOrNullInPayload_ThenWebhookReturnsInternalServerErrorResponse(string attributeName, int index) + { + string filePath = Path.Combine(_projectDir, Config.TestConfig.PayloadFolder, "MandatoryAttributeValidation.JSON"); + RestResponse response = await WebhookEndpoint.PostWebhookResponseForMandatoryAttributeValidation(filePath, await _authToken.GetAzureADToken(false), attributeName, index, "Remove"); + response.StatusCode.Should().Be(System.Net.HttpStatusCode.InternalServerError); + + response = await WebhookEndpoint.PostWebhookResponseForMandatoryAttributeValidation(filePath, await _authToken.GetAzureADToken(false), attributeName, index, "EmptyOrNull"); + response.StatusCode.Should().Be(System.Net.HttpStatusCode.InternalServerError); + } } } diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/JSONHelper.cs b/tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/JSONHelper.cs index 08f9d448..4c3bb759 100644 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/JSONHelper.cs +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/JSONHelper.cs @@ -28,5 +28,39 @@ public static async Task<List<JsonInputRoSWebhookEvent>> GetEventJsonListUsingFi } return listOfEventJson; } + + public static string ModifyMandatoryAttribute(string payload, string attributeName, int index, string action) + { + payload = SapXmlHelper.UpdatePermitField(payload, "PermitWithSameKey"); + JObject jsonObject = JObject.Parse(payload); + + + string[] types = attributeName.Split("."); + + var tokens = types[0] == "products" + ? jsonObject.SelectTokens($"$.data.products[{index}].{types[1]}").ToList() + : types[0] == "unitsOfSale" + ? jsonObject.SelectTokens($"$.data.unitsOfSale[{index}].{types[1]}").ToList() + : jsonObject.SelectTokens($"$.data.ukhoWeekNumber.{types[0]}").ToList(); + + if (action == "Remove") + { + foreach (var token in tokens) + { + JProperty parentProperty = (JProperty)token.Parent; + parentProperty?.Remove(); + } + } + else + { + foreach (var token in tokens) + { + token.Replace(JValue.CreateNull()); + } + } + + payload = jsonObject.ToString(); + return payload; + } } } diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/SAPXmlHelper.cs b/tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/SAPXmlHelper.cs index 14927a4a..3443d8b3 100644 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/SAPXmlHelper.cs +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/Helpers/SAPXmlHelper.cs @@ -1,1113 +1,114 @@ using System.Text; -using System.Xml; -using System.Xml.Serialization; -using Newtonsoft.Json; +using System.Xml.Linq; using Newtonsoft.Json.Linq; -using NUnit.Framework; using UKHO.ERPFacade.API.FunctionalTests.Configuration; -using UKHO.ERPFacade.API.FunctionalTests.Model; - namespace UKHO.ERPFacade.API.FunctionalTests.Helpers { public class SapXmlHelper { - private static int actionCounter; - private static readonly List<string> attrNotMatched = new(); - private static List<string> changeAvcsUoS = new(); - private static readonly Dictionary<string, List<string>> changeEncCell = new(); - private static JsonPayloadHelper JsonPayload { get; set; } - private static JsonPayloadHelper UpdatedJsonPayload { get; set; } - public static List<string> ListFromJson = new(); - public static List<string> ActionsListFromXml = new(); - private static readonly string weekNoTag = Config.TestConfig.WeekNoTag; - private static readonly string validFromTagThursday = Config.TestConfig.ValidFromTagThursday; - private static readonly string validFromTagFriday = Config.TestConfig.ValidFromTagFriday; - private static readonly int noOfMandatoryXMLAttribute = 20; + private static readonly string permitWithSameKeyActiveKey = Config.TestConfig.PermitWithSameKey.ActiveKey; + private static readonly string permitWithSameKeyNextKey = Config.TestConfig.PermitWithSameKey.NextKey; + private static readonly string permitWithDifferentKeyActiveKey = Config.TestConfig.PermitWithDifferentKey.ActiveKey; + private static readonly string permitWithDifferentKeyNextKey = Config.TestConfig.PermitWithDifferentKey.NextKey; - public static async Task<bool> CheckXmlAttributes(JsonPayloadHelper jsonPayload, string xmlFilePath, string updatedRequestBody, string correctionTag, string permitState) + public static string GenerateRandomCorrelationId() { - SapXmlHelper.JsonPayload = jsonPayload; - UpdatedJsonPayload = JsonConvert.DeserializeObject<JsonPayloadHelper>(updatedRequestBody); - - XmlDocument xmlDoc = new (); - xmlDoc.LoadXml(await File.ReadAllTextAsync(xmlFilePath)); - - while (xmlDoc.DocumentElement.Name == "soap:Envelope" || xmlDoc.DocumentElement.Name == "soap:Body") - { - string tempXmlString = xmlDoc.DocumentElement.InnerXml; - xmlDoc.LoadXml(tempXmlString); - } - - var ms = new MemoryStream(Encoding.UTF8.GetBytes(xmlDoc.InnerXml)); - var reader = new XmlTextReader(ms) { Namespaces = false }; - var serializer = new XmlSerializer(typeof(Z_ADDS_MAT_INFO)); - var result = (Z_ADDS_MAT_INFO)serializer.Deserialize(reader); - - Assert.That(VerifyPresenceOfMandatoryXmlAttributes(result.IM_MATINFO.ACTIONITEMS).Result); - - actionCounter = 1; - changeEncCell.Clear(); - foreach (ZMAT_ACTIONITEMS item in result.IM_MATINFO.ACTIONITEMS) - { - if (item.ACTION == "CREATE ENC CELL") - Assert.That(VerifyCreateEncCell(item.CHILDCELL, item, correctionTag, permitState)); - else if (item.ACTION == "CREATE AVCS UNIT OF SALE") - Assert.That(VerifyCreateAVCSUnitOfSale(item.PRODUCTNAME, item, correctionTag)); - else if (item.ACTION == "ASSIGN CELL TO AVCS UNIT OF SALE") - Assert.That(VerifyAssignCellToAVCSUnitOfSale(item.CHILDCELL, item.PRODUCTNAME, item, correctionTag)); - else if (item.ACTION == "REPLACED WITH ENC CELL") - Assert.That(VerifyReplaceWithEncCell(item.CHILDCELL, item.REPLACEDBY, item, correctionTag) ?? false); - else if (item.ACTION == "ADDITIONAL COVERAGE ENC CELL") - Assert.That(VerifyAdditionalCoverageWithEncCell(item.CHILDCELL, item.REPLACEDBY, item, correctionTag) ?? false); - else if (item.ACTION == "REMOVE ENC CELL FROM AVCS UNIT OF SALE") - Assert.That(VerifyRemoveENCCellFromAVCSUnitOFSale(item.CHILDCELL, item.PRODUCTNAME, item, correctionTag) ?? false); - else if (item.ACTION == "CANCEL ENC CELL") - Assert.That(VerifyCancelEncCell(item.CHILDCELL, item.PRODUCTNAME, item, correctionTag) ?? false); - else if (item.ACTION == "CANCEL AVCS UNIT OF SALE") - Assert.That(VerifyCancelToAVCSUnitOfSale(item.PRODUCTNAME, item, correctionTag) ?? false); - else if (item.ACTION == "CHANGE ENC CELL") - Assert.That(VerifyChangeEncCell(item.CHILDCELL, item, correctionTag) ?? false); - else if (item.ACTION == "CHANGE AVCS UNIT OF SALE") - Assert.That(VerifyChangeAVCSUnitOfSale(item.PRODUCTNAME, item, correctionTag) ?? false); - else if (item.ACTION == "UPDATE ENC CELL EDITION UPDATE NUMBER") - Assert.That(VerifyUpdateEncCellEditionUpdateNumber(item.CHILDCELL, item, permitState, correctionTag) ?? false); - else - Assert.Fail("Not a required action"); - actionCounter++; - } - - Console.WriteLine("Total verified Actions:" + --actionCounter); - await Task.CompletedTask; - Console.WriteLine("XML has correct data"); - return true; + Guid guid = Guid.NewGuid(); + string randomCorrId = guid.ToString("N").Substring(0, 21); + randomCorrId = randomCorrId.Insert(5, "-"); + randomCorrId = randomCorrId.Insert(11, "-"); + randomCorrId = randomCorrId.Insert(16, "-"); + var currentTimeStamp = DateTime.Now.ToString("yyyyMMdd"); + randomCorrId = "ft-" + currentTimeStamp + "-" + randomCorrId; + return randomCorrId; } - private static bool? VerifyChangeAVCSUnitOfSale(string productName, ZMAT_ACTIONITEMS item, string correctionTag) + public static string UpdateTimeAndCorrIdField(string requestBody, string generatedCorrelationId) { - Console.WriteLine("Action#:" + actionCounter + ".UnitOfSale:" + productName); - foreach (KeyValuePair<string, List<string>> ele2 in changeEncCell) - { - changeAvcsUoS = ele2.Value; - - if (changeAvcsUoS.Contains(productName)) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - if (!item.PRODUCT.Equals("AVCS UNIT")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals(GetProductInfo(ele2.Key).ProductType)) - attrNotMatched.Add(nameof(item.PRODTYPE)); - if (!item.AGENCY.Equals((GetProductInfo(ele2.Key)).Agency)) - attrNotMatched.Add(nameof(item.AGENCY)); - if (!item.PROVIDER.Equals(GetProductInfo(ele2.Key).ProviderCode)) - attrNotMatched.Add(nameof(item.PROVIDER)); - if (!item.ENCSIZE.Equals(GetUoSInfo(productName).UnitSize)) - attrNotMatched.Add(nameof(item.ENCSIZE)); - VerifyAdditionalXmlTags(item, correctionTag); - //Checking blanks - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "EDITIONNO", "UPDATENO", "ACTIVEKEY", "NEXTKEY", "TITLE", "UNITTYPE" }; - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("CHANGE AVCS UNIT OF SALE Action's Data is correct"); - int valueIndex = ele2.Value.IndexOf(productName); - changeAvcsUoS[valueIndex] = changeAvcsUoS[valueIndex].Replace(productName, "skip"); - return true; - } - - Console.WriteLine("CHANGE AVCS UNIT OF SALE Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { - Console.WriteLine(attribute); - } - return false; - } - } - Console.WriteLine("JSON doesn't have corresponding Unit of Sale."); - return false; + var currentTimeStamp = DateTime.Now.ToString("yyyy-MM-dd"); + JObject jsonObj = JObject.Parse(requestBody); + jsonObj["time"] = currentTimeStamp; + jsonObj["data"]["correlationId"] = generatedCorrelationId; + return jsonObj.ToString(); } - private static bool? VerifyUpdateEncCellEditionUpdateNumber(string childCell, ZMAT_ACTIONITEMS item, string permitState, string correctionTag) + public static string UpdatePermitField(string requestBody, string permitState) { - Console.WriteLine("Action#:" + actionCounter + ".Childcell:" + childCell); - foreach (Product product in JsonPayload.Data.Products) - { - if ((childCell == product.ProductName) && - (product.Status.StatusName.Contains("Update") || product.Status.StatusName.Contains("New Edition") || product.Status.StatusName.Contains("Re-issue")) && - (!product.Status.IsNewCell) && - (product.ContentChange)) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - if (!item.PRODUCT.Equals("ENC CELL")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals(product.ProductType[4..])) - attrNotMatched.Add(nameof(item.PRODTYPE)); - if ((!product.InUnitsOfSale.Contains(item.PRODUCTNAME)) && (!item.PRODUCTNAME.Equals(GetUoSName(childCell)))) - attrNotMatched.Add(nameof(item.PRODUCTNAME)); - if (!item.EDITIONNO.Equals(product.EditionNumber)) - attrNotMatched.Add(nameof(item.EDITIONNO)); - if (!item.UPDATENO.Equals(product.UpdateNumber)) - attrNotMatched.Add(nameof(item.UPDATENO)); - VerifyAdditionalXmlTags(item, correctionTag); - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "UNITTYPE", "AGENCY", "PROVIDER", "ENCSIZE", "TITLE" }; - VerifyDecryptedPermit(item, permitState); - - //Checking blanks - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("UPDATE ENC CELL EDITION UPDATE NUMBER Action's Data is correct"); - return true; - } - - Console.WriteLine("UPDATE ENC CELL EDITION UPDATE NUMBER Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - else if ((childCell == product.ProductName) && (product.Status.StatusName.Contains("Suspended"))) - { - attrNotMatched.Clear(); - Console.WriteLine("The UoS name for " + childCell + " calculated is: " + GetUoSName(childCell)); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - if (!item.PRODUCT.Equals("ENC CELL")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals(product.ProductType[4..])) - attrNotMatched.Add(nameof(item.PRODTYPE)); - if ((!product.InUnitsOfSale.Contains(item.PRODUCTNAME)) && (!item.PRODUCTNAME.Equals(GetUoSName(childCell)))) - attrNotMatched.Add(nameof(item.PRODUCTNAME)); - if (!item.EDITIONNO.Equals(product.EditionNumber)) - attrNotMatched.Add(nameof(item.EDITIONNO)); - if (!item.UPDATENO.Equals(product.UpdateNumber)) - attrNotMatched.Add(nameof(item.UPDATENO)); - VerifyDecryptedPermit(item, permitState); - //Checking blanks - List<string> blankFieldNames = new(){ "CANCELLED", "REPLACEDBY", "UNITTYPE", "AGENCY", "PROVIDER", "ENCSIZE", "TITLE" }; - VerifyBlankFields(item, blankFieldNames); + JObject jsonObj = JObject.Parse(requestBody); + var products = jsonObj["data"]["products"]; - if (attrNotMatched.Count == 0) - { - Console.WriteLine("UPDATE ENC CELL EDITION UPDATE NUMBER Action's Data is correct"); - return true; - } - Console.WriteLine("UPDATE ENC CELL EDITION UPDATE NUMBER Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - } - Console.WriteLine("JSON doesn't have corresponding product."); - return false; - } + string permit = permitState.Contains("Same") ? Config.TestConfig.PermitWithSameKey.Permit + : permitState.Contains("Different") ? Config.TestConfig.PermitWithDifferentKey.Permit + : "permitString"; - private static bool? VerifyChangeEncCell(string childCell, ZMAT_ACTIONITEMS item, string correctionTag) - { - Console.WriteLine("Action#:" + actionCounter + ".Childcell:" + childCell); - foreach (Product product in JsonPayload.Data.Products) + foreach (var product in products) { - if ((childCell == product.ProductName) && (!product.ContentChange)) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - if (!item.PRODUCT.Equals("ENC CELL")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals(product.ProductType[4..])) - attrNotMatched.Add(nameof(item.PRODTYPE)); - if ((!product.InUnitsOfSale.Contains(item.PRODUCTNAME)) && (!item.PRODUCTNAME.Equals(GetUoSName(childCell)))) - attrNotMatched.Add(nameof(item.PRODUCTNAME)); - if (!item.AGENCY.Equals(product.Agency)) - attrNotMatched.Add(nameof(item.AGENCY)); - if (!item.PROVIDER.Equals(product.ProviderCode)) - attrNotMatched.Add(nameof(item.PROVIDER)); - if (!item.ENCSIZE.Equals(product.Size)) - attrNotMatched.Add(nameof(item.ENCSIZE)); - VerifyAdditionalXmlTags(item, correctionTag); - //Checking blanks - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "UNITTYPE", "ACTIVEKEY", "NEXTKEY", "TITLE", "EDITIONNO", "UPDATENO" }; - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("CHANGE ENC CELL Action's Data is correct"); - changeEncCell.Add(childCell, product.InUnitsOfSale); - return true; - } - - Console.WriteLine("CHANGE ENC CELL Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } + product["permit"] = permit; } - Console.WriteLine("JSON doesn't have corresponding product."); - return false; - } - private static bool? VerifyCancelToAVCSUnitOfSale(string productName, ZMAT_ACTIONITEMS item, string correctionTag) - { - Console.WriteLine("Action#:" + actionCounter + ".UnitOfSale:" + productName); - foreach (UnitOfSale unitOfSale in JsonPayload.Data.UnitsOfSales) - { - if ((productName == unitOfSale.UnitName) && (unitOfSale.Status.Equals("NotForSale"))) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - //xmlAttributes[1] is skipped as already checked - if (!item.PRODUCT.Equals("AVCS UNIT")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals((GetProductInfo(unitOfSale.CompositionChanges.RemoveProducts)).ProductType)) - attrNotMatched.Add(nameof(item.PRODTYPE)); - VerifyAdditionalXmlTags(item, correctionTag); - //Checking blanks - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "AGENCY", "PROVIDER", "ENCSIZE", "TITLE", "EDITIONNO", "UPDATENO", "UNITTYPE", "ACTIVEKEY", "NEXTKEY" }; - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("CANCEL AVCS UNIT OF SALE Action's Data is correct"); - return true; - } - - Console.WriteLine("CANCEL AVCS UNIT OF SALE Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - } - Console.WriteLine("JSON doesn't have corresponding Unit of Sale."); - return false; + return jsonObj.ToString(); } - private static bool? VerifyCancelEncCell(string childCell, string productName, ZMAT_ACTIONITEMS item, string correctionTag) + public static bool VerifyGeneratedXml(string generatedXmlFilePath, string xmlFilePath, string permitState) { - Console.WriteLine("Action#:" + actionCounter + ".ENC Cell:" + childCell); - foreach (Product product in JsonPayload.Data.Products) - { - if ((childCell == product.ProductName) && (product.Status.StatusName.Equals("Cancellation Update")) && (product.InUnitsOfSale.Contains(productName))) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - //xmlAttributes[1] is skipped as already checked - if (!item.PRODUCT.Equals("ENC CELL")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals(product.ProductType[4..])) - attrNotMatched.Add(nameof(item.PRODTYPE)); - if ((!product.InUnitsOfSale.Contains(item.PRODUCTNAME)) && (!item.PRODUCTNAME.Equals(GetUoSName(childCell)))) - attrNotMatched.Add(nameof(item.PRODUCTNAME)); - VerifyAdditionalXmlTags(item, correctionTag); - - //Checking blanks - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "AGENCY", "PROVIDER", "ENCSIZE", "TITLE", "EDITIONNO", "UPDATENO", "UNITTYPE", "ACTIVEKEY", "NEXTKEY" }; - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("CANCEL ENC CELL Action's Data is correct"); - return true; - } - - Console.WriteLine("CANCEL ENC CELL Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - } - Console.WriteLine("JSON doesn't have corresponding product."); - return false; - } + XElement generatedXml; + XElement expectedXml; - private static bool? VerifyRemoveENCCellFromAVCSUnitOFSale(string childCell, string productName, ZMAT_ACTIONITEMS item, string correctionTag) - { - Console.WriteLine("Action#:" + actionCounter + ".AVCSUnitOfSale:" + productName); - foreach (UnitOfSale unitOfSale in JsonPayload.Data.UnitsOfSales) + using (StreamReader reader = new StreamReader(generatedXmlFilePath, Encoding.UTF8)) { - List<string> pdts = unitOfSale.CompositionChanges.RemoveProducts; - foreach (string pdt in pdts) - { - if ((childCell == pdt) && (productName == unitOfSale.UnitName)) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - if (!item.PRODUCT.Equals("AVCS UNIT")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals((GetProductInfo(unitOfSale.CompositionChanges.RemoveProducts)).ProductType)) - attrNotMatched.Add(nameof(item.PRODTYPE)); - VerifyAdditionalXmlTags(item, correctionTag); - //xmlAttributes[4] & [5] are skipped as already checked - //Checking blanks - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "AGENCY", "PROVIDER", "ENCSIZE", "TITLE", "EDITIONNO", "UPDATENO", "UNITTYPE", "ACTIVEKEY", "NEXTKEY" }; - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("REMOVE ENC CELL FROM AVCS UNIT OF SALE Action's Data is correct"); - return true; - } - - Console.WriteLine("REMOVE ENC CELL FROM AVCS UNIT OF SALE Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - } + generatedXml = XElement.Load(reader); } - Console.WriteLine("JSON doesn't have corresponding Unit of Sale."); - return false; - } - private static bool? VerifyReplaceWithEncCell(string childCell, string replaceBy, ZMAT_ACTIONITEMS item, string correctionTag) - { - Console.WriteLine("Action#:" + actionCounter + ".ENC Cell:" + childCell); - foreach (Product product in JsonPayload.Data.Products) + using (StreamReader reader = new StreamReader(xmlFilePath, Encoding.UTF8)) { - if ((childCell == product.ProductName) && (product.ReplacedBy.Contains(replaceBy))) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - //xmlAttributes[1] is skipped as already checked - if (!item.PRODUCT.Equals("ENC CELL")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals(product.ProductType[4..])) - attrNotMatched.Add(nameof(item.PRODTYPE)); - if ((!product.InUnitsOfSale.Contains(item.PRODUCTNAME)) && (!item.PRODUCTNAME.Equals(GetUoSName(childCell)))) - attrNotMatched.Add(nameof(item.PRODUCTNAME)); - VerifyAdditionalXmlTags(item, correctionTag); - //Checking blanks - List<string> blankFieldNames = new() { "CANCELLED", "AGENCY", "PROVIDER", "ENCSIZE", "TITLE", "EDITIONNO", "UPDATENO", "UNITTYPE", "ACTIVEKEY", "NEXTKEY" }; - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("REPLACED WITH ENC CELL Action's Data is correct"); - int valueIndex = product.ReplacedBy.IndexOf(replaceBy); - product.ReplacedBy[valueIndex] = product.ReplacedBy[valueIndex].Replace(replaceBy, "skip"); - return true; - } - - Console.WriteLine("REPLACED WITH ENC CELL Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } + expectedXml = XElement.Load(reader); } - Console.WriteLine("JSON doesn't have corresponding product."); - return false; - } - private static bool? VerifyAdditionalCoverageWithEncCell(string childCell, string replaceBy, ZMAT_ACTIONITEMS item, string correctionTag) - { - Console.WriteLine("Action#:" + actionCounter + ".ENC Cell:" + childCell); - foreach (Product product in JsonPayload.Data.Products) - { - if ((childCell == product.ProductName) && (product.AdditionalCoverage.Contains(replaceBy))) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - //xmlAttributes[1] is skipped as already checked - if (!item.PRODUCT.Equals("ENC CELL")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals(product.ProductType[4..])) - attrNotMatched.Add(nameof(item.PRODTYPE)); - VerifyAdditionalXmlTags(item, correctionTag); - //Checking blanks - List<string> blankFieldNames = new() { "PRODUCTNAME", "CANCELLED", "AGENCY", "PROVIDER", "ENCSIZE", "TITLE", "EDITIONNO", "UPDATENO", "UNITTYPE", "ACTIVEKEY", "NEXTKEY" }; - VerifyBlankFields(item, blankFieldNames); + var generatedAttributes = generatedXml.Descendants("Item").ToList(); + var expectedAttributes = expectedXml.Descendants("Item").ToList(); - if (attrNotMatched.Count == 0) - { - Console.WriteLine("ADDITIONAL COVERAGE ENC CELL Action's Data is correct"); - int valueIndex = product.AdditionalCoverage.IndexOf(replaceBy); - product.AdditionalCoverage[valueIndex] = product.AdditionalCoverage[valueIndex].Replace(replaceBy, "skip"); - return true; - } - Console.WriteLine("ADDITIONAL COVERAGE ENC CELL Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - } - Console.WriteLine("JSON doesn't have corresponding product."); - return false; - } + string activeKey = permitState == "PermitWithSameKey" ? permitWithSameKeyActiveKey : permitWithDifferentKeyActiveKey; + string nextKey = permitState == "PermitWithSameKey" ? permitWithSameKeyNextKey : permitWithDifferentKeyNextKey; - private static bool VerifyAssignCellToAVCSUnitOfSale(string childCell, string productName, ZMAT_ACTIONITEMS item, string correctionTag) - { - Console.WriteLine("Action#:" + actionCounter + ".AVCSUnitOfSale:" + productName); - foreach (UnitOfSale unitOfSale in JsonPayload.Data.UnitsOfSales) + // Ensure both XMLs have the same number of items + if (generatedAttributes.Count != expectedAttributes.Count) { - List<string> pdts = unitOfSale.CompositionChanges.AddProducts; - foreach (string pdt in pdts) - { - if ((childCell == pdt) && (productName == unitOfSale.UnitName)) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - if (!item.PRODUCT.Equals("AVCS UNIT")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals((GetProductInfo(unitOfSale.CompositionChanges.AddProducts)).ProductType)) - attrNotMatched.Add(nameof(item.PRODTYPE)); - //xmlAttributes[4] & [5] are skipped as already checked - //Checking blanks - VerifyAdditionalXmlTags(item, correctionTag); - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "AGENCY", "PROVIDER", "ENCSIZE", "TITLE", "EDITIONNO", "UPDATENO", "UNITTYPE", "ACTIVEKEY", "NEXTKEY" }; - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("ASSIGN CELL TO AVCS UNIT OF SALE Action's Data is correct"); - return true; - } - - Console.WriteLine("ASSIGN CELL TO AVCS UNIT OF SALE Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - } + Console.WriteLine("XML files have different number of items."); + return false; } - Console.WriteLine("JSON doesn't have corresponding Product/Unit of Sale."); - return false; - } - private static bool VerifyCreateAVCSUnitOfSale(string productName, ZMAT_ACTIONITEMS item, string correctionTag) - { - Console.WriteLine("Action#:" + actionCounter + ".UnitOfSale:" + productName); - foreach (UnitOfSale unitOfSale in JsonPayload.Data.UnitsOfSales) + // Iterate over the items and compare their elements + for (int i = 0; i < generatedAttributes.Count; i++) { - if ((productName == unitOfSale.UnitName) && (unitOfSale.IsNewUnitOfSale)) - { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - //xmlAttributes[1] is skipped as already checked - if (!item.PRODUCT.Equals("AVCS UNIT")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals((GetFirstProductsInfoHavingUoS(productName)).ProductType)) - attrNotMatched.Add(nameof(item.PRODTYPE)); - if (!item.AGENCY.Equals((GetFirstProductsInfoHavingUoS(productName)).Agency)) - attrNotMatched.Add(nameof(item.AGENCY)); - if (!item.PROVIDER.Equals((GetFirstProductsInfoHavingUoS(productName)).ProviderCode)) - attrNotMatched.Add(nameof(item.PROVIDER)); - if (!item.ENCSIZE.Equals(unitOfSale.UnitSize)) - attrNotMatched.Add(nameof(item.ENCSIZE)); - if (!item.TITLE.Equals(unitOfSale.Title)) - attrNotMatched.Add(nameof(item.TITLE)); - if (!item.UNITTYPE.Equals(unitOfSale.UnitType)) - attrNotMatched.Add(nameof(item.UNITTYPE)); - VerifyAdditionalXmlTags(item, correctionTag); - //Checking blanks - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "EDITIONNO", "UPDATENO", "ACTIVEKEY", "NEXTKEY" }; - VerifyBlankFields(item, blankFieldNames); + var generatedAction = generatedAttributes[i]; + var expectedAction = expectedAttributes[i]; + string action = generatedAction.Element("ACTION")?.Value; - if (attrNotMatched.Count == 0) - { - Console.WriteLine("CREATE AVCS UNIT OF SALE Action's Data is correct"); - return true; - } - - Console.WriteLine("CREATE AVCS UNIT OF SALE Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - } - Console.WriteLine("JSON doesn't have corresponding Unit of Sale."); - return false; - } - - private static bool VerifyCreateEncCell(string childCell, ZMAT_ACTIONITEMS item, string correctionTag, string permitState) - { - Console.WriteLine("Action#:" + actionCounter + ".Childcell:" + childCell); - foreach (Product product in JsonPayload.Data.Products) - { - if ((childCell == product.ProductName) && (product.Status.IsNewCell)) + foreach (var generatedAttribute in generatedAction.Elements()) { - attrNotMatched.Clear(); - if (!item.ACTIONNUMBER.Equals(actionCounter.ToString())) - attrNotMatched.Add(nameof(item.ACTIONNUMBER)); - if (!item.PRODUCT.Equals("ENC CELL")) - attrNotMatched.Add(nameof(item.PRODUCT)); - if (!item.PRODTYPE.Equals(product.ProductType[4..])) - attrNotMatched.Add(nameof(item.PRODTYPE)); - if ((!product.InUnitsOfSale.Contains(item.PRODUCTNAME)) && (!item.PRODUCTNAME.Equals(GetUoSName(childCell)))) - attrNotMatched.Add(nameof(item.PRODUCTNAME)); - if (!item.AGENCY.Equals(product.Agency)) - attrNotMatched.Add(nameof(item.AGENCY)); - if (!item.PROVIDER.Equals(product.ProviderCode)) - attrNotMatched.Add(nameof(item.PROVIDER)); - if (!item.ENCSIZE.Equals(product.Size)) - attrNotMatched.Add(nameof(item.ENCSIZE)); - if (!item.TITLE.Equals(product.Title)) - attrNotMatched.Add(nameof(item.TITLE)); - if (!item.EDITIONNO.Equals(product.EditionNumber)) - attrNotMatched.Add(nameof(item.EDITIONNO)); - if (!item.UPDATENO.Equals(product.UpdateNumber)) - attrNotMatched.Add(nameof(item.UPDATENO)); - VerifyAdditionalXmlTags(item, correctionTag); - VerifyDecryptedPermit(item, permitState); - //Checking blanks - List<string> blankFieldNames = new() { "CANCELLED", "REPLACEDBY", "UNITTYPE" }; - VerifyBlankFields(item, blankFieldNames); - - if (attrNotMatched.Count == 0) - { - Console.WriteLine("CREATE ENC CELL Action's Data is correct"); - return true; - } - - Console.WriteLine("CREATE ENC CELL Action's Data is incorrect"); - Console.WriteLine("Not matching attributes are:"); - foreach (string attribute in attrNotMatched) - { Console.WriteLine(attribute); } - return false; - } - } - Console.WriteLine("JSON doesn't have corresponding product."); - return true; - } + var expectedAttribute = expectedAction.Element(generatedAttribute.Name); - private static void VerifyAdditionalXmlTags(ZMAT_ACTIONITEMS item, string correctionTag) - { - if (!item.WEEKNO.Equals(weekNoTag)) - attrNotMatched.Add(nameof(item.WEEKNO)); - if (correctionTag == "Y") - { - if (!item.VALIDFROM.Equals(validFromTagFriday)) - attrNotMatched.Add(nameof(item.VALIDFROM)); - } - else - { - if (!item.VALIDFROM.Equals(validFromTagThursday)) - attrNotMatched.Add(nameof(item.VALIDFROM)); - } - if (!item.CORRECTION.Equals(correctionTag)) - attrNotMatched.Add(nameof(item.CORRECTION)); - } - - private static void VerifyDecryptedPermit(ZMAT_ACTIONITEMS item, string permitState) - { - if (permitState.Contains("Same")) - { - - if (!item.ACTIVEKEY.Equals(Config.TestConfig.PermitWithSameKey.ActiveKey)) - attrNotMatched.Add(nameof(item.ACTIVEKEY)); - if (!item.NEXTKEY.Equals(Config.TestConfig.PermitWithSameKey.NextKey)) - attrNotMatched.Add(nameof(item.NEXTKEY)); - } - else if (permitState.Contains("Different")) - { - if (!item.ACTIVEKEY.Equals(Config.TestConfig.PermitWithDifferentKey.ActiveKey)) - attrNotMatched.Add(nameof(item.ACTIVEKEY)); - if (!item.NEXTKEY.Equals(Config.TestConfig.PermitWithDifferentKey.NextKey)) - attrNotMatched.Add(nameof(item.NEXTKEY)); - } - } - - private static bool VerifyBlankFields(ZMAT_ACTIONITEMS item, List<string> fieldNames) - { - bool allBlanks = true; - - foreach (string field in fieldNames) - { - if (!typeof(ZMAT_ACTIONITEMS).GetProperty(field).GetValue(item, null).Equals("")) - attrNotMatched.Add(typeof(ZMAT_ACTIONITEMS).GetProperty(field).Name); - } - return allBlanks; - } - - private static UoSProductInfo GetProductInfo(List<string> products) - { - UoSProductInfo productInfo = new UoSProductInfo(); - foreach (string pdt in products) - { - foreach (Product product in JsonPayload.Data.Products) - { - if (pdt.Equals(product.ProductName)) + if ((action == "CREATE ENC CELL" || action == "UPDATE ENC CELL EDITION UPDATE NUMBER") && (generatedAttribute.Name == "ACTIVEKEY" || generatedAttribute.Name == "NEXTKEY")) { - productInfo.ProductType = product.ProductType[4..]; - productInfo.Agency = product.Agency; - productInfo.ProviderCode = product.ProviderCode; - } - } - } - return productInfo; - } - - public static async Task<bool> VerifyPresenceOfMandatoryXmlAttributes(ZMAT_ACTIONITEMS[] ZMAT_ACTIONITEMS) - { - List<string> actionAttributesSeq = Config.TestConfig.XmlActionList.ToList<string>(); - List<string> currentActionAttributes = new(); - foreach (ZMAT_ACTIONITEMS item in ZMAT_ACTIONITEMS) - { - currentActionAttributes.Clear(); - Type arrayType = item.GetType(); - System.Reflection.PropertyInfo[] properties = arrayType.GetProperties(); - currentActionAttributes.AddRange(properties.Select(property => property.Name)); - if (currentActionAttributes.Count == noOfMandatoryXMLAttribute) - { + string expectedValue = generatedAttribute.Name == "ACTIVEKEY" ? activeKey : nextKey; - - for (int i = 0; i < noOfMandatoryXMLAttribute; i++) - { - if (currentActionAttributes[i] != actionAttributesSeq[i]) + if (generatedAttribute.Value != expectedValue && generatedAttribute.Value.Length > 0) { - Console.WriteLine("First missed Attribute is:" + actionAttributesSeq[i] + - " for action number:" + item.ACTIONNUMBER); + Console.WriteLine( + $"Mismatch in {generatedAttribute.Name} in item {i + 1}. XML1: {generatedAttribute.Value}, Expected: {expectedValue}"); return false; } } - } - else - { - Console.WriteLine("Mandatory attributes are more than expected for Action number " + item.ACTIONNUMBER); - - return false; - } - } - if (ZMAT_ACTIONITEMS.Length > 0) - { - Console.WriteLine("Mandatory attributes are present in all XML actions"); - await Task.CompletedTask; - return true; - } - return false; - } - - private static UoSProductInfo GetFirstProductsInfoHavingUoS(string unitOfSalesName) - { - UoSProductInfo firstProductInfo = new(); - Product prodHavingRequiredUoS = UpdatedJsonPayload.Data.Products.FirstOrDefault(p => p.InUnitsOfSale.Contains(unitOfSalesName)); - - if (prodHavingRequiredUoS != null) - { - firstProductInfo.ProductType = prodHavingRequiredUoS.ProductType[4..]; - firstProductInfo.Agency = prodHavingRequiredUoS.Agency; - firstProductInfo.ProviderCode = prodHavingRequiredUoS.ProviderCode; - firstProductInfo.Title = prodHavingRequiredUoS.Title; - } - else - { - Console.WriteLine(unitOfSalesName + " not found in any Product's inUnitOfSale"); - } - return firstProductInfo; - } - - private static ProductUoSInfo GetUoSInfo(string productName) - { - ProductUoSInfo uoSInfo = new(); - foreach (UnitOfSale uos in JsonPayload.Data.UnitsOfSales) - { - if (productName.Equals(uos.UnitName)) - { - uoSInfo.UnitType = uos.UnitType; - uoSInfo.UnitSize = uos.UnitSize; - uoSInfo.Title = uos.Title; - uoSInfo.UnitOfSaleType = uos.UnitOfSaleType; - } - } - return uoSInfo; - } - - private static UoSProductInfo GetProductInfo(string products) - { - UoSProductInfo productInfo = new(); - foreach (Product product in JsonPayload.Data.Products) - { - if (products.Equals(product.ProductName)) - { - productInfo.ProductType = product.ProductType[4..]; - productInfo.Agency = product.Agency; - productInfo.ProviderCode = product.ProviderCode; - productInfo.Title = product.Title; - } - } - return productInfo; - } - - public static string GetRequiredXmlText(string generatedXmlFilePath, string tagName) - { - XmlDocument xDoc = new(); - xDoc.LoadXml(File.ReadAllText(generatedXmlFilePath)); - XmlNode node = xDoc.SelectSingleNode("//" + tagName); - return node.InnerText; - } - - public static bool VerifyOrderOfActions(JsonPayloadHelper jsonPayload, string generatedXmlFilePath) - { - bool areEqual = GetFinalActionsListFromJson(ListFromJson).SequenceEqual(CurateListOfActionsFromXmlFile(generatedXmlFilePath)); - if (areEqual) - { - Console.WriteLine("XML has correct action sequence"); - return true; - } - - Console.WriteLine("XML has incorrect action sequence"); - return false; - } - - public static bool VerifyInitialXmlHeaders(JsonPayloadHelper jsonPayload, string generatedXMLFilePath) - { - bool isNoOfActionsMatching = VerifyNoOfActionsHeader(jsonPayload, generatedXMLFilePath); - bool isRecTimeMatching = VerifyRECTIMEHeader(jsonPayload, generatedXMLFilePath); - bool isCorrIdMatching = VerifyCORRIDHeader(jsonPayload, generatedXMLFilePath); - bool isOrgMatching = VerifyORGHeader(jsonPayload, generatedXMLFilePath); - - if (isRecTimeMatching && isNoOfActionsMatching && isCorrIdMatching && isOrgMatching) - { - Console.WriteLine("XML headers are correct"); - return true; - } - - Console.WriteLine("XML headers are incorrect"); - return false; - } - - public static bool VerifyRECTIMEHeader(JsonPayloadHelper jsonPayload, string generatedXmlFilePath) - { - string time = jsonPayload.Time; - DateTime dt = DateTime.Parse(time); - string timeFromJson = dt.ToString("yyyyMMdd"); - - string timeFromXml = GetRequiredXmlText(generatedXmlFilePath, "RECDATE"); - - if (timeFromJson == timeFromXml) - return true; - return false; - } - - public static bool VerifyNoOfActionsHeader(JsonPayloadHelper jsonPayload, string generatedXMLFilePath) - { - int totalNumberOfActions = CalculateTotalNumberOfActions(jsonPayload); - int noOfActions = int.Parse(GetRequiredXmlText(generatedXMLFilePath, "NOOFACTIONS")); - - if (totalNumberOfActions == noOfActions) - { - Console.WriteLine("XML has correct number of actions"); - return true; - } - - Console.WriteLine("XML has incorrect number of actions"); - return false; - } - - public static bool VerifyCORRIDHeader(JsonPayloadHelper jsonPayload, string generatedXMLFilePath) - { - string correlationId = jsonPayload.Data.correlationId; - string corrId = GetRequiredXmlText(generatedXMLFilePath, "CORRID"); - - if (correlationId == corrId) - return true; - return false; - } - - public static bool VerifyORGHeader(JsonPayloadHelper jsonPayload, string generatedXmlFilePath) - { - string orgValueFromXMl = GetRequiredXmlText(generatedXmlFilePath, "ORG"); - - if (orgValueFromXMl == "UKHO") - return true; - - Console.WriteLine("ORG Header failed to match"); - return false; - } - - public static List<string> CurateListOfActionsFromXmlFile(string downloadedXmlFilePath) - { - ActionsListFromXml.Clear(); - XmlDocument xDoc = new XmlDocument(); - xDoc.LoadXml(File.ReadAllText(downloadedXmlFilePath)); - XmlNodeList nodeList = xDoc.SelectNodes("//ACTION"); - - foreach (XmlNode node in nodeList) - { - ActionsListFromXml.Add(node.InnerText); - } - return ActionsListFromXml; - } - - public static void UpdateActionList(int n, string actionMessage) - { - for (int i = 0; i < n; i++) - { - ListFromJson.Add(actionMessage); - } - ListFromJson.Sort(); - } - - public static List<string> GetFinalActionsListFromJson(List<string> actionsList) - { - for (int i = 0; i < actionsList.Count; i++) - { - actionsList[i] = actionsList[i].Substring(4); - } - return actionsList; - } - - // ====== Calculation Logic Starts ====== - - public static int CalculateTotalNumberOfActions(JsonPayloadHelper jsonPayload) - { - int totalNumberOfActions = 0; - ListFromJson.Clear(); - totalNumberOfActions = CalculateNewCellCount(jsonPayload) - + CalculateNewUnitOfSalesCount(jsonPayload) - + CalculateAssignCellToUoSActionCount(jsonPayload) - + CalculateReplaceCellActionCount(jsonPayload) - + CalculateAdditionalCoverageCellActionCount(jsonPayload) - + CalculateChangeEncCellActionCount(jsonPayload) - + CalculateChangeUoSActionCount(jsonPayload) - + CalculateRemoveCellFromUoSActionCount(jsonPayload) - + CalculateUpdateEncCellEditionUpdateNumber(jsonPayload) - + CalculateUpdateEncCellEditionUpdateNumberForSuspendedStatus(jsonPayload) - + CalculateCancelledCellCount(jsonPayload) - + CalculateCancelUnitOfSalesActionCount(jsonPayload); - - Console.WriteLine("Total No. of Actions = " + totalNumberOfActions); - return totalNumberOfActions; - } - - public static int CalculateNewCellCount(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.Products.Count(product => product.Status.IsNewCell == true); - if (count > 0) - { - UpdateActionList(count, "1. CREATE ENC CELL"); - Console.WriteLine("Total no. of Create ENC Cell: " + count); - } - return count; - } - - public static int CalculateNewUnitOfSalesCount(JsonPayloadHelper jsonPayload) - { - int newUoSCount = jsonPayload.Data.UnitsOfSales.Count(unitOfSale => unitOfSale.IsNewUnitOfSale == true); - if (newUoSCount > 0) - { - UpdateActionList(newUoSCount, "2. CREATE AVCS UNIT OF SALE"); - Console.WriteLine("Total no. of Create AVCS Unit of Sale: " + newUoSCount); - } - return newUoSCount; - } - - public static int CalculateAssignCellToUoSActionCount(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.UnitsOfSales.Aggregate(0, (current, unitOfSale) => current + unitOfSale.CompositionChanges.AddProducts.Count); - if (count > 0) - { - UpdateActionList(count, "3. ASSIGN CELL TO AVCS UNIT OF SALE"); - Console.WriteLine("Total no. of Assign Cell to AVCS UoS: " + count); - } - return count; - } - - public static int CalculateReplaceCellActionCount(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.Products.Where(product => product.Status.IsNewCell == false && ((product.ReplacedBy.Count) > 0)).Aggregate(0, (current, product) => current + product.ReplacedBy.Count); - if (count > 0) - { - UpdateActionList(count, "4. REPLACED WITH ENC CELL"); - Console.WriteLine("Total no. of ReplaceD With ENC Cell: " + count); - } - - return count; - } - - public static int CalculateAdditionalCoverageCellActionCount(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.Products.Where(product => (product.AdditionalCoverage.Count) > 0).Sum(product => product.AdditionalCoverage.Count); - - if (count <= 0) - return count; - - UpdateActionList(count, "5. ADDITIONAL COVERAGE ENC CELL"); - Console.WriteLine("Total no. of Additional coverage ENC Cell: " + count); - - return count; - } - - public static int CalculateChangeEncCellActionCount(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.Products.Count(product => product.ContentChange == false); - if (count > 0) - { - UpdateActionList(count, "6. CHANGE ENC CELL"); - Console.WriteLine("Total No. of Change ENC Cell: " + count); - } - return count; - } - - public static int CalculateChangeUoSActionCount(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.Products.Where(product => product.ContentChange == false).Aggregate(0, (current, product) => current + product.InUnitsOfSale.Count); - if (count > 0) - { - UpdateActionList(count, "7. CHANGE AVCS UNIT OF SALE"); - Console.WriteLine("Total No. of Change AVCS UoS: " + count); - } - return count; - } - - public static int CalculateUpdateEncCellEditionUpdateNumber(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.Products.Count(product => product.ContentChange == true && product.Status.IsNewCell == false && (product.Status.StatusName == "Update" || product.Status.StatusName == "New Edition" || product.Status.StatusName == "Re-issue")); - if (count > 0) - { - UpdateActionList(count, "8. UPDATE ENC CELL EDITION UPDATE NUMBER"); - Console.WriteLine("Total no. of ENC Cell Edition Update Number: " + count); - } - return count; - } - - public static int CalculateUpdateEncCellEditionUpdateNumberForSuspendedStatus(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.Products.Count(product => product.Status.StatusName == "Suspended"); - if (count > 0) - { - UpdateActionList(count, "8. UPDATE ENC CELL EDITION UPDATE NUMBER"); - Console.WriteLine("Total no. of ENC Cell Edition Update Number: " + count); - } - return count; - } - - public static int CalculateRemoveCellFromUoSActionCount(JsonPayloadHelper jsonPayload) - { - int count = jsonPayload.Data.UnitsOfSales.Where(unitOfSale => unitOfSale.CompositionChanges.RemoveProducts.Count > 0).Aggregate(0, (current, unitOfSale) => current + unitOfSale.CompositionChanges.RemoveProducts.Count); - if (count > 0) - { - UpdateActionList(count, "9. REMOVE ENC CELL FROM AVCS UNIT OF SALE"); - Console.WriteLine("Total no. of Remove Cell from UoS: " + count); - } - return count; - } - - public static int CalculateCancelledCellCount(JsonPayloadHelper jsonPayload) - { - int cancelledCellCount = jsonPayload.Data.Products.Count(product => product.Status.StatusName == "Cancellation Update"); - if (cancelledCellCount > 0) - { - UpdateActionList(cancelledCellCount, "91. CANCEL ENC CELL"); - Console.WriteLine("Total No. of Cancel ENC Cell: " + cancelledCellCount); - } - return cancelledCellCount; - } - - public static int CalculateCancelUnitOfSalesActionCount(JsonPayloadHelper jsonPayload) - { - int cancelledUoSCount = jsonPayload.Data.UnitsOfSales.Count(unitOfSale => unitOfSale.Status == "NotForSale"); - if (cancelledUoSCount > 0) - { - UpdateActionList(cancelledUoSCount, "92. CANCEL AVCS UNIT OF SALE"); - Console.WriteLine("Total No. of Cancel AVCS UoS: " + cancelledUoSCount); - } - return cancelledUoSCount; - } - - public static string GenerateRandomCorrelationId() - { - Guid guid = Guid.NewGuid(); - string randomCorrId = guid.ToString("N").Substring(0, 21); - randomCorrId = randomCorrId.Insert(5, "-"); - randomCorrId = randomCorrId.Insert(11, "-"); - randomCorrId = randomCorrId.Insert(16, "-"); - var currentTimeStamp = DateTime.Now.ToString("yyyyMMdd"); - randomCorrId = "ft-" + currentTimeStamp + "-" + randomCorrId; - Console.WriteLine("Generated CorrelationId = " + randomCorrId); - return randomCorrId; - } - - public static string UpdateTimeAndCorrIdField(string requestBody, string generatedCorrelationId) - { - var currentTimeStamp = DateTime.Now.ToString("yyyy-MM-dd"); - JObject jsonObj = JObject.Parse(requestBody); - jsonObj["time"] = currentTimeStamp; - jsonObj["data"]["correlationId"] = generatedCorrelationId; - return jsonObj.ToString(); - } - - private static string GetUoSName(string productName) - { - Product prod = UpdatedJsonPayload.Data.Products.FirstOrDefault(p => p.ProductName == productName); - if (prod != null) - { - List<string> inUoS = prod.InUnitsOfSale; - //this will return object of - var matchingUosItems = UpdatedJsonPayload.Data.UnitsOfSales - .Where(uos => uos.UnitOfSaleType == "unit" && inUoS.Contains(uos.UnitName)) - .ToList(); - - if (matchingUosItems.Count > 1) - { - UnitOfSale uosObj = matchingUosItems - .FirstOrDefault(x => x.CompositionChanges.AddProducts.Contains(productName)); - - if (uosObj != null) + else if (generatedAttribute.Value != expectedAttribute?.Value) { - string name = uosObj.UnitName; - return name; + Console.WriteLine($"Mismatch in element {generatedAttribute.Name.LocalName} in item {i + 1}. XML1: {generatedAttribute.Value}, XML2: {expectedAttribute?.Value}"); + return false; } - Console.WriteLine("Item not found"); - return ""; } - return matchingUosItems.FirstOrDefault()?.UnitName; } - Console.WriteLine("Product object is null"); - return null; - } - public static string UpdatePermitField(string requestBody, string permitState) - { - JObject jsonObj = JObject.Parse(requestBody); - if (permitState.Contains("Same")) - { - var products = jsonObj["data"]["products"]; - foreach (var product in products) - { - Assert.That(Config.TestConfig.PermitWithSameKey.Permit, Is.Not.EqualTo(""), "Permit String is empty"); - product["permit"] = Config.TestConfig.PermitWithSameKey.Permit; - } - } - else if (permitState.Contains("Different")) - { - var products = jsonObj["data"]["products"]; - foreach (var product in products) - { - Assert.That(Config.TestConfig.PermitWithDifferentKey.Permit, Is.Not.EqualTo(""), "Permit String is empty"); - product["permit"] = Config.TestConfig.PermitWithDifferentKey.Permit; - } - } - else - { - var products = jsonObj["data"]["products"]; - foreach (var product in products) - { - product["permit"] = "permitString"; - } - } - return jsonObj.ToString(); + return true; } } } diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/Service/WebhookEndpoint.cs b/tests/UKHO.ERPFacade.API.FunctionalTests/Service/WebhookEndpoint.cs index 0d57d83c..e3ae5cdd 100644 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/Service/WebhookEndpoint.cs +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/Service/WebhookEndpoint.cs @@ -51,7 +51,7 @@ public async Task<RestResponse> PostWebhookResponseAsync(string filePath, string return response; } - public async Task<RestResponse> PostWebhookResponseAsyncForXml(string filePath, string generatedXmlFolder, string token, string correctionTag = "N", string permitState = "permitString") + public async Task<RestResponse> PostWebhookResponseAsyncForXml(string filePath, string generatedXmlFolder, string token, string permitState = "permitString") { string requestBody; @@ -59,8 +59,6 @@ public async Task<RestResponse> PostWebhookResponseAsyncForXml(string filePath, { requestBody = await streamReader.ReadToEndAsync(); } - GeneratedCorrelationId = SapXmlHelper.GenerateRandomCorrelationId(); - requestBody = SapXmlHelper.UpdateTimeAndCorrIdField(requestBody, GeneratedCorrelationId); requestBody = SapXmlHelper.UpdatePermitField(requestBody, permitState); var request = new RestRequest(WebhookRequestEndPoint, Method.Post); @@ -72,17 +70,38 @@ public async Task<RestResponse> PostWebhookResponseAsyncForXml(string filePath, JsonPayloadHelper jsonPayload = JsonConvert.DeserializeObject<JsonPayloadHelper>(requestBody); string correlationId = jsonPayload.Data.correlationId; - //Logic to download XML from container using TraceID from JSON - string generatedXmlFilePath = _azureBlobStorageHelper.DownloadGeneratedXml(generatedXmlFolder, correlationId); - - //Logic to verifyxml + //Logic to verify xml if (response.StatusCode == System.Net.HttpStatusCode.OK) { - Assert.That(SapXmlHelper.VerifyInitialXmlHeaders(jsonPayload, generatedXmlFilePath), Is.True, "Initial Header Value Not Correct"); - Assert.That(SapXmlHelper.VerifyOrderOfActions(jsonPayload, generatedXmlFilePath), Is.True, "Order of Action Not Correct in XML File"); - Assert.That(SapXmlHelper.CheckXmlAttributes(jsonPayload, generatedXmlFilePath, requestBody, correctionTag, permitState).Result, Is.True, "CheckXmlAttributes Failed"); + //Logic to download XML from container using TraceID from JSON + string generatedXmlFilePath = _azureBlobStorageHelper.DownloadGeneratedXml(generatedXmlFolder, correlationId); + + //Expected XML + string xmlFilePath = filePath.Replace(Config.TestConfig.PayloadFolder, "ERPFacadeExpectedXmlFiles").Replace(".JSON", ".xml"); + + Assert.That(SapXmlHelper.VerifyGeneratedXml(generatedXmlFilePath, xmlFilePath, permitState)); } return response; } + + public async Task<RestResponse> PostWebhookResponseForMandatoryAttributeValidation(string filePath, string token, string attributeName, int index, string action) + { + string requestBody; + + using (StreamReader streamReader = new(filePath)) + { + requestBody = await streamReader.ReadToEndAsync(); + } + requestBody = JsonHelper.ModifyMandatoryAttribute(requestBody, attributeName, index, action); + + var request = new RestRequest(WebhookRequestEndPoint, Method.Post); + request.AddHeader("Content-Type", "application/json"); + request.AddHeader("Authorization", "Bearer " + token); + request.AddParameter("application/json", requestBody, ParameterType.RequestBody); + RestResponse response = await _client.ExecuteAsync(request); + + return response; + } + } } diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/UKHO.ERPFacade.API.FunctionalTests.csproj b/tests/UKHO.ERPFacade.API.FunctionalTests/UKHO.ERPFacade.API.FunctionalTests.csproj index 118dc65b..f112f4fc 100644 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/UKHO.ERPFacade.API.FunctionalTests.csproj +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/UKHO.ERPFacade.API.FunctionalTests.csproj @@ -23,7 +23,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="FluentAssertions" Version="6.12.1" /> + <PackageReference Include="FluentAssertions" Version="6.12.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" /> @@ -57,127 +57,196 @@ <None Update="appsettings.local.overrides.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Update="ERPFacadeGeneratedXmlFiles\we123s-sds3-df333-d3d.xml"> + <None Update="ERPFacadeExpectedXmlFiles\2NewCells.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID10_UpdateSimple.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\3AdditionalCoverageCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID11_updateOneCellWithNewEditionStatus.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\3AdditionalCoverageCell_AND_CancelCellWithNewCellReplacement.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID12_updateOneCellWithReIssueStatus.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\AdditionalCoverageWithNewEdition.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID13_updateTwoCellsWithDifferentStatusName.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\CancelCellWithExistingCellReplacement.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID14_moveOneCell.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\CancelCellWithNewCellReplacement.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID15_oneNewCellAndOneMoveOneCell.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID33_NewCell_With2UoS_But_only1_having_addProduct.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\CancelCellWithNewCellReplacement_AND_UpdateCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID34_Cancel&Replace_With_NewCells_having_2UoS_With_addProductValue.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\CancelCellWithoutCellReplacement.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID35_Cancel&Replace_With_CancelCell_having_2UoS_but_onlyOneAsTypeUnit.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\CellMetadataChange.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID36_MoveAndSuspended_With_2UoS_But1_Having_addProductsValue.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\CellMetadataChangeWithNewCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID38_3AdditionalCoverageCell.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\CellMetadataChange_AND_SuspendCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID39_1AdditionalCoverageWith1CancelledCell.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\MoveCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID39_1AdditionalCoverageWithReplacedCell.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\MoveCell_AND_SuspendCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID40_1AdditionalCoverageWithReplacedCellAnd1CancelledCell.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\MultipleCellsInSingleUnit.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\LicenceUpdatedPayloadTestData\LU01_ValidInput.json"> + <None Update="ERPFacadeExpectedXmlFiles\NewCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\LicenceUpdatedPayloadTestData\LU02_UnSupportedPayloadType.xml"> + <None Update="ERPFacadeExpectedXmlFiles\NewCell_AND_CancelCellWithNewCellReplacement.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\LicenceUpdatedPayloadTestData\LU04_InvalidLUJsonFile.json"> + <None Update="ERPFacadeExpectedXmlFiles\NewCell_AND_MoveCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\LicenceUpdatedPayloadTestData\LU03_InvalidLUJsonFile.json"> + <None Update="ERPFacadeExpectedXmlFiles\NewCell_AND_UoSMetadataChange.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\PC7_PAYSFDuration12Month.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\NewCell_AND_UpdateCell_AND_CellMetadataChange.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\PC3_MultipleProductDifferentDuration.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\Re-issue.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\PC6_MultipleDurationSameEffectiveDifferentFutureDate.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\SuspendCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\PC1_MultipleProduct.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\SuspendCell_AND_WithdrawCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\PC5_MultipleDurationDifferentEffectiveAndFutureDate.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\UoSMetadataChange.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\PC4_MultipleDurationSameEffectiveAndFutureDate.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\UpdateCell.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\PC2_FutureDateBlank.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\UpdateCellsWithDifferentStatusName.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID37_CreateUoSHavingMultipleItemsInAddProducts.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\UpdateCellWithNewEdition.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\PriceChangeInput.JSON"> + <None Update="ERPFacadeExpectedXmlFiles\WithdrawCell.xml"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadeGeneratedXmlFiles\we123s-sds3-df333-d3d.xml"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\2NewCells.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\3AdditionalCoverageCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\3AdditionalCoverageCell_AND_CancelCellWithNewCellReplacement.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\AdditionalCoverageWithNewEdition.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\CancelCellWithExistingCellReplacement.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\CancelCellWithNewCellReplacement.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\CancelCellWithNewCellReplacement_AND_CellMetadataChange_AND_MoveCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\CancelCellWithNewCellReplacement_AND_UpdateCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\CancelCellWithoutCellReplacement.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\CellMetadataChange.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\CellMetadataChangeWithNewCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\CellMetadataChange_AND_SuspendCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\ID39_1AdditionalCoverageWithReplacedCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\LicenceUpdatedPayloadTestData\LU01_ValidInput.json"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\LicenceUpdatedPayloadTestData\LU02_UnSupportedPayloadType.xml"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\LicenceUpdatedPayloadTestData\LU04_InvalidLUJsonFile.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID20_newEditionAdditionalCoverageV_01.JSON"> + <None Update="ERPFacadePayloadTestData\LicenceUpdatedPayloadTestData\LU03_InvalidLUJsonFile.json"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\MandatoryAttributeValidation.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\MoveCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\MoveCell_AND_SuspendCell.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID21_cancelAndReplaceV_03.JSON"> + <None Update="ERPFacadePayloadTestData\MultipleCellsInSingleUnit.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID22_Cell_Moves_Unit_and_New_CellV_03.JSON"> + <None Update="ERPFacadePayloadTestData\NewCell.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID23_Cell_MoveV_03.JSON"> + <None Update="ERPFacadePayloadTestData\NewCell_AND_CancelCellWithNewCellReplacement.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID24_Metadata_ChangeV_03.JSON"> + <None Update="ERPFacadePayloadTestData\NewCell_AND_MoveCell.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID25_Mixed_scenario1V_03.JSON"> + <None Update="ERPFacadePayloadTestData\NewCell_AND_UoSMetadataChange.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID26_New_CellV_03.JSON"> + <None Update="ERPFacadePayloadTestData\NewCell_AND_UpdateCell_AND_CellMetadataChange.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID27_supplier_Defined_ReleasabilitySet_V_01.JSON"> + <None Update="ERPFacadePayloadTestData\PC7_PAYSFDuration12Month.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID28_simpleSuspendedScenario.JSON"> + <None Update="ERPFacadePayloadTestData\PC3_MultipleProductDifferentDuration.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID29_simpleWithdrawnScenario.JSON"> + <None Update="ERPFacadePayloadTestData\PC6_MultipleDurationSameEffectiveDifferentFutureDate.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID30_Suspend_and_WithdrawV01.JSON"> + <None Update="ERPFacadePayloadTestData\PC1_MultipleProduct.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID31_metadataAndSuspended.JSON"> + <None Update="ERPFacadePayloadTestData\PC5_MultipleDurationDifferentEffectiveAndFutureDate.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID32_moveAndSuspended.JSON"> + <None Update="ERPFacadePayloadTestData\PC4_MultipleDurationSameEffectiveAndFutureDate.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\PC2_FutureDateBlank.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\PriceChangeInput.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\Re-issue.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> <None Update="ERPFacadePayloadTestData\RoSPayloadTestData\LTC03_InValidLTCwithNoCorrelationID.json"> @@ -252,47 +321,16 @@ <None Update="ERPFacadePayloadTestData\SapMockApiConfigure.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\UoS1_Pricing.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - - <None Update="ERPFacadePayloadTestData\ID16_newCell_updateCell_metadataChange.JSON"> + <None Update="ERPFacadePayloadTestData\SuspendCell.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID17_newCell_and_CancelReplace.JSON"> + <None Update="ERPFacadePayloadTestData\SuspendCell_AND_WithdrawCell.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID18_CancelReplace_UpdateCell.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID19_CR_metadata_move.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID1_WebhookPayload.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID2_WebhookPayload_Invalid.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID3_1NewCellScenario.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID4_2NewCellScenario.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID5_1NewCellWoNewAVCSUnit.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID6_2CellsReplace1CellsCancel.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID7_1CellCancel.JSON"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="ERPFacadePayloadTestData\ID8_2CellMetadataChange.JSON"> + <None Update="ERPFacadePayloadTestData\UoS1_Pricing.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="ERPFacadePayloadTestData\ID9_MetadataChange.JSON"> + <None Update="ERPFacadePayloadTestData\WebhookPayload.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> <None Update="ERPFacadePayloadTestData\UoS2_ProductISNullUOS.JSON"> @@ -301,6 +339,9 @@ <None Update="ERPFacadePayloadTestData\UoS3_ProductMissingUOS.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> + <None Update="ERPFacadePayloadTestData\UoSMetadataChange.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> <None Update="ERPFacadePayloadTestData\UoS_10_DiffntEffectiveAndDiffFutureDate.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> @@ -324,6 +365,18 @@ </None> <None Update="ERPFacadePayloadTestData\UoS_9_SameEffectiveDiffFutureDate.JSON"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\UpdateCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\UpdateCellsWithDifferentStatusName.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\UpdateCellWithNewEdition.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="ERPFacadePayloadTestData\WithdrawCell.JSON"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/appsettings.json b/tests/UKHO.ERPFacade.API.FunctionalTests/appsettings.json index 6aea8a24..8ff1aea8 100644 --- a/tests/UKHO.ERPFacade.API.FunctionalTests/appsettings.json +++ b/tests/UKHO.ERPFacade.API.FunctionalTests/appsettings.json @@ -1,8 +1,8 @@ { "PayloadFolder": "ERPFacadePayloadTestData", - "WebhookPayloadFileName": "ID1_WebhookPayload.JSON", + "WebhookPayloadFileName": "WebhookPayload.JSON", "WebhookInvalidPayloadFileName": "ID2_WebhookPayload_Invalid.JSON", - "GeneratedXMLFolder": "ERPFacadeGeneratedXmlFiles", + "GeneratedXMLFolder": "ERPFacadeGeneratedXmlFiles", "LicenceUpdatedPayloadTestData": "LicenceUpdatedPayloadTestData", "WeekNoTag": "202403", "ValidFromTagThursday": "20240118", @@ -27,6 +27,7 @@ "AzureStorageConfiguration": { "ConnectionString": "" }, + "PermitWithSameKey": { "Permit": "", "ActiveKey": "", @@ -39,29 +40,6 @@ "NextKey": "" }, - "XMLActionList": [ - "ACTIONNUMBER", - "ACTION", - "PRODUCT", - "PRODTYPE", - "CHILDCELL", - "PRODUCTNAME", - "CANCELLED", - "REPLACEDBY", - "AGENCY", - "PROVIDER", - "ENCSIZE", - "TITLE", - "EDITIONNO", - "UPDATENO", - "UNITTYPE", - "ACTIVEKEY", - "NEXTKEY", - "WEEKNO", - "VALIDFROM", - "CORRECTION" - ], - "RosLicenceUpdateXMLList": [ "GUID", "SERVICETYPE", diff --git a/tests/UKHO.ERPFacade.API.UnitTests/Controllers/WebhookControllerTests.cs b/tests/UKHO.ERPFacade.API.UnitTests/Controllers/WebhookControllerTests.cs index fe6beda8..63af4249 100644 --- a/tests/UKHO.ERPFacade.API.UnitTests/Controllers/WebhookControllerTests.cs +++ b/tests/UKHO.ERPFacade.API.UnitTests/Controllers/WebhookControllerTests.cs @@ -128,32 +128,32 @@ public async Task WhenValidEventInNewEncContentPublishedEventReceived_ThenWebhoo A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information - && call.GetArgument<EventId>(1) == EventIds.StoreEncContentPublishedEventInAzureTable.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Storing the received ENC content published event in azure table.").MustHaveHappenedOnceExactly(); + && call.GetArgument<EventId>(1) == EventIds.AddingEntryForEncContentPublishedEventInAzureTable.ToEventId() + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Adding/Updating entry for enccontentpublished event in azure table.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information - && call.GetArgument<EventId>(1) == EventIds.UploadEncContentPublishedEventInAzureBlob.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Uploading the received ENC content published event in blob storage.").MustHaveHappenedOnceExactly(); + && call.GetArgument<EventId>(1) == EventIds.UploadEncContentPublishedEventInAzureBlobStarted.ToEventId() + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Uploading enccontentpublished event payload in blob storage.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information - && call.GetArgument<EventId>(1) == EventIds.UploadedEncContentPublishedEventInAzureBlob.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "ENC content published event is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); + && call.GetArgument<EventId>(1) == EventIds.UploadEncContentPublishedEventInAzureBlobCompleted.ToEventId() + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "The enccontentpublished event payload is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information && call.GetArgument<EventId>(1) == EventIds.UploadSapXmlPayloadInAzureBlobStarted.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Uploading the SAP xml payload in blob storage.").MustHaveHappenedOnceExactly(); + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Uploading the SAP XML payload in blob storage.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information && call.GetArgument<EventId>(1) == EventIds.UploadSapXmlPayloadInAzureBlobCompleted.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP xml payload is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP XML payload is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information - && call.GetArgument<EventId>(1) == EventIds.EncUpdatePushedToSap.ToEventId() + && call.GetArgument<EventId>(1) == EventIds.EncUpdateSentToSap.ToEventId() && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "ENC update has been sent to SAP successfully. | {StatusCode}").MustHaveHappenedOnceExactly(); } @@ -178,7 +178,7 @@ public async Task WhenCorrelationIdIsMissingInNewEncContentPublishedEvent_ThenWe A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Warning && call.GetArgument<EventId>(1) == EventIds.CorrelationIdMissingInEvent.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "CorrelationId is missing in ENC content published event.").MustHaveHappenedOnceExactly(); + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "CorrelationId is missing in enccontentpublished event.").MustHaveHappenedOnceExactly(); } [Test] @@ -208,33 +208,28 @@ public void WhenSapDoesNotRespond200Ok_ThenWebhookReturns500InternalServerRespon A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information - && call.GetArgument<EventId>(1) == EventIds.StoreEncContentPublishedEventInAzureTable.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Storing the received ENC content published event in azure table.").MustHaveHappenedOnceExactly(); + && call.GetArgument<EventId>(1) == EventIds.AddingEntryForEncContentPublishedEventInAzureTable.ToEventId() + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Adding/Updating entry for enccontentpublished event in azure table.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information - && call.GetArgument<EventId>(1) == EventIds.UploadEncContentPublishedEventInAzureBlob.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Uploading the received ENC content published event in blob storage.").MustHaveHappenedOnceExactly(); + && call.GetArgument<EventId>(1) == EventIds.UploadEncContentPublishedEventInAzureBlobStarted.ToEventId() + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Uploading enccontentpublished event payload in blob storage.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information - && call.GetArgument<EventId>(1) == EventIds.UploadedEncContentPublishedEventInAzureBlob.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "ENC content published event is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); + && call.GetArgument<EventId>(1) == EventIds.UploadEncContentPublishedEventInAzureBlobCompleted.ToEventId() + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "The enccontentpublished event payload is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information && call.GetArgument<EventId>(1) == EventIds.UploadSapXmlPayloadInAzureBlobStarted.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Uploading the SAP xml payload in blob storage.").MustHaveHappenedOnceExactly(); + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Uploading the SAP XML payload in blob storage.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument<LogLevel>(0) == LogLevel.Information && call.GetArgument<EventId>(1) == EventIds.UploadSapXmlPayloadInAzureBlobCompleted.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP xml payload is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); - - A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument<LogLevel>(0) == LogLevel.Error - && call.GetArgument<EventId>(1) == EventIds.ErrorOccuredInSap.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "An error occured while processing your request in SAP. | {StatusCode}").MustHaveHappenedOnceExactly(); + && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP XML payload is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); } [Test] @@ -503,11 +498,6 @@ public void WhenSapDoesNotRespond200Ok_ThenLicenceUpdatedWebhookReturns500Intern && call.GetArgument<LogLevel>(0) == LogLevel.Information && call.GetArgument<EventId>(1) == EventIds.UploadedLicenceUpdatedPublishedEventInAzureBlob.ToEventId() && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Licence updated published event is uploaded in blob storage successfully.").MustHaveHappenedOnceExactly(); - - A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument<LogLevel>(0) == LogLevel.Error - && call.GetArgument<EventId>(1) == EventIds.ErrorOccurredInSapForLicenceUpdatedPublishedEvent.ToEventId() - && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "An error occurred while sending licence updated event data to SAP. | {StatusCode}").MustHaveHappenedOnceExactly(); } } } diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/ActionItemNodeTest.xml b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/ActionItemNodeTest.xml deleted file mode 100644 index 2438f92b..00000000 --- a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/ActionItemNodeTest.xml +++ /dev/null @@ -1,593 +0,0 @@ -<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> - <soap:Body> - <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> - <IM_MATINFO xmlns=""> - <CORRID></CORRID> - <NOOFACTIONS></NOOFACTIONS> - <RECDATE></RECDATE> - <RECTIME></RECTIME> - <ORG>UKHO</ORG> -<ACTIONITEMS> -<item> - <ACTIONNUMBER>4</ACTIONNUMBER> - <ACTION>REPLACED WITH ENC CELL</ACTION> - <PRODUCT>ENC CELL</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY>US4AK6NT</REPLACEDBY> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>4</ACTIONNUMBER> - <ACTION>REPLACED WITH ENC CELL</ACTION> - <PRODUCT>ENC CELL</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY>US4AK6NU</REPLACEDBY> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>9</ACTIONNUMBER> - <ACTION>CANCEL ENC CELL</ACTION> - <PRODUCT>ENC CELL</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>10</ACTIONNUMBER> - <ACTION>CANCEL AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL /> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>1</ACTIONNUMBER> - <ACTION>CREATE ENC CELL</ACTION> - <PRODUCT>ENC CELL</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NT</CHILDCELL> - <PRODUCTNAME>US4AK6NT</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY>US</AGENCY> - <PROVIDER>1</PROVIDER> - <ENCSIZE>medium</ENCSIZE> - <TITLE>Norton Sound - Alaska - 8 - 2 - - - - 1 - CREATE ENC CELL - ENC CELL - S57 - US4AK6NU - US4AK6NU - - - US - 1 - medium - Norton Sound - Alaska - 8 - 2 - - - - 2 - CREATE AVCS UNIT OF SALE - AVCS UNIT - S57 - - US4AK6NT - - - US - 1 - large - Norton Sound - Alaska - - - AVCS Units Coastal - - - 2 - CREATE AVCS UNIT OF SALE - AVCS UNIT - S57 - - US4AK6NU - - - US - 1 - large - Norton Sound - Alaska - - - AVCS Units Coastal - - - 3 - ASSIGN CELL TO AVCS UNIT OF SALE - AVCS UNIT - S57 - US4AK6NT - US4AK6NT - - - - - - - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NU</CHILDCELL> - <PRODUCTNAME>US4AK6NU</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NT</CHILDCELL> - <PRODUCTNAME>AVCSO</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NU</CHILDCELL> - <PRODUCTNAME>AVCSO</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NT</CHILDCELL> - <PRODUCTNAME>PAYSF</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NU</CHILDCELL> - <PRODUCTNAME>PAYSF</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>8</ACTIONNUMBER> - <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>8</ACTIONNUMBER> - <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>AVCSO</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>8</ACTIONNUMBER> - <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>PAYSF</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>4</ACTIONNUMBER> - <ACTION>REPLACED WITH ENC CELL</ACTION> - <PRODUCT>ENC CELL</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY>US4AK6NT</REPLACEDBY> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>4</ACTIONNUMBER> - <ACTION>REPLACED WITH ENC CELL</ACTION> - <PRODUCT>ENC CELL</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY>US4AK6NU</REPLACEDBY> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>9</ACTIONNUMBER> - <ACTION>CANCEL ENC CELL</ACTION> - <PRODUCT>ENC CELL</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>10</ACTIONNUMBER> - <ACTION>CANCEL AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL /> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>1</ACTIONNUMBER> - <ACTION>CREATE ENC CELL</ACTION> - <PRODUCT>ENC CELL</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NT</CHILDCELL> - <PRODUCTNAME>US4AK6NT</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY>US</AGENCY> - <PROVIDER>1</PROVIDER> - <ENCSIZE>medium</ENCSIZE> - <TITLE>Norton Sound - Alaska - 8 - 2 - - - - 1 - CREATE ENC CELL - ENC CELL - S57 - US4AK6NU - US4AK6NU - - - US - 1 - medium - Norton Sound - Alaska - 8 - 2 - - - - 2 - CREATE AVCS UNIT OF SALE - AVCS UNIT - S57 - - US4AK6NT - - - US - 1 - large - Norton Sound - Alaska - - - AVCS Units Coastal - - - 2 - CREATE AVCS UNIT OF SALE - AVCS UNIT - S57 - - US4AK6NU - - - US - 1 - large - Norton Sound - Alaska - - - AVCS Units Coastal - - - 3 - ASSIGN CELL TO AVCS UNIT OF SALE - AVCS UNIT - S57 - US4AK6NT - US4AK6NT - - - - - - - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NU</CHILDCELL> - <PRODUCTNAME>US4AK6NU</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NT</CHILDCELL> - <PRODUCTNAME>AVCSO</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NU</CHILDCELL> - <PRODUCTNAME>AVCSO</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NT</CHILDCELL> - <PRODUCTNAME>PAYSF</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>3</ACTIONNUMBER> - <ACTION>ASSIGN CELL TO AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US4AK6NU</CHILDCELL> - <PRODUCTNAME>PAYSF</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>8</ACTIONNUMBER> - <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>US5AK83M</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>8</ACTIONNUMBER> - <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>AVCSO</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> -<item> - <ACTIONNUMBER>8</ACTIONNUMBER> - <ACTION>REMOVE ENC CELL FROM AVCS UNIT OF SALE</ACTION> - <PRODUCT>AVCS UNIT</PRODUCT> - <PRODTYPE>S57</PRODTYPE> - <CHILDCELL>US5AK83M</CHILDCELL> - <PRODUCTNAME>PAYSF</PRODUCTNAME> - <CANCELLED /> - <REPLACEDBY /> - <AGENCY /> - <PROVIDER /> - <ENCSIZE /> - <TITLE /> - <EDITIONNO /> - <UPDATENO /> - <UNITTYPE /> -</item> - </ACTIONITEMS> - </IM_MATINFO> - </Z_ADDS_MAT_INFO> - </soap:Body> -</soap:Envelope> diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/AdditionalCoverageWithNewEdition.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/AdditionalCoverageWithNewEdition.JSON new file mode 100644 index 00000000..b890986b --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/AdditionalCoverageWithNewEdition.JSON @@ -0,0 +1,126 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "681eb9ee-2b1e-408f-95c6-3e2dcc33a721", + "time": "2024-09-16T10:06:58.8441514+00:00", + "subject": "RU4O5XQ0", + "datacontenttype": "application/json", + "data": { + "correlationId": "05334dd0-db09-47a7-9cee-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "RU4O5XQ0.000", + "productName": "RU4O5XQ0", + "title": "Sea of Okhotsk - Shelikhov Gulf - Nayakhanskaya and Varkhalamskaya Inlet", + "scale": 45000, + "usageBand": 4, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "permitstring", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B4" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-13", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [ + "RU4O0YF0" + ], + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386746, + "southLimit": 61.6953413, + "eastLimit": 159.5691864, + "westLimit": 158.8358531 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "RU4O5XQ0", + "PAYSF" + ], + "s63": { + "name": "RU4O5XQ0.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "867BA7C2" + }, + "signature": { + "name": "RULO5XQ0.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "RU4O5XQ0", + "title": "Nayakhanskaya-Varkhalamskaya", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 61.9386749, + "southLimit": 61.6953416, + "eastLimit": 159.5691747, + "westLimit": 158.8358414 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/CancelCellWithExistingCellReplacement.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/CancelCellWithExistingCellReplacement.JSON new file mode 100644 index 00000000..69fd4fc7 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/CancelCellWithExistingCellReplacement.JSON @@ -0,0 +1,264 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "b5c7a0fe-7459-432b-bdd0-9229b63b87ee", + "time": "2024-09-11T13:13:07.9481962+00:00", + "subject": "GB100160,GB50382B", + "datacontenttype": "application/json", + "data": { + "correlationId": "e61f5a69-c5a8-465b-6e56-08dccb3abf10", + "ukhoWeekNumber": { + "year": 2024, + "week": 32, + "currentWeekAlphaCorrection": true + }, + "products": [ + { + "dataSetName": "GB100160.000", + "productName": "GB100160", + "title": "British Isles", + "scale": 1500000, + "usageBand": 1, + "editionNumber": 54, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "permitstring", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-05-20", + "isNewCell": false + }, + "replaces": [ + "GB50382B" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 62.8339046, + "southLimit": 48.16669, + "eastLimit": 3.4164755, + "westLimit": -13.78663 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "GB100160", + "PAYSF" + ], + "s63": { + "name": "GB100160.000", + "hash": "D59D6E3CC8058A6FB2E4B0576FEF912801CDB0D5F0DD5D1B18B23DCE16EDEEB9", + "fileSize": 1318248, + "compression": true, + "s57Crc": "9C30F721" + }, + "signature": { + "name": "GBI00160.000", + "hash": "FB37D9A565437278A2A72F311885C9BBCA7B30B494B3DD48ADA55624B29FB946", + "fileSize": 874 + }, + "ancillaryFiles": [ + { + "name": "GBDEEPWR.TXT", + "hash": "1159C9F4E5618C0F5280D96625413C8EFF35DB7C53A7DC72B7FC39C844EE2125", + "fileSize": 128 + }, + { + "name": "GBN00905.TXT", + "hash": "699DDF31E5BCD5D553A5BFB235D14F8BFE526A9AE8B0630A7A2C393292B51E94", + "fileSize": 348 + }, + { + "name": "GBN00903.TXT", + "hash": "570319BB2F318EA7B5DBBF2DFCCA5349DEE2A37C0513A393F9BF2EF1841BD629", + "fileSize": 305 + }, + { + "name": "GB114_18.TXT", + "hash": "FE1216B9D0119AA35713DB71A25E32C853D669448CF5E30278B8686DCCE465F2", + "fileSize": 140 + }, + { + "name": "GBD3A002.TXT", + "hash": "0B62ABAED81556475005823A79071580410E15A9C9E7E6472DD88249477B88EA", + "fileSize": 265 + }, + { + "name": "GBDARWIN.TXT", + "hash": "2B0EFEE39BD48CDCA8FD6518966850518E53E9DD2C851381F936730A4930A085", + "fileSize": 141 + }, + { + "name": "GB114_34.TXT", + "hash": "F6BC3DEDEB0BADD25CD1B2FB83AEEC6A7861159B04B57C7AC8695C9A93FE5C6A", + "fileSize": 150 + }, + { + "name": "GB5500MR.TXT", + "hash": "E893DCDD6BB4DF54A7E394E80CD9758FE6C92BD11B22B5507FDE72A2DB89DBF0", + "fileSize": 263 + }, + { + "name": "GBN00904.TXT", + "hash": "81B1518737304F274F8DCE4094CE6A42D628061BACC45867B233D1F718DE7A9E", + "fileSize": 303 + }, + { + "name": "GBG1DXXX.TXT", + "hash": "0DD997E018EBBC272E8965DC8265DAF51A78B83AEB8EF400C6E09381128EE4AA", + "fileSize": 376 + }, + { + "name": "GB062_36.TXT", + "hash": "1608AEBF1AB7BF68ACA9FB5768D0ABEF6B313A0F028FE3D297E15E829F40942E", + "fileSize": 170 + } + ] + }, + { + "dataSetName": "GB50382B.003", + "productName": "GB50382B", + "title": "Warkworth Harbour", + "scale": 12000, + "usageBand": 5, + "editionNumber": 6, + "updateNumber": 3, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "permitstring", + "providerCode": "1", + "providerName": "ICE", + "size": "small", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "GB100160" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 55.3600388, + "southLimit": 55.3050432, + "eastLimit": -1.5116288, + "westLimit": -1.6166183 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "GB50382B.003", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "D3821E07" + }, + "signature": { + "name": "GBM0382B.003", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "GB100160", + "title": "British Isles", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Overview", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 62.8339046, + "southLimit": 48.16669, + "eastLimit": 3.4164755, + "westLimit": -13.78663 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "GB50382B", + "title": "Warkworth Harbour", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 55.3600388, + "southLimit": 55.3050432, + "eastLimit": -1.5116288, + "westLimit": -1.6166183 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "GB50382B" + ] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "GB50382B" + ] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/CancelCellWithNewCellReplacement.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/CancelCellWithNewCellReplacement.JSON new file mode 100644 index 00000000..970ba952 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/CancelCellWithNewCellReplacement.JSON @@ -0,0 +1,334 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "2e7a5a1c-f86d-4ec9-8623-a885b6d40c3a", + "time": "2024-09-13T09:56:57.4064515+00:00", + "subject": "US5NY28M,US5NY6HU,US5NY6HV", + "datacontenttype": "application/json", + "data": { + "correlationId": "21e3517a-ff12-4f82-9d05-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5NY28M.002", + "productName": "US5NY28M", + "title": "Oswego Harbor", + "scale": 10000, + "usageBand": 5, + "editionNumber": 16, + "updateNumber": 2, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "permitString", + "providerCode": "1", + "providerName": "ICE", + "size": "", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-07", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "US5NY6HU", + "US5NY6HV" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 43.4970538, + "southLimit": 43.4299118, + "eastLimit": -76.4792537, + "westLimit": -76.5562608 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "US5NY28M.002", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "E6F9DCCE" + }, + "signature": { + "name": "USMNY28M.002", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + }, + { + "dataSetName": "US5NY6HU.000", + "productName": "US5NY6HU", + "title": "Lake Ontario - Oswego Harbor NY", + "scale": 12000, + "usageBand": 5, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "GB1234562024121826A12EE4B22227AF778FAEB926CDFD86F0465D3FDFA7B612", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-15", + "isNewCell": true + }, + "replaces": [ + "US5NY28M" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 43.5, + "southLimit": 43.425, + "eastLimit": -76.5, + "westLimit": -76.575 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5NY6HU" + ], + "s63": { + "name": "US5NY6HU.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "F7069025" + }, + "signature": { + "name": "USMNY6HU.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US386HUD.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + }, + { + "name": "US386HUA.TXT", + "hash": "01D5B3B4408AEC496FD57FD3286CF7B95AC6A035B081671DFD1D02BADA526548", + "fileSize": 5267 + }, + { + "name": "US386HUC.TXT", + "hash": "A70F53C099FC942C4CE2240CEB5BE6FBCDCFD6098AA4673DC9E55FB024822AEB", + "fileSize": 329 + }, + { + "name": "US386HUB.TXT", + "hash": "1E8A7357C00BCA2BD384B678BD6B7392150FFD471A220B836BCD0446E64DCBC5", + "fileSize": 838 + } + ] + }, + { + "dataSetName": "US5NY6HV.000", + "productName": "US5NY6HV", + "title": "Lake Ontario - Oswego NY", + "scale": 12000, + "usageBand": 5, + "editionNumber": 2, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "GB1234562024121826A12EE4B22227AF778FAEB926CDFD86F0465D3FDFA7B612", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-15", + "isNewCell": true + }, + "replaces": [ + "US5NY28M" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 43.5, + "southLimit": 43.425, + "eastLimit": -76.425, + "westLimit": -76.5 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5NY6HV" + ], + "s63": { + "name": "US5NY6HV.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "FF05E6A0" + }, + "signature": { + "name": "USMNY6HV.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US386HVA.TXT", + "hash": "FF434E362FF07B5EF7A2296DE77197453C5CBF6851A66DCBB4E255F574E9D235", + "fileSize": 4701 + }, + { + "name": "US386HVC.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + }, + { + "name": "US386HVB.TXT", + "hash": "1E8A7357C00BCA2BD384B678BD6B7392150FFD471A220B836BCD0446E64DCBC5", + "fileSize": 838 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5NY28M", + "title": "Oswego Harbor", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 43.4970538, + "southLimit": 43.4299118, + "eastLimit": -76.4792537, + "westLimit": -76.5562608 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "US5NY28M" + ] + } + }, + { + "unitName": "US5NY6HU", + "title": "Lake Ontario - Oswego Harbor NY", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 43.5, + "southLimit": 43.425, + "eastLimit": -76.5, + "westLimit": -76.575 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5NY6HU" + ], + "removeProducts": [] + } + }, + { + "unitName": "US5NY6HV", + "title": "Lake Ontario - Oswego NY", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "NotForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 43.5, + "southLimit": 43.425, + "eastLimit": -76.425, + "westLimit": -76.5 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5NY6HV" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5NY6HU", + "US5NY6HV" + ], + "removeProducts": [ + "US5NY28M" + ] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCell.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCell.JSON new file mode 100644 index 00000000..1e413fa1 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCell.JSON @@ -0,0 +1,139 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "f206ec1c-0b83-43a2-b11c-cca1d981c2a4", + "time": "2024-09-13T05:34:42.4904747+00:00", + "subject": "US5AK9DI", + "datacontenttype": "application/json", + "data": { + "correlationId": "5004bc72-5beb-42c1-5037-08dcc74c342e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5AK9DI.000", + "productName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "permitstring", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-11", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK9DI" + ], + "s63": { + "name": "US5AK9DI.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8A46B83F" + }, + "signature": { + "name": "USMAK9DI.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US213DIA.TXT", + "hash": "4E3E678781D95F476C0D099375A71A81FC5570C9D92C6DFFC93EF2C11A029632", + "fileSize": 4008 + }, + { + "name": "US213DIB.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithEmptyPermit.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithEmptyPermit.JSON new file mode 100644 index 00000000..70fdd0e2 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithEmptyPermit.JSON @@ -0,0 +1,139 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "f206ec1c-0b83-43a2-b11c-cca1d981c2a4", + "time": "2024-09-13T05:34:42.4904747+00:00", + "subject": "US5AK9DI", + "datacontenttype": "application/json", + "data": { + "correlationId": "5004bc72-5beb-42c1-5037-08dcc74c342e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5AK9DI.000", + "productName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-11", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK9DI" + ], + "s63": { + "name": "US5AK9DI.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8A46B83F" + }, + "signature": { + "name": "USMAK9DI.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US213DIA.TXT", + "hash": "4E3E678781D95F476C0D099375A71A81FC5570C9D92C6DFFC93EF2C11A029632", + "fileSize": 4008 + }, + { + "name": "US213DIB.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + } + ] + } +} \ No newline at end of file diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithNoUnitOfSaleHavingTypeIsUnit.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithNoUnitOfSaleHavingTypeIsUnit.JSON new file mode 100644 index 00000000..d22127d6 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithNoUnitOfSaleHavingTypeIsUnit.JSON @@ -0,0 +1,113 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "f206ec1c-0b83-43a2-b11c-cca1d981c2a4", + "time": "2024-09-13T05:34:42.4904747+00:00", + "subject": "US5AK9DI", + "datacontenttype": "application/json", + "data": { + "correlationId": "5004bc72-5beb-42c1-5037-08dcc74c342e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5AK9DI.000", + "productName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "permitString", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-11", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK9DI" + ], + "s63": { + "name": "US5AK9DI.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8A46B83F" + }, + "signature": { + "name": "USMAK9DI.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US213DIA.TXT", + "hash": "4E3E678781D95F476C0D099375A71A81FC5570C9D92C6DFFC93EF2C11A029632", + "fileSize": 4008 + }, + { + "name": "US213DIB.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithWrongUkhoWeekDetails.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithWrongUkhoWeekDetails.JSON new file mode 100644 index 00000000..c1124c8a --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithWrongUkhoWeekDetails.JSON @@ -0,0 +1,139 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "f206ec1c-0b83-43a2-b11c-cca1d981c2a4", + "time": "2024-09-13T05:34:42.4904747+00:00", + "subject": "US5AK9DI", + "datacontenttype": "application/json", + "data": { + "correlationId": "5004bc72-5beb-42c1-5037-08dcc74c342e", + "ukhoWeekNumber": { + "year": 0, + "week": 89, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5AK9DI.000", + "productName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "permitString", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-11", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK9DI" + ], + "s63": { + "name": "US5AK9DI.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8A46B83F" + }, + "signature": { + "name": "USMAK9DI.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US213DIA.TXT", + "hash": "4E3E678781D95F476C0D099375A71A81FC5570C9D92C6DFFC93EF2C11A029632", + "fileSize": 4008 + }, + { + "name": "US213DIB.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithoutProviderCodeAttributes.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithoutProviderCodeAttributes.JSON new file mode 100644 index 00000000..0712d20a --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithoutProviderCodeAttributes.JSON @@ -0,0 +1,139 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "f206ec1c-0b83-43a2-b11c-cca1d981c2a4", + "time": "2024-09-13T05:34:42.4904747+00:00", + "subject": "US5AK9DI", + "datacontenttype": "application/json", + "data": { + "correlationId": "5004bc72-5beb-42c1-5037-08dcc74c342e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "US5AK9DI.000", + "productName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "permitString", + "provideCode": "", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-11", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK9DI" + ], + "s63": { + "name": "US5AK9DI.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8A46B83F" + }, + "signature": { + "name": "USMAK9DI.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US213DIA.TXT", + "hash": "4E3E678781D95F476C0D099375A71A81FC5570C9D92C6DFFC93EF2C11A029632", + "fileSize": 4008 + }, + { + "name": "US213DIB.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithoutUkhoWeekNumberSection.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithoutUkhoWeekNumberSection.JSON new file mode 100644 index 00000000..388249be --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/NewCellWithoutUkhoWeekNumberSection.JSON @@ -0,0 +1,134 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "f206ec1c-0b83-43a2-b11c-cca1d981c2a4", + "time": "2024-09-13T05:34:42.4904747+00:00", + "subject": "US5AK9DI", + "datacontenttype": "application/json", + "data": { + "correlationId": "5004bc72-5beb-42c1-5037-08dcc74c342e", + "products": [ + { + "dataSetName": "US5AK9DI.000", + "productName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "scale": 22000, + "usageBand": 5, + "editionNumber": 1, + "updateNumber": 0, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "permitString", + "providerCode": "1", + "providerName": "ICE", + "size": "medium", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B5" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-07-11", + "isNewCell": true + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "PAYSF", + "US5AK9DI" + ], + "s63": { + "name": "US5AK9DI.000", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "8A46B83F" + }, + "signature": { + "name": "USMAK9DI.000", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [ + { + "name": "US213DIA.TXT", + "hash": "4E3E678781D95F476C0D099375A71A81FC5570C9D92C6DFFC93EF2C11A029632", + "fileSize": 4008 + }, + { + "name": "US213DIB.TXT", + "hash": "58BB9B3E80832BFFBB86B8BF2513BF3755B847BDEA0AF3332BE445FE864E9835", + "fileSize": 293 + } + ] + } + ], + "unitsOfSale": [ + { + "unitName": "US5AK9DI", + "title": "Amlia Island - Svechnikof Harbor", + "unitOfSaleType": "unit", + "unitSize": "medium", + "unitType": "AVCS Units Harbour", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": true, + "geographicLimit": { + "boundingBox": { + "northLimit": 52.125, + "southLimit": 52.05, + "eastLimit": -173.4, + "westLimit": -173.55 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [ + "US5AK9DI" + ], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/ReplaceCellWithNoUnitOfSaleHavingTypeIsUnit.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/ReplaceCellWithNoUnitOfSaleHavingTypeIsUnit.JSON new file mode 100644 index 00000000..7619166c --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/ReplaceCellWithNoUnitOfSaleHavingTypeIsUnit.JSON @@ -0,0 +1,214 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "b5c7a0fe-7459-432b-bdd0-9229b63b87ee", + "time": "2024-09-11T13:13:07.9481962+00:00", + "subject": "GB100160,GB50382B", + "datacontenttype": "application/json", + "data": { + "correlationId": "e61f5a69-c5a8-465b-6e56-08dccb3abf10", + "ukhoWeekNumber": { + "year": 2024, + "week": 32, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "GB100160.000", + "productName": "GB100160", + "title": "British Isles", + "scale": 1500000, + "usageBand": 1, + "editionNumber": 54, + "updateNumber": 0, + "mayAffectHoldings": false, + "contentChange": false, + "permit": "permitString", + "providerCode": "1", + "providerName": "ICE", + "size": "large", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "New Edition", + "statusDate": "2024-05-20", + "isNewCell": false + }, + "replaces": [ + "GB50382B" + ], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 62.8339046, + "southLimit": 48.16669, + "eastLimit": 3.4164755, + "westLimit": -13.78663 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "GB100160", + "PAYSF" + ], + "s63": { + "name": "GB100160.000", + "hash": "D59D6E3CC8058A6FB2E4B0576FEF912801CDB0D5F0DD5D1B18B23DCE16EDEEB9", + "fileSize": 1318248, + "compression": true, + "s57Crc": "9C30F721" + }, + "signature": { + "name": "GBI00160.000", + "hash": "FB37D9A565437278A2A72F311885C9BBCA7B30B494B3DD48ADA55624B29FB946", + "fileSize": 874 + }, + "ancillaryFiles": [ + { + "name": "GBDEEPWR.TXT", + "hash": "1159C9F4E5618C0F5280D96625413C8EFF35DB7C53A7DC72B7FC39C844EE2125", + "fileSize": 128 + }, + { + "name": "GBN00905.TXT", + "hash": "699DDF31E5BCD5D553A5BFB235D14F8BFE526A9AE8B0630A7A2C393292B51E94", + "fileSize": 348 + }, + { + "name": "GBN00903.TXT", + "hash": "570319BB2F318EA7B5DBBF2DFCCA5349DEE2A37C0513A393F9BF2EF1841BD629", + "fileSize": 305 + }, + { + "name": "GB114_18.TXT", + "hash": "FE1216B9D0119AA35713DB71A25E32C853D669448CF5E30278B8686DCCE465F2", + "fileSize": 140 + }, + { + "name": "GBD3A002.TXT", + "hash": "0B62ABAED81556475005823A79071580410E15A9C9E7E6472DD88249477B88EA", + "fileSize": 265 + }, + { + "name": "GBDARWIN.TXT", + "hash": "2B0EFEE39BD48CDCA8FD6518966850518E53E9DD2C851381F936730A4930A085", + "fileSize": 141 + }, + { + "name": "GB114_34.TXT", + "hash": "F6BC3DEDEB0BADD25CD1B2FB83AEEC6A7861159B04B57C7AC8695C9A93FE5C6A", + "fileSize": 150 + }, + { + "name": "GB5500MR.TXT", + "hash": "E893DCDD6BB4DF54A7E394E80CD9758FE6C92BD11B22B5507FDE72A2DB89DBF0", + "fileSize": 263 + }, + { + "name": "GBN00904.TXT", + "hash": "81B1518737304F274F8DCE4094CE6A42D628061BACC45867B233D1F718DE7A9E", + "fileSize": 303 + }, + { + "name": "GBG1DXXX.TXT", + "hash": "0DD997E018EBBC272E8965DC8265DAF51A78B83AEB8EF400C6E09381128EE4AA", + "fileSize": 376 + }, + { + "name": "GB062_36.TXT", + "hash": "1608AEBF1AB7BF68ACA9FB5768D0ABEF6B313A0F028FE3D297E15E829F40942E", + "fileSize": 170 + } + ] + }, + { + "dataSetName": "GB50382B.003", + "productName": "GB50382B", + "title": "Warkworth Harbour", + "scale": 12000, + "usageBand": 5, + "editionNumber": 6, + "updateNumber": 3, + "mayAffectHoldings": true, + "contentChange": true, + "permit": "", + "providerCode": "1", + "providerName": "ICE", + "size": "small", + "bundle": [ + { + "bundleType": "DVD", + "location": "M1;B3" + } + ], + "status": { + "statusName": "Cancellation Update", + "statusDate": "2024-07-15", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [ + "GB100160" + ], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": 55.3600388, + "southLimit": 55.3050432, + "eastLimit": -1.5116288, + "westLimit": -1.6166183 + }, + "polygons": [] + }, + "inUnitsOfSale": [], + "s63": { + "name": "GB50382B.003", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "D3821E07" + }, + "signature": { + "name": "GBM0382B.003", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [ + "GB50382B" + ] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/UnsortedActionItems.xml b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/UnsortedActionItems.xml new file mode 100644 index 00000000..d1bc36e1 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/UnsortedActionItems.xml @@ -0,0 +1,103 @@ +<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + <soap:Body> + <Z_ADDS_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions"> + <IM_MATINFO xmlns=""> + <CORRID></CORRID> + <NOOFACTIONS></NOOFACTIONS> + <RECDATE></RECDATE> + <RECTIME></RECTIME> + <ORG>UKHO</ORG> + <ACTIONITEMS> + <Item> + <ACTIONNUMBER>2</ACTIONNUMBER> + <ACTION>CREATE AVCS UNIT OF SALE</ACTION> + <PRODUCT>AVCS UNIT</PRODUCT> + <PRODTYPE>S57</PRODTYPE> + <CHILDCELL></CHILDCELL> + <PRODUCTNAME>US5AK9DI</PRODUCTNAME> + <CANCELLED></CANCELLED> + <REPLACEDBY></REPLACEDBY> + <AGENCY>US</AGENCY> + <PROVIDER>1</PROVIDER> + <ENCSIZE>medium</ENCSIZE> + <TITLE>Amlia Island - Svechnikof Harbor + + + AVCS Units Harbour + 202431 + 20240801 + N + + + + + 3 + ASSIGN CELL TO AVCS UNIT OF SALE + AVCS UNIT + S57 + US5AK9DI + US5AK9DI + + + + + + + + + + 202431 + 20240801 + N + + + + + 1 + CREATE ENC CELL + ENC CELL + S57 + US5AK9DI + US5AK9DI + + + US + 1 + medium + Amlia Island - Svechnikof Harbor + 1 + 0 + + 202431 + 20240801 + N + firstkey + nextkey + + + 3 + ASSIGN CELL TO AVCS UNIT OF SALE + AVCS UNIT + S57 + US5AK9DI + PAYSF + + + + + + + + + + 202431 + 20240801 + N + + + + + + + + diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/UpdateCell.JSON b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/UpdateCell.JSON new file mode 100644 index 00000000..b9e5b6c8 --- /dev/null +++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/UpdateCell.JSON @@ -0,0 +1,124 @@ +{ + "specversion": "1.0", + "type": "uk.gov.ukho.encpublishing.enccontentpublished.v2.2", + "source": "https://encpublishing.ukho.gov.uk", + "id": "6c475a0c-5b97-4ed7-a95d-3008e98f1520", + "time": "2024-09-16T10:03:04.1978804+00:00", + "subject": "AU421115", + "datacontenttype": "application/json", + "data": { + "correlationId": "b28a8274-444a-4d5a-9d10-08dcc128489e", + "ukhoWeekNumber": { + "year": 2024, + "week": 31, + "currentWeekAlphaCorrection": false + }, + "products": [ + { + "dataSetName": "AU421115.003", + "productName": "AU421115", + "title": "Australia - Western Australia - Montebello Islands - Montebello Islands and Barrow Island", + "scale": 180000, + "usageBand": 4, + "editionNumber": 19, + "updateNumber": 3, + "mayAffectHoldings": false, + "contentChange": true, + "permit": "permitstring", + "providerCode": "1", + "providerName": "ICE", + "size": "small", + "bundle": [ + { + "bundleType": "DVD", + "location": "M2;B7" + } + ], + "status": { + "statusName": "Update", + "statusDate": "2024-07-17", + "isNewCell": false + }, + "replaces": [], + "replacedBy": [], + "additionalCoverage": [], + "geographicLimit": { + "boundingBox": { + "northLimit": -20, + "southLimit": -21, + "eastLimit": 116, + "westLimit": 115 + }, + "polygons": [] + }, + "inUnitsOfSale": [ + "AU421115", + "PAYSF" + ], + "s63": { + "name": "AU421115.003", + "hash": "", + "fileSize": 0, + "compression": true, + "s57Crc": "9CED2216" + }, + "signature": { + "name": "AUL21115.003", + "hash": "", + "fileSize": 0 + }, + "ancillaryFiles": [] + } + ], + "unitsOfSale": [ + { + "unitName": "AU421115", + "title": "Montebello and Barrow Islands", + "unitOfSaleType": "unit", + "unitSize": "large", + "unitType": "AVCS Units Approach", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": -20, + "southLimit": -21, + "eastLimit": 116, + "westLimit": 115 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + }, + { + "unitName": "PAYSF", + "title": "World Folio", + "unitOfSaleType": "folio", + "unitSize": "large", + "unitType": "AVCS Folio Transit", + "providerCode": "1", + "providerName": "ICE", + "status": "ForSale", + "isNewUnitOfSale": false, + "geographicLimit": { + "boundingBox": { + "northLimit": 0, + "southLimit": 0, + "eastLimit": 0, + "westLimit": 0 + }, + "polygons": [] + }, + "compositionChanges": { + "addProducts": [], + "removeProducts": [] + } + } + ] + } +} diff --git a/tests/UKHO.ERPFacade.API.UnitTests/Filters/LoggingMiddlewareTests.cs b/tests/UKHO.ERPFacade.API.UnitTests/Filters/LoggingMiddlewareTests.cs index 596aa94f..5bc18560 100644 --- a/tests/UKHO.ERPFacade.API.UnitTests/Filters/LoggingMiddlewareTests.cs +++ b/tests/UKHO.ERPFacade.API.UnitTests/Filters/LoggingMiddlewareTests.cs @@ -4,11 +4,13 @@ using System.Linq; using System.Net; using System.Text; +using System.Text.Json; using System.Threading.Tasks; using FakeItEasy; +using FluentAssertions; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using Newtonsoft.Json.Linq; using NUnit.Framework; using UKHO.ERPFacade.API.Filters; using UKHO.ERPFacade.Common.Exceptions; @@ -20,70 +22,75 @@ namespace UKHO.ERPFacade.API.UnitTests.Filters public class LoggingMiddlewareTests { private RequestDelegate _fakeNextMiddleware; - private LoggingMiddleware _middleware; private HttpContext _fakeHttpContext; private ILogger _fakeLogger; + private LoggingMiddleware _middleware; [SetUp] public void SetUp() { _fakeNextMiddleware = A.Fake(); _fakeLogger = A.Fake>(); + _fakeHttpContext = new DefaultHttpContext(); + _middleware = new LoggingMiddleware(_fakeNextMiddleware, _fakeLogger); - _fakeHttpContext = A.Fake(); } [Test] public async Task WhenExceptionIsOfTypeException_ThenLogsErrorWithUnhandledExceptionEventId() { - A.CallTo(() => _fakeNextMiddleware(_fakeHttpContext)).Throws(new Exception()); - var exception = A.Fake(x => x.WithArgumentsForConstructor(() => new Exception())); - var correlationId = Guid.NewGuid().ToString(); - A.CallTo(() => _fakeHttpContext.Request.Headers[CorrelationIdMiddleware.XCorrelationIdHeaderKey]).Returns(correlationId); + var memoryStream = new MemoryStream(); + _fakeHttpContext.Request.Headers.Append(CorrelationIdMiddleware.XCorrelationIdHeaderKey, "fakeCorrelationId"); + _fakeHttpContext.Response.Body = memoryStream; + A.CallTo(() => _fakeNextMiddleware(_fakeHttpContext)).Throws(new Exception("fake exception")); + await _middleware.InvokeAsync(_fakeHttpContext); + memoryStream.Seek(0, SeekOrigin.Begin); + var responseBody = await new StreamReader(memoryStream).ReadToEndAsync(); + + var problemDetails = JsonSerializer.Deserialize(responseBody, new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true + }); + + problemDetails.Status.Should().Be((int)HttpStatusCode.InternalServerError); + problemDetails.Extensions["correlationId"].ToString().Should().Be("fakeCorrelationId"); + _fakeHttpContext.Response.StatusCode.Should().Be((int)HttpStatusCode.InternalServerError); + _fakeHttpContext.Response.ContentType.Should().Be("application/json; charset=utf-8"); + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument(0) == LogLevel.Error && call.GetArgument(1) == EventIds.UnhandledException.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Exception occured while processing ErpFacade API." + " | _X-Correlation-ID : {_X-Correlation-ID}").MustHaveHappenedOnceExactly(); - - Assert.That((int)HttpStatusCode.InternalServerError, Is.EqualTo(_fakeHttpContext.Response.StatusCode)); + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "fake exception").MustHaveHappenedOnceExactly(); } [Test] - public async Task WhenExceptionOfTypeERPFacadeException_ThenLogsErrorWithNoScenarioFoundEventId() + public async Task WhenExceptionIsOfTypePermitServiceException_ThenLogsErrorWithPermitServiceExceptionEventId() { - var eventId = EventIds.NoScenarioFound; - A.CallTo(() => _fakeNextMiddleware(_fakeHttpContext)).Throws(new ERPFacadeException(eventId.ToEventId())); + var memoryStream = new MemoryStream(); + _fakeHttpContext.Request.Headers.Append(CorrelationIdMiddleware.XCorrelationIdHeaderKey, "fakeCorrelationId"); + _fakeHttpContext.Response.Body = memoryStream; + A.CallTo(() => _fakeNextMiddleware(_fakeHttpContext)).Throws(new ERPFacadeException(EventIds.SapXmlTemplateNotFound.ToEventId(), "fakemessage")); - var exception = A.Fake(x => x.WithArgumentsForConstructor(() => new ERPFacadeException(eventId.ToEventId()))); + await _middleware.InvokeAsync(_fakeHttpContext); - var correlationId = Guid.NewGuid().ToString(); - A.CallTo(() => _fakeHttpContext.Request.Headers[CorrelationIdMiddleware.XCorrelationIdHeaderKey]).Returns(correlationId); + memoryStream.Seek(0, SeekOrigin.Begin); + var responseBody = await new StreamReader(memoryStream).ReadToEndAsync(); + var problemDetails = JsonSerializer.Deserialize(responseBody, new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true + }); - await _middleware.InvokeAsync(_fakeHttpContext); + problemDetails.Status.Should().Be((int)HttpStatusCode.InternalServerError); + problemDetails.Extensions["correlationId"].ToString().Should().Be("fakeCorrelationId"); + _fakeHttpContext.Response.StatusCode.Should().Be((int)HttpStatusCode.InternalServerError); + _fakeHttpContext.Response.ContentType.Should().Be("application/json; charset=utf-8"); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument(0) == LogLevel.Error - && call.GetArgument(1) == eventId.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == eventId.ToString() + ". | _X-Correlation-ID : {_X-Correlation-ID}").MustHaveHappenedOnceExactly(); - - Assert.That((int)HttpStatusCode.InternalServerError, Is.EqualTo(_fakeHttpContext.Response.StatusCode)); - } - - [Test] - public async Task WhenInvokeAsyncIsCalled_ThenNextMiddlewareShouldBeInvoked() - { - var bodyAsJson = new JObject { { "data", new JObject { } } }; - var bodyAsText = bodyAsJson.ToString(); - - _fakeHttpContext.Request.Body = new MemoryStream(Encoding.UTF8.GetBytes(bodyAsText)); - _fakeHttpContext.Request.ContentLength = bodyAsText.Length; - _fakeHttpContext.Response.Body = new MemoryStream(); - - await _middleware.InvokeAsync(_fakeHttpContext); - - A.CallTo(() => _fakeNextMiddleware(_fakeHttpContext)).MustHaveHappenedOnceExactly(); + && call.GetArgument(1) == EventIds.SapXmlTemplateNotFound.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "fakemessage").MustHaveHappenedOnceExactly(); } } } diff --git a/tests/UKHO.ERPFacade.API.UnitTests/Helpers/EncContentSapMessageBuilderTests.cs b/tests/UKHO.ERPFacade.API.UnitTests/Helpers/EncContentSapMessageBuilderTests.cs index f4bb14fc..797bc465 100644 --- a/tests/UKHO.ERPFacade.API.UnitTests/Helpers/EncContentSapMessageBuilderTests.cs +++ b/tests/UKHO.ERPFacade.API.UnitTests/Helpers/EncContentSapMessageBuilderTests.cs @@ -12,11 +12,12 @@ using NUnit.Framework; using UKHO.ERPFacade.API.Helpers; using UKHO.ERPFacade.API.UnitTests.Common; +using UKHO.ERPFacade.Common.Exceptions; using UKHO.ERPFacade.Common.IO; using UKHO.ERPFacade.Common.Logging; using UKHO.ERPFacade.Common.Models; -using UKHO.ERPFacade.Common.Providers; using UKHO.ERPFacade.Common.PermitDecryption; +using UKHO.ERPFacade.Common.Providers; namespace UKHO.ERPFacade.API.UnitTests.Helpers { @@ -30,6 +31,7 @@ public class EncContentSapMessageBuilderTests private IWeekDetailsProvider _fakeWeekDetailsProvider; private IPermitDecryption _fakePermitDecryption; private EncContentSapMessageBuilder _fakeEncContentSapMessageBuilder; + private string _sapXmlTemplate; private const string XpathActionItems = $"//*[local-name()='ACTIONITEMS']"; private const string EncCell = "ENC CELL"; @@ -41,42 +43,10 @@ public class EncContentSapMessageBuilderTests private const string XpathNextKey = $"//*[local-name()='NEXTKEY']"; private const string XpathChildCell = $"//*[local-name()='CHILDCELL']"; private const string XpathReplacedBy = $"//*[local-name()='REPLACEDBY']"; - - private const string SapXmlFile = @" - - - - - - - - - - UKHO - - - - - - - -"; - - #region scenariosData - - private const string ScenariosDataCancelReplaceCell = @"{""specversion"":""1.0"",""type"":""uk.gov.ukho.encpublishing.enccontentpublished.v2.1"",""source"":""https://encpublishing.ukho.gov.uk"",""id"":""2f03a25f-28b3-46ea-b009-5943250a9a41"",""time"":""2020-10-13T12:08:03.4880776Z"",""subject"":""US5AK83M,US4AK6NT,US4AK6NU"",""datacontenttype"":""application/json"",""data"":{""correlationId"":""1c23a350-6239-472a-a0f7-09ad5fb2d51d"",""ukhoWeekNumber"":{""year"":2024,""week"":3,""currentWeekAlphaCorrection"":false},""products"":[{""productType"":""ENC S57"",""dataSetName"":""US5AK83M.001"",""productName"":""US5AK83M"",""title"":""St. Michael Bay"",""scale"":90000,""usageBand"":5,""editionNumber"":0,""updateNumber"":1,""mayAffectHoldings"":true,""contentChange"":true,""permit"":""permitString"",""providerCode"":""1"",""providerName"":""ICE"",""size"":""small"",""agency"":""US"",""bundle"":[{""bundleType"":""DVD"",""location"":""M1;B1""}],""status"":{""statusName"":""Cancellation Update"",""statusDate"":""2023-03-03T04:30:00+05:30"",""isNewCell"":false},""replaces"":[],""replacedBy"":[""US4AK6NT"",""US4AK6NU""],""additionalCoverage"":[],""geographicLimit"":{""boundingBox"":{""northLimit"":24.0,""southLimit"":22.0,""eastLimit"":120.0,""westLimit"":119.0}},""inUnitsOfSale"":[""US5AK83M"",""AVCSO"",""PAYSF""],""s63"":{""name"":""US5AK83M.001"",""hash"":""5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea"",""location"":""8198201e-78ce-4af8-9145-ad68ba0472e2"",""fileSize"":""4500"",""compression"":true,""s57Crc"":""5C06E104""},""signature"":{""name"":""US5AK83M.001"",""hash"":""fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9"",""location"":""0ecf2f38-a876-4d77-bd0e-0d901d3a0e73"",""fileSize"":""2500""},""ancillaryFiles"":[{""name"":""GB123_04.TXT"",""hash"":""d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b"",""location"":""2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5"",""fileSize"":""1240""},{""name"":""GB125_01.TXT"",""hash"":""bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b"",""location"":""1ad0f9c3-8c93-495a-99a1-06a36410faa9"",""fileSize"":""1360""},{""name"":""GB162_01.TXT"",""hash"":""81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6"",""location"":""eb443aad-394c-4eb0-b391-415a261605a1"",""fileSize"":""1360""}]},{""productType"":""ENC S57"",""dataSetName"":""US4AK6NT.001"",""productName"":""US4AK6NT"",""title"":""Norton Sound - Alaska"",""scale"":12000,""usageBand"":6,""editionNumber"":8,""updateNumber"":2,""mayAffectHoldings"":true,""contentChange"":true,""permit"":""permitString"",""providerCode"":""1"",""providerName"":""ICE"",""size"":""medium"",""agency"":""US"",""bundle"":[{""bundleType"":""DVD"",""location"":""M1;B1""}],""status"":{""statusName"":""New Edition"",""statusDate"":""2023-03-03T04:30:00+05:30"",""isNewCell"":true},""replaces"":[""US5AK83M""],""replacedBy"":[],""additionalCoverage"":[],""geographicLimit"":{""boundingBox"":{""northLimit"":63.0,""southLimit"":63.0,""eastLimit"":162.0,""westLimit"":161.0}},""inUnitsOfSale"":[""US4AK6NT"",""AVCSO"",""PAYSF""],""s63"":{""name"":""US4AK6NT.001"",""hash"":""5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea"",""location"":""8198201e-78ce-4af8-9145-ad68ba0472e2"",""fileSize"":""4500"",""compression"":true,""s57Crc"":""5C06E104""},""signature"":{""name"":""US4AK6NT.001"",""hash"":""fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9"",""location"":""0ecf2f38-a876-4d77-bd0e-0d901d3a0e73"",""fileSize"":""2500""},""ancillaryFiles"":[{""name"":""US4AK6NT_04.TXT"",""hash"":""d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b"",""location"":""2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5"",""fileSize"":""1240""}]},{""productType"":""ENC S57"",""dataSetName"":""US4AK6NU.001"",""productName"":""US4AK6NU"",""title"":""Norton Sound - Alaska"",""scale"":12000,""usageBand"":6,""editionNumber"":8,""updateNumber"":2,""mayAffectHoldings"":true,""contentChange"":true,""permit"":""permitString"",""providerCode"":""1"",""providerName"":""ICE"",""size"":""medium"",""agency"":""US"",""bundle"":[{""bundleType"":""DVD"",""location"":""M1;B1""}],""status"":{""statusName"":""New Edition"",""statusDate"":""2023-03-03T04:30:00+05:30"",""isNewCell"":true},""replaces"":[""US5AK83M""],""replacedBy"":[],""additionalCoverage"":[],""geographicLimit"":{""boundingBox"":{""northLimit"":63.0,""southLimit"":63.0,""eastLimit"":162.0,""westLimit"":161.0}},""inUnitsOfSale"":[""US4AK6NU"",""AVCSO"",""PAYSF""],""s63"":{""name"":""US4AK6NU.001"",""hash"":""5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea"",""location"":""8198201e-78ce-4af8-9145-ad68ba0472e2"",""fileSize"":""4500"",""compression"":true,""s57Crc"":""5C06E104""},""signature"":{""name"":""US4AK6NU.001"",""hash"":""fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9"",""location"":""0ecf2f38-a876-4d77-bd0e-0d901d3a0e73"",""fileSize"":""2500""},""ancillaryFiles"":[{""name"":""US4AK6NU_04.TXT"",""hash"":""d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b"",""location"":""2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5"",""fileSize"":""1240""}]}],""unitsOfSale"":[{""unitName"":""US5AK83M"",""title"":""St. Michael Bay"",""unitOfSaleType"":""unit"",""unitSize"":""large"",""unitType"":""AVCS Units Coastal"",""status"":""NotForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":24.146815,""southLimit"":22.581615,""eastLimit"":120.349635,""westLimit"":119.39142}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[""US5AK83M""]}},{""unitName"":""US4AK6NT"",""title"":""Norton Sound - Alaska"",""unitOfSaleType"":""unit"",""unitSize"":""large"",""unitType"":""AVCS Units Coastal"",""status"":""ForSale"",""isNewUnitOfSale"":true,""geographicLimit"":{""boundingBox"":{""northLimit"":22.643255,""southLimit"":22.4625767,""eastLimit"":120.34972,""westLimit"":120.219475}},""compositionChanges"":{""addProducts"":[""US4AK6NT""],""removeProducts"":[]}},{""unitName"":""US4AK6NU"",""title"":""Norton Sound - Alaska"",""unitOfSaleType"":""unit"",""unitSize"":""large"",""unitType"":""AVCS Units Coastal"",""status"":""ForSale"",""isNewUnitOfSale"":true,""geographicLimit"":{""boundingBox"":{""northLimit"":22.643255,""southLimit"":22.4625767,""eastLimit"":120.34972,""westLimit"":120.219475}},""compositionChanges"":{""addProducts"":[""US4AK6NU""],""removeProducts"":[]}},{""unitName"":""AVCSO"",""title"":""AVCS Online Folio Some Title"",""unitOfSaleType"":""folio"",""unitSize"":""large"",""unitType"":""AVCS Online Folio"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[""US4AK6NT"",""US4AK6NU""],""removeProducts"":[""US5AK83M""]}},{""unitName"":""PAYSF"",""title"":""World Folio"",""unitOfSaleType"":""folio"",""unitSize"":""large"",""unitType"":""AVCS Folio Transit"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[""US4AK6NT"",""US4AK6NU""],""removeProducts"":[""US5AK83M""]}}]}}"; - - private const string ScenariosDataChangeMoveCell = @"{""specversion"":""1.0"",""type"":""uk.gov.ukho.encpublishing.enccontentpublished.v2.1"",""source"":""https://encpublishing.ukho.gov.uk"",""id"":""2f03a25f-28b3-46ea-b009-5943250a9a41"",""time"":""2020-10-13T12:08:03.4880776Z"",""subject"":""MX545010"",""datacontenttype"":""application/json"",""data"":{""correlationId"":""365ce4a4-1d62-4f56-b359-59e178d77202"",""ukhoWeekNumber"":{""year"":2024,""week"":3,""currentWeekAlphaCorrection"":false},""products"":[{""productType"":""ENC S57"",""dataSetName"":""MX545010.001"",""productName"":""MX545010"",""title"":""Isla Clarion"",""scale"":90000,""usageBand"":5,""editionNumber"":1,""updateNumber"":0,""mayAffectHoldings"":true,""contentChange"":false,""permit"":""permitString"",""providerCode"":""1"",""providerName"":""ICE"",""size"":""medium"",""agency"":""MX"",""bundle"":[{""bundleType"":""DVD"",""location"":""M1;B1""}],""status"":{""statusName"":""New Edition"",""statusDate"":""2023-03-03T04:30:00+05:30"",""isNewCell"":false},""replaces"":[],""replacedBy"":[],""additionalCoverage"":[],""geographicLimit"":{""boundingBox"":{""northLimit"":24.0,""southLimit"":22.0,""eastLimit"":120.0,""westLimit"":119.0}},""inUnitsOfSale"":[""MX545010"",""MX509226"",""AVCSO"",""PAYSF""],""s63"":{""name"":""XXXXXXXX.001"",""hash"":""5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea"",""location"":""8198201e-78ce-4af8-9145-ad68ba0472e2"",""fileSize"":""4500"",""compression"":true,""s57Crc"":""5C06E104""},""signature"":{""name"":""XXXXXXXX.001"",""hash"":""fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9"",""location"":""0ecf2f38-a876-4d77-bd0e-0d901d3a0e73"",""fileSize"":""2500""},""ancillaryFiles"":[{""name"":""GBXXXXXXXX_04.TXT"",""hash"":""d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b"",""location"":""2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5"",""fileSize"":""1240""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b"",""location"":""1ad0f9c3-8c93-495a-99a1-06a36410faa9"",""fileSize"":""1360""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6"",""location"":""eb443aad-394c-4eb0-b391-415a261605a1"",""fileSize"":""1360""}]}],""unitsOfSale"":[{""unitName"":""MX545010"",""title"":""Isla Clarion"",""unitOfSaleType"":""unit"",""unitSize"":""large"",""unitType"":""AVCS Units Coastal"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":24.146815,""southLimit"":22.581615,""eastLimit"":120.349635,""westLimit"":119.39142}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[""MX545010""]}},{""unitName"":""MX509226"",""title"":""Playa del Carmen"",""unitOfSaleType"":""unit"",""unitSize"":""large"",""unitType"":""AVCS Units Coastal"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":24.146815,""southLimit"":22.581615,""eastLimit"":120.349635,""westLimit"":119.39142}},""compositionChanges"":{""addProducts"":[""MX545010""],""removeProducts"":[]}},{""unitName"":""AVCSO"",""title"":""AVCS Online Folio Some Title"",""unitOfSaleType"":""folio"",""unitSize"":""large"",""unitType"":""AVCS Online Folio"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}},{""unitName"":""PAYSF"",""title"":""World Folio"",""unitOfSaleType"":""folio"",""unitSize"":""large"",""unitType"":""AVCS Folio Transit"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}}]}}"; - - private const string ScenariosDataCreateEncCell = @"{""specversion"":""1.0"",""type"":""uk.gov.ukho.encpublishing.enccontentpublished.v2"",""source"":""https://encpublishing.ukho.gov.uk"",""id"":""2f03a25f-28b3-46ea-b009-5943250a9a41"",""time"":""2020-10-13T12:08:03.4880776Z"",""subject"":""MX545010"",""datacontenttype"":""application/json"",""data"":{""correlationId"":""765ce4a4-1d62-4f56-b359-59e178d77107"",""ukhoWeekNumber"":{""year"":2024,""week"":3,""currentWeekAlphaCorrection"":false},""products"":[{""productType"":""ENC S57"",""dataSetName"":""MX545010.001"",""productName"":""MX545010"",""title"":""Isla Clarion"",""scale"":90000,""usageBand"":5,""editionNumber"":1,""updateNumber"":0,""mayAffectHoldings"":true,""contentChange"":true,""permit"":""permitString"",""providerCode"":""1"",""providerName"":""ICE"",""size"":""medium"",""agency"":""MX"",""bundle"":[{""bundleType"":""DVD"",""location"":""M1;B1""}],""status"":{""statusName"":""New Edition"",""statusDate"":""2023-03-03T04:30:00+05:30"",""isNewCell"":true},""replaces"":[],""replacedBy"":[],""additionalCoverage"":[],""geographicLimit"":{""boundingBox"":{""northLimit"":24.0,""southLimit"":22.0,""eastLimit"":120.0,""westLimit"":119.0}},""inUnitsOfSale"":[""MX545010"",""AVCSO"",""PAYSF""],""s63"":{""name"":""XXXXXXXX.001"",""hash"":""5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea"",""location"":""8198201e-78ce-4af8-9145-ad68ba0472e2"",""fileSize"":""4500"",""compression"":true,""s57Crc"":""5C06E104""},""signature"":{""name"":""XXXXXXXX.001"",""hash"":""fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9"",""location"":""0ecf2f38-a876-4d77-bd0e-0d901d3a0e73"",""fileSize"":""2500""},""ancillaryFiles"":[{""name"":""GBXXXXXXXX_04.TXT"",""hash"":""d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b"",""location"":""2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5"",""fileSize"":""1240""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b"",""location"":""1ad0f9c3-8c93-495a-99a1-06a36410faa9"",""fileSize"":""1360""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6"",""location"":""eb443aad-394c-4eb0-b391-415a261605a1"",""fileSize"":""1360""}]}],""unitsOfSale"":[{""unitName"":""MX545010"",""title"":""Isla Clarion"",""unitOfSaleType"":""unit"",""unitSize"":""large"",""unitType"":""AVCS Units Coastal"",""status"":""ForSale"",""isNewUnitOfSale"":true,""geographicLimit"":{""boundingBox"":{""northLimit"":24.146815,""southLimit"":22.581615,""eastLimit"":120.349635,""westLimit"":119.39142}},""compositionChanges"":{""addProducts"":[""MX545010""],""removeProducts"":[]}},{""unitName"":""AVCSO"",""title"":""AVCS Online Folio Some Title"",""unitOfSaleType"":""folio"",""unitSize"":""large"",""unitType"":""AVCS Online Folio"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[""MX545010""],""removeProducts"":[]}},{""unitName"":""PAYSF"",""title"":""World Folio"",""unitOfSaleType"":""folio"",""unitSize"":""large"",""unitType"":""AVCS Folio Transit"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[""MX545010""],""removeProducts"":[]}}]}}"; - - private const string ScenariosDataUpdateEncCell = @"{""specversion"":""1.0"",""type"":""uk.gov.ukho.encpublishing.enccontentpublished.v2.1"",""source"":""https://encpublishing.ukho.gov.uk"",""id"":""2f03a25f-28b3-46ea-b009-5943250a9a41"",""time"":""2020-10-13T12:08:03.4880776Z"",""subject"":""DE416080"",""datacontenttype"":""application/json"",""data"":{""correlationId"":""765ce4a4-1d62-4f56-b359-59e178d77104"",""ukhoWeekNumber"":{""year"":2024,""week"":3,""currentWeekAlphaCorrection"":false},""products"":[{""productType"":""ENC S57"",""dataSetName"":""DE416080.001"",""productName"":""DE416080"",""title"":""Greifswalder Bodden"",""scale"":100000,""usageBand"":4,""editionNumber"":11,""updateNumber"":0,""mayAffectHoldings"":true,""contentChange"":true,""permit"":""permitString"",""providerCode"":""1"",""providerName"":""ICE"",""size"":""medium"",""agency"":""DE"",""bundle"":[{""bundleType"":""DVD"",""location"":""M1;B1""}],""status"":{""statusName"":""New Edition"",""statusDate"":""2023-03-03T04:30:00+05:30"",""isNewCell"":false},""replaces"":[],""replacedBy"":[],""additionalCoverage"":[],""geographicLimit"":{""boundingBox"":{""northLimit"":24.0,""southLimit"":22.0,""eastLimit"":120.0,""westLimit"":119.0}},""inUnitsOfSale"":[""DE416080"",""AVCSO"",""PAYSF""],""s63"":{""name"":""XXXXXXXX.001"",""hash"":""5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea"",""location"":""8198201e-78ce-4af8-9145-ad68ba0472e2"",""fileSize"":""4500"",""compression"":true,""s57Crc"":""5C06E104""},""signature"":{""name"":""XXXXXXXX.001"",""hash"":""fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9"",""location"":""0ecf2f38-a876-4d77-bd0e-0d901d3a0e73"",""fileSize"":""2500""},""ancillaryFiles"":[{""name"":""GBXXXXXXXX_04.TXT"",""hash"":""d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b"",""location"":""2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5"",""fileSize"":""1240""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b"",""location"":""1ad0f9c3-8c93-495a-99a1-06a36410faa9"",""fileSize"":""1360""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6"",""location"":""eb443aad-394c-4eb0-b391-415a261605a1"",""fileSize"":""1360""}]}],""unitsOfSale"":[{""unitName"":""DE416080"",""title"":""Greifswalder Bodden Unit"",""unitOfSaleType"":""unit"",""unitSize"":""large"",""unitType"":""AVCS Units Coastal"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":24.146815,""southLimit"":22.581615,""eastLimit"":120.349635,""westLimit"":119.39142}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}},{""unitName"":""AVCSO"",""title"":""AVCS Online Folio Some Title"",""unitOfSaleType"":null,""unitSize"":""large"",""unitType"":""AVCS Online Folio"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[""DE416080""]}},{""unitName"":""PAYSF"",""title"":""World Folio"",""unitOfSaleType"":null,""unitSize"":""large"",""unitType"":""AVCS Folio Transit"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[""DE416080""]}}]}}"; - - private const string ScenariosDataChangeEncCell = @"{""specversion"":""1.0"",""type"":""uk.gov.ukho.encpublishing.enccontentpublished.v2.1"",""source"":""https://encpublishing.ukho.gov.uk"",""id"":""2f03a25f-28b3-46ea-b009-5943250a9a41"",""time"":""2020-10-13T12:08:03.4880776Z"",""subject"":""MX545010"",""datacontenttype"":""application/json"",""data"":{""correlationId"":""465ce4a4-1d62-4f56-b359-59e178d77102"",""ukhoWeekNumber"":{""year"":2024,""week"":3,""currentWeekAlphaCorrection"":false},""products"":[{""productType"":""ENC S57"",""dataSetName"":""MX545010.001"",""productName"":""MX545010"",""title"":""Isla Clarion"",""scale"":90000,""usageBand"":5,""editionNumber"":1,""updateNumber"":0,""mayAffectHoldings"":false,""contentChange"":false,""permit"":""permitString"",""providerCode"":""2"",""providerName"":""PRIMAR"",""size"":""medium"",""agency"":""MX"",""bundle"":[{""bundleType"":""DVD"",""location"":""M1;B1""}],""status"":{""statusName"":""New Edition"",""statusDate"":""2023-03-03T04:30:00+05:30"",""isNewCell"":false},""replaces"":[],""replacedBy"":[],""additionalCoverage"":[],""geographicLimit"":{""boundingBox"":{""northLimit"":24.0,""southLimit"":22.0,""eastLimit"":120.0,""westLimit"":119.0}},""inUnitsOfSale"":[""MX545010"",""AVCSO"",""PAYSF""],""s63"":{""name"":""XXXXXXXX.001"",""hash"":""5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea"",""location"":""8198201e-78ce-4af8-9145-ad68ba0472e2"",""fileSize"":""4500"",""compression"":true,""s57Crc"":""5C06E104""},""signature"":{""name"":""XXXXXXXX.001"",""hash"":""fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9"",""location"":""0ecf2f38-a876-4d77-bd0e-0d901d3a0e73"",""fileSize"":""2500""},""ancillaryFiles"":[{""name"":""GBXXXXXXXX_04.TXT"",""hash"":""d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b"",""location"":""2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5"",""fileSize"":""1240""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b"",""location"":""1ad0f9c3-8c93-495a-99a1-06a36410faa9"",""fileSize"":""1360""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6"",""location"":""eb443aad-394c-4eb0-b391-415a261605a1"",""fileSize"":""1360""}]}],""unitsOfSale"":[{""unitName"":""MX545010"",""title"":""Isla Clarion"",""unitOfSaleType"":""unit"",""unitSize"":""large"",""unitType"":""AVCS Units Coastal"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":24.146815,""southLimit"":22.581615,""eastLimit"":120.349635,""westLimit"":119.39142}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}},{""unitName"":""AVCSO"",""title"":""AVCS Online Folio Some Title"",""unitOfSaleType"":""folio"",""unitSize"":""large"",""unitType"":""AVCS Online Folio"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}},{""unitName"":""PAYSF"",""title"":""World Folio"",""unitOfSaleType"":""folio"",""unitSize"":""large"",""unitType"":""AVCS Folio Transit"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{""northLimit"":0.0,""southLimit"":0.0,""eastLimit"":0.0,""westLimit"":0.0}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}}]}}"; - - private const string ScenariosDataAdditionalCoverage = @"{""specversion"":""1.0"",""type"":""uk.gov.ukho.encpublishing.enccontentpublished.v2.1"",""source"":""https://encpublishing.ukho.gov.uk"",""id"":""2f03a25f-28b3-46ea-b009-5943250a9a41"",""time"":""2020-10-13T12:08:03.4880776Z"",""subject"":""DE416080"",""datacontenttype"":""application/json"",""data"":{""correlationId"":""765ce4a4-1d62-4f56-b359-59e178d77104"",""ukhoWeekNumber"":{""year"":2024,""week"":3,""currentWeekAlphaCorrection"":false},""products"":[{""productType"":""ENC S57"",""dataSetName"":""DE416080.001"",""productName"":""DE416080"",""title"":""Greifswalder Bodden"",""scale"":100000,""usageBand"":4,""editionNumber"":11,""updateNumber"":0,""mayAffectHoldings"":true,""contentChange"":true,""permit"":"" permitstring"",""providerCode"":""1"",""providerName"":""ICE"",""_ENUM"":[""large"",""medium"",""small""],""size"":""medium"",""agency"":""DE"",""bundle"":[{""bundleType"":""DVD"",""_ENUM"":[""DVD""],""location"":""M1;B1""}],""status"":{""statusName"":""New Edition"",""_ENUM"":[""New Edition"",""Re-issue"",""Update"",""Cancellation Update"",""Withdrawn"",""Suspended""],""statusDate"":""2023-03-03T00:00:00.00+01:00"",""isNewCell"":false},""replaces"":[],""replacedBy"":[],""additionalCoverage"":[""DK4LIMFW"",""DK5LIMFW""],""geographicLimit"":{""boundingBox"":{""northLimit"":24,""southLimit"":22,""eastLimit"":120,""westLimit"":119}},""inUnitsOfSale"":[""DE416080"",""AVCSO"",""PAYSF""],""s63"":{""name"":""XXXXXXXX.001"",""hash"":""5160204288db0a543850da177ec637b71ed55946e7f3843e6180b1906ee4f4ea"",""location"":""8198201e-78ce-4af8-9145-ad68ba0472e2"",""fileSize"":""4500"",""compression"":true,""s57Crc"":""5C06E104""},""signature"":{""name"":""XXXXXXXX.001"",""hash"":""fd0c9e5f95c0b664a1a27c2ff98812c648ebd113b117f5639f74536c397fbac9"",""location"":""0ecf2f38-a876-4d77-bd0e-0d901d3a0e73"",""fileSize"":""2500""},""ancillaryFiles"":[{""name"":""GBXXXXXXXX_04.TXT"",""hash"":""d030b93ad8a0801e6955e4f52599f6200d01310155882a1b80eec78c9b93662b"",""location"":""2a29932e-dcb8-4e3a-b8a2-b3cfc335ede5"",""fileSize"":""1240""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""bb8042082bd1d37236801837585fa0df5e96097fb8d2281b41888af2b23ceb0b"",""location"":""1ad0f9c3-8c93-495a-99a1-06a36410faa9"",""fileSize"":""1360""},{""name"":""GBXXXXXXXX_01.TXT"",""hash"":""81470666f387a9035f6b33f59fb9bbf0872e9c296fecee58c4e919d6a1d87ab6"",""location"":""eb443aad-394c-4eb0-b391-415a261605a1"",""fileSize"":""1360""}]}],""unitsOfSale"":[{""unitName"":""DE416080"",""title"":""Greifswalder Bodden Unit"",""unitType"":""AVCS Units Coastal"",""unitSize"":""large"",""status"":""ForSale"",""_ENUM"":[""ForSale"",""NotForSale""],""isNewUnitOfSale"":false,""unitOfSaleType"":""unit"",""geographicLimit"":{""boundingBox"":{""northLimit"":24.146815,""southLimit"":22.581615,""eastLimit"":120.349635,""westLimit"":119.39142}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}},{""unitName"":""AVCSO"",""title"":""AVCS Online Folio Some Title"",""unitSize"":""large"",""unitType"":""AVCS Online Folio"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}},{""unitName"":""PAYSF"",""title"":""World Folio"",""unitType"":""AVCS Folio Transit"",""unitSize"":""large"",""status"":""ForSale"",""isNewUnitOfSale"":false,""geographicLimit"":{""boundingBox"":{}},""compositionChanges"":{""addProducts"":[],""removeProducts"":[]}}]}}"; - - #endregion scenariosData + private const string XpathActionNumber = $"//*[local-name()='ACTIONNUMBER']"; + private const string XpathAction = $"//*[local-name()='ACTION']"; + private const string ReplaceEncCellAction = "REPLACED WITH ENC CELL"; + private const string ChangeEncCellAction = "CHANGE ENC CELL"; [SetUp] public void Setup() @@ -88,6 +58,7 @@ public void Setup() _fakeWeekDetailsProvider = A.Fake(); _fakePermitDecryption = A.Fake(); _fakeEncContentSapMessageBuilder = new EncContentSapMessageBuilder(_fakeLogger, _fakeXmlHelper, _fakeFileSystemHelper, _fakeSapActionConfig, _fakeWeekDetailsProvider, _fakePermitDecryption); + _sapXmlTemplate = TestHelper.ReadFileData("SapXmlTemplates\\SAPRequest.xml"); } private IConfiguration InitConfiguration() @@ -102,455 +73,355 @@ private IConfiguration InitConfiguration() } [Test] - public void WhenBuildSapMessageXmlIsCalledWithCancelReplacecellScenario_ThenReturnXMLDocument() + public void WhenSapXmlTemplateFileNotExist_ThenThrowERPFacadeException() { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataCancelReplaceCell); - var correlationId = "367ce4a4-1d62-4f56-b359-59e178d77100"; - var permitKeys = new PermitKey { ActiveKey = "", NextKey = "" }; - - XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); - - A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); - A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - A.CallTo(() => _fakePermitDecryption.GetPermitKeys(A.Ignored)).Returns(permitKeys); + var newCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\NewCell.JSON"); + var eventData = JsonConvert.DeserializeObject(newCellEventPayloadJson); - var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(scenarios!, correlationId); - - result.Should().BeOfType(); - var actionItem = result.SelectSingleNode(XpathActionItems); - actionItem.ChildNodes.Count.Should().Be(17); - - A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Information - && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP actions.").MustHaveHappenedOnceExactly(); + A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(false); - A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Information - && call.GetArgument(1) == EventIds.SapActionCreated.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(17, Times.Exactly); + Assert.Throws(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!)) + .Message.Should().Be("The SAP XML payload template does not exist."); } [Test] - public void WhenBuildSapMessageXmlIsCalledWithChangeEncCellScenario_ThenReturnXMLDocument() + public void WhenBuildSapMessageXmlIsCalledWithCancelCellWithExistingCellReplacementScenario_ThenReturnXMLDocument() { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataChangeEncCell); - var correlationId = "367ce4a4-1d62-4f56-b359-59e178d77100"; - var permitKeys = new PermitKey { ActiveKey = "", NextKey = "" }; + var cancelReplaceCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\CancelCellWithExistingCellReplacement.JSON"); + var eventData = JsonConvert.DeserializeObject(cancelReplaceCellEventPayloadJson); XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); + soapXml.LoadXml(_sapXmlTemplate); A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - A.CallTo(() => _fakePermitDecryption.GetPermitKeys(A.Ignored)).Returns(permitKeys); + A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Returns("20240808"); - var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(scenarios!, correlationId); + var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!); result.Should().BeOfType(); - var actionItem = result.SelectSingleNode(XpathActionItems); - actionItem.ChildNodes.Count.Should().Be(4); - var activeKey = result.SelectSingleNode(XpathActiveKey); - activeKey.InnerText.Should().Be(string.Empty); + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.GenerationOfSapXmlPayloadStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP XML payload started.").MustHaveHappenedOnceExactly(); - var nextKey = result.SelectSingleNode(XpathNextKey); - nextKey.InnerText.Should().Be(string.Empty); + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.EncCellSapActionGenerationStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building ENC cell SAP actions.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Information - && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP actions.").MustHaveHappenedOnceExactly(); + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP action {ActionName}.").MustHaveHappened(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument(0) == LogLevel.Information && call.GetArgument(1) == EventIds.SapActionCreated.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(4, Times.Exactly); + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(7, Times.Exactly); + + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.GenerationOfSapXmlPayloadCompleted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP XML payload completed.").MustHaveHappenedOnceExactly(); } [Test] - public void WhenBuildSapMessageXmlIsCalledWithCreateEnccellScenario_ThenReturnXMLDocument() + public void WhenBuildSapMessageXmlIsCalledWithNewCellScenario_ThenReturnXMLDocument() { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataCreateEncCell); - var correlationId = "367ce4a4-1d62-4f56-b359-59e178d77100"; - var permitKeys = new PermitKey { ActiveKey = "firstkey", NextKey = "nextkey" }; + var newCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\NewCell.JSON"); + var eventData = JsonConvert.DeserializeObject(newCellEventPayloadJson); + var permitKeys = new DecryptedPermit { ActiveKey = "firstkey", NextKey = "nextkey" }; XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); + soapXml.LoadXml(_sapXmlTemplate); A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - A.CallTo(() => _fakePermitDecryption.GetPermitKeys(A.Ignored)).Returns(permitKeys); + A.CallTo(() => _fakePermitDecryption.Decrypt(A.Ignored)).Returns(permitKeys); + A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Returns("20240801"); - var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(scenarios!, correlationId); + var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!); result.Should().BeOfType(); - var actionItem = result.SelectSingleNode(XpathActionItems); - actionItem.ChildNodes.Count.Should().Be(5); - var activeKey = result.SelectSingleNode(XpathActiveKey); - activeKey.InnerText.Should().Be("firstkey"); + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.GenerationOfSapXmlPayloadStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP XML payload started.").MustHaveHappenedOnceExactly(); - var nextKey = result.SelectSingleNode(XpathNextKey); - nextKey.InnerText.Should().Be("nextkey"); + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.EncCellSapActionGenerationStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building ENC cell SAP actions.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Information - && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP actions.").MustHaveHappenedOnceExactly(); + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP action {ActionName}.").MustHaveHappened(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument(0) == LogLevel.Information && call.GetArgument(1) == EventIds.SapActionCreated.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(5, Times.Exactly); + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(4, Times.Exactly); + + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.GenerationOfSapXmlPayloadCompleted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP XML payload completed.").MustHaveHappenedOnceExactly(); } [Test] - public void WhenBuildSapMessageXmlIsCalledWithUpdateEncCellScenario_ThenReturnXMLDocument() + public void WhenBuildSapMessageXmlIsCalledWithUpdateCellScenario_ThenReturnXMLDocument() { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataUpdateEncCell); - var correlationId = "367ce4a4-1d62-4f56-b359-59e178d77100"; - var permitKeys = new PermitKey { ActiveKey = "activekey", NextKey = "nextkey" }; + var updateCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\UpdateCell.JSON"); + var eventData = JsonConvert.DeserializeObject(updateCellEventPayloadJson); + var permitKeys = new DecryptedPermit { ActiveKey = "firstkey", NextKey = "nextkey" }; XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); + soapXml.LoadXml(_sapXmlTemplate); A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - A.CallTo(() => _fakePermitDecryption.GetPermitKeys(A.Ignored)).Returns(permitKeys); + A.CallTo(() => _fakePermitDecryption.Decrypt(A.Ignored)).Returns(permitKeys); + A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Returns("20240801"); - var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(scenarios!, correlationId); + var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!); result.Should().BeOfType(); - var actionItem = result.SelectSingleNode(XpathActionItems); - actionItem.ChildNodes.Count.Should().Be(3); - - var activeKey = result.SelectSingleNode(XpathActiveKey); - activeKey.InnerText.Should().Be("activekey"); - - var nextKey = result.SelectSingleNode(XpathNextKey); - nextKey.InnerText.Should().Be("nextkey"); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument(0) == LogLevel.Information - && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP actions.").MustHaveHappenedOnceExactly(); + && call.GetArgument(1) == EventIds.GenerationOfSapXmlPayloadStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP XML payload started.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Information - && call.GetArgument(1) == EventIds.SapActionCreated.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(3, Times.Exactly); - } - - [Test] - public void WhenBuildSapMessageXmlIsCalledWithChangeMoveCellScenario_ThenReturnXMLDocument() - { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataChangeMoveCell); - var correlationId = "367ce4a4-1d62-4f56-b359-59e178d77100"; - - XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); - - A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); - A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - - var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(scenarios!, correlationId); - - result.Should().BeOfType(); - var actionItem = result.SelectSingleNode(XpathActionItems); - actionItem.ChildNodes.Count.Should().Be(7); + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.EncCellSapActionGenerationStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building ENC cell SAP actions.").MustHaveHappenedOnceExactly(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Information - && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP actions.").MustHaveHappenedOnceExactly(); + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP action {ActionName}.").MustHaveHappened(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument(0) == LogLevel.Information && call.GetArgument(1) == EventIds.SapActionCreated.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(7, Times.Exactly); - } - - [Test] - public void WhenSapXmlTemplateFileNotExist_ThenThrowFileNotFoundException() - { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataCancelReplaceCell); - var correlationId = "367ce4a4-1d62-4f56-b359-59e178d77100"; - - A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(false); - - Assert.Throws(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(scenarios!, correlationId)); + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(3, Times.Exactly); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Error - && call.GetArgument(1) == EventIds.SapXmlTemplateNotFound.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "The SAP message xml template does not exist.").MustHaveHappenedOnceExactly(); + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.GenerationOfSapXmlPayloadCompleted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP XML payload completed.").MustHaveHappenedOnceExactly(); } [Test] - public void WhenBuildSapMessageXmlIsCalledWithAdditionalCoverageScenario_ThenReturnXMLDocument() + public void WhenBuildSapMessageXmlIsCalledWithAdditionalCoverageWithNewEditionScenario_ThenReturnXMLDocument() { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataAdditionalCoverage); - var correlationId = "765ce4a4-1d62-4f56-b359-59e178d77104"; + var additionalCoverageEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\AdditionalCoverageWithNewEdition.JSON"); + var eventData = JsonConvert.DeserializeObject(additionalCoverageEventPayloadJson); + var permitKeys = new DecryptedPermit { ActiveKey = "firstkey", NextKey = "nextkey" }; XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); + soapXml.LoadXml(_sapXmlTemplate); A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Returns("20240118"); + A.CallTo(() => _fakePermitDecryption.Decrypt(A.Ignored)).Returns(permitKeys); + A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Returns("20240801"); - var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(scenarios!, correlationId); + var result = _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!); result.Should().BeOfType(); - var actionItem = result.SelectSingleNode(XpathActionItems); - actionItem.ChildNodes.Count.Should().Be(3); - var childCell = result.SelectSingleNode(XpathChildCell); - childCell.InnerXml.Should().Be("DE416080"); - var replacedBy = result.SelectSingleNode(XpathReplacedBy); - replacedBy.InnerXml.Should().Be("DK4LIMFW"); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument(0) == LogLevel.Information - && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP actions.").MustHaveHappenedOnceExactly(); + && call.GetArgument(1) == EventIds.GenerationOfSapXmlPayloadStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP XML payload started.").MustHaveHappenedOnceExactly(); + + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.EncCellSapActionGenerationStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building ENC cell SAP actions.").MustHaveHappenedOnceExactly(); + + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.BuildingSapActionStarted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Building SAP action {ActionName}.").MustHaveHappened(); A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" && call.GetArgument(0) == LogLevel.Information && call.GetArgument(1) == EventIds.SapActionCreated.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(3, Times.Exactly); - } + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP action {ActionName} created.").MustHaveHappened(4, Times.Exactly); - [Test] - public void WhenMoreThanOneUnitOfSaleHavingUnitOfSaleTypeUnitIsPassedToGetUnitOfSaleForEncCell_ThenReturnsFirstUnitOfSaleHavingAddProduct() - { - var listOfUnitOfSales = new List() - { - new UnitOfSale() { UnitName = "MX545010", Title = "Title1", UnitOfSaleType = "unit", - CompositionChanges = new CompositionChanges { AddProducts = new List() } }, - new UnitOfSale() { UnitName = "MX509226", Title = "Title2", UnitOfSaleType = "unit", - CompositionChanges = new CompositionChanges { AddProducts = new List(){ "MX545010" } } } - }; - - var product = new Product() - { - ProductName = "MX545010", - InUnitsOfSale = new List() { "MX545010", "MX509226" } - }; - - MethodInfo methodInfo = typeof(EncContentSapMessageBuilder).GetMethod("GetUnitOfSaleForEncCell", BindingFlags.NonPublic | BindingFlags.Instance)!; - var result = (UnitOfSale)methodInfo.Invoke(_fakeEncContentSapMessageBuilder, new object[] { listOfUnitOfSales, product })!; - - result.UnitName.Should().BeSameAs("MX509226"); - listOfUnitOfSales.Count.Should().Be(2); + A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" + && call.GetArgument(0) == LogLevel.Information + && call.GetArgument(1) == EventIds.GenerationOfSapXmlPayloadCompleted.ToEventId() + && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP XML payload completed.").MustHaveHappenedOnceExactly(); } [Test] - public void WhenOneUnitOfSaleHavingUnitOfSaleTypeUnitIsPassedToGetUnitOfSaleForEncCell_ThenReturnsFirstOrDefaultUnitOfSale() + public void SortXmlPayloadTest() { - var listOfUnitOfSales = new List() - { - new UnitOfSale() { UnitName = "MX509226", Title = "Title1", UnitOfSaleType = "unit" }, - }; + var expectedActionNumber = "1"; + var expectedAction = "CREATE ENC CELL"; + var sapReqXml = TestHelper.ReadFileData("ERPTestData\\UnsortedActionItems.xml"); + + var xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(sapReqXml); + var actionItemNode = xmlDoc.SelectSingleNode(XpathActionItems); - var product = new Product() - { - ProductName = "MX545010", - InUnitsOfSale = new List() { "MX509226" } - }; + var sortedXmlPayLoad = typeof(EncContentSapMessageBuilder).GetMethod("SortXmlPayload", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; + var result = (XmlNode)sortedXmlPayLoad.Invoke(_fakeEncContentSapMessageBuilder, new object[] { actionItemNode! })!; - MethodInfo methodInfo = typeof(EncContentSapMessageBuilder).GetMethod("GetUnitOfSaleForEncCell", BindingFlags.NonPublic | BindingFlags.Instance)!; - var result = (UnitOfSale)methodInfo.Invoke(_fakeEncContentSapMessageBuilder, new object[] { listOfUnitOfSales, product })!; + var firstActionNumber = result.SelectSingleNode(XpathActionNumber); + firstActionNumber.InnerXml.Should().Be(expectedActionNumber); - result.UnitName.Should().BeSameAs("MX509226"); + var firstActionName = result.SelectSingleNode(XpathAction); + firstActionName.InnerXml.Should().Be(expectedAction); } [Test] - [TestCase("ENC S57", "S57")] - [TestCase("ENC", "ENC")] - [TestCase("", "")] - [TestCase(null, "")] - public void GetProdTypeTest(string prodType, string actual) + public void WhenBuildSapMessageXmlIsCalledWithNewCellWithNoUnitOfSaleHavingTypeIsUnit_ThenThrowERPFacadeException() { - MethodInfo getProdType = typeof(EncContentSapMessageBuilder).GetMethod("GetProdType", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - string result = (string)getProdType.Invoke(_fakeEncContentSapMessageBuilder, new object[] { prodType })!; + var newCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\NewCellWithNoUnitOfSaleHavingTypeIsUnit.JSON"); + var eventData = JsonConvert.DeserializeObject(newCellEventPayloadJson); - Assert.That(actual, Is.EqualTo(result)); - } + XmlDocument soapXml = new(); + soapXml.LoadXml(_sapXmlTemplate); - [Test] - [TestCase("ENC S57", "PRODTYPE", "S57")] - [TestCase("ENC S57", "PRODTYPE1", "ENC S57")] - [TestCase("", "PRODTYPE1", "")] - [TestCase(null, "PRODTYPE1", "")] - public void GetXmlNodeValueTest(string prodType, string prod, string actual) - { - MethodInfo xmlNodeValue = typeof(EncContentSapMessageBuilder).GetMethod("GetXmlNodeValue", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - string result = (string)xmlNodeValue.Invoke(_fakeEncContentSapMessageBuilder, new object[] { prodType, prod })!; + A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); + A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - Assert.That(actual, Is.EqualTo(result)); + Assert.Throws(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!)) + .Message.Should().Be("Required unit not found in event payload to generate CREATE ENC CELL action for US5AK9DI."); } [Test] - public void SortXmlPayloadTest() + public void WhenBuildSapMessageXmlIsCalledWithReplaceCellWithNoUnitOfSaleHavingTypeIsUnit_ThenThrowERPFacadeException() { - string expectedResult = "1CREATE ENC CELLENC CELLS57US4AK6NTUS4AK6NTUS1mediumNorton Sound - Alaska82"; - string xpathActionItems = $"//*[local-name()='ACTIONITEMS']"; - var sapReqXml = TestHelper.ReadFileData("ERPTestData\\ActionItemNodeTest.xml"); + var newCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\ReplaceCellWithNoUnitOfSaleHavingTypeIsUnit.JSON"); + var eventData = JsonConvert.DeserializeObject(newCellEventPayloadJson); - XmlDocument xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(sapReqXml); - XmlNode actionItemNode = xmlDoc.SelectSingleNode(xpathActionItems)!; + XmlDocument soapXml = new(); + soapXml.LoadXml(_sapXmlTemplate); - MethodInfo xmlPayLoad = typeof(EncContentSapMessageBuilder).GetMethod("SortXmlPayload", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - var result = (XmlNode)xmlPayLoad.Invoke(_fakeEncContentSapMessageBuilder, new object[] { actionItemNode })!; + A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); + A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - var firstNode = result.Cast().FirstOrDefault().InnerText; - Assert.That(expectedResult, Is.EqualTo(firstNode)); + Assert.Throws(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!)) + .Message.Should().Be("Required unit not found in event payload to generate REPLACED WITH ENC CELL action for GB50382B."); } [Test] - public void BuildActionTest() + public void WhenBuildSapMessageXmlIfRequiredAttributesNotProvided_ThenThrowERPFacadeException() { - var actualXmlElement = @"1CREATE ENC CELLENC CELLS57US5AK83MUS5AK83MUS1smallSt. Michael Bay01"; - var permitKeys = new PermitKey { ActiveKey = "", NextKey = "" }; + var newCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\NewCellWithoutProviderCodeAttributes.JSON"); + var eventData = JsonConvert.DeserializeObject(newCellEventPayloadJson); - var scenarios = JsonConvert.DeserializeObject(ScenariosDataCancelReplaceCell); XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); - A.CallTo(() => _fakePermitDecryption.GetPermitKeys(A.Ignored)).Returns(permitKeys); + soapXml.LoadXml(_sapXmlTemplate); - MethodInfo getUnitOfSaleForEncCell = typeof(EncContentSapMessageBuilder).GetMethod("GetUnitOfSaleForEncCell", BindingFlags.NonPublic | BindingFlags.Instance)!; - var unitOfSale = (UnitOfSale)getUnitOfSaleForEncCell.Invoke(_fakeEncContentSapMessageBuilder, new object[] { scenarios.Data.UnitsOfSales, - scenarios.Data.Products.FirstOrDefault()! })!; - - var action = _fakeSapActionConfig.Value.SapActions.FirstOrDefault(x => x.Product == EncCell); - - MethodInfo buildAction = typeof(EncContentSapMessageBuilder).GetMethod("BuildAction", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - var result = (XmlElement)buildAction.Invoke(_fakeEncContentSapMessageBuilder, new object[] {soapXml,scenarios.Data.Products.FirstOrDefault()!, - unitOfSale,action!,null,null,null})!; + A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); + A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - result.ChildNodes.Count.Should().Be(20); - result.InnerXml.Should().Be(actualXmlElement); + Assert.Throws(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!)) + .Message.Should().Be("Error while generating SAP action information. | Action : CREATE ENC CELL | XML Attribute : PROVIDER | ErrorMessage : Object reference not set to an instance of an object."); } [Test] - public void WhenUnitOfSaleIsNull_ThenReturnsXmlPayloadWithEmptyNode() + public void WhenBuildSapMessageXmlIfUkhoWeekNumberSectionNotProvided_ThenThrowERPFacadeException() { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataCancelReplaceCell); + var newCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\NewCellWithoutUkhoWeekNumberSection.JSON"); + var eventData = JsonConvert.DeserializeObject(newCellEventPayloadJson); + var permitKeys = new DecryptedPermit { ActiveKey = "firstkey", NextKey = "nextkey" }; XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); + soapXml.LoadXml(_sapXmlTemplate); - A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Returns("20240118"); - - var action = _fakeSapActionConfig.Value.SapActions.FirstOrDefault(x => x.Product == EncCell); - - MethodInfo buildAction = typeof(EncContentSapMessageBuilder).GetMethod("BuildAction", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - var result = (XmlElement)buildAction.Invoke(_fakeEncContentSapMessageBuilder, new object[] {soapXml,scenarios.Data.Products.FirstOrDefault()!, - null,action!,null,null,null})!; + A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); + A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); + A.CallTo(() => _fakePermitDecryption.Decrypt(A.Ignored)).Returns(permitKeys); - result.ChildNodes.Count.Should().Be(20); - var productName = result.SelectSingleNode(XpathProductName); - productName.InnerXml.Should().BeEmpty(); + Assert.Throws(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!)) + .Message.Should().Be("UkhoWeekNumber section not found in enccontentpublished event payload while creating CREATE ENC CELL action."); } [Test] - public void WhenValidUkhoWeekNumberIsPassed_ThenReturnsXmlPayloadWithNodeValues() + public void WhenBuildSapMessageXmlWithWrongUkhoWeekNumberDetails_ThenThrowERPFacadeException() { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataCancelReplaceCell); + var newCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\NewCellWithWrongUkhoWeekDetails.JSON"); + var eventData = JsonConvert.DeserializeObject(newCellEventPayloadJson); + var permitKeys = new DecryptedPermit { ActiveKey = "firstkey", NextKey = "nextkey" }; XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); - - A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Returns("20240118"); - - MethodInfo getUnitOfSaleForEncCell = typeof(EncContentSapMessageBuilder).GetMethod("GetUnitOfSaleForEncCell", BindingFlags.NonPublic | BindingFlags.Instance)!; - var unitOfSale = (UnitOfSale)getUnitOfSaleForEncCell.Invoke(_fakeEncContentSapMessageBuilder, new object[] { scenarios.Data.UnitsOfSales, - scenarios.Data.Products.FirstOrDefault()! })!; - - var action = _fakeSapActionConfig.Value.SapActions.FirstOrDefault(x => x.Product == EncCell); + soapXml.LoadXml(_sapXmlTemplate); - MethodInfo buildAction = typeof(EncContentSapMessageBuilder).GetMethod("BuildAction", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - var result = (XmlElement)buildAction.Invoke(_fakeEncContentSapMessageBuilder, new object[] {soapXml,scenarios.Data.Products.FirstOrDefault()!, - unitOfSale,action!,scenarios.Data.UkhoWeekNumber,null,null})!; + A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); + A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); + A.CallTo(() => _fakePermitDecryption.Decrypt(A.Ignored)).Returns(permitKeys); + A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Throws(); - result.ChildNodes.Count.Should().Be(20); - var correction = result.SelectSingleNode(XpathCorrection); - var weekNo = result.SelectSingleNode(XpathWeekNo); - var validFrom = result.SelectSingleNode(XpathValidFrom); - correction.InnerXml.Should().Be("N"); - weekNo.InnerXml.Should().Be("202403"); - validFrom.InnerXml.Should().Be("20240118"); + Assert.Throws(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!)) + .Message.Should().Be("Error while generating SAP action information. | Action : CREATE ENC CELL | XML Attribute : VALIDFROM | ErrorMessage : Exception of type 'System.Exception' was thrown."); } [Test] - public void WhenUkhoWeekNumberIsNullOrNodeRequiredIsFalse_ThenReturnsXmlPayloadWithEmptyNodes() + public void WhenBuildSapMessageXmlWithEmptyPermit_ThenThrowERPFacadeException() { - var scenarios = JsonConvert.DeserializeObject(ScenariosDataCancelReplaceCell); + var newCellEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\NewCellWithEmptyPermit.JSON"); + var eventData = JsonConvert.DeserializeObject(newCellEventPayloadJson); XmlDocument soapXml = new(); - soapXml.LoadXml(SapXmlFile); + soapXml.LoadXml(_sapXmlTemplate); + + A.CallTo(() => _fakeFileSystemHelper.IsFileExists(A.Ignored)).Returns(true); + A.CallTo(() => _fakeXmlHelper.CreateXmlDocument(A.Ignored)).Returns(soapXml); - MethodInfo getUnitOfSaleForEncCell = typeof(EncContentSapMessageBuilder).GetMethod("GetUnitOfSaleForEncCell", BindingFlags.NonPublic | BindingFlags.Instance)!; - var unitOfSale = (UnitOfSale)getUnitOfSaleForEncCell.Invoke(_fakeEncContentSapMessageBuilder, new object[] { scenarios.Data.UnitsOfSales, - scenarios.Data.Products.FirstOrDefault()! })!; + A.CallTo(() => _fakeWeekDetailsProvider.GetDateOfWeek(A.Ignored, A.Ignored, A.Ignored)).Throws(); - var action = _fakeSapActionConfig.Value.SapActions.FirstOrDefault(x => x.Product == EncCell); - action.Attributes.LastOrDefault().IsRequired = false; + Assert.Throws(() => _fakeEncContentSapMessageBuilder.BuildSapMessageXml(eventData!)) + .Message.Should().Be("Required details are missing in enccontentpublished event payload. | Property Name : permit"); + } - MethodInfo buildAction = typeof(EncContentSapMessageBuilder).GetMethod("BuildAction", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - var result = (XmlElement)buildAction.Invoke(_fakeEncContentSapMessageBuilder, new object[] {soapXml,scenarios.Data.Products.FirstOrDefault()!, - unitOfSale,action!,null,null,null})!; + [Test] + public void WhenUnitOfSaleIsNullWhileReplacingEncCell_ThenReturnsNull() + { + var cancelCellWithNewCellReplacementPayloadJson = TestHelper.ReadFileData("ERPTestData\\CancelCellWithNewCellReplacement.JSON"); + var eventData = JsonConvert.DeserializeObject(cancelCellWithNewCellReplacementPayloadJson); + var action = _fakeSapActionConfig.Value.SapActions.FirstOrDefault(x => x.Product == EncCell && x.Action == ReplaceEncCellAction); - result.ChildNodes.Count.Should().Be(20); - var correction = result.SelectSingleNode(XpathCorrection); - var weekNo = result.SelectSingleNode(XpathWeekNo); - var validFrom = result.SelectSingleNode(XpathValidFrom); - correction.InnerXml.Should().BeEmpty(); - weekNo.InnerXml.Should().BeEmpty(); - validFrom.InnerXml.Should().BeEmpty(); + MethodInfo buildAction = typeof(EncContentSapMessageBuilder).GetMethod("GetUnitOfSale", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; + var result = (XmlElement)buildAction.Invoke(_fakeEncContentSapMessageBuilder, new object[] { action.ActionNumber, eventData.Data.UnitsOfSales!, eventData.Data.Products.FirstOrDefault()! })!; - A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Error - && call.GetArgument(1) == EventIds.InvalidUkhoWeekNumber.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Invalid UkhoWeekNumber field received in enccontentpublished event.").MustHaveHappened(); + result.Should().BeNull(); } [Test] - [TestCase("202403", 3, 2024)] - [TestCase("202512", 12, 2025)] - public void GetUkhoWeekNumberDataTest(string expectedResult, int week, int year) + public void WhenUnitOfSaleIsNullWhileChangingEncCell_ThenReturnsNull() { - UkhoWeekNumber ukhoWeekNumber = new() - { - Year = year, - Week = week - }; + var cancelCellWithNewCellReplacementPayloadJson = TestHelper.ReadFileData("ERPTestData\\CancelCellWithNewCellReplacement.JSON"); + var eventData = JsonConvert.DeserializeObject(cancelCellWithNewCellReplacementPayloadJson); + var action = _fakeSapActionConfig.Value.SapActions.FirstOrDefault(x => x.Product == EncCell && x.Action == ChangeEncCellAction); - MethodInfo getUkhoWeekNumber = typeof(EncContentSapMessageBuilder).GetMethod("GetUkhoWeekNumberData", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - string result = (string)getUkhoWeekNumber.Invoke(_fakeEncContentSapMessageBuilder, new object[] { ukhoWeekNumber })!; + MethodInfo buildAction = typeof(EncContentSapMessageBuilder).GetMethod("GetUnitOfSale", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; + var result = (XmlElement)buildAction.Invoke(_fakeEncContentSapMessageBuilder, new object[] { action.ActionNumber, eventData.Data.UnitsOfSales!, eventData.Data.Products.LastOrDefault()! })!; - Assert.That(expectedResult, Is.EqualTo(result)); + result.Should().BeNull(); } [Test] - [TestCase(0, 0, false)] - [TestCase(52, 0, false)] - [TestCase(0, 2023, false)] - public void ValidWeekNumberTest_WhenInvalidUkhoWeekNumberIsPassed(int validWeek, int validYear, bool expectedResult) + [TestCase("fieldvalue", null, "fieldvalue")] + [TestCase("fieldvalue", "AGENCY", "fi")] + [TestCase("fieldvalue", "", "fieldvalue")] + public void WhenGetXmlNodeValue(string fieldValue, string xmlNodeName, string expectedValue) { - UkhoWeekNumber ukhoWeekNumber = new() - { - Year = validYear, - Week = validWeek - }; - - MethodInfo isValidWeekNumber = typeof(EncContentSapMessageBuilder).GetMethod("IsValidWeekNumber", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; - bool result = (bool)isValidWeekNumber.Invoke(_fakeEncContentSapMessageBuilder, new object[] { ukhoWeekNumber })!; + MethodInfo buildAction = typeof(EncContentSapMessageBuilder).GetMethod("GetXmlNodeValue", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)!; + var result = (string)buildAction.Invoke(_fakeEncContentSapMessageBuilder, new object[] { fieldValue, xmlNodeName })!; - Assert.That(expectedResult, Is.EqualTo(result)); + result.Should().Be(expectedValue); } } } diff --git a/tests/UKHO.ERPFacade.API.UnitTests/UKHO.ERPFacade.API.UnitTests.csproj b/tests/UKHO.ERPFacade.API.UnitTests/UKHO.ERPFacade.API.UnitTests.csproj index 224855bd..5dc94431 100644 --- a/tests/UKHO.ERPFacade.API.UnitTests/UKHO.ERPFacade.API.UnitTests.csproj +++ b/tests/UKHO.ERPFacade.API.UnitTests/UKHO.ERPFacade.API.UnitTests.csproj @@ -33,15 +33,48 @@ - + Always Always + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + Always + + Always + diff --git a/tests/UKHO.ERPFacade.EventAggregation.WebJob.UnitTests/Services/AggregationServiceTests.cs b/tests/UKHO.ERPFacade.EventAggregation.WebJob.UnitTests/Services/AggregationServiceTests.cs index 27c5abd1..1ea27e01 100644 --- a/tests/UKHO.ERPFacade.EventAggregation.WebJob.UnitTests/Services/AggregationServiceTests.cs +++ b/tests/UKHO.ERPFacade.EventAggregation.WebJob.UnitTests/Services/AggregationServiceTests.cs @@ -191,11 +191,6 @@ public void WhenSapDoesNotRespond200Ok_ThenWebJobReturns500InternalServerRespons && call.GetArgument(0) == LogLevel.Information && call.GetArgument(1) == EventIds.UploadedRecordOfSaleSapXmlPayloadInAzureBlob.ToEventId() && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "SAP xml payload for record of sale event is uploaded in blob storage successfully. | _X-Correlation-ID : {_X-Correlation-ID} | EventID : {EventID}").MustHaveHappenedOnceExactly(); - - A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Error - && call.GetArgument(1) == EventIds.ErrorOccurredInSapForRecordOfSalePublishedEvent.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "An error occurred while sending record of sale event data to SAP. | _X-Correlation-ID : {_X-Correlation-ID} | EventID : {EventID} | StatusCode: {StatusCode}").MustHaveHappenedOnceExactly(); } [Test] @@ -283,7 +278,7 @@ public void WhenValidateEntityThrowsException_ThenThrowsException() A.CallTo(() => _fakeSapClient.PostEventData(A.Ignored, A.Ignored, A.Ignored, A.Ignored, A.Ignored)) - .Throws(new ERPFacadeException(EventIds.UnhandledWebJobException.ToEventId())); + .Throws(new ERPFacadeException(EventIds.UnhandledWebJobException.ToEventId(), "message", [])); var ex = Assert.ThrowsAsync(() => _fakeAggregationService.MergeRecordOfSaleEvents(queueMessage)); @@ -295,11 +290,6 @@ public void WhenValidateEntityThrowsException_ThenThrowsException() && call.GetArgument(0) == LogLevel.Information && call.GetArgument(1) == EventIds.MessageDequeueCount.ToEventId() && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Dequeue Count : {DequeueCount} | _X-Correlation-ID : {_X-Correlation-ID} | EventID : {EventID}").MustHaveHappenedOnceOrMore(); - - A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log" - && call.GetArgument(0) == LogLevel.Error - && call.GetArgument(1) == EventIds.UnhandledWebJobException.ToEventId() - && call.GetArgument>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Exception occurred while processing Event Aggregation WebJob. | _X-Correlation-ID : {_X-Correlation-ID} | EventID : {EventID}").MustHaveHappenedOnceExactly(); } } }