Repository: UKHO/erp-facade
Pull request #306: 205201 To map the business rules for unit of sale type as Unit and process S-100 v1.1 events only
Author: login: mohamme15315
Created: 2025-03-10T11:24:44Z | Merged: 2025-03-13T10:19:27Z

This PR contains below file changes

Code
1. S100DataContentPublishedEventSapActionConfiguration.json
2. EventTypes.cs
3. S100BoundingBox.cs

Unit Test
1. CancellationAndReplacement.json
2. ChangeProduct.json
3. NewProduct.json
4. NewProductWithNoUnitOfSaleStatusandAddProducts.json
5. NewProductWithoutProducingAgencyAttributes.json
6. NewProductWithUnitOfSaleTypeAsFolio.json
7. ReplaceProductWithNoUnitOfSaleRemoveProducts.json
8. S100DataContentPublishedEventXmlTransformerTests.cs

Automation Test Changes
1. CancellationAndReplacement.json
2. NewCell.json
3. NewCellAndEdition.json
4. NewCellV1.json
5. SAP500InternalServerError.json
6. SimpleUpdate.json
7. SupplierChange.json
8. SupplierDefinedReleasability.json
9. SupplierDefinedUnitChange.json
10. SupplierDefinedUnitChangeV2.json
11. Suspend.json
12. Withdrawn.json
13. S100WebhookScenario.cs
14. UKHO.ERPFacade.API.FunctionalTests.csproj

Pipeline execution - https://dev.azure.com/ukhydro/ERP%20Facade/_build/results?buildId=434488&view=results


Diff:
diff --git a/src/UKHO.ERPFacade.API/ConfigurationFiles/S100DataContentPublishedEventSapActionConfiguration.json b/src/UKHO.ERPFacade.API/ConfigurationFiles/S100DataContentPublishedEventSapActionConfiguration.json
index 04f33ae6a..0d7035097 100644
--- a/src/UKHO.ERPFacade.API/ConfigurationFiles/S100DataContentPublishedEventSapActionConfiguration.json
+++ b/src/UKHO.ERPFacade.API/ConfigurationFiles/S100DataContentPublishedEventSapActionConfiguration.json
@@ -108,6 +108,11 @@ Each action has the following properties:
                                 "AttributeDataType": "bool",
                                 "AttributeName": "IsNewUnitOfSale",
                                 "AttributeValue": "True"
+                            },
+                            {
+                                "AttributeDataType": "string",
+                                "AttributeName": "UnitOfSaleType",
+                                "AttributeValue": "unit"
                             }
                         ]
                     }
diff --git a/src/UKHO.ERPFacade.Common/Constants/EventTypes.cs b/src/UKHO.ERPFacade.Common/Constants/EventTypes.cs
index 02e4177e2..6564ffc4c 100644
--- a/src/UKHO.ERPFacade.Common/Constants/EventTypes.cs
+++ b/src/UKHO.ERPFacade.Common/Constants/EventTypes.cs
@@ -6,7 +6,7 @@ namespace UKHO.ERPFacade.Common.Constants
     public static class EventTypes
     {
         public const string S57EventType = "uk.gov.ukho.encpublishing.enccontentpublished.v2.2";
-        public const string S100EventType = "uk.gov.ukho.encpublishing.s100datacontentpublished.v1";
-        public const string S100UnitOfSaleUpdatedEventType = "uk.gov.ukho.erp.s100UnitOfSaleUpdated.v1";
+        public const string S100EventType = "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1";
+        public const string S100UnitOfSaleUpdatedEventType = "uk.gov.ukho.erp.s100UnitOfSaleUpdated.v1.1";
     }
 }
diff --git a/src/UKHO.ERPFacade.Common/Models/CloudEvents/S100Event/S100BoundingBox.cs b/src/UKHO.ERPFacade.Common/Models/CloudEvents/S100Event/S100BoundingBox.cs
index c65f8b10b..935f9b8e1 100644
--- a/src/UKHO.ERPFacade.Common/Models/CloudEvents/S100Event/S100BoundingBox.cs
+++ b/src/UKHO.ERPFacade.Common/Models/CloudEvents/S100Event/S100BoundingBox.cs
@@ -9,9 +9,9 @@ public class S100BoundingBox
         [JsonProperty("northLimit")]
         public double NorthLimit { get; set; }
         [JsonProperty("southLimit")]
-        public int SouthLimit { get; set; }
+        public double SouthLimit { get; set; }
         [JsonProperty("eastLimit")]
