Feature: Device Batch Attachments

allows for attachments to be uploaded and associated with Device Batches
This commit is contained in:
Gary Sharp
2020-11-29 16:41:20 +11:00
parent e531ffe2b7
commit 28e5901929
26 changed files with 2153 additions and 320 deletions
@@ -76,6 +76,22 @@ namespace Disco.Web.Areas.API.Models.Attachment
MimeType = da.MimeType
};
}
public static _AttachmentModel FromAttachment(Disco.Models.Repository.DeviceBatchAttachment attachment)
{
return new _AttachmentModel
{
ParentId = attachment.DeviceBatchId.ToString(),
Id = attachment.Id,
AuthorId = attachment.TechUserId,
Author = attachment.TechUser.ToStringFriendly(),
Timestamp = attachment.Timestamp,
Comments = attachment.Comments,
DocumentTemplateId = null, // not supported for DeviceBatchAttachment
DocumentTemplateDescription = null, // not supported for DeviceBatchAttachment
Filename = attachment.Filename,
MimeType = attachment.MimeType
};
}
}
}