order

package
v0.0.0-...-ff63965 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Order

type Order struct {
	ID             int64  `db:"id"`
	UserID         int64  `db:"user_id"`
	OrderNumber    string `db:"order_number"`
	IsConfirmed    bool   `db:"is_confirmed"`
	IdempotencyKey string `db:"idempotency_key"`
	Metadata       string `db:"metadata"`
}

type Resource

type Resource interface {
	CreateOrder(Order) error
}

type Service

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

Service order

func New

func New(orderResource Resource, userService UserService) *Service

New order service

func (*Service) ConfirmOrder

func (s *Service) ConfirmOrder(orderid string) error

func (*Service) CreateOrder

func (s *Service) CreateOrder(order Order) error

type UserService

type UserService interface {
	IsUserActive(int64) (bool, error)
}

Jump to

Keyboard shortcuts

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