<?php

namespace Database\Seeders;

use App\Models\User\Permission;
use Illuminate\Database\Seeder;

class PermissionSeeder extends Seeder
{
    public function run(): void
    {
        $permissions = [

            /*
            |--------------------------------------------------------------------------
            | USERS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'users.view',
                'group'       => 'Users',
                'label'       => 'View users',
                'description' => 'View user lists and individual user profiles',
            ],
            [
                'name'        => 'users.create',
                'group'       => 'Users',
                'label'       => 'Create users',
                'description' => 'Create new user accounts',
            ],
            [
                'name'        => 'users.update',
                'group'       => 'Users',
                'label'       => 'Edit users',
                'description' => 'Edit existing user details and status',
            ],
            [
                'name'        => 'users.delete',
                'group'       => 'Users',
                'label'       => 'Delete users',
                'description' => 'Permanently delete user accounts',
            ],
            [
                'name'        => 'users.impersonate',
                'group'       => 'Users',
                'label'       => 'Impersonate users',
                'description' => 'Log in as another user for support or troubleshooting',
            ],
            [
                'name'        => 'users.sessions.manage',
                'group'       => 'Users',
                'label'       => 'Manage user sessions',
                'description' => 'Revoke active sessions and log users out of devices',
            ],
            [
                'name'        => 'users.api-keys.manage',
                'group'       => 'Users',
                'label'       => 'Manage API keys',
                'description' => 'Create and revoke API tokens for users',
            ],

            /*
            |--------------------------------------------------------------------------
            | ROLES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'roles.view',
                'group'       => 'Roles',
                'label'       => 'View roles',
                'description' => 'View roles and their assigned permissions',
            ],
            [
                'name'        => 'roles.create',
                'group'       => 'Roles',
                'label'       => 'Create roles',
                'description' => 'Create new roles',
            ],
            [
                'name'        => 'roles.update',
                'group'       => 'Roles',
                'label'       => 'Edit roles',
                'description' => 'Edit role names and permissions',
            ],
            [
                'name'        => 'roles.delete',
                'group'       => 'Roles',
                'label'       => 'Delete roles',
                'description' => 'Delete non-system roles',
            ],

            /*
            |--------------------------------------------------------------------------
            | PERMISSIONS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'permissions.view',
                'group'       => 'Permissions',
                'label'       => 'View permissions',
                'description' => 'View system permissions and their usage',
            ],
            [
                'name'        => 'permissions.create',
                'group'       => 'Permissions',
                'label'       => 'Create permissions',
                'description' => 'Create new permissions',
            ],
            [
                'name'        => 'permissions.edit',
                'group'       => 'Permissions',
                'label'       => 'Edit permission descriptions',
                'description' => 'Edit permission descriptions',
            ],
            /*
            |--------------------------------------------------------------------------
            | TRANCHES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'tranches.view',
                'group'       => 'Tranches',
                'label'       => 'View tranches',
                'description' => 'View tranche lists and details',
            ],
            [
                'name'        => 'tranches.create',
                'group'       => 'Tranches',
                'label'       => 'Create tranches',
                'description' => 'Create new tranches',
            ],
            [
                'name'        => 'tranches.edit',
                'group'       => 'Tranches',
                'label'       => 'Edit tranches',
                'description' => 'Edit existing tranches',
            ],
            [
                'name'        => 'tranches.delete',
                'group'       => 'Tranches',
                'label'       => 'Delete tranches',
                'description' => 'Delete tranches',
            ],

            /*
            |--------------------------------------------------------------------------
            | CLIENTS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'clients.view',
                'group'       => 'Clients',
                'label'       => 'View clients',
                'description' => 'View client lists and profiles',
            ],
            [
                'name'        => 'clients.create',
                'group'       => 'Clients',
                'label'       => 'Create clients',
                'description' => 'Create new clients',
            ],
            [
                'name'        => 'clients.edit',
                'group'       => 'Clients',
                'label'       => 'Edit clients',
                'description' => 'Edit existing client details',
            ],
            [
                'name'        => 'clients.delete',
                'group'       => 'Clients',
                'label'       => 'Delete clients',
                'description' => 'Delete clients from the system',
            ],

            /*
            |--------------------------------------------------------------------------
            | CLAIMS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'claims.view',
                'group'       => 'Claims',
                'label'       => 'View claims',
                'description' => 'View claim lists and details',
            ],
            [
                'name'        => 'claims.create',
                'group'       => 'Claims',
                'label'       => 'Create claims',
                'description' => 'Register new claims',
            ],
            [
                'name'        => 'claims.edit',
                'group'       => 'Claims',
                'label'       => 'Edit claims',
                'description' => 'Update claim information',
            ],
            [
                'name'        => 'claims.delete',
                'group'       => 'Claims',
                'label'       => 'Delete claims',
                'description' => 'Delete claims',
            ],

            /*
            |--------------------------------------------------------------------------
            | INSTITUTIONS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'institutions.view',
                'group'       => 'Institutions',
                'label'       => 'View institutions',
                'description' => 'View institution lists and details',
            ],
            [
                'name'        => 'institutions.create',
                'group'       => 'Institutions',
                'label'       => 'Create institutions',
                'description' => 'Add new institutions',
            ],
            [
                'name'        => 'institutions.edit',
                'group'       => 'Institutions',
                'label'       => 'Edit institutions',
                'description' => 'Edit existing institutions',
            ],
            [
                'name'        => 'institutions.delete',
                'group'       => 'Institutions',
                'label'       => 'Delete institutions',
                'description' => 'Delete institutions',
            ],

            /*
            |--------------------------------------------------------------------------
            | INSTITUTION CONTACTS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'institutions.contacts.view',
                'group'       => 'Institution Contacts',
                'label'       => 'View contacts',
                'description' => 'View contacts associated with institutions',
            ],
            [
                'name'        => 'institutions.contacts.create',
                'group'       => 'Institution Contacts',
                'label'       => 'Create contacts',
                'description' => 'Create new institution contacts',
            ],
            [
                'name'        => 'institutions.contacts.edit',
                'group'       => 'Institution Contacts',
                'label'       => 'Edit contacts',
                'description' => 'Edit existing institution contacts',
            ],
            [
                'name'        => 'institutions.contacts.delete',
                'group'       => 'Institution Contacts',
                'label'       => 'Delete contacts',
                'description' => 'Delete institution contacts',
            ],

            /*
            |--------------------------------------------------------------------------
            | INSTITUTION ADDRESSES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'institutions.addresses.view',
                'group'       => 'Institution Addresses',
                'label'       => 'View addresses',
                'description' => 'View addresses associated with institutions',
            ],
            [
                'name'        => 'institutions.addresses.create',
                'group'       => 'Institution Addresses',
                'label'       => 'Create addresses',
                'description' => 'Create new institution addresses',
            ],
            [
                'name'        => 'institutions.addresses.edit',
                'group'       => 'Institution Addresses',
                'label'       => 'Edit addresses',
                'description' => 'Edit existing institution addresses',
            ],
            [
                'name'        => 'institutions.addresses.delete',
                'group'       => 'Institution Addresses',
                'label'       => 'Delete addresses',
                'description' => 'Delete institution addresses',
            ],

            /*
            |--------------------------------------------------------------------------
            | INSTITUTION LINKS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'institutions.links.create',
                'group'       => 'Institution Links',
                'label'       => 'Create links',
                'description' => 'Link institutions together or to other entities',
            ],
            [
                'name'        => 'institutions.links.delete',
                'group'       => 'Institution Links',
                'label'       => 'Delete links',
                'description' => 'Remove links between institutions or entities',
            ],

            /*
            |--------------------------------------------------------------------------
            | CLAIM INSTITUTIONS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'claims.institutions.view',
                'group'       => 'Claim Institutions',
                'label'       => 'View claim institution history',
                'description' => 'View institutions linked to a claim with record types and dates',
            ],
            [
                'name'        => 'claims.institutions.create',
                'group'       => 'Claim Institutions',
                'label'       => 'Link institution to claim',
                'description' => 'Add an institution to a claim with a record type and dates',
            ],
            [
                'name'        => 'claims.institutions.delete',
                'group'       => 'Claim Institutions',
                'label'       => 'Remove institution from claim',
                'description' => 'Unlink an institution record from a claim',
            ],

            /*
            |--------------------------------------------------------------------------
            | INSTITUTION RECORD TYPES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'institution-record-types.view',
                'group'       => 'Institution Record Types',
                'label'       => 'View institution record types',
                'description' => 'View the list of institution record types',
            ],
            [
                'name'        => 'institution-record-types.create',
                'group'       => 'Institution Record Types',
                'label'       => 'Create institution record types',
                'description' => 'Add new institution record types',
            ],
            [
                'name'        => 'institution-record-types.edit',
                'group'       => 'Institution Record Types',
                'label'       => 'Edit institution record types',
                'description' => 'Edit existing institution record types',
            ],
            [
                'name'        => 'institution-record-types.delete',
                'group'       => 'Institution Record Types',
                'label'       => 'Delete institution record types',
                'description' => 'Delete institution record types',
            ],

            /*
            |--------------------------------------------------------------------------
            | LEAD SOURCES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'sources.view',
                'group'       => 'Lead Sources',
                'label'       => 'View lead sources',
                'description' => 'View lead source lists',
            ],
            [
                'name'        => 'sources.create',
                'group'       => 'Lead Sources',
                'label'       => 'Create lead sources',
                'description' => 'Add new lead sources',
            ],
            [
                'name'        => 'sources.edit',
                'group'       => 'Lead Sources',
                'label'       => 'Edit lead sources',
                'description' => 'Edit existing lead sources',
            ],
            [
                'name'        => 'sources.delete',
                'group'       => 'Lead Sources',
                'label'       => 'Delete lead sources',
                'description' => 'Delete lead sources',
            ],

            /*
            |--------------------------------------------------------------------------
            | LEAD SOURCE ENDPOINTS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'sources.endpoints.view',
                'group'       => 'Lead Source Endpoints',
                'label'       => 'View lead source endpoints',
                'description' => 'View lead source endpoint lists',
            ],
            [
                'name'        => 'sources.endpoints.create',
                'group'       => 'Lead Source Endpoints',
                'label'       => 'Create lead source endpoints',
                'description' => 'Add new lead source endpoints',
            ],
            [
                'name'        => 'sources.endpoints.edit',
                'group'       => 'Lead Source Endpoints',
                'label'       => 'Edit lead source endpoints',
                'description' => 'Edit existing lead source endpoints',
            ],
            [
                'name'        => 'sources.endpoints.delete',
                'group'       => 'Lead Source Endpoints',
                'label'       => 'Delete lead source endpoints',
                'description' => 'Delete lead source endpoints',
            ],

            /*
            |--------------------------------------------------------------------------
            | REPORTS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'reports.view',
                'group'       => 'Reports',
                'label'       => 'View reports',
                'description' => 'View any report',
            ],
            [
                'name'        => 'reports.tranches.view',
                'group'       => 'Reports',
                'label'       => 'View tranche report',
                'description' => 'View the summary report for tranches',
            ],
            [
                'name'        => 'reports.tranches.details',
                'group'       => 'Reports',
                'label'       => 'View tranche report details',
                'description' => 'View detailed breakdown within the tranche report',
            ],
            [
                'name'        => 'reports.tranches.export',
                'group'       => 'Reports',
                'label'       => 'Export tranche report',
                'description' => 'Export tranche report data to external formats',
            ],



            [
                'name'        => 'sources.endpoints.toggle',
                'group'       => 'Lead Source Endpoints',
                'label'       => 'Toggle source endpoints',
                'description' => 'Enable or disable specific source endpoints',
            ],
            [
                'name'        => 'sources.toggle',
                'group'       => 'Lead Sources',
                'label'       => 'Toggle sources',
                'description' => 'Enable or disable lead sources',
            ],
            [
                'name'        => 'sources.view.single',
                'group'       => 'Lead Sources',
                'label'       => 'View single source',
                'description' => 'View detailed information for a specific source',
            ],
            [
                'name'        => 'reports.status',
                'group'       => 'Reports',
                'label'       => 'View status report',
                'description' => 'Access the status report',
            ],
            [
                'name'        => 'reports.status.days',
                'group'       => 'Reports',
                'label'       => 'View report daily status',
                'description' => 'View days in status report',
            ],
            [
                'name'        => 'reports.status.claims',
                'group'       => 'Reports',
                'label'       => 'View status report claims',
                'description' => 'View claims in status report',
            ],
            [
                'name'        => 'reports.status.days.claims',
                'group'       => 'Reports',
                'label'       => 'View days in status report claims',
                'description' => 'View claims in days in status report',
            ],
            [
                'name'        => 'dashboard.view',
                'group'       => 'Dashboard',
                'label'       => 'View dashboard',
                'description' => 'Access the main dashboard overview',
            ],
            [
                'name'        => 'users.roles.manage',
                'group'       => 'Users',
                'label'       => 'Manage user roles',
                'description' => 'Assign and remove roles from users',
            ],
            [
                'name'        => 'users.status.toggle',
                'group'       => 'Users',
                'label'       => 'Toggle user status',
                'description' => 'Enable or disable user accounts',
            ],
            [
                'name'        => 'users.view.single',
                'group'       => 'Users',
                'label'       => 'View single user',
                'description' => 'View detailed information for a specific user profile',
            ],
            [
                'name'        => 'users.profile.manage',
                'group'       => 'Users',
                'label'       => 'Manage user profiles',
                'description' => 'Edit and update user profile information',
            ],
            [
                'name'        => 'institutions.view.single',
                'group'       => 'Institutions',
                'label'       => 'View single institution',
                'description' => 'View details for a specific institution',
            ],
            [
                'name'        => 'claims.application.generate',
                'group'       => 'Claims',
                'label'       => 'Generate claim applications',
                'description' => 'Create and generate application documents for claims',
            ],
            [
                'name'        => 'claims.request.send',
                'group'       => 'Claims',
                'label'       => 'Send claim requests',
                'description' => 'Submit an esign request for the claim',
            ],
            [
                'name'        => 'dsars.view',
                'group'       => 'DSARs',
                'label'       => 'View DSARs',
                'description' => 'View Data Subject Access Request lists and details',
            ],
            [
                'name'        => 'dsars.types.view',
                'group'       => 'DSARs',
                'label'       => 'View DSAR types',
                'description' => 'View the different categories and types of DSAR configurations',
            ],
            [
                'name'        => 'dsars.types.create',
                'group'       => 'DSARs',
                'label'       => 'Create DSAR types',
                'description' => 'Create new DSAR type configurations',
            ],
            [
                'name'        => 'dsars.types.edit',
                'group'       => 'DSARs',
                'label'       => 'Edit DSAR types',
                'description' => 'Edit existing DSAR type configurations',
            ],
            [
                'name'        => 'dsars.types.delete',
                'group'       => 'DSARs',
                'label'       => 'Delete DSAR types',
                'description' => 'Delete DSAR type configurations',
            ],
            [
                'name'        => 'dsars.responses.log',
                'group'       => 'DSARs',
                'label'       => 'Log DSAR responses',
                'description' => 'Log a response received against a DSAR',
            ],
            [
                'name'        => 'dsars.tranche.view',
                'group'       => 'DSARs',
                'label'       => 'View DSAR tranche',
                'description' => 'View a DSAR tranche and its associated requests',
            ],
            [
                'name'        => 'dsars.batch.send',
                'group'       => 'DSARs',
                'label'       => 'Send DSAR batch',
                'description' => 'Send an approved batch of DSARs in a tranche',
            ],
            [
                'name'        => 'dsars.report',
                'group'       => 'DSARs',
                'label'       => 'View DSAR report',
                'description' => 'View the DSAR activity report',
            ],

            [
                'name'        => 'notes.view',
                'group'       => 'Notes',
                'label'       => 'View notes',
                'description' => 'View lists and individual content of system notes',
            ],
            [
                'name'        => 'notes.create',
                'group'       => 'Notes',
                'label'       => 'Create notes',
                'description' => 'Create and attach new notes to records',
            ],
            [
                'name'        => 'notes.delete',
                'group'       => 'Notes',
                'label'       => 'Delete notes',
                'description' => 'Remove notes from the system',
            ],

            [
                'name'        => 'notes.primary.delete',
                'group'       => 'Clients',
                'label'       => 'Delete key info',
                'description' => 'Remove key info from a client',
            ],
            [
                'name'        => 'tasks.admin',
                'group'       => 'Task Manager',
                'label'       => 'View task hub',
                'description' => 'Have an admin view over everyones tasks',
            ],
            [
                'name'        => 'clients.tranche.view',
                'group'       => 'Clients',
                'label'       => 'View Client Tranche',
                'description' => 'View the client tranche on listing pages',
            ],
            [
                'name'        => 'users.history.view',
                'group'       => 'Users',
                'label'       => 'View User Log',
                'description' => 'View history tab on a user profile'
            ],

            /*
            |--------------------------------------------------------------------------
            | WORKSPACES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'workspaces.override',
                'group'       => 'Workspaces',
                'label'       => 'Override workspace whitelist',
                'description' => 'Grants access to all workspaces regardless of the per-user workspace whitelist',
            ],

            [
                'name'        => 'monitoring.view',
                'group'       => 'Monitoring',
                'label'       => 'View Monitoring',
                'description' => 'View monitoring tab'
            ],

            /*
            |--------------------------------------------------------------------------
            | CLIENT RELATIONS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'clients.relations.view',
                'group'       => 'Clients',
                'label'       => 'View client relations',
                'description' => 'View connections and relations between clients',
            ],
            [
                'name'        => 'clients.relations.create',
                'group'       => 'Clients',
                'label'       => 'Create client relations',
                'description' => 'Create new relations between clients',
            ],
            [
                'name'        => 'clients.relations.edit',
                'group'       => 'Clients',
                'label'       => 'Edit client relations',
                'description' => 'Edit existing client relations',
            ],
            [
                'name'        => 'clients.relations.delete',
                'group'       => 'Clients',
                'label'       => 'Delete client relations',
                'description' => 'Delete client relations',
            ],

            /*
            |--------------------------------------------------------------------------
            | INSTITUTION MERGE
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'institutions.merge',
                'group'       => 'Institutions',
                'label'       => 'Merge institutions',
                'description' => 'Merge two institution records into one',
            ],

            /*
            |--------------------------------------------------------------------------
            | SOLICITORS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'solicitors.view',
                'group'       => 'Solicitors',
                'label'       => 'View solicitors',
                'description' => 'View solicitor lists and profiles',
            ],
            [
                'name'        => 'solicitors.create',
                'group'       => 'Solicitors',
                'label'       => 'Create solicitors',
                'description' => 'Create new solicitor records',
            ],
            [
                'name'        => 'solicitors.edit',
                'group'       => 'Solicitors',
                'label'       => 'Edit solicitors',
                'description' => 'Edit existing solicitor details',
            ],
            [
                'name'        => 'solicitors.delete',
                'group'       => 'Solicitors',
                'label'       => 'Delete solicitors',
                'description' => 'Delete solicitor records',
            ],

            /*
            |--------------------------------------------------------------------------
            | TEMPLATES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'templates.view',
                'group'       => 'Templates',
                'label'       => 'View templates',
                'description' => 'View template lists',
            ],
            [
                'name'        => 'templates.create',
                'group'       => 'Templates',
                'label'       => 'Create templates',
                'description' => 'Create new templates',
            ],
            [
                'name'        => 'templates.edit',
                'group'       => 'Templates',
                'label'       => 'Edit templates',
                'description' => 'Edit existing templates',
            ],
            [
                'name'        => 'templates.delete',
                'group'       => 'Templates',
                'label'       => 'Delete templates',
                'description' => 'Delete templates',
            ],

            /*
            |--------------------------------------------------------------------------
            | DOCUMENT TYPES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'doc-types.view',
                'group'       => 'Document Types',
                'label'       => 'View document types',
                'description' => 'View document type definitions',
            ],
            [
                'name'        => 'doc-types.create',
                'group'       => 'Document Types',
                'label'       => 'Create document types',
                'description' => 'Create new document type definitions',
            ],
            [
                'name'        => 'doc-types.edit',
                'group'       => 'Document Types',
                'label'       => 'Edit document types',
                'description' => 'Edit existing document type definitions',
            ],
            [
                'name'        => 'doc-types.delete',
                'group'       => 'Document Types',
                'label'       => 'Delete document types',
                'description' => 'Delete document type definitions',
            ],

            /*
            |--------------------------------------------------------------------------
            | KEY DATES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'key-dates.view',
                'group'       => 'Key Dates',
                'label'       => 'View key date definitions',
                'description' => 'View key date type definitions',
            ],
            [
                'name'        => 'key-dates.create',
                'group'       => 'Key Dates',
                'label'       => 'Create key date definitions',
                'description' => 'Create new key date type definitions',
            ],
            [
                'name'        => 'key-dates.edit',
                'group'       => 'Key Dates',
                'label'       => 'Edit key date definitions',
                'description' => 'Edit existing key date type definitions',
            ],
            [
                'name'        => 'key-dates.delete',
                'group'       => 'Key Dates',
                'label'       => 'Delete key date definitions',
                'description' => 'Delete key date type definitions',
            ],

            /*
            |--------------------------------------------------------------------------
            | TAGS
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'tags.view',
                'group'       => 'Tags',
                'label'       => 'View tags',
                'description' => 'View tag definitions',
            ],
            [
                'name'        => 'tags.create',
                'group'       => 'Tags',
                'label'       => 'Create tags',
                'description' => 'Create new tags',
            ],
            [
                'name'        => 'tags.edit',
                'group'       => 'Tags',
                'label'       => 'Edit tags',
                'description' => 'Edit existing tags',
            ],
            [
                'name'        => 'tags.delete',
                'group'       => 'Tags',
                'label'       => 'Delete tags',
                'description' => 'Delete tags',
            ],

            /*
            |--------------------------------------------------------------------------
            | STATUSES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'statuses.view',
                'group'       => 'Statuses',
                'label'       => 'View claim statuses',
                'description' => 'View claim status definitions',
            ],
            [
                'name'        => 'statuses.create',
                'group'       => 'Statuses',
                'label'       => 'Create claim statuses',
                'description' => 'Create new claim status definitions',
            ],
            [
                'name'        => 'statuses.edit',
                'group'       => 'Statuses',
                'label'       => 'Edit claim statuses',
                'description' => 'Edit existing claim status definitions',
            ],
            [
                'name'        => 'statuses.delete',
                'group'       => 'Statuses',
                'label'       => 'Delete claim statuses',
                'description' => 'Delete claim status definitions',
            ],

            /*
            |--------------------------------------------------------------------------
            | INSTITUTION TYPES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'institution-types.view',
                'group'       => 'Institution Types',
                'label'       => 'View institution types',
                'description' => 'View institution type definitions',
            ],
            [
                'name'        => 'institution-types.create',
                'group'       => 'Institution Types',
                'label'       => 'Create institution types',
                'description' => 'Create new institution type definitions',
            ],
            [
                'name'        => 'institution-types.edit',
                'group'       => 'Institution Types',
                'label'       => 'Edit institution types',
                'description' => 'Edit existing institution type definitions',
            ],
            [
                'name'        => 'institution-types.delete',
                'group'       => 'Institution Types',
                'label'       => 'Delete institution types',
                'description' => 'Delete institution type definitions',
            ],

            /*
            |--------------------------------------------------------------------------
            | PRINT QUEUE
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'print-queue.view',
                'group'       => 'Print Queue',
                'label'       => 'View print queue',
                'description' => 'View the print queue and its pending items',
            ],
            [
                'name'        => 'print-queue.manage',
                'group'       => 'Print Queue',
                'label'       => 'Manage print queue',
                'description' => 'Remove items from and print the print queue',
            ],

            /*
            |--------------------------------------------------------------------------
            | PENSION CASES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'pension-cases.view',
                'group'       => 'Pension Cases',
                'label'       => 'View pension cases',
                'description' => 'View pension case lists and individual case records',
            ],
            [
                'name'        => 'pension-cases.create',
                'group'       => 'Pension Cases',
                'label'       => 'Create pension cases',
                'description' => 'Create new pension case records',
            ],
            [
                'name'        => 'pension-cases.edit',
                'group'       => 'Pension Cases',
                'label'       => 'Edit pension cases',
                'description' => 'Edit existing pension case details',
            ],
            [
                'name'        => 'pension-cases.delete',
                'group'       => 'Pension Cases',
                'label'       => 'Delete pension cases',
                'description' => 'Delete pension case records',
            ],
            [
                'name'        => 'pension-cases.comment',
                'group'       => 'Pension Cases',
                'label'       => 'Add pension case comments',
                'description' => 'Add comments to pension cases',
            ],
            [
                'name'        => 'pension-cases.interims',
                'group'       => 'Pension Cases',
                'label'       => 'Manage pension case interims',
                'description' => 'Add and delete interim payment records on pension cases',
            ],

            /*
            |--------------------------------------------------------------------------
            | WILLS & TRUSTS CASES
            |--------------------------------------------------------------------------
            */
            [
                'name'        => 'wills-cases.view',
                'group'       => 'Wills & Trusts',
                'label'       => 'View Wills & Trusts cases',
                'description' => 'View Wills & Trusts case lists and individual case records',
            ],
            [
                'name'        => 'wills-cases.create',
                'group'       => 'Wills & Trusts',
                'label'       => 'Create Wills & Trusts cases',
                'description' => 'Create new Wills & Trusts case records',
            ],
            [
                'name'        => 'wills-cases.edit',
                'group'       => 'Wills & Trusts',
                'label'       => 'Edit Wills & Trusts cases',
                'description' => 'Edit existing Wills & Trusts case details',
            ],
            [
                'name'        => 'wills-cases.delete',
                'group'       => 'Wills & Trusts',
                'label'       => 'Delete Wills & Trusts cases',
                'description' => 'Delete Wills & Trusts case records',
            ],
        ];

        foreach ($permissions as $permission) {
            Permission::updateOrCreate(
                ['name' => $permission['name']],
                [
                    'group'       => $permission['group'],
                    'label'       => $permission['label'],
                    'description' => $permission['description'],
                    'guard_name'  => 'web',
                ]
            );
        }
    }
}
