...
┌─────────────────────────────────────────────────────┐
│ Bright App │
└─────────────────────┬───────────────────────────────┘
│ HTTPS + JWT Bearer
┌─────────────────────▼───────────────────────────────┐
│ EGU Common API │
│ │
│ ┌──────────────────────────────────────────────┐ │
│ │ API Layer (WebApp) │ │
│ │ │ │
│ │ AccountsApi BankIdApi AuthApi EventsApi │ │
│ │ SystemApi WebViewApi │ │
│ └──────────────────┬───────────────────────────┘ │
│ │ │
│ ┌──────────────────▼───────────────────────────┐ │
│ │ Orchestration Layer │ │
│ │ │ │
│ │ AccountApiService BankIdApiService │ │
│ │ AuthenticationApiService EventsApiService │ │
│ └──────────┬─────────────────┬─────────────────┘ │
│ │ │ │
│ ┌──────────▼──────┐ ┌──────▼──────────────────┐ │
│ │ Shared Services │ │ Adapter Factory │ │
│ │ │ │ │ │
│ │ InvoiceArchive │ │ Resolves adapter by │ │
│ │ - EDB │ │ AdapterType from │ │
│ │ - IData │ │ SubscriptionSetting │ │
│ │ - Stralfors │ └──────────┬──────────────┘ │
│ │ - TietoEvry │ │ │
│ │ - Url │ ┌──────────▼──────────────┐ │
│ │ │ │ Adapter Layer │ │
│ │ ZignSec BankID │ │ │ │
│ │ - V5 client │◄─┤ CST Xellent Zynergy │ │
│ │ │ │ Gasell SonWin ProBill │ │
│ └─────────────────┘ └──────────┬──────────────┘ │
│ │ │
└───────────────────────────────────┼─────────────────┘
│
Backend Systems (External APIs) │
┌───────────┬──────────┬────────┴───┬──────────┬──────────────┐
│ │ │ │ │ │
┌─────▼────┐ ┌───▼────┐ ┌──▼──────┐ ┌─▼──────┐ ┌──▼──────┐ ┌──▼──────┐
│ CST API │ │Xellent │ │ Zynergy │ │ Gasell │ │ SonWin │ │ ProBill │
│ │ │ API │ │ API │ │ API │ │ API │ │Bright AP│
└──────────┘ └────────┘ └─────────┘ └────────┘ └────────┘ └─────────┘
...
3. Request Flow
1. Client sends request to:
POST /subscriptions/{subscriptionId}/accounts/search
2. API endpoint (AccountsApi) receives the request
└── extracts subscriptionId from route
3. AccountFactoryService is called
└── ISubscriptionSettingService looks up the subscription
└── reads AdapterType from configuration (e.g. AdapterType.CST)
└── returns the matching IAccountAdapterService instance
4. Adapter executes the operation
└── calls InternalServices for business logic
└── InternalServices call ApiCallServices for HTTP communication
└── maps backend response to standard Bright Kit DTO
5. Unified response returned to client
4. Layer Breakdown
Project Structure
EGU.CommonAPI.sln
├── src/
│ ├── App/
│ │ └── EGU.CommonAPI.WebApp # ASP.NET Core Minimal API host
│ │ ├── Apis/ # Endpoint definitions
│ │ └── Adapters/
│ │ ├── Factories/ # Adapter factory services
│ │ └── Services/ # Orchestration (API → adapter)
│ │
│ ├── Domain/
│ │ ├── EGU.CommonAPI.Domain.Contracts # Interfaces, DTOs, enums, settings
│ │ ├── EGU.CommonAPI.Domain.Core # Base classes, shared utilities
│ │ └── EGU.CommonAPI.Domain.InvoiceArchive # Invoice PDF infrastructure
│ │
│ └── Adapters/
│ ├── EGU.CommonAPI.Adapters.CST
│ ├── EGU.CommonAPI.Adapters.Xellent
│ ├── EGU.CommonAPI.Adapters.Zynergy
│ ├── EGU.CommonAPI.Adapters.Gasell
│ ├── EGU.CommonAPI.Adapters.SonWin
│ └── EGU.CommonAPI.Adapters.ProBill
│
└── test/
└── EGU.CommonAPI.UnitTests # MSTest + NSubstitute
...