# yrbre/fs-finish-oil-warehouse-system architecture

> Architecture diagram of the GitHub repository yrbre/fs-finish-oil-warehouse-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yrbre/fs-finish-oil-warehouse-system
- Repository: https://github.com/yrbre/fs-finish-oil-warehouse-system

## Overview

Finish Oil System is a Laravel inventory and warehouse application for tracking oil lots and stock movement. Users submit receiving, consumption, adjustment, disposal, relocation, and inter-warehouse transfer operations through web screens; controllers invoke business services, which use repositories and Eloquent models for persistence. Transfers have distinct request, approval, dispatch, and receipt stages. The README also documents FEFO allocation, stock-ledger reporting, and scheduled minimum-stock and near-expiry alerts. Some module links rely on the README’s documented architecture because their source was not sampled.

Main entry points: [`app/Repositories/Eloquents`](https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/app/Repositories/Eloquents) (Eloquent repositories), [`app/Services/TransferRequestService.php`](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/TransferRequestService.php) (Transfer service), [`routes/web.php`](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/TransferRequestController.php`](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/TransferRequestController.php) (Transfer controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Web interaction"]
  node_web["Web routes<br/>[web.php]"]
  node_screens["Inventory screens"]
  node_txcontroller["Transaction controller"]
  node_transfercontroller["Transfer controller"]
  node_itemcontroller["Item controller<br/>[ItemController.php]"]
end

subgraph group_stock["Stock operations"]
  node_stockservice["Transaction service"]
  node_lotservice["Item location service"]
  node_alloc["Package allocator"]
  node_disposal["Disposal service"]
  node_relocation["Relocation service"]
end

subgraph group_transfer["Warehouse transfers"]
  node_transfer["Transfer service"]
  node_transferpdf["Receipt PDF view"]
end

subgraph group_data["Persistence"]
  node_repository["Eloquent repositories"]
  node_models["Inventory models"]
  node_database[("MySQL database")]
end

subgraph group_oversight["Reporting and alerts"]
  node_reports["Reports controller"]
  node_ledger["Stock ledger service"]
  node_alerts["Stock alert service"]
  node_alertcommand["Alert scheduler command"]
  node_notifications["User notifications"]
end

node_user(("Warehouse user"))

node_user -->|"submits requests"| node_web
node_web -->|"dispatches"| node_txcontroller
node_web -->|"dispatches"| node_transfercontroller
node_web -->|"dispatches"| node_itemcontroller
node_txcontroller -->|"renders"| node_screens
node_transfercontroller -->|"renders"| node_screens
node_itemcontroller -->|"renders"| node_screens
node_txcontroller -->|"invokes"| node_stockservice
node_transfercontroller -->|"invokes"| node_transfer
node_transfercontroller -->|"renders"| node_transferpdf
node_stockservice -->|"uses lot operations"| node_lotservice
node_stockservice -->|"accesses data"| node_repository
node_transfer -->|"allocates and receives lots"| node_lotservice
node_transfer -->|"allocates packages"| node_alloc
node_lotservice -->|"uses allocation"| node_alloc
node_disposal -->|"accesses data"| node_repository
node_relocation -->|"accesses data"| node_repository
node_transfer -->|"accesses data"| node_repository
node_repository -->|"queries and updates"| node_models
node_models -->|"persists records"| node_database
node_reports -->|"uses ledger reporting"| node_ledger
node_ledger -->|"accesses data"| node_repository
node_alertcommand -->|"checks stock"| node_alerts
node_alerts -->|"sends alerts"| node_notifications
node_transfer -->|"sends status updates"| node_notifications

click node_web "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/routes/web.php"
click node_screens "https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/resources/views/pages"
click node_txcontroller "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/TransactionController.php"
click node_transfercontroller "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/TransferRequestController.php"
click node_itemcontroller "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/ItemController.php"
click node_stockservice "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/TransactionService.php"
click node_lotservice "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/ItemLocationService.php"
click node_alloc "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/PackageAllocator.php"
click node_disposal "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/DisposalService.php"
click node_relocation "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/RelocationService.php"
click node_transfer "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/TransferRequestService.php"
click node_transferpdf "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/resources/views/pdf/receipt-of-goods.blade.php"
click node_repository "https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/app/Repositories/Eloquents"
click node_models "https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/app/Models"
click node_reports "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/ReportController.php"
click node_ledger "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/StockLedgerService.php"
click node_alerts "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/StockAlertService.php"
click node_alertcommand "https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Console/Commands/CheckStockAlerts.php"
click node_notifications "https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/app/Notifications"

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_web,node_screens,node_txcontroller,node_transfercontroller,node_itemcontroller,node_user toneBlue
class node_stockservice,node_lotservice,node_alloc,node_disposal,node_relocation toneAmber
class node_transfer,node_transferpdf toneMint
class node_repository,node_models,node_database toneRose
class node_reports,node_ledger,node_alerts,node_alertcommand,node_notifications toneIndigo
```

## Components

### Web interaction

- [Web routes](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/routes/web.php): `routes/web.php`
- [Inventory screens](https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/resources/views/pages): `resources/views/pages`
- [Transaction controller](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/TransactionController.php): `app/Http/Controllers/TransactionController.php`
- [Transfer controller](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/TransferRequestController.php): `app/Http/Controllers/TransferRequestController.php`
- [Item controller](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/ItemController.php): `app/Http/Controllers/ItemController.php`

### Stock operations

- [Transaction service](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/TransactionService.php): `app/Services/TransactionService.php`
- [Item location service](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/ItemLocationService.php): `app/Services/ItemLocationService.php`
- [Package allocator](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/PackageAllocator.php): `app/Services/PackageAllocator.php`
- [Disposal service](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/DisposalService.php): `app/Services/DisposalService.php`
- [Relocation service](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/RelocationService.php): `app/Services/RelocationService.php`

### Warehouse transfers

- [Transfer service](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/TransferRequestService.php): `app/Services/TransferRequestService.php`
- [Receipt PDF view](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/resources/views/pdf/receipt-of-goods.blade.php): `resources/views/pdf/receipt-of-goods.blade.php`

### Persistence

- [Eloquent repositories](https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/app/Repositories/Eloquents): `app/Repositories/Eloquents`
- [Inventory models](https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/app/Models): `app/Models`
- **MySQL database**

### Reporting and alerts

- [Reports controller](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Http/Controllers/ReportController.php): `app/Http/Controllers/ReportController.php`
- [Stock ledger service](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/StockLedgerService.php): `app/Services/StockLedgerService.php`
- [Stock alert service](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Services/StockAlertService.php): `app/Services/StockAlertService.php`
- [Alert scheduler command](https://github.com/yrbre/fs-finish-oil-warehouse-system/blob/main/app/Console/Commands/CheckStockAlerts.php): `app/Console/Commands/CheckStockAlerts.php`
- [User notifications](https://github.com/yrbre/fs-finish-oil-warehouse-system/tree/main/app/Notifications): `app/Notifications`

### Other components

- **Warehouse user**

## Connections

- Warehouse user → Web routes: submits requests
- Web routes → Transaction controller: dispatches
- Web routes → Transfer controller: dispatches
- Web routes → Item controller: dispatches
- Transaction controller → Inventory screens: renders
- Transfer controller → Inventory screens: renders
- Item controller → Inventory screens: renders
- Transaction controller → Transaction service: invokes
- Transfer controller → Transfer service: invokes
- Transfer controller → Receipt PDF view: renders
- Transaction service → Item location service: uses lot operations
- Transaction service → Eloquent repositories: accesses data
- Transfer service → Item location service: allocates and receives lots
- Transfer service → Package allocator: allocates packages
- Item location service → Package allocator: uses allocation
- Disposal service → Eloquent repositories: accesses data
- Relocation service → Eloquent repositories: accesses data
- Transfer service → Eloquent repositories: accesses data
- Eloquent repositories → Inventory models: queries and updates
- Inventory models → MySQL database: persists records
- Reports controller → Stock ledger service: uses ledger reporting
- Stock ledger service → Eloquent repositories: accesses data
- Alert scheduler command → Stock alert service: checks stock
- Stock alert service → User notifications: sends alerts
- Transfer service → User notifications: sends status updates
