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: 10 Imported by: 0

Documentation

Overview

Package diner contains the repository implementation for the diner entity

Package diner contains the repository implementation for the diner entity

Package diner contains the repository implementation for the diner entity

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diner

type Diner struct {
	ID          int64     `db:"id" example:"123"`
	TableNumber int       `db:"table_no" example:"101"`
	Name        string    `db:"name" example:"Mr. Smith"`
	CreatedAt   time.Time `db:"created_at" example:"2021-02-24 20:19:39"`
	UpdatedAt   time.Time `db:"updated_at" example:"2021-02-24 20:19:39"`
}

Diner is a struct that contains the diner model

func (*Diner) TableName

func (*Diner) TableName() string

TableName overrides the table name used by User to `users`

type Repository

type Repository struct {
	Store  *sdksql.DB
	Logger *logger.Logger
}

Repository is a struct that contains the database implementation for diner entity

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, newDiner *domainDiner.Diner) (*domainDiner.Diner, error)

Create ... Insert New data

func (*Repository) Delete

func (r *Repository) Delete(ctx context.Context, id int64) (err error)

Delete ... Delete diner

func (*Repository) GetAll

func (r *Repository) GetAll(ctx context.Context, page int64, limit int64) (*repository.PaginationResultDiner, error)

GetAll Fetch all diner data

func (*Repository) GetByID

func (r *Repository) GetByID(ctx context.Context, id int64) (*domainDiner.Diner, error)

GetByID ... Fetch only one diner by Id

func (*Repository) GetTotalCount

func (r *Repository) GetTotalCount(ctx context.Context) (int64, error)

GetTotalCount Fetch total count of diners

Jump to

Keyboard shortcuts

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