<?php

namespace App\Models;

use Database\Factories\AdsPlacementFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

/**
 * @property int $id
 * @property string $kode
 * @property string|null $keterangan
 * @property string|null $url
 */
class AdsPlacement extends Model
{
    /** @use HasFactory<AdsPlacementFactory> */
    use HasFactory;

    protected $fillable = ['kode', 'keterangan', 'url'];

    /**
     * Kode placement default bila tidak dikenali (FR-PLACE-03).
     */
    public const DEFAULT_KODE = 'UNKNOWN';

    public const DEFAULT_ID = 1;

    public function adsHistories(): HasMany
    {
        return $this->hasMany(AdsHistory::class);
    }
}
