Skip to content

enhancement: R2 push secrets from env + Added Upsells CRUD - #101

Open
mouradsme wants to merge 4 commits into
bighadj22:mainfrom
mouradsme:improvements/r2-push-secrets-from-env
Open

enhancement: R2 push secrets from env + Added Upsells CRUD#101
mouradsme wants to merge 4 commits into
bighadj22:mainfrom
mouradsme:improvements/r2-push-secrets-from-env

Conversation

@mouradsme

@mouradsme mouradsme commented Sep 8, 2026

Copy link
Copy Markdown

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

  • In Cloudflare Dashboard, go to R2 Object Storage, and click on "Manage API tokens" (usually in the bottom right corner), and generate a new token.
  • Update .env file with R2_ACCESS_KEY_ID & R2_SECRET_ACCESS_KEY
  • Run:
    cd cod-server
    npm run setup:r2 -- --push-secrets

- 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.
@mouradsme mouradsme changed the title Improvements/r2 push secrets from env enhancement: R2 push secrets from env Sep 8, 2026
@mouradsme mouradsme changed the title enhancement: R2 push secrets from env enhancement: R2 push secrets from env + Added Upsells CRUD Sep 8, 2026
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant