package repository

import "errors"

const (
	FindCartByUserIDQuery = `SELECT id, user_id, total_price, status, expire_at, created_at
		                 FROM carts
			             WHERE  user_id = ? AND status = 'active' AND deleted_at IS NULL
			             ORDER BY created_at DESC`

	FindCartByIDQuery = `SELECT id, user_id, total_price, status, expire_at, created_at
		             FROM carts
			         WHERE  id = ? AND status = 'active' AND deleted_at IS NULL`
)

var (
	ErrNotExistsCart = errors.New("not exists cart")
	ErrExpiredCart   = errors.New("expired cart")
)

const (
	IDField         = "id"
	UserIDField     = "user_id"
	StatusField     = "status"
	TotalPriceField = "total_price"
	CreatedAtField  = "created_at"
	ExpireAtField   = "expire_at"
	UpdatedAtField  = "updated_at"
)
