add final attachment response

This commit is contained in:
efrilm
2025-12-06 11:20:33 +07:00
parent e83eefc614
commit 5e9af152a7
3 changed files with 18 additions and 0 deletions
@@ -1635,6 +1635,19 @@ func transformLetterToResponse(letter *entities.LetterOutgoing) *contract.Outgoi
}
}
if len(letter.FinalAttachments) > 0 {
resp.FinalAttachments = make([]contract.OutgoingLetterAttachmentResponse, len(letter.FinalAttachments))
for i, attachment := range letter.FinalAttachments {
resp.FinalAttachments[i] = contract.OutgoingLetterAttachmentResponse{
ID: attachment.ID,
FileURL: attachment.FileURL,
FileName: attachment.FileName,
FileType: attachment.FileType,
UploadedAt: attachment.UploadedAt,
}
}
}
if len(letter.Approvals) > 0 {
resp.Approvals = make([]contract.OutgoingLetterApprovalResponse, len(letter.Approvals))
for i, approval := range letter.Approvals {