-        public int EastLimit { get; set; }
+        public double EastLimit { get; set; }
         [JsonProperty("westLimit")]
         public double WestLimit { get; set; }
     }
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/S100ExpectedXmlFiles/NewCellWithUnitOfSaleTypeIsFolio.xml b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/S100ExpectedXmlFiles/NewCellWithUnitOfSaleTypeIsFolio.xml
new file mode 100644
index 000000000..2dabfe820
--- /dev/null
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadeExpectedXmlFiles/S100ExpectedXmlFiles/NewCellWithUnitOfSaleTypeIsFolio.xml
@@ -0,0 +1,68 @@
+﻿<?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_SHOP_MAT_INFO xmlns="urn:sap-com:document:sap:rfc:functions">
+			<IM_MATINFO xmlns="">
+				<CORRID>165cea4-1d6-4f6-b35-59e178d7108</CORRID>
+				<NOOFACTIONS>4</NOOFACTIONS>
+				<RECDATE>20250312</RECDATE>
+				<RECTIME>100824</RECTIME>
+				<ORG>UKHO</ORG>
+				<ACTIONITEMS>
+					<item>
+						<ACTIONNUMBER>1</ACTIONNUMBER>
+						<ACTION>CREATE PRODUCT</ACTION>
+						<PRODUCT>SHOP CELL</PRODUCT>
+						<PRODTYPE>s101</PRODTYPE>
+						<CHILDCELL>101GB7645JTHG83</CHILDCELL>
+						<PRODUCTNAME>101GB7645JTHG83</PRODUCTNAME>
+						<REPLACEDBY></REPLACEDBY>
+						<AGENCY>GB</AGENCY>
+						<PROVIDER>1</PROVIDER>
+						<ENCSIZE>medium</ENCSIZE>
+						<TITLE>101GB7645JTHG83</TITLE>
+					</item>
+					<item>
+						<ACTIONNUMBER>2</ACTIONNUMBER>
+						<ACTION>ASSIGN PRODUCT TO UNIT OF SALE</ACTION>
+						<PRODUCT>SHOP UNIT</PRODUCT>
+						<PRODTYPE>s101</PRODTYPE>
+						<CHILDCELL>101GB7645JTHG83</CHILDCELL>
+						<PRODUCTNAME>101GB7645JTHG83</PRODUCTNAME>
+						<REPLACEDBY></REPLACEDBY>
+						<AGENCY></AGENCY>
+						<PROVIDER></PROVIDER>
+						<ENCSIZE></ENCSIZE>
+						<TITLE></TITLE>
+					</item>
+					<item>
+						<ACTIONNUMBER>3</ACTIONNUMBER>
+						<ACTION>ASSIGN PRODUCT TO UNIT OF SALE</ACTION>
+						<PRODUCT>SHOP UNIT</PRODUCT>
+						<PRODTYPE>s101</PRODTYPE>
+						<CHILDCELL>101GB007645JTHG83</CHILDCELL>
+						<PRODUCTNAME>s100WorldFolio</PRODUCTNAME>
+						<REPLACEDBY></REPLACEDBY>
+						<AGENCY></AGENCY>
+						<PROVIDER></PROVIDER>
+						<ENCSIZE></ENCSIZE>
+						<TITLE></TITLE>
+					</item>
+					<item>
+						<ACTIONNUMBER>4</ACTIONNUMBER>
+						<ACTION>CHANGE UNIT OF SALE</ACTION>
+						<PRODUCT>SHOP UNIT</PRODUCT>
+						<PRODTYPE>s101</PRODTYPE>
+						<CHILDCELL></CHILDCELL>
+						<PRODUCTNAME>s100WorldFolio</PRODUCTNAME>
+						<REPLACEDBY></REPLACEDBY>
+						<AGENCY>UKHO</AGENCY>
+						<PROVIDER>0</PROVIDER>
+						<ENCSIZE>large</ENCSIZE>
+						<TITLE></TITLE>
+					</item>
+				</ACTIONITEMS>
+			</IM_MATINFO>
+		</Z_SHOP_MAT_INFO>
+	</soap:Body>
+</soap:Envelope>
\ No newline at end of file
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/CancellationAndReplacement.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/CancellationAndReplacement.JSON
index adc0250d7..2f91f877c 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/CancellationAndReplacement.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/CancellationAndReplacement.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCell.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCell.JSON
index 5b523acbd..7a7748c6a 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCell.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCell.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellAndEdition.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellAndEdition.JSON
index 21ab3628b..39162c2df 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellAndEdition.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellAndEdition.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellV1.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellV1.JSON
new file mode 100644
index 000000000..f70d812ce
--- /dev/null
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellV1.JSON
@@ -0,0 +1,94 @@
+{
+    "specversion": "1.0",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "source": "https://encpublishing.ukho.gov.uk",
+    "id": "5f03a25-28b-46e-b00-593250a9a4",
+    "time": "2024-08-13T12:08:03.4880776Z",
+    "subject": "101GB7645JTHG83",
+    "datacontenttype": "application/json",
+    "data": {
+        "correlationId": "165ce4a-1d6-4f5-b35-59e178d7111",
+        "products": [
+            {
+                "productType": "s100",
+                "productIdentifier": "s101",
+                "productName": "101GB7645JTHG83",
+                "editionNumber": 1,
+                "updateNumber": 0,
+                "mayAffectHoldings": true,
+                "providerCode": "1",
+                "providerName": "ICE",
+                "size": "medium",
+                "producingAgency": "GB",
+                "status": {
+                    "statusName": "newDataset",
+                    "statusDate": "2024-07-16T19:20:30.45+01:00",
+                    "isNewCell": true
+                },
+                "replaces": [],
+                "dataReplacement": [],
+                "boundingBox": {
+                    "northLimit": 63,
+                    "southLimit": 63,
+                    "eastLimit": 8,
+                    "westLimit": 7
+                },
+                "fileSize": 3456,
+                "inUnitsOfSale": [
+                    "101GB7645JTHG83"
+                ],
+                "producerUnitName": "101GB7645JTHG83"
+            }
+        ],
+        "unitsOfSale": [
+            {
+                "unitName": "101GB7645JTHG83",
+                "productIdentifier": "s101",
+                "title": "A test S-101 cell from GB authority in its own unit of sale",
+                "unitOfSaleType": "unit",
+                "providerCode": "1",
+                "providerName": "ICE",
+                "producingAgency": "GB00",
+                "unitSize": "large",
+                "status": "ForSale",
+                "isNewUnitOfSale": true,
+                "boundingBox": {
+                    "northLimit": 63,
+                    "southLimit": 63,
+                    "eastLimit": 8,
+                    "westLimit": 7
+                },
+                "compositionChanges": {
+                    "addProducts": [
+                        "101GB7645JTHG83"
+                    ],
+                    "removeProducts": []
+                }
+            },
+            {
+                "unitName": "s100WorldFolio",
+                "productIdentifier": "s101",
+                "title": "Whole World Wide Folio",
+                "unitOfSaleType": "folio",
+                "providerCode": "0",
+                "providerName": "UKHO",
+                "producingAgency": "UKHO",
+                "unitSize": "large",
+                "status": "ForSale",
+                "isNewUnitOfSale": false,
+                "boundingBox": {
+                    "northLimit": 90,
+                    "southLimit": -90,
+                    "eastLimit": 180,
+                    "westLimit": -180
+                },
+                "compositionChanges": {
+                    "addProducts": [
+                        "101GB007645JTHG83"
+                    ],
+                    "removeProducts": []
+                }
+            }
+        ]
+    }
+}
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellWithUnitOfSaleTypeIsFolio.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellWithUnitOfSaleTypeIsFolio.JSON
new file mode 100644
index 000000000..b16f415dd
--- /dev/null
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/NewCellWithUnitOfSaleTypeIsFolio.JSON
@@ -0,0 +1,94 @@
+{
+    "specversion": "1.0",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
+    "source": "https://encpublishing.ukho.gov.uk",
+    "id": "5f03a25-283-46e-b09-594325a9a41",
+    "time": "2024-08-13T12:08:03.4880776Z",
+    "subject": "101GB7645JTHG83",
+    "datacontenttype": "application/json",
+    "data": {
+        "correlationId": "165cea4-1d6-4f6-b35-59e178d7108",
+        "products": [
+            {
+                "productType": "s100",
+                "productIdentifier": "s101",
+                "productName": "101GB7645JTHG83",
+                "editionNumber": 1,
+                "updateNumber": 0,
+                "mayAffectHoldings": true,
+                "providerCode": "1",
+                "providerName": "ICE",
+                "size": "medium",
+                "producingAgency": "GB",
+                "status": {
+                    "statusName": "newDataset",
+                    "statusDate": "2024-07-16T19:20:30.45+01:00",
+                    "isNewCell": true
+                },
+                "replaces": [],
+                "dataReplacement": [],
+                "boundingBox": {
+                    "northLimit": 63,
+                    "southLimit": 63,
+                    "eastLimit": 8,
+                    "westLimit": 7
+                },
+                "fileSize": 3456,
+                "inUnitsOfSale": [
+                    "101GB7645JTHG83"
+                ],
+                "producerUnitName": "101GB7645JTHG83"
+            }
+        ],
+        "unitsOfSale": [
+          {
+            "unitName": "101GB7645JTHG83",
+            "productIdentifier": "s101",
+            "title": "A test S-101 cell from GB authority in its own unit of sale",
+            "unitOfSaleType": "folio",
+            "providerCode": "1",
+            "providerName": "ICE",
+            "producingAgency": "GB00",
+            "unitSize": "large",
+            "status": "ForSale",
+            "isNewUnitOfSale": true,
+            "boundingBox": {
+              "northLimit": 63,
+              "southLimit": 63,
+              "eastLimit": 8,
+              "westLimit": 7
+            },
+            "compositionChanges": {
+              "addProducts": [
+                "101GB7645JTHG83"
+              ],
+              "removeProducts": []
+            }
+          },
+            {
+                "unitName": "s100WorldFolio",
+                "productIdentifier": "s101",
+                "title": "Whole World Wide Folio",
+                "unitOfSaleType": "folio",
+                "providerCode": "0",
+                "providerName": "UKHO",
+                "producingAgency": "UKHO",
+                "unitSize": "large",
+                "status": "ForSale",
+                "isNewUnitOfSale": false,
+                "boundingBox": {
+                    "northLimit": 90,
+                    "southLimit": -90,
+                    "eastLimit": 180,
+                    "westLimit": -180
+                },
+                "compositionChanges": {
+                    "addProducts": [
+                        "101GB007645JTHG83"
+                    ],
+                    "removeProducts": []
+                }
+            }
+        ]
+    }
+}
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SAP500InternalServerError.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SAP500InternalServerError.JSON
index c7f079e96..72fb9b4ae 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SAP500InternalServerError.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SAP500InternalServerError.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SimpleUpdate.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SimpleUpdate.JSON
index a492593b8..49b3feb88 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SimpleUpdate.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SimpleUpdate.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierChange.JSON
index 596af2639..4d4b47a0f 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierChange.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierChange.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedReleasability.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedReleasability.JSON
index 38ee33752..953178f1a 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedReleasability.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedReleasability.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedUnitChange.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedUnitChange.JSON
index aa3934e0b..74b02a6ac 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedUnitChange.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedUnitChange.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedUnitChangeV2.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedUnitChangeV2.JSON
index 89177a245..c5e70317c 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedUnitChangeV2.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/SupplierDefinedUnitChangeV2.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/Suspend.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/Suspend.JSON
index 4cc145a66..1a9b7412f 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/Suspend.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/Suspend.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a42",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/Withdrawn.JSON b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/Withdrawn.JSON
index 67949a903..2eb042bcb 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/Withdrawn.JSON
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/ERPFacadePayloadTestData/S100PayloadTestData/Withdrawn.JSON
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a42",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/S100WebhookScenario.cs b/tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/S100WebhookScenario.cs
index f92acad3e..9e3fce7b1 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/S100WebhookScenario.cs
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/S100WebhookScenario.cs
@@ -1,12 +1,11 @@
-﻿using NUnit.Framework;
-using FluentAssertions;
-using UKHO.ERPFacade.API.FunctionalTests.Service;
-using RestSharp;
-using UKHO.ERPFacade.Common.Constants;
+﻿using FluentAssertions;
+using NUnit.Framework;
 using UKHO.ERPFacade.API.FunctionalTests.Auth;
