application

package
v0.0.0-...-76fafce Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(orders OrderRepository) *app

Types

type Application

type Application interface {
	SearchOrders(ctx context.Context, search SearchOrders) ([]*models.Order, error)
	GetOrder(ctx context.Context, get GetOrder) (*models.Order, error)
}

type CustomerCacheRepository

type CustomerCacheRepository interface {
	Add(ctx context.Context, customerID, name string) error
	CustomerRepository
}

type CustomerRepository

type CustomerRepository interface {
	Find(ctx context.Context, customerID string) (*models.Customer, error)
}

type Filters

type Filters struct {
	CustomerID string
	After      time.Time
	Before     time.Time
	StoreIDs   []string
	ProductIDs []string
	MinTotal   float64
	MaxTotal   float64
	Status     string
}

type GetOrder

type GetOrder struct {
	OrderID string
}

type OrderRepository

type OrderRepository interface {
	Add(ctx context.Context, order *models.Order) error
	UpdateStatus(ctx context.Context, orderID, status string) error
	Search(ctx context.Context, search SearchOrders) ([]*models.Order, error)
	Get(ctx context.Context, orderID string) (*models.Order, error)
}

type ProductCacheRepository

type ProductCacheRepository interface {
	Add(ctx context.Context, productID, storeID, name string) error
	Rebrand(ctx context.Context, productID, name string) error
	Remove(ctx context.Context, productID string) error
	ProductRepository
}

type ProductRepository

type ProductRepository interface {
	Find(ctx context.Context, productID string) (*models.Product, error)
}

type SearchOrders

type SearchOrders struct {
	Filters Filters
	Next    string
	Limit   int
}

type StoreCacheRepository

type StoreCacheRepository interface {
	Add(ctx context.Context, storeID, name string) error
	Rename(ctx context.Context, storeID, name string) error
	StoreRepository
}

type StoreRepository

type StoreRepository interface {
	Find(ctx context.Context, storeID string) (*models.Store, error)
}

Jump to

Keyboard shortcuts

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