Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cart ¶
type Cart struct { ID uint CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time UserID uint TotalPrice int }
type CartProduct ¶
type CartProduct struct { ID uint CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time CartID uint ProductID uint Count int Price int }
func NewCartProduct ¶
func (*CartProduct) ModifyCartProduct ¶
func (oldCartProduct *CartProduct) ModifyCartProduct(newPrice int, newCount int, updated time.Time) CartProduct
type CartWithProduct ¶
type CreateCartData ¶
type Repository ¶
type Repository interface { FindCartByUserID(int) (*Cart, error) CreateCart(Cart) (*Cart, error) UpdateCart(Cart) (*Cart, error) FindCartProduct(int, int) (*CartProduct, error) FindCartProductByCart(int) ([]CartProduct, error) CreateCartProduct(CartProduct) (*CartProduct, error) UpdateCartProduct(CartProduct) (*CartProduct, error) SumPrice(int) int }
type Service ¶
type Service interface { CreateCart(int, CreateCartData) error FindCartByUserID(userID int) ([]CartProduct, error) }
func NewService ¶
func NewService(repository Repository, productRepo productServ.Repository) Service
Click to show internal directories.
Click to hide internal directories.