<?php

namespace Database\Seeders;

use App\Models\MembershipCategory;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;

/**
 * MembershipCategorySeeder
 *
 * Seeds the seven official SSHIA membership categories as defined in the
 * SSHIA constitution. Uses updateOrCreate keyed on slug for idempotency.
 */
class MembershipCategorySeeder extends Seeder
{
    public function run(): void
    {
        $categories = [
            [
                'name'        => 'Founder Members',
                'slug'        => 'founder-members',
                'description' => 'Founder Members are those who originally established this Organization and declared establishment of this ASSOCIATION.',
                'benefits'    => [
                    'Founding recognition and lifetime honorary status',
                    'Voting rights on all constitutional matters',
                    'Authority to nominate Honorary Members on merit',
                    'Permanent seat on the founding council',
                    'Access to all SSHIA programmes and resources',
                ],
                'theme_color' => '#7c3aed',
                'icon'        => 'fa-crown',
                'sort_order'  => 1,
                'is_active'   => true,
            ],
            [
                'name'        => 'Ordinary Members',
                'slug'        => 'ordinary-members',
                'description' => 'Ordinary Membership shall be opened to any South Sudanese Health and Informatics experts with age not below 18 years and who shown willingness and ability to spearhead the objectives and vision of SSHIA.',
                'benefits'    => [
                    'Full voting rights in general assemblies',
                    'Eligibility to hold elected office',
                    'Access to all SSHIA training and mentorship programmes',
                    'Access to knowledge base and research publications',
                    'Networking with health and informatics professionals',
                    'Membership certificate and digital ID',
                ],
                'theme_color' => '#16a34a',
                'icon'        => 'fa-user-check',
                'sort_order'  => 2,
                'is_active'   => true,
            ],
            [
                'name'        => 'Associate Members',
                'slug'        => 'associate-members',
                'description' => 'Associate Membership shall be opened to any non-South Sudanese Health and Informatics Experts with age not below 18 years and who show willingness and ability to spearhead the objectives and vision of SSHIA.',
                'benefits'    => [
                    'Participation in SSHIA events and conferences',
                    'Access to knowledge base and publications',
                    'Networking with South Sudanese health professionals',
                    'Collaboration on research and advocacy initiatives',
                    'Membership certificate and digital ID',
                ],
                'theme_color' => '#0284c7',
                'icon'        => 'fa-user-friends',
                'sort_order'  => 3,
                'is_active'   => true,
            ],
            [
                'name'        => 'Honorary Members',
                'slug'        => 'honorary-members',
                'description' => 'Honorary Membership shall be given to a person nominated by the Founder Members to be Honorary Member on Merit. These are individuals who have demonstrated exceptional merit in furthering the aims and interests of SSHIA.',
                'benefits'    => [
                    'Recognition for exceptional contribution to health informatics',
                    'Invitation to all SSHIA high-level events',
                    'Advisory role in SSHIA strategic initiatives',
                    'Lifetime honorary membership status',
                    'Featured profile in SSHIA publications',
                ],
                'theme_color' => '#d97706',
                'icon'        => 'fa-award',
                'sort_order'  => 4,
                'is_active'   => true,
            ],
            [
                'name'        => 'Institutional Members',
                'slug'        => 'institutional-members',
                'description' => 'There are two categories: corporate and academic members. Corporate members include vendor, consulting, and technology firms as well as national professional organizations. Academic members include universities, medical centres, research centres and like institutions.',
                'benefits'    => [
                    'Institutional recognition and branding in SSHIA materials',
                    'Corporate: vendor, consulting, and technology firm membership',
                    'Academic: universities, medical centres, and research institutions',
                    'Participation in SSHIA policy and advocacy forums',
                    'Access to SSHIA talent pool and professional network',
                    'Co-branding opportunities on joint publications and events',
                ],
                'theme_color' => '#0f766e',
                'icon'        => 'fa-building',
                'sort_order'  => 5,
                'is_active'   => true,
            ],
            [
                'name'        => 'Graduate Members',
                'slug'        => 'graduate-members',
                'description' => 'Graduate Members will be mentored and transformed to Ordinary Members for potential growth of health and health informatics professionals.',
                'benefits'    => [
                    'Structured mentorship pathway to Ordinary Membership',
                    'Access to SSHIA training and capacity-building programmes',
                    'Guidance from experienced health informatics professionals',
                    'Participation in SSHIA student and graduate forums',
                    'Career development resources and job placement support',
                    'Reduced membership fees during graduate transition period',
                ],
                'theme_color' => '#2563eb',
                'icon'        => 'fa-user-graduate',
                'sort_order'  => 6,
                'is_active'   => true,
            ],
            [
                'name'        => 'Affiliate Members',
                'slug'        => 'affiliate-members',
                'description' => 'Affiliate Members are international organizations that share an interest in the broad field of health and health informatics.',
                'benefits'    => [
                    'International partnership and collaboration opportunities',
                    'Access to SSHIA research and knowledge-sharing platforms',
                    'Joint advocacy and policy engagement',
                    'Participation in SSHIA international conferences and events',
                    'Cross-organizational networking and resource sharing',
                ],
                'theme_color' => '#be185d',
                'icon'        => 'fa-globe',
                'sort_order'  => 7,
                'is_active'   => true,
            ],
        ];

        foreach ($categories as $data) {
            MembershipCategory::updateOrCreate(
                ['slug' => $data['slug']],
                $data
            );
        }
    }
}
