enhancement: R2 push secrets from env + Added Upsells CRUD - #101
Open
mouradsme wants to merge 4 commits into
Open
enhancement: R2 push secrets from env + Added Upsells CRUD#101mouradsme wants to merge 4 commits into
mouradsme wants to merge 4 commits into
Conversation
- Implemented upsell functionality including database schema changes for products, upsell assignments, and store configurations. - Created routes and handlers for managing upsell assignments with validation. - Added integration tests for upsell configuration and product upsells. - Introduced shared queries for upsell configurations and product upsells. - Enhanced error handling for upsell operations.
- Introduced `isUpsell` property to the Product model and updated related components to handle upsell products. - Added `ProductUpsellsCard` component for managing upsell offers associated with products. - Implemented `UpsellSettings` component for configuring upsell visibility options in store settings. - Enhanced API endpoints to support fetching and saving upsell configurations. - Created database migration to add `show_in_catalogue` field to `store_upsell_config` table. - Updated tests to cover new upsell features and configurations.
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.
UPSELLS CRUD API endpoints:
GET /api/products/{productId}/upsells
| No body
POST /api/products/{productId}/upsells
| { upsellProductId, price?, compareAtPrice?, isActive?, position? }
PATCH /api/products/{productId}/upsells/{upsellId}
| same, minus upsellProductId
DELETE /api/products/{productId}/upsells/{upsellId}
| No body
GET /api/stores/upsell-config
| No body
POST /api/stores/upsell-config
| { showInInlineCheckout?, showInConfirmModal? }
Order creation also accepts upsells: [{ productId, quantity }], validates each offer is active, checks inventory, and links the extra lines to the parent via order_products.upsell_of_id.
PUSH R2 SECRETS
cd cod-servernpm run setup:r2 -- --push-secrets