module attachment.dto;

import attachment.model;

struct AttachmentResponse {
    ulong id;
    string uploadedAt;
    string filename;
    string contentType;
    ulong size;

    static AttachmentResponse of(Attachment a) {
        return AttachmentResponse(
            a.id,
            a.uploadedAt.toISOExtString(),
            a.filename,
            a.contentType,
            a.size
        );
    }
}