<?php

namespace App\Enum\Contact;

enum RecipientValidity: string
{
    case VALID = 'valid';
    case MISSING = 'missing';
    case INVALID = 'invalid';
    case SUPPRESSED = 'suppressed';

    public function label(): string
    {
        return match ($this) {
            self::VALID => 'Valid',
            self::MISSING => 'Missing',
            self::INVALID => 'Invalid',
            self::SUPPRESSED => 'Opted out',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::VALID => 'success',
            self::MISSING => 'warning',
            self::INVALID => 'danger',
            self::SUPPRESSED => 'dark',
        };
    }

    public function icon(): string
    {
        return match ($this) {
            self::VALID => 'mdi mdi-check-circle',
            self::MISSING => 'mdi mdi-alert-circle-outline',
            self::INVALID => 'mdi mdi-close-circle',
            self::SUPPRESSED => 'mdi mdi-cancel',
        };
    }

    public function canSend(): bool
    {
        return $this === self::VALID;
    }
}
