<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;

class RoleSeeder extends Seeder
{

    public function run(): void
    {
        $role1 = Role::create(['name'=>'Admin']);
        $role2 = Role::create(['name'=>'Programador']);
        $role3 = Role::create(['name'=>'Promotor']);
        $role4 = Role::create(['name'=>'Alumno']);
        $role5 = Role::create(['name'=>'Control escolar']);
        $role6 = Role::create(['name'=>'Coordinación académica']);
        $role7 = Role::create(['name'=>'Docente']);

        Permission::create(['name'=>'note.index','description'=>'Ver notas'])->syncRoles([$role1,$role2,$role3,$role4,$role5]);
        Permission::create(['name'=>'note.create','description'=>'Crear notas'])->syncRoles([$role1,$role2,$role3,$role4,$role5]);
        Permission::create(['name'=>'note.edit','description'=>'Editar notas'])->syncRoles([$role1,$role2,$role3,$role4,$role5]);
        Permission::create(['name'=>'note.destroy','description'=>'Eliminar notas'])->syncRoles([$role1,$role2,$role3,$role4,$role5]);

        Permission::create(['name'=>'user.index','description'=>'Ver usuarios'])->syncRoles([$role1]);
        Permission::create(['name'=>'user.create','description'=>'Crear usuarios'])->syncRoles([$role1]);
        Permission::create(['name'=>'user.edit','description'=>'Editar usuarios'])->syncRoles([$role1]);
        Permission::create(['name'=>'user.destroy','description'=>'Eliminar usuarios'])->syncRoles([$role1]);

        Permission::create(['name'=>'permission.index','description'=>'Ver permisos'])->syncRoles([$role1]);
        Permission::create(['name'=>'permission.create','description'=>'Crear permisos'])->syncRoles([$role1]);
        Permission::create(['name'=>'permission.edit','description'=>'Editar permisos'])->syncRoles([$role1]);
        Permission::create(['name'=>'permission.destroy','description'=>'Eliminar permisos'])->syncRoles([$role1]);

        Permission::create(['name'=>'role.index','description'=>'Ver roles'])->syncRoles([$role1]);
        Permission::create(['name'=>'role.create','description'=>'Crear roles'])->syncRoles([$role1]);
        Permission::create(['name'=>'role.edit','description'=>'Editar roles'])->syncRoles([$role1]);
        Permission::create(['name'=>'role.destroy','description'=>'Eliminar roles'])->syncRoles([$role1]);

        Permission::create(['name'=>'plantel.index','description'=>'Ver planteles'])->syncRoles([$role1]);
        Permission::create(['name'=>'plantel.create','description'=>'Crear planteles'])->syncRoles([$role1]);
        Permission::create(['name'=>'plantel.edit','description'=>'Editar planteles'])->syncRoles([$role1]);
        Permission::create(['name'=>'plantel.destroy','description'=>'Eliminar planteles'])->syncRoles([$role1]);

        Permission::create(['name'=>'nivel.index','description'=>'Ver niveles'])->syncRoles([$role1]);
        Permission::create(['name'=>'nivel.create','description'=>'Crear niveles'])->syncRoles([$role1]);
        Permission::create(['name'=>'nivel.edit','description'=>'Editar niveles'])->syncRoles([$role1]);
        Permission::create(['name'=>'nivel.destroy','description'=>'Eliminar niveles'])->syncRoles([$role1]);

        Permission::create(['name'=>'carrera.index','description'=>'Ver carreras'])->syncRoles([$role1]);
        Permission::create(['name'=>'carrera.create','description'=>'Crear carreras'])->syncRoles([$role1]);
        Permission::create(['name'=>'carrera.edit','description'=>'Editar carreras'])->syncRoles([$role1]);
        Permission::create(['name'=>'carrera.destroy','description'=>'Eliminar carreras'])->syncRoles([$role1]);

        Permission::create(['name'=>'material.index','description'=>'Ver materiales'])->syncRoles([$role1]);
        Permission::create(['name'=>'material.create','description'=>'Crear materiales'])->syncRoles([$role1]);
        Permission::create(['name'=>'material.edit','description'=>'Editar materiales'])->syncRoles([$role1]);
        Permission::create(['name'=>'material.destroy','description'=>'Eliminar materiales'])->syncRoles([$role1]);

        Permission::create(['name'=>'duration.index','description'=>'Ver duraciones'])->syncRoles([$role1]);
        Permission::create(['name'=>'duration.create','description'=>'Crear duraciones'])->syncRoles([$role1]);
        Permission::create(['name'=>'duration.edit','description'=>'Editar duraciones'])->syncRoles([$role1]);
        Permission::create(['name'=>'duration.destroy','description'=>'Eliminar duraciones'])->syncRoles([$role1]);

        Permission::create(['name'=>'plan.index','description'=>'Ver planes'])->syncRoles([$role1]);
        Permission::create(['name'=>'plan.create','description'=>'Crear planes'])->syncRoles([$role1]);
        Permission::create(['name'=>'plan.edit','description'=>'Editar planes'])->syncRoles([$role1]);
        Permission::create(['name'=>'plan.destroy','description'=>'Eliminar planes'])->syncRoles([$role1]);

        Permission::create(['name'=>'alumno.index','description'=>'Ver alumnos'])->syncRoles([$role1,$role3,$role5]);
        Permission::create(['name'=>'alumno.create','description'=>'Crear alumnos'])->syncRoles([$role1,$role3]);
        Permission::create(['name'=>'alumno.edit','description'=>'Editar alumnos'])->syncRoles([$role1,$role3,$role5]);
        Permission::create(['name'=>'alumno.destroy','description'=>'Eliminar alumnos'])->syncRoles([$role1]);

        Permission::create(['name'=>'area.index','description'=>'Ver areas'])->syncRoles([$role1]);
        Permission::create(['name'=>'area.create','description'=>'Crear areas'])->syncRoles([$role1]);
        Permission::create(['name'=>'area.edit','description'=>'Editar areas'])->syncRoles([$role1]);
        Permission::create(['name'=>'area.destroy','description'=>'Eliminar areas'])->syncRoles([$role1]);

        Permission::create(['name'=>'campan.index','description'=>'Ver campañas'])->syncRoles([$role1]);
        Permission::create(['name'=>'campan.create','description'=>'Crear campañas'])->syncRoles([$role1]);
        Permission::create(['name'=>'campan.edit','description'=>'Editar campañas'])->syncRoles([$role1]);
        Permission::create(['name'=>'campan.destroy','description'=>'Eliminar campañas'])->syncRoles([$role1]);

        Permission::create(['name'=>'turno.index','description'=>'Ver turnos'])->syncRoles([$role1]);
        Permission::create(['name'=>'turno.create','description'=>'Crear turnos'])->syncRoles([$role1]);
        Permission::create(['name'=>'turno.edit','description'=>'Editar turnos'])->syncRoles([$role1]);
        Permission::create(['name'=>'turno.destroy','description'=>'Eliminar turnos'])->syncRoles([$role1]);

        Permission::create(['name'=>'medio.index','description'=>'Ver medios'])->syncRoles([$role1]);
        Permission::create(['name'=>'medio.create','description'=>'Crear medios'])->syncRoles([$role1]);
        Permission::create(['name'=>'medio.edit','description'=>'Editar medios'])->syncRoles([$role1]);
        Permission::create(['name'=>'medio.destroy','description'=>'Eliminar medios'])->syncRoles([$role1]);

        Permission::create(['name'=>'plane.index','description'=>'Ver planes de pago'])->syncRoles([$role1]);
        Permission::create(['name'=>'plane.create','description'=>'Crear planes de pago'])->syncRoles([$role1]);
        Permission::create(['name'=>'plane.edit','description'=>'Editar planes de pago'])->syncRoles([$role1]);
        Permission::create(['name'=>'plane.destroy','description'=>'Eliminar planes de pago'])->syncRoles([$role1]);

        Permission::create(['name'=>'concepto.index','description'=>'Ver conceptos'])->syncRoles([$role1]);
        Permission::create(['name'=>'concepto.create','description'=>'Crear conceptos'])->syncRoles([$role1]);
        Permission::create(['name'=>'concepto.edit','description'=>'Editar conceptos'])->syncRoles([$role1]);
        Permission::create(['name'=>'concepto.destroy','description'=>'Eliminar conceptos'])->syncRoles([$role1]);

        Permission::create(['name'=>'areacode.index','description'=>'Ver códigos qr'])->syncRoles([$role1]);
        Permission::create(['name'=>'areacode.create','description'=>'Crear códigos qr'])->syncRoles([$role1]);
        Permission::create(['name'=>'areacode.edit','description'=>'Editar códigos qr'])->syncRoles([$role1]);
        Permission::create(['name'=>'areacode.destroy','description'=>'Eliminar códigos qr'])->syncRoles([$role1]);

        Permission::create(['name'=>'asistencia','description'=>'asistencia digital'])->syncRoles([$role1]);

        Permission::create(['name'=>'mail.index','description'=>'Ver mail'])->syncRoles([$role1]);
        Permission::create(['name'=>'mail.create','description'=>'Crear mail'])->syncRoles([$role1]);
        Permission::create(['name'=>'mail.edit','description'=>'Editar mail'])->syncRoles([$role1]);
        Permission::create(['name'=>'mail.destroy','description'=>'Eliminar mail'])->syncRoles([$role1]);

        Permission::create(['name'=>'horario.index','description'=>'Ver horario'])->syncRoles([$role1]);
        Permission::create(['name'=>'horario.create','description'=>'Crear horario'])->syncRoles([$role1]);
        Permission::create(['name'=>'horario.edit','description'=>'Editar horario'])->syncRoles([$role1]);
        Permission::create(['name'=>'horario.destroy','description'=>'Eliminar horario'])->syncRoles([$role1]);

        Permission::create(['name'=>'pago.index','description'=>'Ver pagos'])->syncRoles([$role1,$role3,$role4]);
        Permission::create(['name'=>'pago.create','description'=>'Crear pagos'])->syncRoles([$role1,$role3]);
        Permission::create(['name'=>'pago.edit','description'=>'Editar pagos'])->syncRoles([$role1]);
        Permission::create(['name'=>'pago.destroy','description'=>'Eliminar pagos'])->syncRoles([$role1,$role3]);

        Permission::create(['name'=>'grupo.index','description'=>'Ver grupos'])->syncRoles([$role1,$role4,$role5,$role6,$role7]);
        Permission::create(['name'=>'grupo.create','description'=>'Crear grupos'])->syncRoles([$role1,$role5]);
        Permission::create(['name'=>'grupo.edit','description'=>'Editar grupos'])->syncRoles([$role1,$role5,$role6]);
        Permission::create(['name'=>'grupo.destroy','description'=>'Eliminar grupos'])->syncRoles([$role1,$role5]);

        Permission::create(['name'=>'docente.index','description'=>'Ver docentes'])->syncRoles([$role1,$role6]);
        Permission::create(['name'=>'docente.create','description'=>'Crear docentes'])->syncRoles([$role1,$role6]);
        Permission::create(['name'=>'docente.edit','description'=>'Editar docentes'])->syncRoles([$role1,$role6]);
        Permission::create(['name'=>'docente.destroy','description'=>'Eliminar docentes'])->syncRoles([$role1,$role6]);

        Permission::create(['name'=>'documentoTipo.index','description'=>'Ver documentación'])->syncRoles([$role1]);
        Permission::create(['name'=>'documentoTipo.create','description'=>'Crear documentación'])->syncRoles([$role1]);
        Permission::create(['name'=>'documentoTipo.edit','description'=>'Editar documentación'])->syncRoles([$role1]);
        Permission::create(['name'=>'documentoTipo.destroy','description'=>'Eliminar documentación'])->syncRoles([$role1]);
    }
}
