<?php

namespace App\Enums;

enum SpecDocumentSectionType: string
{
    case INTRODUCTION = 'introduction';
    case COMPANY_INFORMATION = 'company-information';
    case LOCATIONS = 'locations';
    case DESIGN = 'design';
    case FEEDS = 'feeds';
    case INTEGRATIONS = 'integrations';
    case CONTENT = 'content';
    case USERS = 'users';
    case ENQUIRY_FORMS = 'enquiry-forms';
    case NOTES = 'notes';
    case DOMAINS = 'domains';
    case ADDITIONAL_INFORMATION = 'additional-information';
    case ASSUMPTIONS = 'assumptions';
    case SYSTEM_FEATURES = 'system-features';
    case CHANGE_CONTROL = 'change-control';
    case CUSTOM = 'custom';

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

    /**
     * Predefined section types seeded onto every new spec document, in document order.
     *
     * @return array<self>
     */
    public static function predefined(): array
    {
        return array_values(array_filter(self::cases(), fn (self $type) => $type !== self::CUSTOM));
    }

    public function label(): string
    {
        return match ($this) {
            self::INTRODUCTION => 'Introduction',
            self::COMPANY_INFORMATION => 'General Company Information',
            self::LOCATIONS => 'Franchises, Locations & Departments',
            self::DESIGN => 'Design',
            self::FEEDS => 'Feeds',
            self::INTEGRATIONS => 'Integrations',
            self::CONTENT => 'Content',
            self::USERS => 'Users',
            self::ENQUIRY_FORMS => 'Enquiry Forms',
            self::NOTES => 'Additional Notes & Custom Requirements',
            self::DOMAINS => 'Domain Requirements',
            self::ADDITIONAL_INFORMATION => 'Additional Information',
            self::ASSUMPTIONS => 'Assumptions and Dependencies',
            self::SYSTEM_FEATURES => 'System Features and Requirements',
            self::CHANGE_CONTROL => 'Change Control',
            self::CUSTOM => 'Custom Section',
        };
    }
}
