101577f163
- Updated import paths in multiple service files to reflect the new agent-desk module. - Added a new configuration file for agent-desk in the Docker setup.
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package builders
|
|
|
|
import (
|
|
"agent-desk/internal/models"
|
|
"agent-desk/internal/pkg/dto/response"
|
|
"agent-desk/internal/pkg/utils"
|
|
"time"
|
|
)
|
|
|
|
func BuildCustomerContactResponse(item *models.CustomerContact) response.CustomerContactResponse {
|
|
if item == nil {
|
|
return response.CustomerContactResponse{}
|
|
}
|
|
return response.CustomerContactResponse{
|
|
ID: item.ID,
|
|
CustomerID: item.CustomerID,
|
|
ContactType: item.ContactType,
|
|
ContactValue: item.ContactValue,
|
|
IsPrimary: item.IsPrimary,
|
|
IsVerified: item.IsVerified,
|
|
VerifiedAt: utils.FormatTimePtr(item.VerifiedAt),
|
|
Source: item.Source,
|
|
Status: item.Status,
|
|
Remark: item.Remark,
|
|
CreatedAt: item.CreatedAt.Format(time.DateTime),
|
|
UpdatedAt: item.UpdatedAt.Format(time.DateTime),
|
|
}
|
|
}
|
|
|
|
func BuildCustomerContactList(list []models.CustomerContact) []response.CustomerContactResponse {
|
|
results := make([]response.CustomerContactResponse, 0, len(list))
|
|
for i := range list {
|
|
results = append(results, BuildCustomerContactResponse(&list[i]))
|
|
}
|
|
return results
|
|
}
|