Documentation ¶
Overview ¶
Package menu provides the use case for menu
Package menu provides the use case for menu ¶
Package menu provides the use case for menu
Index ¶
- type NewMenu
- type PaginationResultMenu
- type Service
- func (s *Service) Create(ctx context.Context, menu *NewMenu) (*menuDomain.Menu, error)
- func (s *Service) Delete(ctx context.Context, id int64) error
- func (s *Service) GetAll(ctx context.Context, page int64, limit int64) (*PaginationResultMenu, error)
- func (s *Service) GetByID(ctx context.Context, id int64) (*menuDomain.Menu, error)
- func (s *Service) GetByTopCount(ctx context.Context, count int) ([]menuDomain.Menu, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NewMenu ¶
type NewMenu struct { Name string `json:"name" example:"Paracetamol"` Description string `json:"description" example:"Some Description"` Price float64 `json:"price" example:"200.50"` }
NewMenu is a struct that contains the data for a new menu
type PaginationResultMenu ¶
type PaginationResultMenu struct { Data *[]domainMenu.Menu Total int64 Limit int64 Current int64 NextCursor uint PrevCursor uint NumPages int64 }
PaginationResultMenu is a struct that contains the pagination result for menu
type Service ¶
type Service struct {
MenuRepository repository.Menus
}
Service is a struct that contains the repository implementation for menu use case
func (*Service) GetAll ¶
func (s *Service) GetAll(ctx context.Context, page int64, limit int64) (*PaginationResultMenu, error)
GetAll is a function that returns all menus
func (*Service) GetByTopCount ¶
GetByTopCount is a function that returns a menu by top counts
Click to show internal directories.
Click to hide internal directories.