feat: add transactional approval workflow
This commit is contained in:
30
app/Domain/Approvals/Models/ApprovalAction.php
Normal file
30
app/Domain/Approvals/Models/ApprovalAction.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Approvals\Models;
|
||||
|
||||
use App\Domain\Reservations\Models\Reservation;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ApprovalAction extends Model
|
||||
{
|
||||
public const UPDATED_AT = null;
|
||||
|
||||
protected $fillable = [
|
||||
'reservation_id', 'actor_id', 'action', 'previous_status', 'new_status',
|
||||
'comment', 'created_at',
|
||||
];
|
||||
|
||||
/** @return BelongsTo<Reservation, $this> */
|
||||
public function reservation(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Reservation::class);
|
||||
}
|
||||
|
||||
/** @return BelongsTo<User, $this> */
|
||||
public function actor(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'actor_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user