store

package
v0.0.0-...-ebc3a5a Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDiscount = errors.New("no discount for store")

Functions

This section is empty.

Types

type MongoRepository

type MongoRepository struct {
	// contains filtered or unexported fields
}

func NewMongoRepo

func NewMongoRepo(ctx context.Context, connectionString string) (*MongoRepository, error)

func (MongoRepository) GetStoreDiscount

func (m MongoRepository) GetStoreDiscount(ctx context.Context, storeID uuid.UUID) (int64, error)

func (MongoRepository) Ping

func (m MongoRepository) Ping(ctx context.Context) error

type Repository

type Repository interface {
	GetStoreDiscount(ctx context.Context, storeID uuid.UUID) (int64, error)
	Ping(ctx context.Context) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(repo Repository) *Service

func (Service) GetStoreSpecificDiscount

func (s Service) GetStoreSpecificDiscount(ctx context.Context, storeID uuid.UUID) (float32, error)

type Store

type Store struct {
	ID              uuid.UUID
	Location        string
	ProductsForSale []coffeego.Product
}

Jump to

Keyboard shortcuts

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