# skillsfundingagency/dss-gdprupdatecustomerinformation architecture

> Architecture diagram of the GitHub repository skillsfundingagency/dss-gdprupdatecustomerinformation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skillsfundingagency/dss-gdprupdatecustomerinformation
- Repository: https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation

## Overview

This Azure Functions app identifies customers requiring GDPR deletion, queues customer IDs, then processes each message by purging related Cosmos DB data and SQL records before completing or dead-lettering the message. Separate message handling also deletes adviser-detail and collection records. The sampled sources show the timer-to-SQL-to-queue path and the deletion phases; the queue-trigger binding and some function details are not shown, so those links are marked unverified. The README describes the anonymisation and redaction purpose but gives no further workflow detail.

Main entry points: [`NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs`](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs) (Process deletion message), [`NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs`](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs) (Find deletion candidates), [`NCS.DSS.GDPRUpdateCustomerInformation/Services/SqlDbService.cs`](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Services/SqlDbService.cs) (SQL data service), [`NCS.DSS.GDPRUpdateCustomerInformation/Services/ServiceBusService.cs`](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Services/ServiceBusService.cs) (Queue service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Scheduling and orchestration"]
  node_retrieve["Find deletion candidates"]
  node_delete["Process deletion message<br/>[DeleteDssData.cs]"]
  node_bulkdelete["Cosmos bulk delete"]
end

subgraph group_messages["Queue messages"]
  node_customer_msg["Customer message"]
  node_adviser_msg["Adviser message"]
  node_collection_msg["Collection message"]
end

subgraph group_services["Persistence and messaging services"]
  node_sql_service["SQL data service<br/>[SqlDbService.cs]"]
  node_bus_service["Queue service"]
  node_cosmos_service["Cosmos data service"]
end

subgraph group_stores["External data stores"]
  node_sql_store[("SQL database")]
  node_queue["Service Bus queue"]
  node_cosmos_store[("Cosmos DB")]
end

node_timer(("Timer schedule"))

node_timer -->|"triggers"| node_retrieve
node_retrieve -->|"requests IDs"| node_sql_service
node_sql_service -->|"reads candidates"| node_sql_store
node_retrieve -->|"creates"| node_customer_msg
node_retrieve -->|"sends message"| node_bus_service
node_bus_service -->|"publishes"| node_queue
node_queue -.->|"delivers message"| node_delete
node_delete -->|"purges customer data"| node_cosmos_service
node_cosmos_service -->|"queries and deletes"| node_cosmos_store
node_delete -->|"purges SQL data"| node_sql_service
node_sql_service -->|"deletes records"| node_sql_store
node_delete -->|"handles message"| node_adviser_msg
node_delete -->|"handles message"| node_collection_msg
node_delete -->|"completes or dead-letters"| node_queue

click node_retrieve "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs"
click node_delete "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs"
click node_bulkdelete "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Functions/CosmosBulkDelete.cs"
click node_customer_msg "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteCustomerQueueMessage.cs"
click node_adviser_msg "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteAdviserDetailQueueMessage.cs"
click node_collection_msg "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteCollectionQueueMessage.cs"
click node_sql_service "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Services/SqlDbService.cs"
click node_bus_service "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Services/ServiceBusService.cs"
click node_cosmos_service "https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Services/CosmosDatabaseService.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_retrieve,node_delete,node_bulkdelete toneBlue
class node_customer_msg,node_adviser_msg,node_collection_msg toneAmber
class node_sql_service,node_bus_service,node_cosmos_service toneMint
class node_sql_store,node_queue,node_cosmos_store toneRose
class node_timer toneIndigo
```

## Components

### Scheduling and orchestration

- [Find deletion candidates](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs`
- [Process deletion message](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs`
- [Cosmos bulk delete](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Functions/CosmosBulkDelete.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Functions/CosmosBulkDelete.cs`

### Queue messages

- [Customer message](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteCustomerQueueMessage.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteCustomerQueueMessage.cs`
- [Adviser message](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteAdviserDetailQueueMessage.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteAdviserDetailQueueMessage.cs`
- [Collection message](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteCollectionQueueMessage.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Models/DeleteCollectionQueueMessage.cs`

### Persistence and messaging services

- [SQL data service](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Services/SqlDbService.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Services/SqlDbService.cs`
- [Queue service](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Services/ServiceBusService.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Services/ServiceBusService.cs`
- [Cosmos data service](https://github.com/skillsfundingagency/dss-gdprupdatecustomerinformation/blob/develop/NCS.DSS.GDPRUpdateCustomerInformation/Services/CosmosDatabaseService.cs): `NCS.DSS.GDPRUpdateCustomerInformation/Services/CosmosDatabaseService.cs`

### External data stores

- **SQL database**
- **Service Bus queue**
- **Cosmos DB**

### Other components

- **Timer schedule**

## Connections

- Timer schedule → Find deletion candidates: triggers (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs`)
- Find deletion candidates → SQL data service: requests IDs (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs`)
- SQL data service → SQL database: reads candidates (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Services/SqlDbService.cs`)
- Find deletion candidates → Customer message: creates (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs`)
- Find deletion candidates → Queue service: sends message (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/RetrieveCustomersToBeDeleted.cs`)
- Queue service → Service Bus queue: publishes (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Services/ServiceBusService.cs`)
- Service Bus queue → Process deletion message: delivers message
- Process deletion message → Cosmos data service: purges customer data (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs`)
- Cosmos data service → Cosmos DB: queries and deletes (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Services/CosmosDatabaseService.cs`)
- Process deletion message → SQL data service: purges SQL data (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs`)
- SQL data service → SQL database: deletes records (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Services/SqlDbService.cs`)
- Process deletion message → Adviser message: handles message (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs`)
- Process deletion message → Collection message: handles message (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs`)
- Process deletion message → Service Bus queue: completes or dead-letters (evidence: `NCS.DSS.GDPRUpdateCustomerInformation/Functions/DeleteDssData.cs`)
