fix(invoices): require settlement before completion (#739)

This commit is contained in:
Darko Gjorgjijoski
2026-08-02 17:02:29 +02:00
committed by GitHub
parent 00c9c4268e
commit 1e72d9d449
7 changed files with 184 additions and 22 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Http\Requests;
use App\Models\Invoice;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ChangeInvoiceStatusRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'status' => [
'required',
Rule::in([
Invoice::STATUS_SENT,
Invoice::STATUS_COMPLETED,
]),
],
];
}
}