service

package
v0.0.0-...-ec6daaa Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateProduct

func ValidateProduct(productServiceURL string, id uint) bool

Types

type OrderService

type OrderService struct {
	DB *gorm.DB
}

func (*OrderService) Create

func (o *OrderService) Create(ctx context.Context, data database.OrderIn) (string, error)

func (*OrderService) Delete

func (o *OrderService) Delete(ctx context.Context, id uint) (string, error)

func (*OrderService) GetByID

func (o *OrderService) GetByID(ctx context.Context, id uint) ([]database.OrderItemOut, error)

func (*OrderService) QuantityOrdered

func (o *OrderService) QuantityOrdered(ctx context.Context, id uint) (uint, error)

func (*OrderService) Search

func (o *OrderService) Search(ctx context.Context, search string, startDate time.Time, endDate time.Time) ([]database.OrderOut, error)

func (*OrderService) Top

func (o *OrderService) Top(ctx context.Context, count uint) ([]database.ProductOutTop, error)

func (*OrderService) Total

func (o *OrderService) Total(ctx context.Context) (float32, error)

type Service

type Service interface {
	GetByID(ctx context.Context, id uint) ([]database.OrderItemOut, error)
	Search(ctx context.Context, search string, startDate time.Time, endDate time.Time) ([]database.OrderOut, error)
	Create(ctx context.Context, data database.OrderIn) (string, error)
	Delete(ctx context.Context, id uint) (string, error)
	Total(ctx context.Context) (float32, error)
	Top(ctx context.Context, count uint) ([]database.ProductOutTop, error)
	QuantityOrdered(ctx context.Context, id uint) (uint, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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