purchase

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardChargeService

type CardChargeService interface {
	ChargeCard(ctx context.Context, amount money.Money, cardToken string) error
}

type MongoRepository

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

func NewMongoRepository

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

func (*MongoRepository) Ping

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

func (*MongoRepository) Store

func (m *MongoRepository) Store(ctx context.Context, purchase Purchase) error

type Purchase

type Purchase struct {
	Store              store.Store
	ProductsToPurchase []coffeego.Product

	PaymentMeans payment.Means

	CardToken *string
	// contains filtered or unexported fields
}

type Repository

type Repository interface {
	Store(ctx context.Context, purchase Purchase) error
	Ping(ctx context.Context) error
}

type Service

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

func NewService

func NewService(cardService CardChargeService, purchaseRepo Repository, storeService StoreService) *Service

func (*Service) CompletePurchase

func (s *Service) CompletePurchase(ctx context.Context, storeID uuid.UUID,
	purchase *Purchase, coffeeBuxCard *loyalty.CoffeeBux) error

type StoreService

type StoreService interface {
	GetStoreSpecificDiscount(ctx context.Context, storeID uuid.UUID) (float32, error)
}

Jump to

Keyboard shortcuts

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