-using UKHO.ERPFacade.API.FunctionalTests.Operations;
 using UKHO.ERPFacade.API.FunctionalTests.Modifiers;
+using UKHO.ERPFacade.API.FunctionalTests.Operations;
+using UKHO.ERPFacade.API.FunctionalTests.Service;
 using UKHO.ERPFacade.API.FunctionalTests.Validators;
+using UKHO.ERPFacade.Common.Constants;
 
 namespace UKHO.ERPFacade.API.FunctionalTests.FunctionalTests
 {
@@ -42,24 +41,25 @@ public void Setup()
         [TestCase("SupplierDefinedUnitChangeV2.JSON", TestName = "WhenICallTheWebhookWithSupplierDefinedUnitChangeV2Scenario_ThenWebhookReturns200Response")]
         [TestCase("Suspend.JSON", TestName = "WhenICallTheWebhookWithSuspendScenario_ThenWebhookReturns200Response")]
         [TestCase("Withdrawn.JSON", TestName = "WhenICallTheWebhookWithWithdrawnScenario_ThenWebhookReturns200Response")]
+        [TestCase("NewCellWithUnitOfSaleTypeIsFolio.JSON", TestName = "VerifyCreateUnitOfSaleActionNotGeneratedWhenUnitOfSaleTypeIsNotUnit")]
         public async Task WhenValidS100DataContentPublishedEventReceivedWithValidToken_ThenWebhookReturns200OkResponse(string jsonPayloadFileName)
         {
-            string jsonPayloadFilePath = Path.Combine(_projectDir, EventPayloadFiles.PayloadFolder, EventPayloadFiles.S100PayloadFolder, jsonPayloadFileName);
-            string xmlPayloadFilePath = jsonPayloadFilePath.Replace(EventPayloadFiles.PayloadFolder, EventPayloadFiles.ErpFacadeExpectedXmlFolder)
+            var jsonPayloadFilePath = Path.Combine(_projectDir, EventPayloadFiles.PayloadFolder, EventPayloadFiles.S100PayloadFolder, jsonPayloadFileName);
+            var xmlPayloadFilePath = jsonPayloadFilePath.Replace(EventPayloadFiles.PayloadFolder, EventPayloadFiles.ErpFacadeExpectedXmlFolder)
                                                .Replace(EventPayloadFiles.S100PayloadFolder, EventPayloadFiles.S100ExpectedXmlFiles)
                                                .Replace(".JSON", ".xml");
 
-            string requestBody = await File.ReadAllTextAsync(jsonPayloadFilePath);
+            var requestBody = await File.ReadAllTextAsync(jsonPayloadFilePath);
             requestBody = JsonModifier.UpdateTime(requestBody);
-            (requestBody, string correlationId) = JsonModifier.UpdateCorrelationId(requestBody);
+            (requestBody, var correlationId) = JsonModifier.UpdateCorrelationId(requestBody);
 
             Console.WriteLine("Scenario: " + jsonPayloadFileName + "\n" + "CorrelationId: " + correlationId + "\n");
 
-            RestResponse response = await _webhookEndpoint.PostWebhookResponseAsync(requestBody, await _authTokenProvider.GetAzureADTokenAsync(false));
+            var response = await _webhookEndpoint.PostWebhookResponseAsync(requestBody, await _authTokenProvider.GetAzureADTokenAsync(false));
 
             response.StatusCode.Should().Be(System.Net.HttpStatusCode.OK);
 
-            string generatedXmlFilePath = _azureBlobReaderWriter.DownloadContainerFile(Path.Combine(_projectDir, EventPayloadFiles.GeneratedXmlFolder), correlationId, ".xml");
+            var generatedXmlFilePath = _azureBlobReaderWriter.DownloadContainerFile(Path.Combine(_projectDir, EventPayloadFiles.GeneratedXmlFolder), correlationId, ".xml");
 
             Assert.That(S100XmlValidator.VerifyXmlAttributes(generatedXmlFilePath, xmlPayloadFilePath, correlationId));
         }
@@ -67,16 +67,16 @@ public async Task WhenValidS100DataContentPublishedEventReceivedWithValidToken_T
         [Test]
         public async Task WhenValidS100DataContentPublishedEventReceivedWithValidToken_ThenWebhookReturns200OkResponseAndCallbackEndpointPublishesEvent()
         {
-            string jsonPayloadFilePath = Path.Combine(_projectDir, EventPayloadFiles.PayloadFolder, EventPayloadFiles.S100PayloadFolder, "NewCell.JSON");
-            string expectedFilePath = Path.Combine(_projectDir, EventPayloadFiles.GeneratedJsonFolder);
+            var jsonPayloadFilePath = Path.Combine(_projectDir, EventPayloadFiles.PayloadFolder, EventPayloadFiles.S100PayloadFolder, "NewCell.JSON");
+            var expectedFilePath = Path.Combine(_projectDir, EventPayloadFiles.GeneratedJsonFolder);
 
-            string requestBody = await File.ReadAllTextAsync(jsonPayloadFilePath);
+            var requestBody = await File.ReadAllTextAsync(jsonPayloadFilePath);
             requestBody = JsonModifier.UpdateTime(requestBody);
-            (requestBody, string correlationId) = JsonModifier.UpdateCorrelationId(requestBody);
+            (requestBody, var correlationId) = JsonModifier.UpdateCorrelationId(requestBody);
 
             Console.WriteLine("Scenario: ERP Facade to SAP to EES event publish.\nCorrelationId: " + correlationId + "\n");
 
-            RestResponse response = await _webhookEndpoint.PostWebhookResponseAsync(requestBody, await _authTokenProvider.GetAzureADTokenAsync(false));
+            var response = await _webhookEndpoint.PostWebhookResponseAsync(requestBody, await _authTokenProvider.GetAzureADTokenAsync(false));
 
             //Once the webhook endpoint returns 200 OK response, the SAP callback endpoint is called from wiremock.
             response.StatusCode.Should().Be(System.Net.HttpStatusCode.OK);
@@ -94,14 +94,31 @@ public async Task WhenValidS100DataContentPublishedEventReceivedWithValidToken_T
         [Test]
         public async Task WhenValidS100DataContentPublishedEventReceived500InternalServerErrorFromSapCallbackEndpoint_ThenWebhookEndPointReturns500InternalServerErrorResponse()
         {
-            string jsonPayloadFilePath = Path.Combine(_projectDir, EventPayloadFiles.PayloadFolder, EventPayloadFiles.S100PayloadFolder, "SAP500InternalServerError.JSON");
+            var jsonPayloadFilePath = Path.Combine(_projectDir, EventPayloadFiles.PayloadFolder, EventPayloadFiles.S100PayloadFolder, "SAP500InternalServerError.JSON");
 
-            string requestBody = await File.ReadAllTextAsync(jsonPayloadFilePath);
+            var requestBody = await File.ReadAllTextAsync(jsonPayloadFilePath);
             requestBody = JsonModifier.UpdateTime(requestBody);
 
-            RestResponse response = await _webhookEndpoint.PostWebhookResponseAsync(requestBody, await _authTokenProvider.GetAzureADTokenAsync(false));
+            var response = await _webhookEndpoint.PostWebhookResponseAsync(requestBody, await _authTokenProvider.GetAzureADTokenAsync(false));
 
             response.StatusCode.Should().Be(System.Net.HttpStatusCode.InternalServerError);
         }
+
+        [Test]
+        public async Task Verify400BadRequestReceivedForInvalidS100DataContentPublishedEvent()
+        {
+            var jsonPayloadFilePath = Path.Combine(_projectDir, EventPayloadFiles.PayloadFolder, EventPayloadFiles.S100PayloadFolder, "NewCellV1.JSON");
+            
+            var requestBody = await File.ReadAllTextAsync(jsonPayloadFilePath);
+            requestBody = JsonModifier.UpdateTime(requestBody);
+            (requestBody, _) = JsonModifier.UpdateCorrelationId(requestBody);
+
+            var response = await _webhookEndpoint.PostWebhookResponseAsync(requestBody, await _authTokenProvider.GetAzureADTokenAsync(false));
+
+            response.StatusCode.Should().Be(System.Net.HttpStatusCode.BadRequest);
+
+            Assert.That(response.Content!.Contains("Unknown event type received in payload."));
+        }
+
     }
 }
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 8f076879f..b965bada8 100644
--- a/tests/UKHO.ERPFacade.API.FunctionalTests/UKHO.ERPFacade.API.FunctionalTests.csproj
+++ b/tests/UKHO.ERPFacade.API.FunctionalTests/UKHO.ERPFacade.API.FunctionalTests.csproj
@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+﻿<Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
     <TargetFramework>net8.0</TargetFramework>
