# xavion-git/benefitsstreamliner architecture

> Architecture diagram of the GitHub repository xavion-git/benefitsstreamliner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xavion-git/benefitsstreamliner
- Repository: https://github.com/xavion-git/benefitsstreamliner

## Overview

Benefits Streamliner is a prototype benefits-application workflow: an applicant submits an application, the API persists it, checks it against mocked iBenefits data, stores and hands off a recommendation for Finance review, then transfers approved applications to mocked Business Central. The graph preserves the documented retry and status paths. Source excerpts show the main API orchestration and persistence calls; several UI, controller, and retry-worker links rely on README documentation because those implementations were not excerpted.

Main entry points: [`BenefitsStreamliner.Api/Services/BenefitsCheckService.cs`](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/BenefitsCheckService.cs) (Benefits check), [`BenefitsStreamliner.Api/Data/AppDbContext.cs`](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Data/AppDbContext.cs) (Application database), [`BenefitsStreamliner.Web/Services/ApplicationApiClient.cs`](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Web/Services/ApplicationApiClient.cs) (API client), [`BenefitsStreamliner.Api/Controllers/ApplicationsController.cs`](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Controllers/ApplicationsController.cs) (Applications API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_application_page["Application page<br/>[Apply.razor]"]
  node_api_client["API client"]
end

subgraph group_api["API orchestration"]
  node_applications_controller["Applications API"]
  node_decision_controller["Decision API"]
  node_application_service["Application submission"]
  node_benefits_check["Benefits check"]
  node_decision_service["Decision processing<br/>[DecisionService.cs]"]
  node_retry_queue["Retry queue<br/>[RetryQueue.cs]"]
  node_retry_worker["Retry worker<br/>[RetryQueue.cs]"]
end

subgraph group_domain["Domain logic"]
  node_application_model["Application model<br/>[Application.cs]"]
  node_recommendation_model["Recommendation model<br/>[Recommendation.cs]"]
  node_recommendation_logic["Recommendation logic"]
  node_decision_request["Decision request<br/>[DecisionRequest.cs]"]
end

subgraph group_integrations["Integrations and state"]
  node_database[("Application database<br/>[AppDbContext.cs]")]
  node_benefits_interface["Benefits service contract<br/>[Interfaces.cs]"]
  node_mock_benefits["Mock iBenefits"]
  node_finance_interface["Finance service contract<br/>[Interfaces.cs]"]
  node_mock_finance["Mock Finance"]
  node_business_central_interface["Business Central contract"]
  node_mock_business_central["Mock Business Central"]
end

node_applicant(("Applicant"))
node_finance_reviewer(("Finance reviewer"))

node_applicant -->|"submits application"| node_application_page
node_finance_reviewer -->|"reviews recommendation"| node_application_page
node_application_page -.->|"uses client"| node_api_client
node_api_client -->|"posts and queries"| node_applications_controller
node_api_client -->|"posts decision"| node_decision_controller
node_applications_controller -->|"submits application"| node_application_service
node_applications_controller -->|"checks benefits"| node_benefits_check
node_decision_controller -->|"applies decision"| node_decision_service
node_decision_controller -->|"accepts request"| node_decision_request
node_application_service -->|"writes application"| node_database
node_benefits_check -->|"reads and writes"| node_database
node_benefits_check -->|"requests benefit data"| node_benefits_interface
node_mock_benefits -->|"implements contract"| node_benefits_interface
node_benefits_check -->|"evaluates eligibility"| node_recommendation_logic
node_benefits_check -->|"creates recommendation"| node_recommendation_model
node_benefits_check -->|"sends recommendation"| node_finance_interface
node_mock_finance -->|"implements contract"| node_finance_interface
node_benefits_check -->|"queues retry"| node_retry_queue
node_retry_worker -->|"drains queue"| node_retry_queue
node_retry_worker -->|"retries check"| node_benefits_check
node_decision_service -->|"reads and updates"| node_database
node_decision_service -->|"transfers approval"| node_business_central_interface
node_mock_business_central -->|"implements contract"| node_business_central_interface
node_database -->|"maps entity"| node_application_model
node_database -->|"maps entity"| node_recommendation_model

click node_application_page "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Web/Components/Pages/Apply.razor"
click node_api_client "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Web/Services/ApplicationApiClient.cs"
click node_applications_controller "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Controllers/ApplicationsController.cs"
click node_decision_controller "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Controllers/DecisionController.cs"
click node_application_service "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/ApplicationService.cs"
click node_benefits_check "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/BenefitsCheckService.cs"
click node_decision_service "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/DecisionService.cs"
click node_retry_queue "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/RetryQueue.cs"
click node_retry_worker "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/RetryQueue.cs"
click node_database "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Data/AppDbContext.cs"
click node_benefits_interface "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Interfaces/Interfaces.cs"
click node_mock_benefits "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/MockBenefitsService.cs"
click node_finance_interface "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Interfaces/Interfaces.cs"
click node_mock_finance "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/MockFinanceService.cs"
click node_business_central_interface "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Interfaces/IBusinessCentralService.cs"
click node_mock_business_central "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/MockBusinessCentralService.cs"
click node_application_model "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Models/Application.cs"
click node_recommendation_model "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Models/Recommendation.cs"
click node_recommendation_logic "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/RecommendationLogic.cs"
click node_decision_request "https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/DTOs/DecisionRequest.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_application_page,node_api_client,node_finance_reviewer toneBlue
class node_applications_controller,node_decision_controller,node_application_service,node_benefits_check,node_decision_service,node_retry_queue,node_retry_worker toneAmber
class node_application_model,node_recommendation_model,node_recommendation_logic,node_decision_request toneMint
class node_database,node_benefits_interface,node_mock_benefits,node_finance_interface,node_mock_finance,node_business_central_interface,node_mock_business_central toneRose
class node_applicant toneIndigo
```

## Components

### Web experience

- [Application page](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Web/Components/Pages/Apply.razor): `BenefitsStreamliner.Web/Components/Pages/Apply.razor`
- [API client](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Web/Services/ApplicationApiClient.cs): `BenefitsStreamliner.Web/Services/ApplicationApiClient.cs`

### API orchestration

- [Applications API](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Controllers/ApplicationsController.cs): `BenefitsStreamliner.Api/Controllers/ApplicationsController.cs`
- [Decision API](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Controllers/DecisionController.cs): `BenefitsStreamliner.Api/Controllers/DecisionController.cs`
- [Application submission](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/ApplicationService.cs): `BenefitsStreamliner.Api/Services/ApplicationService.cs`
- [Benefits check](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/BenefitsCheckService.cs): `BenefitsStreamliner.Api/Services/BenefitsCheckService.cs`
- [Decision processing](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/DecisionService.cs): `BenefitsStreamliner.Api/Services/DecisionService.cs`
- [Retry queue](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/RetryQueue.cs): `BenefitsStreamliner.Api/Services/RetryQueue.cs`
- [Retry worker](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/RetryQueue.cs): `BenefitsStreamliner.Api/Services/RetryQueue.cs`

### Domain logic

- [Application model](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Models/Application.cs): `BenefitsStreamliner.Core/Models/Application.cs`
- [Recommendation model](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Models/Recommendation.cs): `BenefitsStreamliner.Core/Models/Recommendation.cs`
- [Recommendation logic](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/RecommendationLogic.cs): `BenefitsStreamliner.Core/RecommendationLogic.cs`
- [Decision request](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/DTOs/DecisionRequest.cs): `BenefitsStreamliner.Core/DTOs/DecisionRequest.cs`

### Integrations and state

- [Application database](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Data/AppDbContext.cs): `BenefitsStreamliner.Api/Data/AppDbContext.cs`
- [Benefits service contract](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Interfaces/Interfaces.cs): `BenefitsStreamliner.Core/Interfaces/Interfaces.cs`
- [Mock iBenefits](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/MockBenefitsService.cs): `BenefitsStreamliner.Api/Services/MockBenefitsService.cs`
- [Finance service contract](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Interfaces/Interfaces.cs): `BenefitsStreamliner.Core/Interfaces/Interfaces.cs`
- [Mock Finance](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/MockFinanceService.cs): `BenefitsStreamliner.Api/Services/MockFinanceService.cs`
- [Business Central contract](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Core/Interfaces/IBusinessCentralService.cs): `BenefitsStreamliner.Core/Interfaces/IBusinessCentralService.cs`
- [Mock Business Central](https://github.com/xavion-git/benefitsstreamliner/blob/main/BenefitsStreamliner.Api/Services/MockBusinessCentralService.cs): `BenefitsStreamliner.Api/Services/MockBusinessCentralService.cs`

### Other components

- **Applicant**
- **Finance reviewer**

## Connections

- Applicant → Application page: submits application (evidence: `README.md`)
- Finance reviewer → Application page: reviews recommendation (evidence: `README.md`)
- Application page → API client: uses client
- API client → Applications API: posts and queries (evidence: `BenefitsStreamliner.Web/Services/ApplicationApiClient.cs`)
- API client → Decision API: posts decision (evidence: `BenefitsStreamliner.Web/Services/ApplicationApiClient.cs`)
- Applications API → Application submission: submits application (evidence: `BenefitsStreamliner.Api/Controllers/ApplicationsController.cs`)
- Applications API → Benefits check: checks benefits (evidence: `BenefitsStreamliner.Api/Controllers/ApplicationsController.cs`)
- Decision API → Decision processing: applies decision (evidence: `BenefitsStreamliner.Api/Controllers/DecisionController.cs`)
- Decision API → Decision request: accepts request (evidence: `BenefitsStreamliner.Api/Controllers/DecisionController.cs`)
- Application submission → Application database: writes application (evidence: `BenefitsStreamliner.Api/Services/ApplicationService.cs`)
- Benefits check → Application database: reads and writes (evidence: `BenefitsStreamliner.Api/Services/BenefitsCheckService.cs`)
- Benefits check → Benefits service contract: requests benefit data (evidence: `BenefitsStreamliner.Api/Services/BenefitsCheckService.cs`)
- Mock iBenefits → Benefits service contract: implements contract (evidence: `BenefitsStreamliner.Api/Services/MockBenefitsService.cs`)
- Benefits check → Recommendation logic: evaluates eligibility (evidence: `BenefitsStreamliner.Api/Services/BenefitsCheckService.cs`)
- Benefits check → Recommendation model: creates recommendation (evidence: `BenefitsStreamliner.Api/Services/BenefitsCheckService.cs`)
- Benefits check → Finance service contract: sends recommendation (evidence: `BenefitsStreamliner.Api/Services/BenefitsCheckService.cs`)
- Mock Finance → Finance service contract: implements contract (evidence: `BenefitsStreamliner.Api/Services/MockFinanceService.cs`)
- Benefits check → Retry queue: queues retry (evidence: `BenefitsStreamliner.Api/Services/BenefitsCheckService.cs`)
- Retry worker → Retry queue: drains queue (evidence: `README.md`)
- Retry worker → Benefits check: retries check (evidence: `README.md`)
- Decision processing → Application database: reads and updates (evidence: `BenefitsStreamliner.Api/Services/DecisionService.cs`)
- Decision processing → Business Central contract: transfers approval (evidence: `BenefitsStreamliner.Api/Services/DecisionService.cs`)
- Mock Business Central → Business Central contract: implements contract (evidence: `BenefitsStreamliner.Api/Services/MockBusinessCentralService.cs`)
- Application database → Application model: maps entity (evidence: `BenefitsStreamliner.Api/Data/AppDbContext.cs`)
- Application database → Recommendation model: maps entity (evidence: `BenefitsStreamliner.Api/Data/AppDbContext.cs`)
