feat: complete equipment handover workflow
This commit is contained in:
46
app/Domain/Operations/Models/HandoverRecord.php
Normal file
46
app/Domain/Operations/Models/HandoverRecord.php
Normal 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user