Documentation
¶
Index ¶
- Constants
- func Creator(ctx context.Context, cfg *supermarket.Config) (supermarket.Supermarket, error)
- func NewAuthenticator(ctx context.Context, cfg *supermarket.Config) (*authenticatorService, error)
- func NewPromotion(ctx context.Context, cfg *supermarket.Config, ts oauth2.TokenSource) (*promotionService, error)
- type ClipDeal
- type ClipDealRoot
- type EpochMillisTime
- type GetClipDealsResponse
- type Promotion
- type PromotionHierarchy
Constants ¶
View Source
const ( PROMOTIONS_GET_CLIP_DEALS_URL = "https://www.safeway.com/abs/pub/mobile/j4u/api/ecomgallery?storeId=%s&offerPgm=PD-CC&includeRedeemedBonusOffers=y" PROMOTIONS_CLIP_DEALS_URL = "https://www.safeway.com/abs/pub/mobile/j4u/api/offers/clip?storeId=%s" )
View Source
const ( COUPON_TYPE_PERSONALIZED_DEAL couponType = "PD" COUPON_TYPE_COUPON_MF couponType = "MF" COUPON_TYPE_COUPON_SC couponType = "SC" COUPON_TYPE_COUPON_CC couponType = "CC" COUPON_TYPE_GROCERY_REWARD couponType = "GR" COUPON_TYPE_MONOPOLY_PRIZE couponType = "TR" COUPON_TYPE_WEEKLY_AD couponType = "WS" )
View Source
const ( FILTER_COUPON_TYPE_PERSONALIZED_DEAL filterCouponType = "PD" FILTER_COUPON_TYPE_COUPON_MF filterCouponType = "MF" FILTER_COUPON_TYPE_COUPON_SC filterCouponType = "SC" FILTER_COUPON_TYPE_COUPON_CC filterCouponType = "CC" FILTER_COUPON_TYPE_COUPON_MC filterCouponType = "manufacturerCoupons" )
View Source
const ( COUPON_ACTION_TYPE_CLIP couponActionType = "CL" COUPON_ACTION_TYPE_CLIPPED couponActionType = "CLD" COUPON_ACTION_TYPE_ADD couponActionType = "AC" COUPON_ACTION_TYPE_ADDED couponActionType = "ADC" COUPON_ACTION_TYPE_CLIP_COUPON couponActionType = "CLC" COUPON_ACTION_TYPE_CLIP_OFFER couponActionType = "CLCUDC" COUPON_ACTION_TYPE_ACTIVATE couponActionType = "SCC" COUPON_ACTION_TYPE_BONUS_PATH_COMPLETE couponActionType = "CC" )
View Source
const ( OFFER_TYPE_UNLIMITED_USE offerType = "U" OFFER_TYPE_ONE_TIME_USE_O offerType = "O" OFFER_TYPE_ONE_TIME_USE_M offerType = "M" )
View Source
const ( CLIP_STATUS_TYPE_CLIPPED clipStatusType = "C" CLIP_STATUS_TYPE_UNCLIPPED clipStatusType = "U" )
Variables ¶
This section is empty.
Functions ¶
func Creator ¶
func Creator(ctx context.Context, cfg *supermarket.Config) (supermarket.Supermarket, error)
func NewAuthenticator ¶
func NewAuthenticator(ctx context.Context, cfg *supermarket.Config) (*authenticatorService, error)
func NewPromotion ¶
func NewPromotion(ctx context.Context, cfg *supermarket.Config, ts oauth2.TokenSource) (*promotionService, error)
Types ¶
type ClipDealRoot ¶
type ClipDealRoot struct {
Items []ClipDeal `json:"items"`
}
type EpochMillisTime ¶
EpochMillisTime is a custom type to handle Unix milliseconds timestamps.
func (EpochMillisTime) String ¶
func (emt EpochMillisTime) String() string
String returns the time in a human-readable format.
func (*EpochMillisTime) UnmarshalJSON ¶
func (emt *EpochMillisTime) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface and parses a JSON string representing Unix time in milliseconds.
type GetClipDealsResponse ¶
type GetClipDealsResponse struct {
Coupons []Promotion `json:"cc,omitempty"`
PersonalizedDeals []Promotion `json:"pd,omitempty"`
}
GetClipDealsResponse is the top-level structure for the deals response.
type Promotion ¶
type Promotion struct {
AllocationID string `json:"allocationId,omitempty"` //
Brand string `json:"brand"` // Maps to: Brand
Category string `json:"category"` // Maps to: Category
ClipID string `json:"clipId"` // Maps to: ID
Description string `json:"description"` // Maps to: Description
Disclaimer string `json:"disclaimer"` // Maps to: Disclaimer
EcomDescription string `json:"ecomDescription"` // Maps to: Shorter description
ExternalOfferID string `json:"extlOfferId"` //
ForUDescription string `json:"forUDescription"` //
Hierarchies PromotionHierarchy `json:"hierarchies"` // Maps to: Categories
ImageID string `json:"imageId"` // Maps to: ImageID
Upcs []string `json:"upcs"` // Maps to: ApplicableItems
MinPurchaseQuantity int `json:"minPurchaseQty"` // Maps to: MinPurchaseQuantity
MaxPurchaseQuantity int `json:"maxPurchaseQty"` // Maps to: MaxPurchaseQuantity
Price float64 `json:"price"` // Maps to: Price
RegularPrice string `json:"regularPrice,omitempty"` //
OfferID string `json:"offerId"` // Maps to: PromoCode
OfferPgm string `json:"offerPgm"` // Maps to: PromoType
OfferProgramType string `json:"offerProgramType"` // Maps to: ProgramType
ProgramType string `json:"programType,omitempty"` //
OfferProtoType string `json:"offerProtoType"` //
OfferSubPgm string `json:"offerSubPgm,omitempty"` //
PurchaseIndex string `json:"purchaseInd"` //
PurchaseRank string `json:"purchaseRank"` //
Status clipStatusType `json:"status"` // Maps to: Status
UsageType string `json:"usageType"` // Maps to: UsageType
StartDate EpochMillisTime `json:"startDate"` // Maps to: StartDate
EndDate EpochMillisTime `json:"endDate"` // Maps to: EndDate
OfferTimestamp EpochMillisTime `json:"offerTs"` //
ClippedAt EpochMillisTime `json:"clipTs"` // Maps to: ClippedAt
IsDeleted bool `json:"deleted"` // Maps to: IsDeleted
IsClippable bool `json:"isClippable"` // Maps to: IsClippable
IsDisplayable bool `json:"isDisplayable"` // Maps to: IsDisplayable
VendorBannerCd string `json:"vndrBannerCd,omitempty"` //
}
Promotion represents an individual promotion item.
type PromotionHierarchy ¶
type PromotionHierarchy struct {
Categories []string `json:"categories"`
Events []string `json:"events"`
}
PromotionHierarchy represents the nested hierarchy data.
Click to show internal directories.
Click to hide internal directories.