@@ -50,6 +50,9 @@
     <None Update="appsettings.json">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Update="ERPFacadeExpectedXmlFiles\S100ExpectedXmlFiles\NewCellWithUnitOfSaleTypeIsFolio.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="ERPFacadeExpectedXmlFiles\S57ExpectedXmlFiles\2NewCells.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
@@ -164,6 +167,12 @@
     <None Update="ERPFacadeExpectedXmlFiles\S57ExpectedXmlFiles\WithdrawCell.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Update="ERPFacadePayloadTestData\S100PayloadTestData\NewCellWithUnitOfSaleTypeIsFolio.JSON">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="ERPFacadePayloadTestData\S100PayloadTestData\NewCellV1.JSON">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="ERPFacadePayloadTestData\S100PayloadTestData\SAP500InternalServerError.JSON">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
@@ -376,7 +385,7 @@
     </None>
     <None Update="ERPFacadePayloadTestData\S57PayloadTestData\WithdrawCell.JSON">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>    
+    </None>
   </ItemGroup>
 
 	<ItemGroup>
diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/CancellationAndReplacement.json b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/CancellationAndReplacement.json
index 5600988e7..3f0e83323 100644
--- a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/CancellationAndReplacement.json
+++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/CancellationAndReplacement.json
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/ChangeProduct.json b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/ChangeProduct.json
index 1aad3fb46..d51288e26 100644
--- a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/ChangeProduct.json
+++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/ChangeProduct.json
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProduct.json b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProduct.json
index 5c3dcd6a7..1a461acf5 100644
--- a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProduct.json
+++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProduct.json
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithNoUnitOfSaleStatusandAddProducts.json b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithNoUnitOfSaleStatusandAddProducts.json
index 6d32c6fda..c6f0f30e8 100644
--- a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithNoUnitOfSaleStatusandAddProducts.json
+++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithNoUnitOfSaleStatusandAddProducts.json
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithUnitOfSaleTypeAsFolio.json b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithUnitOfSaleTypeAsFolio.json
new file mode 100644
index 000000000..5af2aeff2
--- /dev/null
+++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithUnitOfSaleTypeAsFolio.json
@@ -0,0 +1,93 @@
+{
+    "specversion": "1.0",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
+    "source": "https://encpublishing.ukho.gov.uk",
+    "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
+    "time": "2024-08-13T12:08:03.4880776Z",
+    "subject": "101GB7645JTHG83",
+    "datacontenttype": "application/json",
+    "data": {
+        "correlationId": "165ce4a4-1d62-4f56-b359-59e178d77106",
+        "products": [
+            {
+                "productIdentifier": "s101",
+                "productName": "101GB007645JTHG95",
+                "editionNumber": 1,
+                "updateNumber": 0,
+                "mayAffectHoldings": true,
+                "providerCode": "1B",
+                "providerName": "ICE",
+                "contentChange": true,
+                "size": "small",
+                "producingAgency": "GB03",
+                "status": {
+                    "statusName": "newDataset",
+                    "statusDate": "2024-07-16T19:20:30.45+01:00",
+                    "isNewCell": true
+                },
+                "replaces": [],
+                "dataReplacement": [],
+                "boundingBox": {
+                    "northLimit": 63.25,
+                    "southLimit": 63.75,
+                    "eastLimit": 8.03,
+                    "westLimit": 7.75
+                },
+                "fileSize": 3456,
+                "inUnitsOfSale": [
+                    "101GB007645JTHG95",
+                    "s100WorldFolio"
+                ],
+                "producerUnitName": "101GB007645JTHG95"
+            }
+        ],
+        "unitsOfSale": [
+            {
+                "unitName": "101GB007645JTHG95",
+                "productIdentifier": "s101",
+                "title": "A test S-101 cell from GB authority in its own unit of sale",
+                "unitOfSaleType": "unit",
+                "providerCode": "1",
+                "providerName": "ICE",
+                "producingAgency": "GB00",
+                "unitSize": "large",
+                "status": "ForSale",
+                "isNewUnitOfSale": true,
+                "boundingBox": {
+                    "northLimit": 63.25,
+                    "southLimit": 63.21,
+                    "eastLimit": 8.70,
+                    "westLimit": 7.75
+                },
+                "compositionChanges": {
+                    "addProducts": [
+                        "101GB007645JTHG95"
+                    ],
+                    "removeProducts": []
+                }
+            },
+            {
+                "unitName": "s100WorldFolio",
+                "productIdentifier": "s101",
+                "title": "Whole World Wide Folio",
+                "unitOfSaleType": "folio",
+                "providerCode": "0",
+                "providerName": "UKHO",
+                "producingAgency": "UKHO",
+                "unitSize": "large",
+                "status": "ForSale",
+                "isNewUnitOfSale": true,
+                "boundingBox": {
+                    "northLimit": 90.12,
+                    "southLimit": -90.41,
+                    "eastLimit": 180.06,
+                    "westLimit": -180.60
+                },
+                "compositionChanges": {
+                    "addProducts": [],
+                    "removeProducts": []
+                }
+            }
+        ]
+    }
+}
diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithoutProducingAgencyAttributes.json b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithoutProducingAgencyAttributes.json
index c6e2ec2a3..c519cfb0e 100644
--- a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithoutProducingAgencyAttributes.json
+++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/NewProductWithoutProducingAgencyAttributes.json
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
diff --git a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/ReplaceProductWithNoUnitOfSaleRemoveProducts.json b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/ReplaceProductWithNoUnitOfSaleRemoveProducts.json
index 99101a8f5..6f5b41234 100644
--- a/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/ReplaceProductWithNoUnitOfSaleRemoveProducts.json
+++ b/tests/UKHO.ERPFacade.API.UnitTests/ERPTestData/S100TestData/ReplaceProductWithNoUnitOfSaleRemoveProducts.json
@@ -1,6 +1,6 @@
 {
     "specversion": "1.0",
-    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1",
+    "type": "uk.gov.ukho.encpublishing.s100datacontentpublished.v1.1",
     "source": "https://encpublishing.ukho.gov.uk",
     "id": "5f03a25f-28b3-46ea-b009-5943250a9a41",
     "time": "2024-08-13T12:08:03.4880776Z",
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 cb5bb9978..f113c547d 100644
--- a/tests/UKHO.ERPFacade.API.UnitTests/UKHO.ERPFacade.API.UnitTests.csproj
+++ b/tests/UKHO.ERPFacade.API.UnitTests/UKHO.ERPFacade.API.UnitTests.csproj
@@ -93,6 +93,9 @@
     <None Update="ERPTestData\S100TestData\NewProduct.json">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Update="ERPTestData\S100TestData\NewProductWithUnitOfSaleTypeAsFolio.json">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
 
 </Project>
diff --git a/tests/UKHO.ERPFacade.API.UnitTests/XmlTransformers/S100DataContentPublishedEventXmlTransformerTests.cs b/tests/UKHO.ERPFacade.API.UnitTests/XmlTransformers/S100DataContentPublishedEventXmlTransformerTests.cs
index 7e8efb010..f1d808623 100644
--- a/tests/UKHO.ERPFacade.API.UnitTests/XmlTransformers/S100DataContentPublishedEventXmlTransformerTests.cs
+++ b/tests/UKHO.ERPFacade.API.UnitTests/XmlTransformers/S100DataContentPublishedEventXmlTransformerTests.cs
@@ -120,6 +120,49 @@ public void WhenBuildXmlPayloadIsCalledForNewProductScenario_ThenReturnXMLDocume
                                                 && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP xml payload for S-100 data content published event completed.").MustHaveHappenedOnceExactly();
         }
 
