package cookie

import "time"

type ParseStatus string

const (
	ParseStatusAnonymous ParseStatus = "anonymous"
	ParseStatusDecoded   ParseStatus = "decoded"
	ParseStatusInvalid   ParseStatus = "invalid"
)

type SessionContext struct {
	RawCookie   string
	Plaintext   string
	CookieName  string
	CustomerID  *int64
	CartID      *int64
	LanguageID  *int64
	CurrencyID  *int64
	ShopID      *int64
	GuestID     *int64
	IsLoggedIn  bool
	ExpiresAt   *time.Time
	Values      map[string]string
	OrderedKeys []string
	ParseStatus ParseStatus
}

type Config struct {
	Version       string
	CookieName    string
	CookieKey     string
	CookieIV      string
	ProjectRoot   string
	BootstrapPath string
}

type Codec interface {
	Decode(raw string) (*SessionContext, error)
	Encode(session *SessionContext) (string, error)
}
