# only1ansary/summer-land-shop-inventory-system architecture

> Architecture diagram of the GitHub repository only1ansary/summer-land-shop-inventory-system, 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/only1ansary/summer-land-shop-inventory-system
- Repository: https://github.com/only1ansary/summer-land-shop-inventory-system

## Overview

SummerLand is a shop inventory and sales-management backend, alongside Flutter platform runners. Its central workflow records a sale against a location and employee, allocates product-variant stock, records invoice items and payments, and updates employee sales figures. Other visible API areas cover catalog, purchasing, stock, returns, and reporting. The graph reflects sampled backend code and indexed references; client application code and several controller implementations were not provided, so their internal flows are not asserted.

Main entry points: [`SummerLandBackend/Data/ShopDbContext.cs`](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Data/ShopDbContext.cs) (Shop data context), [`SummerLandBackend/Controllers/SaleInvoicesController.cs`](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/SaleInvoicesController.cs) (Sales invoices), [`SummerLandBackend/Controllers/ReportsController.cs`](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/ReportsController.cs) (Reports), [`SummerLandBackend/Controllers/ProductVariantsController.cs`](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/ProductVariantsController.cs) (Products and variants)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Shop API"]
  node_sales_api["Sales invoices"]
  node_catalog_api["Products and variants"]
  node_purchasing_api["Purchasing"]
  node_stock_api["Stock operations"]
  node_returns_api["Returns"]
  node_reports_api["Reports"]
  node_admin_api["Shop administration"]
end

subgraph group_operations["Shop Operations"]
end

subgraph group_data["Persistence Model"]
  node_db_context[("Shop data context<br/>[ShopDbContext.cs]")]
  node_domain_models["Shop domain entities"]
end

subgraph group_services["Domain Services"]
  node_employee_sales["Employee sales tracking"]
  node_date_range["Date range rules<br/>[QueryDateRange.cs]"]
  node_barcode_service["Barcode service<br/>[BarcodeService.cs]"]
end

node_shop_user(("Shop user"))

node_sales_api -->|"queries and saves"| node_db_context
node_sales_api -->|"records sale"| node_employee_sales
node_catalog_api -->|"queries and saves"| node_db_context
node_purchasing_api -->|"uses context"| node_db_context
node_reports_api -->|"queries"| node_db_context
node_reports_api -->|"normalizes dates"| node_date_range
node_db_context -->|"maps entities"| node_domain_models
node_shop_user -.->|"uses API"| node_sales_api

click node_sales_api "https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/SaleInvoicesController.cs"
click node_catalog_api "https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/ProductVariantsController.cs"
click node_purchasing_api "https://github.com/only1ansary/summer-land-shop-inventory-system/tree/main/SummerLandBackend/Controllers"
click node_stock_api "https://github.com/only1ansary/summer-land-shop-inventory-system/tree/main/SummerLandBackend/Controllers"
click node_returns_api "https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/ReturnsController.cs"
click node_reports_api "https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/ReportsController.cs"
click node_admin_api "https://github.com/only1ansary/summer-land-shop-inventory-system/tree/main/SummerLandBackend/Controllers"
click node_db_context "https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Data/ShopDbContext.cs"
click node_domain_models "https://github.com/only1ansary/summer-land-shop-inventory-system/tree/main/SummerLandBackend/Models"
click node_employee_sales "https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Services/EmployeeSalesService.cs"
click node_date_range "https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Services/QueryDateRange.cs"
click node_barcode_service "https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Services/BarcodeService.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_sales_api,node_catalog_api,node_purchasing_api,node_stock_api,node_returns_api,node_reports_api,node_admin_api,node_shop_user toneBlue
class node_db_context,node_domain_models toneMint
class node_employee_sales,node_date_range,node_barcode_service toneRose
```

## Components

### Shop API

- [Sales invoices](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/SaleInvoicesController.cs): `SummerLandBackend/Controllers/SaleInvoicesController.cs`
- [Products and variants](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/ProductVariantsController.cs): `SummerLandBackend/Controllers/ProductVariantsController.cs`
- [Purchasing](https://github.com/only1ansary/summer-land-shop-inventory-system/tree/main/SummerLandBackend/Controllers): `SummerLandBackend/Controllers`
- [Stock operations](https://github.com/only1ansary/summer-land-shop-inventory-system/tree/main/SummerLandBackend/Controllers): `SummerLandBackend/Controllers`
- [Returns](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/ReturnsController.cs): `SummerLandBackend/Controllers/ReturnsController.cs`
- [Reports](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Controllers/ReportsController.cs): `SummerLandBackend/Controllers/ReportsController.cs`
- [Shop administration](https://github.com/only1ansary/summer-land-shop-inventory-system/tree/main/SummerLandBackend/Controllers): `SummerLandBackend/Controllers`

### Persistence Model

- [Shop data context](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Data/ShopDbContext.cs): `SummerLandBackend/Data/ShopDbContext.cs`
- [Shop domain entities](https://github.com/only1ansary/summer-land-shop-inventory-system/tree/main/SummerLandBackend/Models): `SummerLandBackend/Models`

### Domain Services

- [Employee sales tracking](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Services/EmployeeSalesService.cs): `SummerLandBackend/Services/EmployeeSalesService.cs`
- [Date range rules](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Services/QueryDateRange.cs): `SummerLandBackend/Services/QueryDateRange.cs`
- [Barcode service](https://github.com/only1ansary/summer-land-shop-inventory-system/blob/main/SummerLandBackend/Services/BarcodeService.cs): `SummerLandBackend/Services/BarcodeService.cs`

### Other components

- **Shop user**

## Connections

- Sales invoices → Shop data context: queries and saves (evidence: `SummerLandBackend/Controllers/SaleInvoicesController.cs`)
- Sales invoices → Employee sales tracking: records sale (evidence: `SummerLandBackend/Controllers/SaleInvoicesController.cs`)
- Products and variants → Shop data context: queries and saves (evidence: `SummerLandBackend/Controllers/ProductVariantsController.cs`)
- Purchasing → Shop data context: uses context (evidence: `SummerLandBackend/Controllers/PurchaseInvoicesController.cs`)
- Reports → Shop data context: queries (evidence: `SummerLandBackend/Controllers/ReportsController.cs`)
- Reports → Date range rules: normalizes dates (evidence: `SummerLandBackend/Controllers/ReportsController.cs`)
- Shop data context → Shop domain entities: maps entities (evidence: `SummerLandBackend/Data/ShopDbContext.cs`)
- Shop user → Sales invoices: uses API
