import 'package:superport_v2/core/config/environment.dart';
import 'package:superport_v2/core/permissions/permission_resources.dart';

/// 통합 테스트에서 버튼/액션이 숨겨지지 않도록 기본 권한을 허용한다.
void grantTestPermissions({bool includeWrites = true}) {
  final commonActions = includeWrites ? {'all'} : {'view'};
  Environment.setTestPermissions({
    PermissionResources.dashboard: commonActions,
    PermissionResources.stockTransactions: commonActions,
    PermissionResources.approvals: commonActions,
    PermissionResources.approvalSteps: commonActions,
    PermissionResources.approvalHistories: commonActions,
    PermissionResources.approvalTemplates: commonActions,
    PermissionResources.inventorySummary: commonActions,
    PermissionResources.groupMenuPermissions: commonActions,
    PermissionResources.vendors: commonActions,
    PermissionResources.products: commonActions,
    PermissionResources.warehouses: commonActions,
    PermissionResources.customers: commonActions,
    PermissionResources.users: commonActions,
    PermissionResources.groups: commonActions,
    PermissionResources.menus: commonActions,
    PermissionResources.postalSearch: commonActions,
    PermissionResources.reports: commonActions,
    PermissionResources.reportsTransactions: commonActions,
    PermissionResources.reportsApprovals: commonActions,
    PermissionResources.inventoryScope: {'view'},
  });
}
