Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QuoteHandler ¶
type QuoteHandler struct { QuoteRepository *repositories.QuoteRepository FreteRapido *freterapido.Service }
func NewQuoteHandler ¶
func NewQuoteHandler(qr *repositories.QuoteRepository, fr *freterapido.Service) *QuoteHandler
func (*QuoteHandler) CreateQuote ¶
func (q *QuoteHandler) CreateQuote(w http.ResponseWriter, r *http.Request)
@Summary Create quote @Description Uses frete-rapido API to simulate quote and save response at database @Tags Quotes @Accept json @Produce json @Param request body models.CreateQuoteRequest true "Request body" @Success 200 {object} models.CreateQuoteResponse @Failure 400 {object} utils.BadParamError @Failure 500 {object} utils.ErrorResponse @Router /quote [post]
func (*QuoteHandler) GetQuoteMetrics ¶
func (q *QuoteHandler) GetQuoteMetrics(w http.ResponseWriter, r *http.Request)
@Summary Get quote metrics @Description Use stored quote to generate general metrics @Tags Quotes @Accept json @Produce json @Param last_quotes query int false "limit carriers" @Success 200 {object} models.MetricsResponse @Failure 400 {object} utils.BadParamError @Failure 500 {object} utils.ErrorResponse @Router /metrics [get]