<?php

namespace App\Domain\Audit\Enums;

/** §65A activity categories, used for the timeline's quick filters. */
enum ActivityCategory: string
{
    case Profile = 'profile';
    case Status = 'status';
    case Assignment = 'assignment';
    case Document = 'document';
    case Payment = 'payment';
    case Invoice = 'invoice';
    case Commission = 'commission';
    case Processing = 'processing';
    case Task = 'task';
    case Communication = 'communication';
    case Note = 'note';
    case Accounting = 'accounting';
    case Payroll = 'payroll';
    case Recruitment = 'recruitment';
    case Security = 'security';
    case System = 'system';

    public function label(): string
    {
        return match ($this) {
            self::Profile => 'Profile',
            self::Status => 'Status',
            self::Assignment => 'Assignment',
            self::Document => 'Documents',
            self::Payment => 'Payments',
            self::Invoice => 'Invoices',
            self::Commission => 'Commission',
            self::Processing => 'Processing',
            self::Task => 'Tasks',
            self::Communication => 'Communication',
            self::Note => 'Notes',
            self::Accounting => 'Accounting',
            self::Payroll => 'Payroll',
            self::Recruitment => 'Recruitment',
            self::Security => 'Security',
            self::System => 'System',
        };
    }

    /** Categories only a privileged reader should see in a feed. */
    public function isSensitive(): bool
    {
        return in_array($this, [self::Security, self::Accounting, self::Payroll, self::Commission], true);
    }

    /** @return array<int, string> */
    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }
}
