Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { CacheWriter CacheReader }
type CacheReader ¶
type CacheReader interface {
GetOrder(orderId string) (*entity.OrderStatus, error)
}
type CacheWriter ¶
type OrderError ¶
type OrderError struct { Message string AnnouncementsError []struct { // contains filtered or unexported fields } }
func (*OrderError) Error ¶
func (o *OrderError) Error() string
type OrderMessage ¶
type OrderService ¶
type OrderService struct {
// contains filtered or unexported fields
}
func NewOrderService ¶
func NewOrderService( queue Queue, mercadolivre common.MercadoLivre, storeUseCase store.UseCase, announceUseCase announcement.UseCase, repository Repository, cache Cache, logger metrics.Logger, ) *OrderService
func (*OrderService) ProcessOrder ¶
func (o *OrderService) ProcessOrder(order OrderMessage) error
func (*OrderService) ProcessWebhook ¶
func (o *OrderService) ProcessWebhook(input OrderWebhookDtoInput) error
type OrderWebhookDtoInput ¶
type OrderWebhookDtoInput struct { ID string `json:"_id"` Resource string `json:"resource"` UserID int `json:"user_id"` Topic string `json:"topic"` ApplicationID int64 `json:"application_id"` Attempts int `json:"attempts"` // Can be converted to time Sent string `json:"sent"` // Can be converted to time Received string `json:"received"` }
type Queue ¶
type Queue interface { QueueProducer QueueConsumer }
type QueueConsumer ¶
type QueueConsumer interface { ConsumeOrderNotification() []OrderMessage DeleteOrderNotification(receiptHandle string) error }
type QueueProducer ¶
type QueueProducer interface {
PostOrderNotification(input OrderWebhookDtoInput) error
}
Queue producer interface
type RepoReader ¶
type RepoWriter ¶
type Repository ¶
type Repository interface { RepoWriter RepoReader }
type UseCase ¶
type UseCase interface { ProcessWebhook(input OrderWebhookDtoInput) error ProcessOrder(order OrderMessage) error }
Click to show internal directories.
Click to hide internal directories.