You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
732 B
25 lines
732 B
package dto |
|
|
|
import ( |
|
"autostore/internal/domain/entities" |
|
) |
|
|
|
type ItemResponseDTO struct { |
|
ID string `json:"id"` |
|
Name string `json:"name"` |
|
ExpirationDate JSONTime `json:"expirationDate"` |
|
OrderURL string `json:"orderUrl"` |
|
UserID string `json:"userId"` |
|
CreatedAt JSONTime `json:"createdAt"` |
|
} |
|
|
|
func (dto *ItemResponseDTO) FromEntity(item *entities.ItemEntity) *ItemResponseDTO { |
|
return &ItemResponseDTO{ |
|
ID: item.GetID().String(), |
|
Name: item.GetName(), |
|
ExpirationDate: JSONTime{item.GetExpirationDate().Time()}, |
|
OrderURL: item.GetOrderURL(), |
|
UserID: item.GetUserID().String(), |
|
CreatedAt: JSONTime{item.GetCreatedAt()}, |
|
} |
|
} |