product

package
v0.0.0-...-b0e2d2c Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

type Creator struct {
	DB                    *sql.DB
	StoreRepository       *store_repository.Repository
	ProductRepository     *product_repository.Repository
	ProductMetaRepository *product_repository.MetaRepository
	PriceRepository       *price_repository.Repository
	StatsRepository       *stats_repository.Repository
}

func (*Creator) Create

func (s *Creator) Create(storeProduct MqStoreProduct) error

type EanMatcher

type EanMatcher struct {
	Finder *Finder
}

func (*EanMatcher) Match

func (m *EanMatcher) Match(storeProduct MqStoreProduct) int64

type Finder

type Finder struct {
	DB                         *sql.DB
	ProductWithStatsRepository *product_repository.ProductWithStatsRepository
	ProductRepository          *product_repository.Repository
	ProductMetaRepository      *product_repository.MetaRepository
}

func (*Finder) FindDetailedProducts

func (s *Finder) FindDetailedProducts(
	paginatedQuery pagination.PaginatedQuery,
	filters FinderFilters,
	fetchEan bool,
	fetchSku bool,
) (*pagination.PaginatedData[[]product_repository.Product], error)

func (*Finder) FindProductById

func (s *Finder) FindProductById(productId int64) (*product_repository.Product, error)

func (*Finder) FindProductByUrl

func (s *Finder) FindProductByUrl(url string) (*product_repository.Product, error)

func (*Finder) FindProductIdByStoreSlugAndEANs

func (s *Finder) FindProductIdByStoreSlugAndEANs(storeSlug string, eans []string) (int64, error)

func (*Finder) FindProductIdByStoreSlugAndSKUs

func (s *Finder) FindProductIdByStoreSlugAndSKUs(storeSlug string, skus []string) (int64, error)

func (*Finder) QuickSearch

func (s *Finder) QuickSearch(expression string, andElseOr bool) ([]product_repository.Product, error)

type FinderFilters

type FinderFilters struct {
	ProductId []int64

	StoreId    *int
	MinPrice   *float64
	MaxPrice   *float64
	NameLike   string
	BrandLike  string
	Available  *bool
	ProductUrl string

	MinDifference      *float64
	MaxDifference      *float64
	MinDiscountPercent *float64
	MaxDiscountPercent *float64
	MinAveragePrice    *float64
	MaxAveragePrice    *float64
	MinMinimumPrice    *float64
	MaxMinimumPrice    *float64
	MinMaximumPrice    *float64
	MaxMaximumPrice    *float64
}

type Handler

type Handler struct {
	Matchers []Matcher
	Creator  *Creator
	Updater  *Updater
}

func (*Handler) Handle

func (s *Handler) Handle(ctx context.Context, storeProduct MqStoreProduct) error

type Matcher

type Matcher interface {
	Match(storeProduct MqStoreProduct) int64
}

type MqStoreProduct

type MqStoreProduct struct {
	StoreSlug string
	EAN       []string
	SKU       []string
	Name      string
	Brand     string
	Price     int
	Available bool
	ImageLink string
	Link      string
	Currency  string
}

type SkuMatcher

type SkuMatcher struct {
	Finder *Finder
}

func (*SkuMatcher) Match

func (m *SkuMatcher) Match(storeProduct MqStoreProduct) int64

type Updater

type Updater struct {
	DB                    *sql.DB
	StoreRepository       *store_repository.Repository
	ProductRepository     *product_repository.Repository
	ProductMetaRepository *product_repository.MetaRepository
	PriceRepository       *price_repository.Repository
	StatsRepository       *stats_repository.Repository
}

func (*Updater) Update

func (s *Updater) Update(productId int64, storeProduct MqStoreProduct) error

type UrlMatcher

type UrlMatcher struct {
	Finder *Finder
}

func (*UrlMatcher) Match

func (m *UrlMatcher) Match(storeProduct MqStoreProduct) int64

Jump to

Keyboard shortcuts

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