import { SetMetadata } from '@nestjs/common';

export const REQUIRE_MODULE_KEY = 'require_module';

/**
 * Restrict access to endpoints that require a specific module to be enabled
 * for the club. Checked by ModuleGuard against the club_modules table.
 *
 * @example
 * @RequireModule('sip')
 * @Post('/sip/call')
 * async initiateCall(@Body() dto: InitiateCallDto) { ... }
 */
export const RequireModule = (moduleId: string) =>
  SetMetadata(REQUIRE_MODULE_KEY, moduleId);
