order

package
v0.0.0-...-bc6e940 Latest Latest
Warning

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

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

Documentation

Overview

Package order provides the use case for order

Package order provides the use case for order

Package order provides the use case for orders

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NewOrder

type NewOrder struct {
	DinnerID int64 `db:"diner_id" example:"1"`
	MenuID   int64 `db:"menu_id" example:"3"`
	Quantity int   `db:"quantity" example:"2"`
}

NewOrder is a struct that contains the data for a new Order

type Service

type Service struct {
	OrderRepository repository.Orders
}

Service is a struct that contains the repository implementation for order use case

func (*Service) Create

func (s *Service) Create(ctx context.Context, order *NewOrder) (*orderDomain.Request, error)

Create is a function that creates a order

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id int) error

Delete is a function that deletes a order by id

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, dinerID int64) ([]orderDomain.Response, error)

GetByID is a function that returns a order by diner ID

Jump to

Keyboard shortcuts

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