import { Exclude, Expose, Type } from "class-transformer";

@Exclude()
export class PermissionResponseDto {
  @Expose()
  id: string;

  @Expose()
  name: string;

  @Expose()
  description: string | null;

  @Expose()
  resource: string;

  @Expose()
  action: string;

  @Expose()
  createdAt: Date;

  @Expose()
  updatedAt: Date;
}

@Exclude()
export class RoleResponseDto {
  @Expose()
  id: string;

  @Expose()
  name: string;

  @Expose()
  description: string | null;

  @Expose()
  @Type(() => PermissionResponseDto)
  permissions?: PermissionResponseDto[];

  @Expose()
  createdAt: Date;

  @Expose()
  updatedAt: Date;
}

@Exclude()
export class UserRoleResponseDto {
  @Expose()
  userId: string;

  @Expose()
  roleId: string;

  @Expose()
  createdAt: Date;
}

@Exclude()
export class RolePermissionResponseDto {
  @Expose()
  roleId: string;

  @Expose()
  permissionId: string;

  @Expose()
  createdAt: Date;
}
