dish

package
v0.0.0-...-7a9e484 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dish provides services and types for Dish-related data.

Package dish provides services and types for Dish-related data.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCharacteristicsNotFound = errors.New("the characteristics for the dish could not be found")
	ErrVariantsNotFound        = errors.New("the variants for the characteristics could not be found")
)

Functions

This section is empty.

Types

type Characteristic

type Characteristic struct {
	ID       uint64    `json:"id"`
	Name     string    `json:"name"`
	Multiple bool      `json:"multiple"`
	Variants []Variant `json:"variants"`
}

Characteristic is the API output for model.Characteristic.

type Service

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

Service executes dish-related business logic and use cases. It is also responsible for accessing the model storage under consideration of all business rules.

func NewService

NewService creates a new Service instance utilizing the given storage objects. The storage objects need to be ready to use for the service.

func (*Service) GetCharacteristics

func (s *Service) GetCharacteristics(dishID uint64) ([]Characteristic, error)

GetCharacteristics returns all characteristics of a given dish.

type Variant

type Variant struct {
	ID        uint64 `jsom:"id"`
	Value     string `json:"value"`
	IsDefault bool   `json:"is_default"`
	Price     uint   `json:"price"`
}

Variant is the API output for model.Variant.

Jump to

Keyboard shortcuts

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