cartrepo

package
v0.0.0-...-ffb043f Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 4 Imported by: 0

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

type CartRepository struct {
	DB dbc.SqlDbc
}

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

Jump to

Keyboard shortcuts

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