# Folder Structure Reorganization - File Mapping

This document maps all files that were moved during the folder structure reorganization. All logic and behavior remains unchanged - only file locations and namespaces were updated.

## Date: 2025-01-XX

## Summary
Reorganized project structure to group files by feature/page while maintaining all existing functionality. Filament Resources, Pages, and Widgets remain in their standard locations per Filament conventions. Controllers and Livewire components were reorganized by feature.

---

## Controllers Reorganization

### Dashboard Feature
| Old Location | New Location | Namespace Change |
|-------------|-------------|------------------|
| `app/Http/Controllers/DashboardExportController.php` | `app/Http/Controllers/Dashboard/DashboardExportController.php` | `App\Http\Controllers` → `App\Http\Controllers\Dashboard` |
| `app/Http/Controllers/SavedDashboardController.php` | `app/Http/Controllers/Dashboard/SavedDashboardController.php` | `App\Http\Controllers` → `App\Http\Controllers\Dashboard` |

### Customer Feature
| Old Location | New Location | Namespace Change |
|-------------|-------------|------------------|
| `app/Http/Controllers/UserAdminActionController.php` | `app/Http/Controllers/Customer/UserAdminActionController.php` | `App\Http\Controllers` → `App\Http\Controllers\Customer` |
| `app/Http/Controllers/UserExportController.php` | `app/Http/Controllers/Customer/UserExportController.php` | `App\Http\Controllers` → `App\Http\Controllers\Customer` |

### BackOffice Feature
| Old Location | New Location | Namespace Change |
|-------------|-------------|------------------|
| `app/Http/Controllers/EmailTemplateController.php` | `app/Http/Controllers/BackOffice/EmailTemplateController.php` | `App\Http\Controllers` → `App\Http\Controllers\BackOffice` |

### Tax Feature
| Old Location | New Location | Namespace Change |
|-------------|-------------|------------------|
| `app/Http/Controllers/TaxAdministrationController.php` | `app/Http/Controllers/Tax/TaxAdministrationController.php` | `App\Http\Controllers` → `App\Http\Controllers\Tax` |
| `app/Http/Controllers/TaxRegionController.php` | `app/Http/Controllers/Tax/TaxRegionController.php` | `App\Http\Controllers` → `App\Http\Controllers\Tax` |
| `app/Http/Controllers/BusinessUnitController.php` | `app/Http/Controllers/Tax/BusinessUnitController.php` | `App\Http\Controllers` → `App\Http\Controllers\Tax` |

### Ticket Feature
| Old Location | New Location | Namespace Change |
|-------------|-------------|------------------|
| `app/Http/Controllers/TicketExportController.php` | `app/Http/Controllers/Ticket/TicketExportController.php` | `App\Http\Controllers` → `App\Http\Controllers\Ticket` |

### Invoice Feature
| Old Location | New Location | Namespace Change |
|-------------|-------------|------------------|
| `app/Http/Controllers/InvoiceController.php` | `app/Http/Controllers/Invoice/InvoiceController.php` | `App\Http\Controllers` → `App\Http\Controllers\Invoice` |

### Analytics Feature
| Old Location | New Location | Namespace Change |
|-------------|-------------|------------------|
| `app/Http/Controllers/SegmentBuilderController.php` | `app/Http/Controllers/Analytics/SegmentBuilderController.php` | `App\Http\Controllers` → `App\Http\Controllers\Analytics` |

---

## Livewire Components Reorganization

### Ticket Feature
| Old Location | New Location | Namespace Change |
|-------------|-------------|------------------|
| `app/Livewire/TicketCategoryDropdown.php` | `app/Livewire/Ticket/TicketCategoryDropdown.php` | `App\Livewire` → `App\Livewire\Ticket` |

**Note:** Other Livewire components were already organized by feature:
- `app/Livewire/BackOffice/` - Already organized
- `app/Livewire/Tax/` - Already organized  
- `app/Livewire/Ticket/` - Already organized (except TicketCategoryDropdown which was moved)

---

## Files Updated (References)

### Routes
- `routes/web.php` - Updated all controller references to use new namespaces

### Filament Pages
- `app/Filament/Pages/AnalyticsAndAdmin/SystemAdmin.php` - Updated BusinessUnitController reference

### Livewire Components
- `app/Livewire/Tax/EditBuMapping.php` - Updated TaxAdministrationController reference

---

## Unchanged Structure

The following remain in their standard locations per framework conventions:

### Filament Resources
- `app/Filament/Resources/` - All resources remain here (Filament convention)

### Filament Pages
- `app/Filament/Pages/` - All pages remain here (Filament convention)

### Filament Widgets
- `app/Filament/Widgets/` - All widgets remain here (Filament convention)

### Views
- `resources/views/` - Views remain in their current structure (Filament convention)

### Models
- `app/Models/` - All models remain here (Laravel convention)

### Services
- `app/Services/` - All services remain here

---

## Verification Steps

1. ✅ All controller namespaces updated
2. ✅ All route references updated
3. ✅ All use statements updated
4. ✅ Composer autoload regenerated
5. ✅ No logic changes made

---

## Rollback Instructions

To rollback this reorganization:

1. Move all controllers back to `app/Http/Controllers/` root
2. Update namespaces back to `App\Http\Controllers`
3. Update routes/web.php to use old namespaces
4. Move TicketCategoryDropdown back to `app/Livewire/`
5. Update TicketCategoryDropdown namespace back to `App\Livewire`
6. Update references in SystemAdmin.php and EditBuMapping.php
7. Run `composer dump-autoload`

---

## Notes

- All class names remain unchanged
- All public APIs remain unchanged
- All route URIs remain unchanged
- All database logic remains unchanged
- No business logic was modified
- Only file organization and namespaces were updated

