2025-12-31 01:56:50 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use App\Models\Traits\HasAmount;
|
|
|
|
|
use App\Models\Traits\HasProjectionStatus;
|
2026-03-19 20:34:47 +01:00
|
|
|
use App\Models\Traits\HasUuid;
|
2025-12-31 01:56:50 +01:00
|
|
|
use Carbon\Carbon;
|
|
|
|
|
use Database\Factories\DrawFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
|
|
|
|
/**
|
2026-03-19 20:34:47 +01:00
|
|
|
* @property string $uuid
|
2025-12-31 01:56:50 +01:00
|
|
|
* @property Bucket $bucket
|
|
|
|
|
* @property int $priority_order
|
|
|
|
|
* @property float $amount
|
|
|
|
|
* @property Carbon $date
|
|
|
|
|
* @property string $description
|
|
|
|
|
* @property bool $is_projected
|
2026-03-19 01:09:47 +01:00
|
|
|
*
|
2025-12-31 02:34:30 +01:00
|
|
|
* @method static create(array $array)
|
2025-12-31 01:56:50 +01:00
|
|
|
*/
|
|
|
|
|
class Draw extends Model
|
|
|
|
|
{
|
2026-03-19 01:09:47 +01:00
|
|
|
use HasAmount;
|
|
|
|
|
|
2025-12-31 01:56:50 +01:00
|
|
|
/** @use HasFactory<DrawFactory> */
|
|
|
|
|
use HasFactory;
|
2026-03-30 00:00:54 +02:00
|
|
|
|
2025-12-31 01:56:50 +01:00
|
|
|
use HasProjectionStatus;
|
2026-03-19 20:34:47 +01:00
|
|
|
use HasUuid;
|
2025-12-31 01:56:50 +01:00
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'bucket_id',
|
|
|
|
|
'amount',
|
|
|
|
|
'date',
|
|
|
|
|
'description',
|
|
|
|
|
'is_projected',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'amount' => 'integer',
|
|
|
|
|
'date' => 'date',
|
|
|
|
|
'is_projected' => 'boolean',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function bucket(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Bucket::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function scenario(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->bucket->scenario();
|
|
|
|
|
}
|
|
|
|
|
}
|