📋 Legend
Folder
Bounded Context Folder
PHP Class/Model
Service/Logic
Migration File
Route File
Configuration
📂 Complete Directory Tree
📦 app/Domains/Supply/
│
├── 📂 SubDomains/
│ │
│ ├── 👤 Agents/
│ │ ├── Models/
│ │ │ └── Agent.php
│ │ │
│ │ ├── DTOs/
│ │ │ ├── AgentDTO.php
│ │ │ ├── CreateAgentDTO.php
│ │ │ ├── UpdateAgentDTO.php
│ │ │ └── AgentListDTO.php
│ │ │
│ │ ├── Services/
│ │ │ └── AgentService.php
│ │ │
│ │ ├── Http/
│ │ │ ├── Controllers/
│ │ │ │ └── V1/
│ │ │ │ └── AgentController.php
│ │ │ │
│ │ │ ├── Requests/
│ │ │ │ └── V1/
│ │ │ │ ├── StoreAgentRequest.php
│ │ │ │ └── UpdateAgentRequest.php
│ │ │ │
│ │ │ └── Resources/
│ │ │ └── V1/
│ │ │ └── AgentResource.php
│ │ │
│ │ ├── Events/
│ │ │ ├── AgentCreated.php
│ │ │ ├── AgentUpdated.php
│ │ │ ├── AgentDeleted.php
│ │ │ └── AgentRestored.php
│ │ │
│ │ ├── Exceptions/
│ │ │ ├── AgentNotFoundException.php
│ │ │ └── InvalidAgentDataException.php
│ │ │
│ │ ├── Traits/
│ │ │ ├── HasCommission.php
│ │ │ └── HasAgentRelations.php
│ │ │
│ │ └── Repositories/
│ │ └── AgentRepository.php
│ │
│ ├── 🏪 Customers/
│ │ ├── Models/
│ │ │ ├── Customer.php
│ │ │ └── Location.php
│ │ │
│ │ ├── DTOs/
│ │ │ ├── CustomerDTO.php
│ │ │ ├── CreateCustomerDTO.php
│ │ │ ├── UpdateCustomerDTO.php
│ │ │ ├── LocationDTO.php
│ │ │ └── CustomerLocationDTO.php
│ │ │
│ │ ├── Services/
│ │ │ ├── CustomerService.php
│ │ │ └── LocationService.php
│ │ │
│ │ ├── Http/
│ │ │ ├── Controllers/V1/
│ │ │ │ ├── CustomerController.php
│ │ │ │ └── LocationController.php
│ │ │ ├── Requests/V1/
│ │ │ │ ├── StoreCustomerRequest.php
│ │ │ │ ├── UpdateCustomerRequest.php
│ │ │ │ ├── StoreLocationRequest.php
│ │ │ │ └── UpdateLocationRequest.php
│ │ │ └── Resources/V1/
│ │ │ ├── CustomerResource.php
│ │ │ └── LocationResource.php
│ │ │
│ │ ├── Events/
│ │ │ ├── CustomerCreated.php
│ │ │ ├── CustomerUpdated.php
│ │ │ ├── CreditLimitModified.php
│ │ │ └── LocationAdded.php
│ │ │
│ │ ├── Exceptions/
│ │ ├── Traits/
│ │ └── Repositories/
│ │
│ ├── 🏭 Suppliers/
│ │ ├── Models/
│ │ │ ├── Supplier.php
│ │ │ └── Contact.php
│ │ │
│ │ ├── DTOs/
│ │ │ ├── SupplierDTO.php
│ │ │ ├── CreateSupplierDTO.php
│ │ │ ├── UpdateSupplierDTO.php
│ │ │ └── ContactDTO.php
│ │ │
│ │ ├── Services/
│ │ │ ├── SupplierService.php
│ │ │ └── ContactService.php
│ │ │
│ │ ├── Http/
│ │ │ ├── Controllers/V1/
│ │ │ ├── Requests/V1/
│ │ │ └── Resources/V1/
│ │ │
│ │ ├── Events/
│ │ ├── Exceptions/
│ │ ├── Traits/
│ │ └── Repositories/
│ │
│ ├── 📦 SupplyOrders/
│ │ ├── Models/
│ │ │ ├── SupplyOrder.php
│ │ │ └── OrderItem.php
│ │ │
│ │ ├── DTOs/
│ │ │ ├── SupplyOrderDTO.php
│ │ │ ├── CreateSupplyOrderDTO.php
│ │ │ ├── UpdateSupplyOrderDTO.php
│ │ │ └── OrderItemDTO.php
│ │ │
│ │ ├── Services/
│ │ │ └── SupplyOrderService.php
│ │ │
│ │ ├── Http/
│ │ │ ├── Controllers/V1/
│ │ │ │ └── SupplyOrderController.php
│ │ │ ├── Requests/V1/
│ │ │ └── Resources/V1/
│ │ │ ├── SupplyOrderResource.php
│ │ │ └── OrderItemResource.php
│ │ │
│ │ ├── Events/
│ │ │ ├── SupplyOrderCreated.php
│ │ │ ├── SupplyOrderConfirmed.php
│ │ │ ├── SupplyOrderShipped.php
│ │ │ └── SupplyOrderDelivered.php
│ │ │
│ │ ├── Exceptions/
│ │ ├── Traits/
│ │ └── Repositories/
│ │
│ ├── 💬 Quotations/
│ │ ├── Models/
│ │ │ ├── Quotation.php
│ │ │ └── QuotationItem.php
│ │ │
│ │ ├── DTOs/
│ │ │ ├── QuotationDTO.php
│ │ │ ├── CreateQuotationDTO.php
│ │ │ ├── UpdateQuotationDTO.php
│ │ │ └── QuotationItemDTO.php
│ │ │
│ │ ├── Services/
│ │ │ └── QuotationService.php
│ │ │
│ │ ├── Http/
│ │ │ ├── Controllers/V1/
│ │ │ ├── Requests/V1/
│ │ │ └── Resources/V1/
│ │ │
│ │ ├── Events/
│ │ │ ├── QuotationCreated.php
│ │ │ ├── QuotationSent.php
│ │ │ ├── QuotationAccepted.php
│ │ │ └── QuotationRejected.php
│ │ │
│ │ ├── Exceptions/
│ │ ├── Traits/
│ │ └── Repositories/
│ │
│ ├── 🛒 PurchaseOrders/
│ │ ├── Models/
│ │ │ ├── PurchaseOrder.php
│ │ │ └── POItem.php
│ │ │
│ │ ├── DTOs/
│ │ │ ├── PurchaseOrderDTO.php
│ │ │ ├── CreatePurchaseOrderDTO.php
│ │ │ ├── UpdatePurchaseOrderDTO.php
│ │ │ └── POItemDTO.php
│ │ │
│ │ ├── Services/
│ │ │ └── PurchaseOrderService.php
│ │ │
│ │ ├── Http/
│ │ │ ├── Controllers/V1/
│ │ │ ├── Requests/V1/
│ │ │ └── Resources/V1/
│ │ │
│ │ ├── Events/
│ │ │ ├── PurchaseOrderCreated.php
│ │ │ ├── PurchaseOrderConfirmed.php
│ │ │ └── PurchaseOrderCompleted.php
│ │ │
│ │ ├── Exceptions/
│ │ ├── Traits/
│ │ └── Repositories/
│ │
│ └── 📥 GoodsReceipts/
│ ├── Models/
│ │ ├── GoodsReceipt.php
│ │ └── ReceiptItem.php
│ │
│ ├── DTOs/
│ │ ├── GoodsReceiptDTO.php
│ │ ├── CreateGoodsReceiptDTO.php
│ │ ├── UpdateGoodsReceiptDTO.php
│ │ └── ReceiptItemDTO.php
│ │
│ ├── Services/
│ │ └── GoodsReceiptService.php
│ │
│ ├── Http/
│ │ ├── Controllers/V1/
│ │ ├── Requests/V1/
│ │ └── Resources/V1/
│ │
│ ├── Events/
│ │ ├── GoodsReceiptCreated.php
│ │ ├── GoodsReceiptVerified.php
│ │ └── GoodsReceiptAccepted.php
│ │
│ ├── Exceptions/
│ ├── Traits/
│ └── Repositories/
│
├── 🔗 Shared/
│ ├── DTOs/
│ │ ├── PaginationDTO.php
│ │ └── FilterDTO.php
│ │
│ ├── Traits/
│ │ ├── HasTimestamps.php
│ │ ├── HasSoftDeletes.php
│ │ └── Filterable.php
│ │
│ ├── Helpers/
│ │ ├── ResponseHelper.php
│ │ ├── PaginationHelper.php
│ │ └── FilterHelper.php
│ │
│ └── Enums/
│ ├── OrderStatus.php
│ ├── QuotationStatus.php
│ └── ReceiptStatus.php
│
└── SupplyDomainServiceProvider.php
═══════════════════════════════════════════════════════════════════════════════
📁 database/migrations/ 15+ Files
│
├── 2024_01_15_create_agents_table.php
├── 2024_01_16_create_customers_table.php
├── 2024_01_16_create_customer_locations_table.php
├── 2024_01_17_create_suppliers_table.php
├── 2024_01_17_create_supplier_contacts_table.php
├── 2024_01_18_create_supply_orders_table.php
├── 2024_01_18_create_supply_order_items_table.php
├── 2024_01_19_create_quotations_table.php
├── 2024_01_19_create_quotation_items_table.php
├── 2024_01_20_create_purchase_orders_table.php
├── 2024_01_20_create_purchase_order_items_table.php
├── 2024_01_21_create_goods_receipts_table.php
└── 2024_01_21_create_goods_receipt_items_table.php
═══════════════════════════════════════════════════════════════════════════════
📁 database/seeders/ 8+ Files
│
├── DatabaseSeeder.php
├── SupplySeeder.php
├── AgentSeeder.php
├── CustomerSeeder.php
├── SupplierSeeder.php
├── SupplyOrderSeeder.php
├── QuotationSeeder.php
├── PurchaseOrderSeeder.php
└── GoodsReceiptSeeder.php
═══════════════════════════════════════════════════════════════════════════════
📁 routes/apis/v1/ 8+ Files
│
├── agents.php
├── customers.php
├── suppliers.php
├── supply-orders.php
├── quotations.php
├── purchase-orders.php
├── goods-receipts.php
└── supply.php (main routes file)
═══════════════════════════════════════════════════════════════════════════════
📁 config/
│
└── supply.php (Supply domain configuration)
═══════════════════════════════════════════════════════════════════════════════
📁 app/Providers/
│
└── SupplyDomainServiceProvider.php (Service registration & bootstrapping)
💡 Scroll horizontally to see the full structure on smaller screens
📊 Domain Statistics
7
Bounded Contexts (Subdomains)
100+
PHP Classes
50+
DTO Classes
7
Service Classes
7
API Controllers
50+
API Endpoints
15+
Database Tables
30+
Domain Events
🔀 Subdomains Overview
👤 Agents
Sales agent management
- Agent model
- 4 DTOs
- 1 Service
- Full HTTP layer
- 4 Domain events
- Repositories
🏪 Customers
Customer & location management
- Customer + Location models
- 5+ DTOs
- 2 Services
- Full HTTP layer
- 4+ Domain events
- Repositories
🏭 Suppliers
Supplier & contact management
- Supplier + Contact models
- 4+ DTOs
- 2 Services
- Full HTTP layer
- 3+ Domain events
- Repositories
📦 Supply Orders
Order & item management
- SupplyOrder + OrderItem models
- 4 DTOs
- 1 Service
- Full HTTP layer
- 4+ Domain events
- Repositories
💬 Quotations
Quote management
- Quotation + QuotationItem models
- 4 DTOs
- 1 Service
- Full HTTP layer
- 4+ Domain events
- Repositories
🛒 Purchase Orders
PO management
- PurchaseOrder + POItem models
- 4 DTOs
- 1 Service
- Full HTTP layer
- 3+ Domain events
- Repositories
📥 Goods Receipts
Receipt management
- GoodsReceipt + ReceiptItem models
- 4 DTOs
- 1 Service
- Full HTTP layer
- 3+ Domain events
- Repositories
🔗 Shared
Cross-domain utilities
- Shared DTOs
- Common traits
- Helper classes
- Enumerations
- Shared interfaces
📈 File Distribution
15+
Domain Models
50+
DTO Classes
7
Service Classes
7
Controllers
20+
Request Classes
20+
Resource Classes
30+
Domain Events
15+
Database Migrations
✨ Key Features
🏛️ DDD Architecture
Complete Domain-Driven Design implementation with bounded contexts
Complete Domain-Driven Design implementation with bounded contexts
📊 Type-Safe DTOs
50+ Data Transfer Objects for type-safe operations
50+ Data Transfer Objects for type-safe operations
⚙️ Service Layer
Comprehensive service classes handling business logic
Comprehensive service classes handling business logic
🔌 REST API
50+ RESTful endpoints with V1 versioning
50+ RESTful endpoints with V1 versioning
💾 Database
15+ migration files with relationships and indexes
15+ migration files with relationships and indexes
🎯 Domain Events
30+ events for cross-context communication
30+ events for cross-context communication
⚡ Configuration
Centralized supply domain configuration
Centralized supply domain configuration
🌐 Seeders
Database seeders with test data generation
Database seeders with test data generation