Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| InvoiceUpdateService | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| update | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Domain\Invoice\Services; |
| 4 | |
| 5 | use App\Events\ServiceProcessed; |
| 6 | use App\Models\Invoice\Invoice; |
| 7 | use App\Models\User; |
| 8 | |
| 9 | readonly class InvoiceUpdateService |
| 10 | { |
| 11 | public function update(Invoice $invoice, ?string $observation, User $user): Invoice |
| 12 | { |
| 13 | $invoice->setAttribute('observation', $observation); |
| 14 | $invoice->save(); |
| 15 | |
| 16 | ServiceProcessed::dispatch(self::class, $user); |
| 17 | return $invoice; |
| 18 | } |
| 19 | } |