# vladus-cpu/crossapp-kachanovskyi architecture

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

- Interactive diagram: https://gitdiagram.com/vladus-cpu/crossapp-kachanovskyi
- Repository: https://github.com/vladus-cpu/crossapp-kachanovskyi

## Overview

CrossApp is a .NET CLI for importing product/customer records and creating, validating, querying, and storing orders. Its main order workflow runs from CLI commands through OrderService to domain rules and an IOrderStore implementation; a separate CLI path dispatches CSV, JSON, or mixed-CSV imports and reports accepted records and errors. The graph also preserves the documented DTO mapping and interchangeable memory, file, and caching stores. Relationships for unsampled importer and storage internals rely on README statements or SOURCE INDEX references, not inspection of their implementation.

Main entry points: [`src/Cli/Program.cs`](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Cli/Program.cs) (Command dispatcher), [`src/Core/Import/MixedCsvImporter.cs`](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Import/MixedCsvImporter.cs) (Mixed CSV importer), [`src/Core/Services/OrderService.cs`](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Services/OrderService.cs) (Order service), [`src/Core/Domain/Order.cs`](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/Order.cs) (Order lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_cli["Command dispatcher<br/>[Program.cs]"]
end

subgraph group_domain["Order domain"]
  node_service["Order service<br/>[OrderService.cs]"]
  node_order["Order lifecycle<br/>[Order.cs]"]
  node_customer["Customer<br/>[Customer.cs]"]
  node_orderline["Order line<br/>[OrderLine.cs]"]
  node_rules["Order rules<br/>[OrderRules.cs]"]
  node_status["Order status<br/>[OrderStatus.cs]"]
  node_mapper["Order mapper<br/>[OrderMapper.cs]"]
  node_orderdto["Order DTO<br/>[OrderDto.cs]"]
  node_linedto["Order-line DTO<br/>[OrderLineDto.cs]"]
end

subgraph group_imports["Data import"]
  node_customerdto["Customer DTO<br/>[CustomerDto.cs]"]
  node_productdto["Product DTO<br/>[ProductDto.cs]"]
  node_entrydto["Import entry DTO<br/>[ImportEntryDto.cs]"]
  node_importresult["Import results<br/>[ImportResult.cs]"]
  node_productcsv["Product CSV importer"]
  node_productjson["Product JSON importer"]
  node_mixedcsv["Mixed CSV importer"]
end

subgraph group_storage["Order storage"]
  node_storecontract["Store contract<br/>[IOrderStore.cs]"]
  node_memory["Memory store"]
  node_filestore[("File store<br/>[FileOrderStore.cs]")]
  node_cache["Caching store"]
  node_sampledata["Sample orders<br/>[SampleData.cs]"]
end

node_user(("CLI user"))
node_importdata["Input data files"]

node_user -->|"runs commands"| node_cli
node_cli -->|"runs order operations"| node_service
node_service -->|"checks limits"| node_rules
node_service -->|"creates and changes"| node_order
node_service -->|"uses store"| node_storecontract
node_service -->|"accepts customer"| node_customer
node_order -->|"creates lines"| node_orderline
node_order -->|"maps to DTO"| node_orderdto
node_orderline -->|"maps to DTO"| node_linedto
node_orderdto -->|"stores status"| node_status
node_mapper -->|"maps records"| node_order
node_mapper -->|"maps results"| node_importresult
node_cli -->|"dispatches CSV"| node_productcsv
node_cli -->|"dispatches JSON"| node_productjson
node_cli -->|"dispatches mixed CSV"| node_mixedcsv
node_productcsv -->|"produces records"| node_productdto
node_productcsv -->|"returns results"| node_importresult
node_productjson -->|"produces records"| node_productdto
node_productjson -->|"returns results"| node_importresult
node_mixedcsv -->|"produces entries"| node_entrydto
node_mixedcsv -->|"creates products"| node_productdto
node_mixedcsv -->|"creates customers"| node_customerdto
node_mixedcsv -->|"returns results"| node_importresult
node_productdto -->|"extends entry"| node_entrydto
node_customerdto -->|"extends entry"| node_entrydto
node_importdata -->|"loaded from CSV"| node_productcsv
node_importdata -->|"loaded from JSON"| node_productjson
node_importdata -->|"loaded as mixed CSV"| node_mixedcsv
node_storecontract -->|"implemented by"| node_memory
node_storecontract -->|"implemented by"| node_filestore
node_cli -->|"selects by default"| node_memory
node_cli -->|"selects with --file"| node_filestore
node_cli -->|"wraps with --cache"| node_cache
node_cache -->|"wraps another store"| node_storecontract
node_cli -->|"seeds memory store"| node_sampledata

click node_cli "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Cli/Program.cs"
click node_service "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Services/OrderService.cs"
click node_order "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/Order.cs"
click node_customer "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/Customer.cs"
click node_orderline "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/OrderLine.cs"
click node_rules "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/OrderRules.cs"
click node_status "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/OrderStatus.cs"
click node_mapper "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/OrderMapper.cs"
click node_orderdto "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/OrderDto.cs"
click node_linedto "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/OrderLineDto.cs"
click node_customerdto "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/CustomerDto.cs"
click node_productdto "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/ProductDto.cs"
click node_entrydto "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/ImportEntryDto.cs"
click node_importresult "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/ImportResult.cs"
click node_productcsv "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Import/ProductCsvImporter.cs"
click node_productjson "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Import/ProductJsonImporter.cs"
click node_mixedcsv "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Import/MixedCsvImporter.cs"
click node_storecontract "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Abstractions/IOrderStore.cs"
click node_memory "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Storage/InMemoryOrderStore.cs"
click node_filestore "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Storage/FileOrderStore.cs"
click node_cache "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Storage/CachingOrderStore.cs"
click node_sampledata "https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/SampleData.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_cli,node_user toneBlue
class node_service,node_order,node_customer,node_orderline,node_rules,node_status,node_mapper,node_orderdto,node_linedto toneAmber
class node_customerdto,node_productdto,node_entrydto,node_importresult,node_productcsv,node_productjson,node_mixedcsv toneMint
class node_storecontract,node_memory,node_filestore,node_cache,node_sampledata toneRose
class node_importdata toneIndigo
```

## Components

### CLI workflows

- [Command dispatcher](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Cli/Program.cs): `src/Cli/Program.cs`

### Order domain

- [Order service](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Services/OrderService.cs): `src/Core/Services/OrderService.cs`
- [Order lifecycle](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/Order.cs): `src/Core/Domain/Order.cs`
- [Customer](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/Customer.cs): `src/Core/Domain/Customer.cs`
- [Order line](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/OrderLine.cs): `src/Core/Domain/OrderLine.cs`
- [Order rules](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/OrderRules.cs): `src/Core/Domain/OrderRules.cs`
- [Order status](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/OrderStatus.cs): `src/Core/Domain/OrderStatus.cs`
- [Order mapper](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Domain/OrderMapper.cs): `src/Core/Domain/OrderMapper.cs`
- [Order DTO](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/OrderDto.cs): `src/Core/Dto/OrderDto.cs`
- [Order-line DTO](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/OrderLineDto.cs): `src/Core/Dto/OrderLineDto.cs`

### Data import

- [Customer DTO](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/CustomerDto.cs): `src/Core/Dto/CustomerDto.cs`
- [Product DTO](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/ProductDto.cs): `src/Core/Dto/ProductDto.cs`
- [Import entry DTO](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/ImportEntryDto.cs): `src/Core/Dto/ImportEntryDto.cs`
- [Import results](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Dto/ImportResult.cs): `src/Core/Dto/ImportResult.cs`
- [Product CSV importer](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Import/ProductCsvImporter.cs): `src/Core/Import/ProductCsvImporter.cs`
- [Product JSON importer](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Import/ProductJsonImporter.cs): `src/Core/Import/ProductJsonImporter.cs`
- [Mixed CSV importer](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Import/MixedCsvImporter.cs): `src/Core/Import/MixedCsvImporter.cs`

### Order storage

- [Store contract](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Abstractions/IOrderStore.cs): `src/Core/Abstractions/IOrderStore.cs`
- [Memory store](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Storage/InMemoryOrderStore.cs): `src/Core/Storage/InMemoryOrderStore.cs`
- [File store](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Storage/FileOrderStore.cs): `src/Core/Storage/FileOrderStore.cs`
- [Caching store](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/Storage/CachingOrderStore.cs): `src/Core/Storage/CachingOrderStore.cs`
- [Sample orders](https://github.com/vladus-cpu/crossapp-kachanovskyi/blob/main/src/Core/SampleData.cs): `src/Core/SampleData.cs`

### Other components

- **CLI user**
- **Input data files**

## Connections

- CLI user → Command dispatcher: runs commands (evidence: `src/Cli/Program.cs`)
- Command dispatcher → Order service: runs order operations (evidence: `src/Cli/Program.cs`)
- Order service → Order rules: checks limits (evidence: `src/Core/Services/OrderService.cs`)
- Order service → Order lifecycle: creates and changes (evidence: `src/Core/Services/OrderService.cs`)
- Order service → Store contract: uses store (evidence: `src/Core/Services/OrderService.cs`)
- Order service → Customer: accepts customer (evidence: `src/Core/Services/OrderService.cs`)
- Order lifecycle → Order line: creates lines (evidence: `src/Core/Domain/Order.cs`)
- Order lifecycle → Order DTO: maps to DTO (evidence: `src/Core/Domain/Order.cs`)
- Order line → Order-line DTO: maps to DTO (evidence: `src/Core/Domain/OrderLine.cs`)
- Order DTO → Order status: stores status (evidence: `src/Core/Dto/OrderDto.cs`)
- Order mapper → Order lifecycle: maps records (evidence: `src/Core/Domain/OrderMapper.cs`)
- Order mapper → Import results: maps results (evidence: `src/Core/Domain/OrderMapper.cs`)
- Command dispatcher → Product CSV importer: dispatches CSV (evidence: `src/Cli/Program.cs`)
- Command dispatcher → Product JSON importer: dispatches JSON (evidence: `src/Cli/Program.cs`)
- Command dispatcher → Mixed CSV importer: dispatches mixed CSV (evidence: `src/Cli/Program.cs`)
- Product CSV importer → Product DTO: produces records (evidence: `src/Core/Import/ProductCsvImporter.cs`)
- Product CSV importer → Import results: returns results (evidence: `src/Core/Import/ProductCsvImporter.cs`)
- Product JSON importer → Product DTO: produces records (evidence: `src/Core/Import/ProductJsonImporter.cs`)
- Product JSON importer → Import results: returns results (evidence: `src/Core/Import/ProductJsonImporter.cs`)
- Mixed CSV importer → Import entry DTO: produces entries (evidence: `src/Core/Import/MixedCsvImporter.cs`)
- Mixed CSV importer → Product DTO: creates products (evidence: `src/Core/Import/MixedCsvImporter.cs`)
- Mixed CSV importer → Customer DTO: creates customers (evidence: `src/Core/Import/MixedCsvImporter.cs`)
- Mixed CSV importer → Import results: returns results (evidence: `src/Core/Import/MixedCsvImporter.cs`)
- Product DTO → Import entry DTO: extends entry (evidence: `src/Core/Dto/ProductDto.cs`)
- Customer DTO → Import entry DTO: extends entry (evidence: `src/Core/Dto/CustomerDto.cs`)
- Input data files → Product CSV importer: loaded from CSV (evidence: `README.md`)
- Input data files → Product JSON importer: loaded from JSON (evidence: `README.md`)
- Input data files → Mixed CSV importer: loaded as mixed CSV (evidence: `README.md`)
- Store contract → Memory store: implemented by (evidence: `README.md`)
- Store contract → File store: implemented by (evidence: `README.md`)
- Command dispatcher → Memory store: selects by default (evidence: `src/Cli/Program.cs`)
- Command dispatcher → File store: selects with --file (evidence: `src/Cli/Program.cs`)
- Command dispatcher → Caching store: wraps with --cache (evidence: `src/Cli/Program.cs`)
- Caching store → Store contract: wraps another store (evidence: `README.md`)
- Command dispatcher → Sample orders: seeds memory store (evidence: `src/Cli/Program.cs`)
