# mulaimu00/sha-claims-service architecture

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

- Interactive diagram: https://gitdiagram.com/mulaimu00/sha-claims-service
- Repository: https://github.com/mulaimu00/sha-claims-service

## Overview

SHA Claims Service is a small HTTP service for creating, retrieving, and advancing healthcare claims. An HTTP client submits a claim or requests an adjudication transition; handlers delegate to the in-memory store, which deduplicates submissions and enforces version checks. The state machine governs legal lifecycle moves and appends audit history. The README describes validation and payment as modeled lifecycle stages, not integrations with external claims infrastructure. The graph reflects the sampled runtime code; it does not imply live validation or payment processing.

Main entry points: [`internal/claims/store.go`](https://github.com/mulaimu00/sha-claims-service/blob/main/internal/claims/store.go) (In-memory claim store), [`internal/api/handlers.go`](https://github.com/mulaimu00/sha-claims-service/blob/main/internal/api/handlers.go) (Claim handlers), [`cmd/server/main.go`](https://github.com/mulaimu00/sha-claims-service/blob/main/cmd/server/main.go) (Server entrypoint), [`internal/claims/transitions.go`](https://github.com/mulaimu00/sha-claims-service/blob/main/internal/claims/transitions.go) (Transition rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP service"]
  node_server["Server entrypoint<br/>[main.go]"]
  node_api["Claim handlers<br/>[handlers.go]"]
end

subgraph group_domain["Claim lifecycle"]
  node_claim["Claim model<br/>[claim.go]"]
  node_transitions["Transition rules<br/>[transitions.go]"]
end

subgraph group_storage["Claim storage"]
  node_store[("In-memory claim store<br/>[store.go]")]
end

node_client(("HTTP client"))

node_server -->|"creates"| node_store
node_server -->|"wires handler"| node_api
node_server -->|"serves HTTP"| node_client
node_client -->|"sends requests"| node_api
node_api -->|"submits claim"| node_store
node_api -->|"retrieves claim"| node_store
node_api -->|"requests transition"| node_store
node_store -->|"creates claim"| node_claim
node_store -->|"applies transition"| node_transitions
node_transitions -->|"updates state, history"| node_claim

click node_server "https://github.com/mulaimu00/sha-claims-service/blob/main/cmd/server/main.go"
click node_api "https://github.com/mulaimu00/sha-claims-service/blob/main/internal/api/handlers.go"
click node_claim "https://github.com/mulaimu00/sha-claims-service/blob/main/internal/claims/claim.go"
click node_transitions "https://github.com/mulaimu00/sha-claims-service/blob/main/internal/claims/transitions.go"
click node_store "https://github.com/mulaimu00/sha-claims-service/blob/main/internal/claims/store.go"

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_server,node_api,node_client toneBlue
class node_claim,node_transitions toneAmber
class node_store toneMint
```

## Components

### HTTP service

- [Server entrypoint](https://github.com/mulaimu00/sha-claims-service/blob/main/cmd/server/main.go): `cmd/server/main.go`
- [Claim handlers](https://github.com/mulaimu00/sha-claims-service/blob/main/internal/api/handlers.go): `internal/api/handlers.go`

### Claim lifecycle

- [Claim model](https://github.com/mulaimu00/sha-claims-service/blob/main/internal/claims/claim.go): `internal/claims/claim.go`
- [Transition rules](https://github.com/mulaimu00/sha-claims-service/blob/main/internal/claims/transitions.go): `internal/claims/transitions.go`

### Claim storage

- [In-memory claim store](https://github.com/mulaimu00/sha-claims-service/blob/main/internal/claims/store.go): `internal/claims/store.go`

### Other components

- **HTTP client**

## Connections

- Server entrypoint → In-memory claim store: creates (evidence: `cmd/server/main.go`)
- Server entrypoint → Claim handlers: wires handler (evidence: `cmd/server/main.go`)
- Server entrypoint → HTTP client: serves HTTP (evidence: `cmd/server/main.go`)
- HTTP client → Claim handlers: sends requests (evidence: `README.md`)
- Claim handlers → In-memory claim store: submits claim (evidence: `internal/api/handlers.go`)
- Claim handlers → In-memory claim store: retrieves claim (evidence: `internal/api/handlers.go`)
- Claim handlers → In-memory claim store: requests transition (evidence: `internal/api/handlers.go`)
- In-memory claim store → Claim model: creates claim (evidence: `internal/claims/store.go`)
- In-memory claim store → Transition rules: applies transition (evidence: `internal/claims/store.go`)
- Transition rules → Claim model: updates state, history (evidence: `internal/claims/transitions.go`)
