purchase

package
v0.0.0-...-2654f9e Latest Latest
Warning

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

Go to latest
Published: Jul 16, 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 CashChargeService

type CashChargeService interface {
	CollectCash(ctx context.Context, amount money.Money) error
}

type MongoRepository

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

func NewMongoRepo

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

func (*MongoRepository) Store

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

type Purchase

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

	PaymentMeans payment.Means
	// contains filtered or unexported fields
}

type Repository

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

type Service

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

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