diner

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 diner provides the use case for diner

Package diner provides the use case for diner

Package diner provides the use case for diner

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NewDiner

type NewDiner struct {
	Name        string `json:"name" example:"Mr. Smith"`
	TableNumber int    `json:"table_no" example:"101"`
}

NewDiner is a struct that contains the data for a new diner

type PaginationResultDiner

type PaginationResultDiner struct {
	Data       *[]domainDiner.Diner
	Total      int64
	Limit      int64
	Current    int64
	NextCursor uint
	PrevCursor uint
	NumPages   int64
}

PaginationResultDiner is a struct that contains the pagination result for diner

type Service

type Service struct {
	DinerRepository repository.Diners
}

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

func (*Service) Create

func (s *Service) Create(ctx context.Context, diner *NewDiner) (*dinerDomain.Diner, error)

Create is a function that creates a diner

func (*Service) Delete

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

Delete is a function that deletes a diner by id

func (*Service) GetAll

func (s *Service) GetAll(ctx context.Context, page int64, limit int64) (*PaginationResultDiner, error)

GetAll is a function that returns all diners

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, id int64) (*dinerDomain.Diner, error)

GetByID is a function that returns a diner by id

Jump to

Keyboard shortcuts

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