Documentation ¶
Index ¶
- func CheckPrereqForDrink(name string) (bool, float64, error)
- func CheckPrereqForMoney(d Denomination, cost float64) (bool, Denomination, Denomination, error)
- func ConsumeDrink(name string) (bool, error)
- func GetAvailableDrinks() map[string]Drink
- func GetAvailableDrinksName() []string
- func GetDenominationValueByName(denomination string) (string, error)
- func GetIngredienteValueByName(ingredient string) (string, error)
- func RemoveDrink(name string) (bool, error)
- type Denomination
- func CalculateDenominationAfterConsume(d Denomination, cost float64) (Denomination, error)
- func CleanupDenominations() (Denomination, error)
- func GetCurrentMoney() *Denomination
- func InitializeDenominations(d Denomination) (Denomination, error)
- func UpdateDenominationConsume(d Denomination, cost float64) (Denomination, error)
- func UpdateDenominationPatch(d Denomination) (Denomination, error)
- func UpdateDenominationPut(d Denomination) (Denomination, error)
- func UpdateDenominationValueByName(denomination string, value int) (Denomination, error)
- type DenominationDB
- type Drink
- type DrinkDB
- type Ingredient
- func CleanupIngredients() (Ingredient, error)
- func GetMachineIngredients() *Ingredient
- func InitializeIngredients(ing Ingredient) (Ingredient, error)
- func UpdateIngredientPatch(ing Ingredient) (Ingredient, error)
- func UpdateIngredientPut(ing Ingredient) (Ingredient, error)
- func UpdateIngredientValueByName(ingredient string, value uint16) (Ingredient, error)
- type IngredientDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPrereqForMoney ¶
func CheckPrereqForMoney(d Denomination, cost float64) (bool, Denomination, Denomination, error)
func ConsumeDrink ¶
func GetAvailableDrinks ¶
func GetAvailableDrinksName ¶
func GetAvailableDrinksName() []string
func RemoveDrink ¶
Types ¶
type Denomination ¶
func CalculateDenominationAfterConsume ¶
func CalculateDenominationAfterConsume(d Denomination, cost float64) (Denomination, error)
func CleanupDenominations ¶
func CleanupDenominations() (Denomination, error)
func GetCurrentMoney ¶
func GetCurrentMoney() *Denomination
func InitializeDenominations ¶
func InitializeDenominations(d Denomination) (Denomination, error)
func UpdateDenominationConsume ¶
func UpdateDenominationConsume(d Denomination, cost float64) (Denomination, error)
func UpdateDenominationPatch ¶
func UpdateDenominationPatch(d Denomination) (Denomination, error)
func UpdateDenominationPut ¶
func UpdateDenominationPut(d Denomination) (Denomination, error)
func UpdateDenominationValueByName ¶
func UpdateDenominationValueByName(denomination string, value int) (Denomination, error)
func (*Denomination) CalculateTotal ¶
func (d *Denomination) CalculateTotal()
func (*Denomination) ConvertDenominationToDenominationDB ¶
func (denomination *Denomination) ConvertDenominationToDenominationDB(tenantName string) DenominationDB
func (*Denomination) ValidationDenomination ¶
func (d *Denomination) ValidationDenomination() (bool, error)
type DenominationDB ¶
type DenominationDB struct { gorm.Model TenantName string `gorm:"type:varchar(60);uniqueIndex"` Half int One int Two int Five int Ten int Total float64 }
func (*DenominationDB) CalculateTotal ¶
func (d *DenominationDB) CalculateTotal()
func (*DenominationDB) ConvertDenominationDBToDenomination ¶
func (denominationDB *DenominationDB) ConvertDenominationDBToDenomination() Denomination
type Drink ¶
type Drink struct { Water uint16 Milk uint16 Sugar uint16 CoffeeBeans uint16 TeaBeans uint16 Cups uint16 Money float64 }
func GetDrinkByName ¶
func (*Drink) ConvertDrinkToDB ¶
func (*Drink) ValidationDrink ¶
type DrinkDB ¶
type DrinkDB struct { gorm.Model Name string `gorm:"type:varchar(60);uniqueIndex:idx_name_tenantname"` TenantName string `gorm:"type:varchar(60);uniqueIndex:idx_name_tenantname"` Water uint16 Milk uint16 Sugar uint16 CoffeeBeans uint16 TeaBeans uint16 Cups uint16 Money float64 }
func (*DrinkDB) CheckResourcePrereqForDrinkDB ¶
func (dbDrink *DrinkDB) CheckResourcePrereqForDrinkDB() (bool, float64, Ingredient, error)
func (*DrinkDB) ConsumeDrinkDB ¶
func (*DrinkDB) ConvertDrinkDBToDrink ¶
type Ingredient ¶
type Ingredient struct { Water uint16 Milk uint16 Sugar uint16 CoffeeBeans uint16 TeaBeans uint16 Cups uint16 }
func CleanupIngredients ¶
func CleanupIngredients() (Ingredient, error)
func GetMachineIngredients ¶
func GetMachineIngredients() *Ingredient
func InitializeIngredients ¶
func InitializeIngredients(ing Ingredient) (Ingredient, error)
func UpdateIngredientPatch ¶
func UpdateIngredientPatch(ing Ingredient) (Ingredient, error)
func UpdateIngredientPut ¶
func UpdateIngredientPut(ing Ingredient) (Ingredient, error)
func UpdateIngredientValueByName ¶
func UpdateIngredientValueByName(ingredient string, value uint16) (Ingredient, error)
func (*Ingredient) ConvertIngredientToIngredientDB ¶
func (ingredient *Ingredient) ConvertIngredientToIngredientDB(tenantName string) IngredientDB
func (*Ingredient) ValidationIngredient ¶
func (ing *Ingredient) ValidationIngredient() (bool, error)
type IngredientDB ¶
type IngredientDB struct { gorm.Model TenantName string `gorm:"type:varchar(60);uniqueIndex"` Water uint16 Milk uint16 Sugar uint16 CoffeeBeans uint16 TeaBeans uint16 Cups uint16 }
func (*IngredientDB) ConvertIngredientDBToIngredient ¶
func (ingredientDB *IngredientDB) ConvertIngredientDBToIngredient() Ingredient
Click to show internal directories.
Click to hide internal directories.