feat: surface all Kosik sale types with dynamic pricing UI - #24
Open
GnotAGnoob wants to merge 1 commit into
Open
feat: surface all Kosik sale types with dynamic pricing UI#24GnotAGnoob wants to merge 1 commit into
GnotAGnoob wants to merge 1 commit into
Conversation
Parse and expose the full set of promotional data from Kosik.cz: percentage discounts, action labels, promo labels, loyalty/membership prices, cumulative (bulk) pricing tiers, and recommended-price strike-throughs. Propagate the data through the shared scraper types, orchestrator response, Swagger schema and generated TS client. Render the offers in ProductCard with interactive controls (quantity stepper and member toggle) that recompute the effective unit and total price based on which sale conditions are met, and display the resulting savings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the full set of promotional data Kosik.cz returns and render it in
ProductCard, with interactive controls that recompute the effective price based on which sale conditions are met.Sale types now surfaced
percentageDiscount+recommendedPrice(strike-through original price, red "-XX%" badge on the image)actionLabel)labels[](colored bybackground)loyaltyClubBenefitsPricewith a toggle button to apply itcumulativePrices[]tiers shown as a list, the active tier is highlighted based on the selected quantityDynamic pricing
The new
ProductSalescomponent has a quantity stepper and a "member" toggle. On every change,computeEffectivePricepicks the best per-unit price from the conditions met (base / member / active bulk tier), then shows:Backend changes
RecommendedPrice,PercentageDiscount,ActionLabel,Labels,LoyaltyClubBenefitsPrice,HasLoyaltyClubBenefitsPrice,CumulativePricesininternal/scraper/kosik/kosikSchema.go.Sales,SaleLabel,CumulativePriceshared types ininternal/scraper/shared/structs.go, populated viaextractSalesin the Kosik mapper.salesFields/saleLabel/cumulativePriceFieldsin the orchestrator response +mapSalesFieldmapper, reflected in the regenerated Swagger schema and TS client.Test plan
go build ./...succeeds (verified locally)go test ./...passes (verified locally — no test files for touched packages)make swaggerregeneratesdocs/swagger.jsonwithout errorsbun run build(gen:client + vite build + tsc) succeeds (verified locally)bun run checkpasses (verified locally)POST /api/v1/text/productswith a recipe and confirm the response contains a populatedsalesfield for products on promotionhttps://claude.ai/code/session_01U4pUeWgKtQLYgPgWgDkfto