feat: complete equipment handover workflow

This commit is contained in:
2026-08-04 17:15:51 +01:00
parent 809eab9d4a
commit d829f34580
24 changed files with 1800 additions and 28 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Domain\Operations\Models;
use App\Domain\Operations\Enums\HandoverType;
use App\Domain\Reservations\Models\ReservationItem;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class HandoverRecord extends Model
{
public const UPDATED_AT = null;
protected $fillable = [
'reservation_item_id', 'type', 'operator_id', 'recipient_id',
'condition', 'notes', 'snipe_response', 'created_at',
];
protected function casts(): array
{
return [
'type' => HandoverType::class,
'snipe_response' => 'array',
'created_at' => 'immutable_datetime',
];
}
/** @return BelongsTo<ReservationItem, $this> */
public function reservationItem(): BelongsTo
{
return $this->belongsTo(ReservationItem::class);
}
/** @return BelongsTo<User, $this> */
public function operator(): BelongsTo
{
return $this->belongsTo(User::class, 'operator_id');
}
/** @return BelongsTo<User, $this> */
public function recipient(): BelongsTo
{
return $this->belongsTo(User::class, 'recipient_id');
}
}