finnow/finnow-api/source/attachment/data.d

17 lines
615 B
D

module attachment.data;
import handy_http_primitives : Optional;
import attachment.model;
import std.datetime;
interface AttachmentRepository {
Optional!Attachment findById(ulong id);
Attachment[] findAllByLinkedEntity(string subquery, ulong entityId);
Attachment[] findAllByTransactionId(ulong transactionId);
Attachment[] findAllByValueRecordId(ulong valueRecordId);
Attachment[] findAllByTransactionDraftId(ulong draftId);
ulong save(SysTime uploadedAt, string filename, string contentType, in ubyte[] content);
void remove(ulong id);
Optional!(ubyte[]) getContent(ulong id);
}