import { applyDecorators, UseGuards } from '@nestjs/common';
import { JwtGuard } from '@tria-plc/api-common/modules/auth/services/jwt.guard';
import { PassengerPermissionGuard } from './passenger-permission.guard';
import { PASSENGER_PERMS } from '../seed/passenger-permissions.registry';

export const PassengerStaff = (permission: string | string[]) =>
  applyDecorators(
    UseGuards(
      JwtGuard,
      PassengerPermissionGuard(Array.isArray(permission) ? permission : [permission]),
    ),
  );

export const PassengerAdmin = () => PassengerStaff(PASSENGER_PERMS.admin);
