Documentation ¶
Overview ¶
Package order contains the repository implementation for the order entity
Package order contains the repository implementation for the order entity ¶
Package order contains the repository implementation for the order entity
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
Repository is a struct that contains the database implementation for order entity
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, newOrder *domainOrder.Request) (*domainOrder.Request, error)
Create ... Insert New data
func (*Repository) Delete ¶
func (r *Repository) Delete(ctx context.Context, id int) (err error)
Delete ... Delete order
func (*Repository) GetByID ¶
func (r *Repository) GetByID(ctx context.Context, dinerID int64) ([]domainOrder.Response, error)
GetByID ... Fetch only one order by Id
type Request ¶
type Request struct { ID int64 `db:"id" example:"123"` DinnerID int64 `db:"diner_id" example:"1"` MenuID int64 `db:"menu_id" example:"3"` Quantity int `db:"quantity" example:"2"` CreatedAt time.Time `db:"created_at" example:"2021-02-24 20:19:39"` }
Request is a struct that contains the order model
type Response ¶
type Response struct { ID int64 `db:"id" example:"123"` DinnerName string `db:"diner_name" example:"Mr. Smith"` MenuName string `db:"menu_name" example:"HCDB"` MenuDescription string `db:"menu_description" example:"Hyderabadi Chicken Dum Briyani"` Quantity int `db:"quantity" example:"2"` 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"` }
Response is a struct that contains the response order information
Click to show internal directories.
Click to hide internal directories.