import { IsObject } from 'class-validator';
import type { ModuleAccessLevel, ModuleName } from '../../../common/access/modules';

/**
 * Partial entitlement change: `{ "modules": { "trading": "READ" } }`.
 *
 * The map is validated in UsersService against the canonical module list rather
 * than here, so unknown modules and levels produce one consistent message and
 * the rule lives next to the rest of the access logic.
 */
export class UpdateModuleAccessDto {
  @IsObject()
  modules!: Partial<Record<ModuleName, ModuleAccessLevel>>;
}
