Init All Docs
This commit is contained in:
@@ -65,6 +65,38 @@ func LetterEntityToContract(e *entities.LetterIncoming, attachments []entities.L
|
||||
return resp
|
||||
}
|
||||
|
||||
func LetterIncomingEntityToContract(e *entities.LetterIncoming) *contract.IncomingLetterResponse {
|
||||
if e == nil {
|
||||
return nil
|
||||
}
|
||||
return &contract.IncomingLetterResponse{
|
||||
ID: e.ID,
|
||||
LetterNumber: e.LetterNumber,
|
||||
ReferenceNumber: e.ReferenceNumber,
|
||||
Subject: e.Subject,
|
||||
Description: e.Description,
|
||||
ReceivedDate: e.ReceivedDate,
|
||||
DueDate: e.DueDate,
|
||||
Status: string(e.Status),
|
||||
CreatedBy: e.CreatedBy, // Will be set conditionally
|
||||
CreatedAt: e.CreatedAt,
|
||||
UpdatedAt: e.UpdatedAt,
|
||||
Attachments: make([]contract.IncomingLetterAttachmentResponse, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func DepartmentEntityToContract(e *entities.Department) *contract.DepartmentResponse {
|
||||
if e == nil {
|
||||
return nil
|
||||
}
|
||||
return &contract.DepartmentResponse{
|
||||
ID: e.ID,
|
||||
Code: e.Code,
|
||||
Name: e.Name,
|
||||
Path: e.Path,
|
||||
}
|
||||
}
|
||||
|
||||
func DispositionsToContract(list []entities.LetterIncomingDisposition) []contract.DispositionResponse {
|
||||
out := make([]contract.DispositionResponse, 0, len(list))
|
||||
for _, d := range list {
|
||||
|
||||
Reference in New Issue
Block a user