"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OwnerScopeUseAllMembers1780940000000 = void 0;
class OwnerScopeUseAllMembers1780940000000 {
    constructor() {
        this.name = 'OwnerScopeUseAllMembers1780940000000';
    }
    async up(queryRunner) {
        await queryRunner.query(`
      UPDATE role_permissions rp
      INNER JOIN access_roles ar ON ar.id = rp.role_id
      SET rp.permission_value = 'all'
      WHERE ar.slug = 'owner'
        AND rp.permission_value = 'own_and_all'
        AND rp.permission_key IN (
          'dashboard.view',
          'members.view',
          'members.update',
          'members.delete',
          'attendance.view',
          'leave.view',
          'leave.create',
          'leave.update',
          'leave.delete',
          'reports.view',
          'calendar.view',
          'holidays.view',
          'holidays.create',
          'holidays.update',
          'holidays.delete',
          'notice.view',
          'notice.create',
          'notice.update',
          'notice.delete'
        )
    `);
    }
    async down(queryRunner) {
        await queryRunner.query(`
      UPDATE role_permissions rp
      INNER JOIN access_roles ar ON ar.id = rp.role_id
      SET rp.permission_value = 'own_and_all'
      WHERE ar.slug = 'owner'
        AND rp.permission_value = 'all'
        AND rp.permission_key IN (
          'dashboard.view',
          'members.view',
          'members.update',
          'members.delete',
          'attendance.view',
          'leave.view',
          'leave.create',
          'leave.update',
          'leave.delete',
          'reports.view',
          'calendar.view',
          'holidays.view',
          'holidays.create',
          'holidays.update',
          'holidays.delete',
          'notice.view',
          'notice.create',
          'notice.update',
          'notice.delete'
        )
    `);
    }
}
exports.OwnerScopeUseAllMembers1780940000000 = OwnerScopeUseAllMembers1780940000000;
//# sourceMappingURL=1780940000000-OwnerScopeUseAllMembers.js.map