services

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartService

type CartService interface {
	CreateCart() (*entity.Cart, error)
	GetCartById(string) (entity.Cart, error)
	DeleteCartById(uuid.UUID) error
	GetCartItemsByCartId(uuid.UUID) ([]entity.CartItem, error)
	GetCartItemByCartIdAndProductId(cart_id uuid.UUID, product_id uint) (entity.CartItem, error)
	GetCartSerializer(entity.Cart) interface{}
	SaveCartItem(entity.CartItem) (entity.CartItem, error)
}

func NewCartService

func NewCartService(cartRepository repositories.CartRepository) CartService

type OrderService

type OrderService interface {
	CreateOrder(entity.Order) (*entity.Order, error)
	CreateOrderItems([]entity.OrderItem) error
	GetOrderItemsByOrderId(id uuid.UUID) ([]entity.OrderItem, error)
	GetOrderByUserId(user_id uint) ([]entity.Order, error)
}

func NewOrderService

func NewOrderService(orderRepository repositories.OrderRepository) OrderService

type ProductService

type ProductService interface {
	CreateProduct(*entity.Product) (*entity.Product, error)
	GetAllProducts() ([]entity.Product, error)
	GetProductById(uint) (entity.Product, error)
	DeleteProduct(*entity.Product) error
}

func NewProductService

func NewProductService(productRepository repositories.ProductRepository) ProductService

type ResponseCart

type ResponseCart struct {
	ID        uuid.UUID      `json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`
	Items     []ResponseCartItem
}

type ResponseCartItem

type ResponseCartItem struct {
	CreatedAt time.Time      `json:"created_at"`
	Product   entity.Product `json:"product"`
	Quantity  uint           `json:"quantity"`
}

type UserService

type UserService interface {
	CreateUser(*entity.User) (*entity.User, error)
	GetUserByUsername(string) (*entity.User, error)
}

func NewUserService

func NewUserService(userRepository repositories.UserRepository) UserService

Jump to

Keyboard shortcuts

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