# imcody/asp.net-mvc-customer-billing-management architecture

> Architecture diagram of the GitHub repository imcody/asp.net-mvc-customer-billing-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imcody/asp.net-mvc-customer-billing-management
- Repository: https://github.com/imcody/asp.net-mvc-customer-billing-management

## Overview

##### Project Type and Purpose
- The README makes clear that this is a multi-module, full-stack business application for retail and business travel agencies. It covers CRM, ticketing (with integrations such as Amadeus, Gallelio, Sabre), Accounting, Billing, Reporting, and Banking.
- The overall purpose is to offer a complete travel agency management solution using open source technologies.

##### Analyzing the File Structure
- The solution is split into multiple logical projects:
- Billing.DAL: The Data Access Layer. It contains data access classes (DA classes), configuration files, helper classes, and parameter objects required for database interactions.
- Billing.Entities: Contains the domain models/entities like Agent, Invoice, Vendor, and other business objects that represent the data structure.
- Billing.ViewModel: This project provides view models that mediate between the UI and the data layer. It reflects a typical MVVM/MVC style approach.
- Billing.Web: This is the presentation layer built as an ASP.NET (MVC) web application. It includes controllers (for different business areas like Account, Accounting, Invoice, etc.), views (organized by functional areas), and supporting client-side assets like CSS, JavaScript, and fonts.
- The solution file (Billing.sln) ties these projects together.
- The presence of configuration files (app.config, Web.config) and migration files indicate standard practices for configuring and deploying the application.

##### Key Components
a. Data Layer:
- Billing.DAL interacts directly with the database through various Data Access classes (e.g., AccountingDA.cs, AgentDA.cs, ReportDA.cs).
- Helper components and parameter objects that manage configuration and facilitate interactions with the DB.
b. Domain Entities:
- Billing.Entities contains the business models such as Agent, Invoice, Vendor, and specialized models (like Airlines, AirportCode) that represent business data.
c. Presentation Layer:
- Billing.Web, representing the MVC web application, with Controllers handling user requests, and Views forming the user interface.
- Mention sub-components such as the Controllers (AccountController, InvoiceController, etc.), the Views (organized per module), and the static assets (CSS, JS, fonts).
d. View Models:
- Billing.ViewModel acts as an intermediary between the UI and the data/domain layers, encapsulating data for rendering UI elements.
e. External Integrations:
- Although not directly visible in the file tree, the README indicates integrations with external ticketing systems (Amadeus, Gallelio, Sabre), which should be represented as external services that interact with relevant parts of the system.

##### Architectural Patterns and Relationships
- The project clearly follows an MVC (Model-View-Controller) pattern:
- Models are defined in Billing.Entities.
- Views and Controllers reside in Billing.Web.
- View models (Billing.ViewModel) provide the data shaping needed for effective presentation.
- A layered architecture exists where the Presentation Layer (Billing.Web) calls into the business/data layer (DAL/Entities), ensuring separation of concerns.
- There is an abstraction of data access via repositories or DA classes in Billing.DAL.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Presentation Layer – Billing.Web"
        WebCtrl["MVC Controllers – Billing.Web/Controllers (e.g., AccountController.cs)"]:::presentation
        WebViews["Views – Billing.Web/Views"]:::presentation
        WebAssets["Static Assets – Billing.Web/assets"]:::presentation
    end

    VM["View Models – Billing.ViewModel"]:::viewmodel
    DAL["Data Access Layer – Billing.DAL (e.g., AgentDA.cs)"]:::dal
    Entities["Domain Models – Billing.Entities"]:::entities
    DB(["Database"]):::dal
    External["External Ticketing Systems\n(Amadeus, Gallelio, Sabre)"]:::external

    %% Data Flow
    WebCtrl -->|"calls"| VM
    VM -->|"queries"| DAL
    DAL -->|"interacts"| DB
    DAL -->|"uses"| Entities
    Entities -->|"supplies data"| VM
    WebCtrl -->|"renders"| WebViews
    External -->|"integrates"| DAL

    %% Click Events
    click DAL "https://github.com/imcody/asp.net-mvc-customer-billing-management/blob/master/Billing.DAL"
    click Entities "https://github.com/imcody/asp.net-mvc-customer-billing-management/blob/master/Billing.Entities"
    click VM "https://github.com/imcody/asp.net-mvc-customer-billing-management/blob/master/Billing.ViewModel"
    click WebCtrl "https://github.com/imcody/asp.net-mvc-customer-billing-management/tree/master/Billing.Web/Controllers"
    click WebViews "https://github.com/imcody/asp.net-mvc-customer-billing-management/tree/master/Billing.Web/Views"
    click WebAssets "https://github.com/imcody/asp.net-mvc-customer-billing-management/tree/master/Billing.Web/assets"

    %% Styling / Colors
    classDef presentation fill:#FFD700,stroke:#DAA520,stroke-width:2px;
    classDef viewmodel fill:#90EE90,stroke:#32CD32,stroke-width:2px;
    classDef dal fill:#ADD8E6,stroke:#00008B,stroke-width:2px;
    classDef entities fill:#FFB6C1,stroke:#C71585,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#696969,stroke-width:2px,stroke-dasharray: 5,5;
```