+        [Test]
+        public void WhenBuildXmlPayloadIsCalledForNewProductWithUnitOfSaleTypeAsFolio_ThenReturnXMLDocumentWithoutFolio()
+        {
+            var newProductEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\S100TestData\\NewProductWithUnitOfSaleTypeAsFolio.JSON");
+            var baseCloudEvent = JsonConvert.DeserializeObject<BaseCloudEvent>(newProductEventPayloadJson);
+            var s100EventData = JsonConvert.DeserializeObject<S100EventData>(baseCloudEvent.Data.ToString()!);
+
+            XmlDocument soapXml = new();
+            soapXml.LoadXml(_sapXmlTemplate);
+            A.CallTo(() => _fakeXmlOperations.CreateXmlDocument(A<string>.Ignored)).Returns(soapXml);
+            var result = _fakeS100DataContentPublishedEventXmlTransformer.BuildXmlPayload(s100EventData, _sapXmlTemplate);
+
+            result.Should().BeOfType<XmlDocument>();
+
+            XElement xElement = XElement.Parse(result.OuterXml);
+            var itemList = xElement.Descendants("item").ToList();
+            var s100WorldFolio = itemList.FirstOrDefault(item => item.Descendants("PRODUCTNAME").FirstOrDefault()?.Value == "s100WorldFolio");
+            Assert.That(itemList.Count, Is.EqualTo(3));
+            Assert.That(s100WorldFolio == null, Is.True);
+
+            A.CallTo(() => _fakeXmlOperations.AppendChildNode(A<XmlElement>.Ignored, A<XmlDocument>.Ignored, A<string>.Ignored, A<string>.Ignored)).MustHaveHappened(9, Times.Exactly);
+
+            A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log"
+                                                && call.GetArgument<LogLevel>(0) == LogLevel.Information
+                                                && call.GetArgument<EventId>(1) == EventIds.S100EventSapXmlPayloadGenerationStarted.ToEventId()
+                                                && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP xml payload for S-100 data content published event started.").MustHaveHappenedOnceExactly();
+
+            A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log"
+                                                && call.GetArgument<LogLevel>(0) == LogLevel.Information
+                                                && call.GetArgument<EventId>(1) == EventIds.S100SapActionGenerationStarted.ToEventId()
+                                                && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of {ActionName} action started.").MustHaveHappened(3, Times.Exactly);
+
+            A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log"
+                                                && call.GetArgument<LogLevel>(0) == LogLevel.Information
+                                                && call.GetArgument<EventId>(1) == EventIds.S100SapActionGenerationCompleted.ToEventId()
+                                                && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of {ActionName} action completed.").MustHaveHappened(3, Times.Exactly);
+
+            A.CallTo(_fakeLogger).Where(call => call.Method.Name == "Log"
+                                                && call.GetArgument<LogLevel>(0) == LogLevel.Information
+                                                && call.GetArgument<EventId>(1) == EventIds.S100EventSapXmlPayloadGenerationCompleted.ToEventId()
+                                                && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP xml payload for S-100 data content published event completed.").MustHaveHappenedOnceExactly();
+        }
+
         [Test]
         public void WhenBuildXmlPayloadIfRequiredAttributesNotProvided_ThenThrowERPFacadeException()
         {


Reviews:
user: login: rushdynajath
body: Looks good
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T13:42:31Z
user: login: Avinash15515
body: Is there any Automation Test for scenario where "Create Unit Of Sale" action is not created in SAP xml if unitOfSaleType is not “unit”?
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-12T05:34:16Z
user: login: sachinshengale1980
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T10:58:12Z
user: login: Sums13943
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-12T11:02:33Z
user: login: Avinash15515
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-12T11:13:18Z
user: login: nandani15619
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-12T11:24:12Z
user: login: mohamme15315
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T11:57:19Z
user: login: Sums13943
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-03-12T13:47:13Z
user: login: Avinash15515
body: Looks good to me

state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-03-13T08:36:07Z

Review comments:
diff_hunk: @@ -120,6 +120,50 @@ public void WhenBuildXmlPayloadIsCalledForNewProductScenario_ThenReturnXMLDocume
                                                 && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP xml payload for S-100 data content published event completed.").MustHaveHappenedOnceExactly();
         }
 
+        [Test]
+        public void WhenBuildXmlPayloadIsCalledForNewProductWithUnitOfSaleTypeAsFolio_ThenReturnXMLDocumentWithoutFolio()
+        {
+            var newProductEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\S100TestData\\NewProductWithUnitOfSaleTypeAsFolio.JSON");
+            var baseCloudEvent = JsonConvert.DeserializeObject<BaseCloudEvent>(newProductEventPayloadJson);
+            var s100EventData = JsonConvert.DeserializeObject<S100EventData>(baseCloudEvent.Data.ToString()!);
+
+            XmlDocument soapXml = new();
+            soapXml.LoadXml(_sapXmlTemplate);
+            A.CallTo(() => _fakeXmlOperations.CreateXmlDocument(A<string>.Ignored)).Returns(soapXml);
+            var result = _fakeS100DataContentPublishedEventXmlTransformer.BuildXmlPayload(s100EventData, _sapXmlTemplate);
+
+            result.Should().BeOfType<XmlDocument>();
+
+            XElement xElement = XElement.Parse(result.OuterXml);
+            var itemList = xElement.Descendants("item").ToList();
+            var s100WorldFolio = itemList.FirstOrDefault(item => item.Descendants("PRODUCTNAME").FirstOrDefault()?.Value == "s100WorldFolio");
+            Assert.That(itemList.Count > 0, Is.True);
path: tests/UKHO.ERPFacade.API.UnitTests/XmlTransformers/S100DataContentPublishedEventXmlTransformerTests.cs
user: login: Sums13943
body: Since the payload is statically generated by us, we can be certain about the exact count. I suggest setting it to 3.
created_at: 2025-03-12T11:02:33Z
author_association: COLLABORATOR
diff_hunk: @@ -42,41 +41,42 @@ public void Setup()
         [TestCase("SupplierDefinedUnitChangeV2.JSON", TestName = "WhenICallTheWebhookWithSupplierDefinedUnitChangeV2Scenario_ThenWebhookReturns200Response")]
         [TestCase("Suspend.JSON", TestName = "WhenICallTheWebhookWithSuspendScenario_ThenWebhookReturns200Response")]
         [TestCase("Withdrawn.JSON", TestName = "WhenICallTheWebhookWithWithdrawnScenario_ThenWebhookReturns200Response")]
+        [TestCase("NewCellWithUnitOfSaleTypeIsFolio.JSON", TestName = "VerifyCreateUnitOfSaleActionNotGeneratedWhenUnitOfSaleTypeIsFolio")]
path: tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/S100WebhookScenario.cs
user: login: Avinash15515
body: ```suggestion
        [TestCase("NewCellWithUnitOfSaleTypeIsFolio.JSON", TestName = "VerifyCreateUnitOfSaleActionNotGeneratedWhenUnitOfSaleTypeIsNotUnit")]
```
created_at: 2025-03-12T11:12:44Z
author_association: COLLABORATOR
diff_hunk: @@ -42,41 +41,42 @@ public void Setup()
         [TestCase("SupplierDefinedUnitChangeV2.JSON", TestName = "WhenICallTheWebhookWithSupplierDefinedUnitChangeV2Scenario_ThenWebhookReturns200Response")]
         [TestCase("Suspend.JSON", TestName = "WhenICallTheWebhookWithSuspendScenario_ThenWebhookReturns200Response")]
         [TestCase("Withdrawn.JSON", TestName = "WhenICallTheWebhookWithWithdrawnScenario_ThenWebhookReturns200Response")]
+        [TestCase("NewCellWithUnitOfSaleTypeIsFolio.JSON", TestName = "VerifyCreateUnitOfSaleActionNotGeneratedWhenUnitOfSaleTypeIsFolio")]
path: tests/UKHO.ERPFacade.API.FunctionalTests/FunctionalTests/S100WebhookScenario.cs
user: login: nandani15619
body: Renamed Test name
created_at: 2025-03-12T11:24:12Z
author_association: NONE
diff_hunk: @@ -120,6 +120,50 @@ public void WhenBuildXmlPayloadIsCalledForNewProductScenario_ThenReturnXMLDocume
                                                 && call.GetArgument<IEnumerable<KeyValuePair<string, object>>>(2)!.ToDictionary(c => c.Key, c => c.Value)["{OriginalFormat}"].ToString() == "Generation of SAP xml payload for S-100 data content published event completed.").MustHaveHappenedOnceExactly();
         }
 
