<?php

namespace App\Enums;

enum NotificationType: string
{
    // ── Job Matching ───────────────────────────────────────────
    case JobInterest   = 'job_interest';    // Employer sent interest to your CV
    case JobAccepted   = 'job_accepted';    // Professional accepted job notification
    case JobConnected  = 'job_connected';   // Contact details shared — both consented

    // ── Freelance ──────────────────────────────────────────────
    case FreelanceBrief     = 'freelance_brief';      // New brief matches your profile
    case FreelanceInterest  = 'freelance_interest';   // Seeker interested in your profile
    case FreelanceConnected = 'freelance_connected';  // Contact details shared

    // ── Forum ──────────────────────────────────────────────────
    case ForumReply = 'forum_reply';  // Someone replied to your post
    case ForumLike  = 'forum_like';   // Someone liked your post or reply

    // ── Content ───────────────────────────────────────────────
    case SurveyNew   = 'survey_new';    // A new survey is available
    case DocumentNew = 'document_new';  // A new document added to your hub

    // ── Reviews ───────────────────────────────────────────────
    case ReviewReceived = 'review_received';  // You received a new review

    // ── System ────────────────────────────────────────────────
    case System = 'system';  // General platform announcement

    public function label(): string
    {
        return match($this) {
            NotificationType::JobInterest        => 'Job Interest',
            NotificationType::JobAccepted        => 'Job Accepted',
            NotificationType::JobConnected       => 'Job Connected',
            NotificationType::FreelanceBrief     => 'New Brief',
            NotificationType::FreelanceInterest  => 'Freelance Interest',
            NotificationType::FreelanceConnected => 'Freelance Connected',
            NotificationType::ForumReply         => 'Forum Reply',
            NotificationType::ForumLike          => 'Forum Like',
            NotificationType::SurveyNew          => 'New Survey',
            NotificationType::DocumentNew        => 'New Document',
            NotificationType::ReviewReceived     => 'New Review',
            NotificationType::System             => 'System',
        };
    }

    // Icon name for the notification bell UI
    public function icon(): string
    {
        return match($this) {
            NotificationType::JobInterest,
            NotificationType::JobAccepted,
            NotificationType::JobConnected       => 'briefcase',
            NotificationType::FreelanceBrief,
            NotificationType::FreelanceInterest,
            NotificationType::FreelanceConnected => 'user-check',
            NotificationType::ForumReply         => 'message-circle',
            NotificationType::ForumLike          => 'heart',
            NotificationType::SurveyNew          => 'clipboard',
            NotificationType::DocumentNew        => 'file',
            NotificationType::ReviewReceived     => 'star',
            NotificationType::System             => 'bell',
        };
    }

    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }
}
