# wrath-dev-il/w68 architecture

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

- Interactive diagram: https://gitdiagram.com/wrath-dev-il/w68
- Repository: https://github.com/wrath-dev-il/w68

## Overview

This is a Laravel business-operations application with purchasing, inventory, sales, accounting, reporting, customer records, and Shopee integrations. Users work through role-specific web interfaces; controllers and services handle operational requests, update records and ledgers, and provide reports or synchronization results. The empty README offers no product overview, so capabilities are inferred from the file tree and sampled source. Several major subsystems are represented by tree paths or source-index references rather than inspected implementation; uncertain connections are omitted.

Main entry points: [`app/Models/Product.php`](https://github.com/wrath-dev-il/w68/blob/main/app/Models/Product.php) (Product catalog), [`app/Http/Controllers/DeveloperInventoryControlController.php`](https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/DeveloperInventoryControlController.php) (Inventory controls), [`app/Observers/ProductLedgerObserver.php`](https://github.com/wrath-dev-il/w68/blob/main/app/Observers/ProductLedgerObserver.php) (Ledger observer), [`app/Http/Controllers/PurchaseNoteController.php`](https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/PurchaseNoteController.php) (Purchase notes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Purchasing Operations"]
  node_purchase_notes["Purchase notes"]
  node_purchase_viber["Viber purchasing"]
  node_purchase_records[("Purchase records<br/>[PurchaseNote.php]")]
  node_purchase_status["Note status rules"]
end

subgraph group_inventory["Inventory and Sales"]
  node_inventory_control["Inventory controls"]
  node_product_catalog[("Product catalog<br/>[Product.php]")]
  node_product_ledger[("Product ledger<br/>[ProductLedger.php]")]
  node_stock_sync["Stock synchronization"]
  node_ledger_observer["Ledger observer"]
  node_sales_workflows["Sales workflows"]
end

subgraph group_finance["Accounting and Reporting"]
  node_unserved_reports["Unserved reports"]
  node_payables["Payable vouchers"]
end

subgraph group_integrations["Customer and Integrations"]
  node_customer_soa["Customer statements"]
  node_customer_records[("Customer records<br/>[Customer.php]")]
  node_shopee_sync["Shopee price sync"]
  node_shopee_api["Shopee service<br/>[ShopeeService.php]"]
  node_shopee_job["Price webhook job"]
  node_inventory_job["Inventory sync job"]
  node_gemini["AI assistance<br/>[GeminiService.php]"]
end

node_user(("Business user"))
node_google_ai{{"Gemini API"}}

node_user -.->|"manages purchasing"| node_purchase_notes
node_purchase_notes -->|"reads and updates"| node_purchase_records
node_purchase_notes -->|"uses status rules"| node_purchase_status
node_purchase_viber -->|"searches products"| node_product_catalog
node_purchase_viber -->|"reads purchase notes"| node_purchase_records
node_inventory_control -->|"reads product data"| node_product_catalog
node_inventory_control -->|"invokes sync"| node_stock_sync
node_inventory_control -->|"updates ledger"| node_product_ledger
node_product_catalog -->|"relates ledger entries"| node_product_ledger
node_ledger_observer -->|"observes changes"| node_product_ledger
node_ledger_observer -->|"invokes sync"| node_stock_sync
node_ledger_observer -->|"dispatches job"| node_inventory_job
node_user -.->|"records sales"| node_sales_workflows
node_user -.->|"requests report"| node_unserved_reports
node_user -.->|"manages payables"| node_payables
node_customer_soa -->|"reads customer data"| node_customer_records
node_shopee_job -->|"runs sync"| node_shopee_sync
node_shopee_sync -->|"uses service"| node_shopee_api
node_shopee_sync -->|"reads products"| node_product_catalog
node_gemini -->|"sends generation request"| node_google_ai

click node_purchase_notes "https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/PurchaseNoteController.php"
click node_purchase_viber "https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/PurchaseViberController.php"
click node_purchase_records "https://github.com/wrath-dev-il/w68/blob/main/app/Models/PurchaseNote.php"
click node_purchase_status "https://github.com/wrath-dev-il/w68/blob/main/app/Services/PurchaseNoteStatusService.php"
click node_inventory_control "https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/DeveloperInventoryControlController.php"
click node_product_catalog "https://github.com/wrath-dev-il/w68/blob/main/app/Models/Product.php"
click node_product_ledger "https://github.com/wrath-dev-il/w68/blob/main/app/Models/ProductLedger.php"
click node_stock_sync "https://github.com/wrath-dev-il/w68/blob/main/app/Services/ProductStockSyncService.php"
click node_ledger_observer "https://github.com/wrath-dev-il/w68/blob/main/app/Observers/ProductLedgerObserver.php"
click node_sales_workflows "https://github.com/wrath-dev-il/w68/blob/main/resources/views/Admin/sales/sales-order.blade.php"
click node_unserved_reports "https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/Special/UnservedReportController.php"
click node_payables "https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/PayableChequeVoucherController.php"
click node_customer_soa "https://github.com/wrath-dev-il/w68/blob/main/app/Services/CustomerAutoSoaService.php"
click node_customer_records "https://github.com/wrath-dev-il/w68/blob/main/app/Models/Customer.php"
click node_shopee_sync "https://github.com/wrath-dev-il/w68/blob/main/app/Services/ShopeePriceSyncService.php"
click node_shopee_api "https://github.com/wrath-dev-il/w68/blob/main/app/Services/ShopeeService.php"
click node_shopee_job "https://github.com/wrath-dev-il/w68/blob/main/app/Jobs/ShopeePriceWebhookSyncJob.php"
click node_inventory_job "https://github.com/wrath-dev-il/w68/blob/main/app/Jobs/SyncShopeeProductInventory.php"
click node_gemini "https://github.com/wrath-dev-il/w68/blob/main/app/Services/GeminiService.php"

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_purchase_notes,node_purchase_viber,node_purchase_records,node_purchase_status,node_user toneBlue
class node_inventory_control,node_product_catalog,node_product_ledger,node_stock_sync,node_ledger_observer,node_sales_workflows toneAmber
class node_unserved_reports,node_payables,node_google_ai toneMint
class node_customer_soa,node_customer_records,node_shopee_sync,node_shopee_api,node_shopee_job,node_inventory_job,node_gemini toneRose
```

## Components

### Purchasing Operations

- [Purchase notes](https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/PurchaseNoteController.php): `app/Http/Controllers/PurchaseNoteController.php`
- [Viber purchasing](https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/PurchaseViberController.php): `app/Http/Controllers/PurchaseViberController.php`
- [Purchase records](https://github.com/wrath-dev-il/w68/blob/main/app/Models/PurchaseNote.php): `app/Models/PurchaseNote.php`
- [Note status rules](https://github.com/wrath-dev-il/w68/blob/main/app/Services/PurchaseNoteStatusService.php): `app/Services/PurchaseNoteStatusService.php`

### Inventory and Sales

- [Inventory controls](https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/DeveloperInventoryControlController.php): `app/Http/Controllers/DeveloperInventoryControlController.php`
- [Product catalog](https://github.com/wrath-dev-il/w68/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Product ledger](https://github.com/wrath-dev-il/w68/blob/main/app/Models/ProductLedger.php): `app/Models/ProductLedger.php`
- [Stock synchronization](https://github.com/wrath-dev-il/w68/blob/main/app/Services/ProductStockSyncService.php): `app/Services/ProductStockSyncService.php`
- [Ledger observer](https://github.com/wrath-dev-il/w68/blob/main/app/Observers/ProductLedgerObserver.php): `app/Observers/ProductLedgerObserver.php`
- [Sales workflows](https://github.com/wrath-dev-il/w68/blob/main/resources/views/Admin/sales/sales-order.blade.php): `resources/views/Admin/sales/sales-order.blade.php`

### Accounting and Reporting

- [Unserved reports](https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/Special/UnservedReportController.php): `app/Http/Controllers/Special/UnservedReportController.php`
- [Payable vouchers](https://github.com/wrath-dev-il/w68/blob/main/app/Http/Controllers/PayableChequeVoucherController.php): `app/Http/Controllers/PayableChequeVoucherController.php`

### Customer and Integrations

- [Customer statements](https://github.com/wrath-dev-il/w68/blob/main/app/Services/CustomerAutoSoaService.php): `app/Services/CustomerAutoSoaService.php`
- [Customer records](https://github.com/wrath-dev-il/w68/blob/main/app/Models/Customer.php): `app/Models/Customer.php`
- [Shopee price sync](https://github.com/wrath-dev-il/w68/blob/main/app/Services/ShopeePriceSyncService.php): `app/Services/ShopeePriceSyncService.php`
- [Shopee service](https://github.com/wrath-dev-il/w68/blob/main/app/Services/ShopeeService.php): `app/Services/ShopeeService.php`
- [Price webhook job](https://github.com/wrath-dev-il/w68/blob/main/app/Jobs/ShopeePriceWebhookSyncJob.php): `app/Jobs/ShopeePriceWebhookSyncJob.php`
- [Inventory sync job](https://github.com/wrath-dev-il/w68/blob/main/app/Jobs/SyncShopeeProductInventory.php): `app/Jobs/SyncShopeeProductInventory.php`
- [AI assistance](https://github.com/wrath-dev-il/w68/blob/main/app/Services/GeminiService.php): `app/Services/GeminiService.php`

### Other components

- **Business user**
- **Gemini API**

## Connections

- Business user → Purchase notes: manages purchasing
- Purchase notes → Purchase records: reads and updates (evidence: `app/Http/Controllers/PurchaseNoteController.php`)
- Purchase notes → Note status rules: uses status rules (evidence: `app/Http/Controllers/PurchaseNoteController.php`)
- Viber purchasing → Product catalog: searches products (evidence: `app/Http/Controllers/PurchaseViberController.php`)
- Viber purchasing → Purchase records: reads purchase notes (evidence: `app/Http/Controllers/PurchaseViberController.php`)
- Inventory controls → Product catalog: reads product data (evidence: `app/Http/Controllers/DeveloperInventoryControlController.php`)
- Inventory controls → Stock synchronization: invokes sync (evidence: `app/Http/Controllers/DeveloperInventoryControlController.php`)
- Inventory controls → Product ledger: updates ledger (evidence: `app/Http/Controllers/DeveloperInventoryControlController.php`)
- Product catalog → Product ledger: relates ledger entries (evidence: `app/Models/Product.php`)
- Ledger observer → Product ledger: observes changes (evidence: `app/Observers/ProductLedgerObserver.php`)
- Ledger observer → Stock synchronization: invokes sync (evidence: `app/Observers/ProductLedgerObserver.php`)
- Ledger observer → Inventory sync job: dispatches job (evidence: `app/Observers/ProductLedgerObserver.php`)
- Business user → Sales workflows: records sales
- Business user → Unserved reports: requests report
- Business user → Payable vouchers: manages payables
- Customer statements → Customer records: reads customer data (evidence: `app/Services/CustomerAutoSoaService.php`)
- Price webhook job → Shopee price sync: runs sync (evidence: `app/Jobs/ShopeePriceWebhookSyncJob.php`)
- Shopee price sync → Shopee service: uses service (evidence: `app/Services/ShopeePriceSyncService.php`)
- Shopee price sync → Product catalog: reads products (evidence: `app/Services/ShopeePriceSyncService.php`)
- AI assistance → Gemini API: sends generation request (evidence: `app/Services/GeminiService.php`)