+        [Test]
+        public void WhenBuildXmlPayloadIsCalledForNewProductWithUnitOfSaleTypeAsFolio_ThenReturnXMLDocumentWithoutFolio()
+        {
+            var newProductEventPayloadJson = TestHelper.ReadFileData("ERPTestData\\S100TestData\\NewProductWithUnitOfSaleTypeAsFolio.JSON");
+            var baseCloudEvent = JsonConvert.DeserializeObject<BaseCloudEvent>(newProductEventPayloadJson);
+            var s100EventData = JsonConvert.DeserializeObject<S100EventData>(baseCloudEvent.Data.ToString()!);
+
+            XmlDocument soapXml = new();
+            soapXml.LoadXml(_sapXmlTemplate);
+            A.CallTo(() => _fakeXmlOperations.CreateXmlDocument(A<string>.Ignored)).Returns(soapXml);
+            var result = _fakeS100DataContentPublishedEventXmlTransformer.BuildXmlPayload(s100EventData, _sapXmlTemplate);
+
+            result.Should().BeOfType<XmlDocument>();
+
+            XElement xElement = XElement.Parse(result.OuterXml);
+            var itemList = xElement.Descendants("item").ToList();
+            var s100WorldFolio = itemList.FirstOrDefault(item => item.Descendants("PRODUCTNAME").FirstOrDefault()?.Value == "s100WorldFolio");
+            Assert.That(itemList.Count > 0, Is.True);
path: tests/UKHO.ERPFacade.API.UnitTests/XmlTransformers/S100DataContentPublishedEventXmlTransformerTests.cs
user: login: mohamme15315
body: updated assert as per suggested
created_at: 2025-03-12T11:57:19Z
author_association: CONTRIBUTOR

PR comments:
user: login: snyk-io[bot]
created_at: 2025-03-10T11:24:56Z
body: ![](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)

### :tada: **Snyk checks have passed. No issues have been found so far.**

:white_check_mark: **security/snyk** check is complete. No issues have been found. [(View Details)](https://app.snyk.io/org/abzu/pr-checks/5e1812aa-45ad-4917-b189-4fec6965051b?refs=c539ac199bcbb03db616925e3c15b46b309da334&source=prChecksComment)

:white_check_mark: **license/snyk** check is complete. No issues have been found. [(View Details)](https://app.snyk.io/org/abzu/pr-checks/5e1812aa-45ad-4917-b189-4fec6965051b/license?refs=c539ac199bcbb03db616925e3c15b46b309da334&source=prChecksComment)

:white_check_mark: **code/snyk** check is complete. No issues have been found. [(View Details)](https://app.snyk.io/org/abzu/project/f03b51c5-d79b-4505-ae12-f543b204ad22/pr-check/e6aa6db4-3dee-4087-a242-fed75b74292f?refs=c539ac199bcbb03db616925e3c15b46b309da334&source=prChecksComment)


author_association: NONE
user: login: nandani15619
created_at: 2025-03-13T06:40:39Z
body: > Is there any Automation Test for scenario where "Create Unit Of Sale" action is not created in SAP xml if unitOfSaleType is not “unit”?

I have added the Automation Test for scenario where "Create Unit Of Sale" action is not created in SAP xml if unitOfSaleType is not “unit”.
author_association: NONE