logic

package
v0.0.0-...-6c3add7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cost

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

Cost Base inventory server struct, has a logger and a path

func NewCost

func NewCost(l hclog.Logger, s string) *Cost

NewCost plpl

func (*Cost) AddUnitCost

func (c *Cost) AddUnitCost(ctx context.Context, ar *cost.UpdateRequest) (*cost.UpdateResponse, error)

AddUnitCost Updates a Unit Cost

func (*Cost) GetUnitCost

func (c *Cost) GetUnitCost(ctx context.Context, cr *cost.CostRequest) (*cost.CostResponse, error)

GetUnitCost Gets the unit cost based on the id

func (*Cost) TotalBasket

func (c *Cost) TotalBasket(ctx context.Context, bask *cost.Basket) (*cost.CostResponse, error)

TotalBasket Gets the total cost of a basket

func (*Cost) UpdateUnitCost

func (c *Cost) UpdateUnitCost(ctx context.Context, ar *cost.UpdateRequest) (*cost.UpdateResponse, error)

UpdateUnitCost Updates a Unit Cost

type Inventory

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

Inventory Base inventory server struct, has a logger and a path

func NewInventory

func NewInventory(l hclog.Logger, s string) *Inventory

NewInventory Initialiser, takes the arguments and returns a new inventory server with the arguments passed in

func (*Inventory) ChangeStock

func (i *Inventory) ChangeStock(ctx context.Context, cr *inv.AmendRequest) (*inv.AmendResponse, error)

ChangeStock Changes the amount of stock and adds stock if not present

func (*Inventory) CheckShort

func (i *Inventory) CheckShort(ctx context.Context, sr *inv.ShortRequest) (*inv.ShortList, error)

CheckShort Gets a list of all stocks that are short of items TODO Add a field to stock item saying when to replace items ie replace toilet rolls if stock < 100 but replace toothpaste when stock < 20

func (*Inventory) GetStock

func (i *Inventory) GetStock(ctx context.Context, lr *inv.LevelRequest) (*inv.StockItem, error)

GetStock Gets the stock from the database associated with the ID

func (*Inventory) GetStore

func (i *Inventory) GetStore(ctx context.Context, sr *inv.ShortRequest) (*inv.ShortList, error)

GetStore Gets a list of all stocks for a location

type Order

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

Order in the room

func NewOrder

func NewOrder(l hclog.Logger, s string) *Order

NewOrder Inherits from Joy Division

func (*Order) AddToBasket

func (o *Order) AddToBasket(ctx context.Context, addreq *order.AddToCart) (*order.Cart, error)

AddToBasket da

func (*Order) MakeOrder

func (o *Order) MakeOrder(ctx context.Context, or *order.OrderRequest) (*order.OrderResponse, error)

MakeOrder makes an order

type User

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

User something

func NewUser

func NewUser(l hclog.Logger, s string) *User

NewUser Initialise

func (*User) GetAccess

func (u *User) GetAccess(ctx context.Context, ur *user.IDUserRequest) (*user.AccessResponse, error)

GetAccess DEPRECATED METHOD DUE TO COOKIES WITH HARD CODED VALUE

func (*User) GetUserByID

func (u *User) GetUserByID(ctx context.Context, ur *user.IDUserRequest) (*user.UserResponse, error)

GetUserByID DEPRECATED METHOD

func (*User) GetUserByUN

func (u *User) GetUserByUN(ctx context.Context, ur *user.UNUserRequest) (*user.UserResponse, error)

GetUserByUN blahblablah

func (*User) Login

func (u *User) Login(ctx context.Context, ur *user.AuthsRequest) (*user.AccessResponse, error)

Login blahblablah

Jump to

Keyboard shortcuts

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