order

package
v0.0.0-...-a470c86 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(r *echo.Group, service Service)

RegisterHandlers for customer

Types

type Message

type Message interface {
	Subscribe() error
}

func NewMessage

func NewMessage(consumer mq.PushConsumer, repo Repository, rocketmq rocketmq.Provider, tracing tracing.Provider, logger logger.Provider) Message

type Repository

type Repository interface {
	// OrderPaid needs to change order status, and probably notify other services, such as product service to
	// decrease the product sku.
	OrderPaid(ctx context.Context, orderID string) error

	CreateOrder(ctx context.Context, orderID string) error

	CreateOrderItem(ctx context.Context, orderID string) error
}

Repository db repository

func NewRepository

func NewRepository(pdb postgres.Provider) Repository

NewRepository returns a new repostory

type Service

type Service interface {
	CreateFromCart(c context.Context, customerID int64, req createFromCartRequest) (id int64, err error)
	CreateFromProduct(c context.Context, customerID int64, req createFromProductRequest) (id int64, err error)
}

Service is cutomer service

func NewService

func NewService(repo Repository, logger logger.Provider) Service

NewService is to create new service

Jump to

Keyboard shortcuts

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