import { Attachment } from '../attachment.entity';

export class AttachmentDto {
  id: number;
  name: string;
  type: string;
  size: number;

  constructor(partial: Partial<AttachmentDto>) {
    Object.assign(this, partial);
  }

  static createFromEntity(entity: Attachment): AttachmentDto {
    return new AttachmentDto({
      id: entity.id,
      name: entity.name,
      type: entity.type,
      size: entity.size,
    });
  }
}
