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()}, } }