package db import ( "github.com/gshopify/service-wrapper/model" "gshopper.com/gshopify/products/cache" "time" ) var ( productKey = func(clause string, args ...any) *cache.SqlKey { return cache.NewSQLKey( "product", time.Minute, clause, args...) } productSelection = func(ln model.LanguageCode) []string { return append([]string{ "id", "profile_id", "collection_ids", "type_id", "handle", "thumbnail", "is_giftcard", "discountable", "hs_code", "mid_code", "weight", "length", "height", "width", "origin_country", "vendor", "material", "created_at", "updated_at", "deleted_at", "tags", "status", }, ln.SqlFieldSelection("title"), ln.SqlFieldSelection("subtitle"), ln.SqlFieldSelection("description"), ) } productCollectionKey = func(clause string, args ...any) *cache.SqlKey { return cache.NewSQLKey( "product_collection", 3*time.Minute, clause, args..., ) } productOptionSelection = func(ln model.LanguageCode) []string { return append([]string{ "id", "product_id", "created_at", "updated_at", "deleted_at", }, ln.SqlFieldSelection("name"), ln.SqlArraySelection("values"), ) } productOptionKey = func(clause string, args ...any) *cache.SqlKey { return cache.NewSQLKey( "product_option", time.Second*30, clause, args...) } )