<?php

namespace App\Enums;

/**
 * Status campaign/iklan (RPD BR-03).
 */
enum CampaignStatus: int
{
    case Pending = 0;
    case Aktif = 1;
    case Batal = 2;
    case Selesai = 3;
    case Draft = 4;

    public function label(): string
    {
        return match ($this) {
            self::Pending => 'Menunggu Approve',
            self::Aktif => 'Aktif',
            self::Batal => 'Batal',
            self::Selesai => 'Selesai',
            self::Draft => 'Draft',
        };
    }

    /**
     * Apakah status masih bisa diubah/dibatalkan oleh member?
     */
    public function isPending(): bool
    {
        return $this === self::Pending;
    }

    /**
     * Apakah status Draft (disimpan, tidak tayang, credit terkunci)?
     */
    public function isDraft(): bool
    {
        return $this === self::Draft;
    }
}
