handlers

package
v0.0.0-...-4fc5841 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartHandler

type CartHandler interface {
	NewCart(*fiber.Ctx) error
	AddItem(*fiber.Ctx) error
	GetCart(*fiber.Ctx) error
	DeleteCart(*fiber.Ctx) error
}

func NewCartHandler

func NewCartHandler(
	cartService services.CartService,
	productService services.ProductService,
) CartHandler

type OrderHandler

type OrderHandler interface {
	CreateOrder(*fiber.Ctx) error
	GetTheOrders(*fiber.Ctx) error
	GetOrderSerializer(entity.Order) ResponseOrder
	GetOrdersSerializerByUserId(entity.User) ResponseOrders
}

func NewOrderHandler

func NewOrderHandler(
	orderService services.OrderService,
	cartService services.CartService,
	productService services.ProductService,
) OrderHandler

type ProductHandler

type ProductHandler interface {
	GetProductList(*fiber.Ctx) error
	GetProduct(*fiber.Ctx) error
	NewProduct(*fiber.Ctx) error
	DeleteProduct(*fiber.Ctx) error
}

func NewProductHandler

func NewProductHandler(productService services.ProductService) ProductHandler

type ResponseOrder

type ResponseOrder struct {
	ID        uuid.UUID           `json:"id"`
	CreatedAt time.Time           `json:"created_at"`
	Items     []ResponseOrderItem `json:"items"`
}

type ResponseOrderItem

type ResponseOrderItem struct {
	Product   entity.Product `json:"product"`
	Quantity  uint           `json:"quantity"`
	UnitPrice uint           `json:"unit_price"`
}

type ResponseOrders

type ResponseOrders struct {
	Orders []ResponseOrder `json:"orders"`
}

type UserHandler

type UserHandler interface {
	Register(*fiber.Ctx) error
	Login(*fiber.Ctx) error
}

func NewUserHandler

func NewUserHandler(userService services.UserService) UserHandler

Jump to

Keyboard shortcuts

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