repositories

package
v0.0.0-...-4d27c10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsResponse

type MetricsResponse struct {
	CheapestQuote      float64 `bson:"cheapest_quote"`
	MostExpensiveQuote float64 `bson:"most_expensive_quote"`
	Services           []struct {
		AveragePrice float64 `bson:"average_price"`
		Carrier      string  `bson:"carrier"`
		Count        int     `bson:"count"`
		TotalPrice   float64 `bson:"total_price"`
	} `bson:"services"`
}

type QuoteRepository

type QuoteRepository struct {
	CollectionName string
	Mongo          *services.MongoService
}

func NewQuoteRepository

func NewQuoteRepository(collectionName string, m *services.MongoService) *QuoteRepository

func (*QuoteRepository) GetQuoteMetrics

func (qr *QuoteRepository) GetQuoteMetrics(limit uint64) (*MetricsResponse, error)

func (*QuoteRepository) InsertManyQuotes

func (qr *QuoteRepository) InsertManyQuotes(q []*models.Quote) (*mongo.InsertManyResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL