Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| StockIOFinishService | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| finish | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Domain\StockIO\Services; |
| 4 | |
| 5 | use App\Models\StockIO\StockIO; |
| 6 | use Carbon\Carbon; |
| 7 | use Domain\StockIO\Enums\StockStatusEnum; |
| 8 | |
| 9 | readonly class StockIOFinishService |
| 10 | { |
| 11 | public function finish(StockIO $stockIO): void |
| 12 | { |
| 13 | $stockIO->setAttribute('status', StockStatusEnum::SEPARATED->value); |
| 14 | $stockIO->setAttribute('end_date', Carbon::now()); |
| 15 | $stockIO->save(); |
| 16 | } |
| 17 | } |