How ukho/erp-facade works
Project Type and Purpose
• Type: Cloud‐hosted, event‐driven middleware/Webhook service with batch-oriented JSON→SOAP translation.
• Purpose: Subscribe to ENC Publishing events (CloudEvents) from the Enterprise Event Service (EES), transform relevant data, and call SAP’s inbound SOAP web service. Additional background tasks (aggregation, cleanup) run as Azure WebJobs.
Top-Level Components
• External Systems
– Enterprise Event Service (EES) – emits uk.gov.ukho.encpublishing.enccontentpublished.v2.1 events.
– SAP Inbound SOAP Web Service – on-prem or mock (UKHO.SAP.MockAPIService).
• Azure Infrastructure (provisioned via Terraform under Deployment/Modules)
– App Service (WebApp) hosting the API and WebJobs
– Storage Account (Tables, Queues, Blob)
– Key Vault (secrets: SAP endpoint, AAD, Storage keys)
– Event Hub & Application Insights (logging/telemetry)
• Runtime Components (in src/)
– UKHO.ERPFacade.API – ASP.NET Core Web API
– UKHO.ERPFacade.CleanUp.WebJob – scheduled cleanup of old events/records
– UKHO.ERPFacade.EventAggregation.WebJob – scheduled aggregation of Record-Of-Sale events into SAP batches
– UKHO.SAP.MockAPIService – local/mock SOAP endpoints for testing
– UKHO.ERPFacade.Common – shared code for configuration, HTTP clients, Azure IO, decryption, health checks
• Testing & Support
– Functional and Unit Tests under tests/
– Postman Collections (tests/ERP Facade.postman_collection.json)
– Performance Script (load tests simulating webhooks)
– Deployment pipelines & Terraform templates in Deployment/templates and azure-pipelines.yml
Architectural Patterns & Principles
• Event‐Driven: decoupled ingestion (EES) → processing → outbound SOAP
• Separation of Concerns: Web API vs WebJobs vs Common library
• Dependency Injection: all HTTP clients, storage helpers, message builders registered in Program.cs
• Resilience & Logging: middleware, retries in HttpClients, Application Insights
• IaC: Terraform modules for each Azure resource
Technologies & Frameworks
• .NET 6 (likely) Web API & WebJobs
• Azure Storage (Tables, Queues, Blob) via Azure SDK
• Azure Key Vault for secrets
• Terraform for provisioning (Deployment/Modules/*)
• xUnit/MSTest for Unit/Functional tests
• Postman & custom JS load scripts for performance testing