Consolidate single-action controllers into resource controllers

Merge 11 single-action controllers into their parent resource controllers:
- Invoice: send, sendPreview, clone, changeStatus -> InvoicesController
- Estimate: send, sendPreview, clone, convertToInvoice, changeStatus -> EstimatesController
- Payment: send, sendPreview -> PaymentsController

Extract clone and convert business logic from controllers into services:
- InvoiceService: add clone(), changeStatus()
- EstimateService: add clone(), convertToInvoice(), changeStatus()

Previously this logic was inlined in controllers (~80-90 lines each).
This commit is contained in:
Darko Gjorgjijoski
2026-04-03 17:55:46 +02:00
parent f76f351244
commit 5f389ea3b0
18 changed files with 405 additions and 698 deletions

View File

@@ -1,7 +1,6 @@
<?php
use App\Http\Controllers\V1\Admin\Estimate\EstimatesController;
use App\Http\Controllers\V1\Admin\Estimate\SendEstimateController;
use App\Http\Requests\DeleteEstimatesRequest;
use App\Http\Requests\EstimatesRequest;
use App\Http\Requests\SendEstimatesRequest;
@@ -156,8 +155,8 @@ test('search estimates', function () {
test('send estimate using a form request', function () {
$this->assertActionUsesFormRequest(
SendEstimateController::class,
'__invoke',
EstimatesController::class,
'send',
SendEstimatesRequest::class
);
});