Documentation
¶
Index ¶
Constants ¶
View Source
const ( QUERY_SELECT = "select id, user_id, user_address_id, courier_id, payment_method_id, " + "is_active, key, created_at from cart " QUERY_ACTIVE_CART_BY_USER_ID = QUERY_SELECT + "where user_id = $1 and is_active = true" QUERY_CART_BY_KEY = QUERY_SELECT + "where key = $1 and is_active = true" )
View Source
const (
QUERY_INSERT = "insert into cart (user_id, is_active, key, created_at) " +
"values ($1, $2, $3, $4) returning id"
)
View Source
const (
QUERY_UPDATE = "update cart set courier_id=$1, user_address_id=$2, payment_method_id=$3, is_active=$4, updated_at=now() where id=$5"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartRepository ¶
func (*CartRepository) FindActiveCartByUserId ¶
func (cr *CartRepository) FindActiveCartByUserId(userId int) (*model.Cart, error)
func (*CartRepository) FindCartByKey ¶
func (cr *CartRepository) FindCartByKey(key string) (*model.Cart, error)
func (*CartRepository) InsertNewCart ¶
func (cr *CartRepository) InsertNewCart(cart *model.Cart) error
func (*CartRepository) UpdateCart ¶
func (cr *CartRepository) UpdateCart(cart *model.Cart) error
Click to show internal directories.
Click to hide internal directories.