# ahmedg8202/paymenttaskoop-solid architecture

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

- Interactive diagram: https://gitdiagram.com/ahmedg8202/paymenttaskoop-solid
- Repository: https://github.com/ahmedg8202/paymenttaskoop-solid

## Overview

This small console application repeatedly prompts for a payment method, creates the selected payment implementation, and prints an inquiry containing randomly generated items, their total, and the payment-method label. Payment owns item generation and totaling; Cash, Card, and Fawry specialize the output. The source shows no actual database or payment processor—the “Database” text is part of the printed message. Edges reflect the sampled implementation; no README provides additional capabilities.

Main entry points: [`PaymentMahmoudTask/Payment.cs`](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/Payment.cs) (Payment base), [`PaymentMahmoudTask/Program.cs`](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/Program.cs) (Payment menu), [`PaymentMahmoudTask/PaymentTypes/CashPayment.cs`](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/PaymentTypes/CashPayment.cs) (Cash payment), [`PaymentMahmoudTask/PaymentTypes/CardPayment.cs`](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/PaymentTypes/CardPayment.cs) (Card payment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Console entry"]
  node_program["Payment menu<br/>[Program.cs]"]
end

subgraph group_core["Payment model"]
  node_payment["Payment base<br/>[Payment.cs]"]
  node_contract["Payment contract<br/>[IPayment.cs]"]
  node_item["Item model<br/>[Item.cs]"]
end

subgraph group_methods["Payment methods"]
  node_cash["Cash payment<br/>[CashPayment.cs]"]
  node_card["Card payment<br/>[CardPayment.cs]"]
  node_fawry["Fawry payment<br/>[FawryPayment.cs]"]
end

node_user(("Console user"))

node_user -->|"enters choice"| node_program
node_program -->|"prints result"| node_user
node_program -->|"creates on choice"| node_cash
node_program -->|"creates on choice"| node_card
node_program -->|"creates on choice"| node_fawry
node_program -->|"calls print"| node_cash
node_program -->|"calls print"| node_card
node_program -->|"calls print"| node_fawry
node_payment -->|"implements"| node_contract
node_payment -->|"creates items"| node_item
node_payment -->|"reads prices"| node_item
node_payment -->|"totals items"| node_payment
node_cash -->|"extends"| node_payment
node_cash -->|"uses base output"| node_payment
node_card -->|"extends"| node_payment
node_card -->|"uses base output"| node_payment
node_fawry -->|"extends"| node_payment
node_fawry -->|"uses base output"| node_payment

click node_program "https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/Program.cs"
click node_payment "https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/Payment.cs"
click node_contract "https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/IPayment.cs"
click node_item "https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/Helpers/Item.cs"
click node_cash "https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/PaymentTypes/CashPayment.cs"
click node_card "https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/PaymentTypes/CardPayment.cs"
click node_fawry "https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/PaymentTypes/FawryPayment.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_program,node_user toneBlue
class node_payment,node_contract,node_item toneAmber
class node_cash,node_card,node_fawry toneMint
```

## Components

### Console entry

- [Payment menu](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/Program.cs): `PaymentMahmoudTask/Program.cs`

### Payment model

- [Payment base](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/Payment.cs): `PaymentMahmoudTask/Payment.cs`
- [Payment contract](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/IPayment.cs): `PaymentMahmoudTask/IPayment.cs`
- [Item model](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/Helpers/Item.cs): `PaymentMahmoudTask/Helpers/Item.cs`

### Payment methods

- [Cash payment](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/PaymentTypes/CashPayment.cs): `PaymentMahmoudTask/PaymentTypes/CashPayment.cs`
- [Card payment](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/PaymentTypes/CardPayment.cs): `PaymentMahmoudTask/PaymentTypes/CardPayment.cs`
- [Fawry payment](https://github.com/ahmedg8202/paymenttaskoop-solid/blob/master/PaymentMahmoudTask/PaymentTypes/FawryPayment.cs): `PaymentMahmoudTask/PaymentTypes/FawryPayment.cs`

### Other components

- **Console user**

## Connections

- Console user → Payment menu: enters choice (evidence: `PaymentMahmoudTask/Program.cs`)
- Payment menu → Console user: prints result (evidence: `PaymentMahmoudTask/Program.cs`)
- Payment menu → Cash payment: creates on choice (evidence: `PaymentMahmoudTask/Program.cs`)
- Payment menu → Card payment: creates on choice (evidence: `PaymentMahmoudTask/Program.cs`)
- Payment menu → Fawry payment: creates on choice (evidence: `PaymentMahmoudTask/Program.cs`)
- Payment menu → Cash payment: calls print (evidence: `PaymentMahmoudTask/Program.cs`)
- Payment menu → Card payment: calls print (evidence: `PaymentMahmoudTask/Program.cs`)
- Payment menu → Fawry payment: calls print (evidence: `PaymentMahmoudTask/Program.cs`)
- Payment base → Payment contract: implements (evidence: `PaymentMahmoudTask/Payment.cs`)
- Payment base → Item model: creates items (evidence: `PaymentMahmoudTask/Payment.cs`)
- Payment base → Item model: reads prices (evidence: `PaymentMahmoudTask/Payment.cs`)
- Payment base → Payment base: totals items (evidence: `PaymentMahmoudTask/Payment.cs`)
- Cash payment → Payment base: extends (evidence: `PaymentMahmoudTask/PaymentTypes/CashPayment.cs`)
- Cash payment → Payment base: uses base output (evidence: `PaymentMahmoudTask/PaymentTypes/CashPayment.cs`)
- Card payment → Payment base: extends (evidence: `PaymentMahmoudTask/PaymentTypes/CardPayment.cs`)
- Card payment → Payment base: uses base output (evidence: `PaymentMahmoudTask/PaymentTypes/CardPayment.cs`)
- Fawry payment → Payment base: extends (evidence: `PaymentMahmoudTask/PaymentTypes/FawryPayment.cs`)
- Fawry payment → Payment base: uses base output (evidence: `PaymentMahmoudTask/PaymentTypes/FawryPayment.cs`)
