mirror of
https://github.com/3ybactuk/marketplace-go-service-project.git
synced 2025-10-30 14:03:45 +03:00
27 lines
666 B
Go
27 lines
666 B
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"route256/cart/internal/domain/entity"
|
|
"route256/cart/internal/domain/model"
|
|
)
|
|
|
|
type CartService interface {
|
|
AddItem(ctx context.Context, userID entity.UID, item *model.Item) error
|
|
GetItemsByUserID(ctx context.Context, userID entity.UID) (*model.Cart, error)
|
|
DeleteItem(ctx context.Context, userID entity.UID, sku entity.Sku) error
|
|
DeleteItemsByUserID(ctx context.Context, userID entity.UID) error
|
|
CheckoutUserCart(ctx context.Context, userID entity.UID) (int64, error)
|
|
}
|
|
|
|
type Server struct {
|
|
cartService CartService
|
|
}
|
|
|
|
func NewServer(cartService CartService) *Server {
|
|
return &Server{
|
|
cartService: cartService,
|
|
}
|
|
}
|