import { IsIn, IsOptional, IsString } from 'class-validator';
import type { ProjectGovernanceRole } from '../../../common/rbac/rbac.service';

const PROJECT_ROLES = ['owner', 'admin', 'member', 'viewer'] as const;

export class AddProjectMemberDto {
  @IsString()
  actorId!: string;

  @IsString()
  userId!: string;

  @IsOptional()
  @IsIn(PROJECT_ROLES)
  role?: ProjectGovernanceRole;
}

export class UpdateProjectMemberRoleDto {
  @IsString()
  actorId!: string;

  @IsIn(PROJECT_ROLES)
  role!: ProjectGovernanceRole;
}

export class RemoveProjectMemberDto {
  @IsString()
  actorId!: string;
}
