Skip to content

feat(products): expose add-on category limits on public product payloads - #118

Merged
roncodes merged 2 commits into
release/v0.4.25from
feat/product-option-limits
Oct 7, 2026
Merged

roncodes merged 2 commits into
release/v0.4.25from
feat/product-option-limits

Conversation

@roncodes

@roncodes roncodes commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

The public product payload (GET storefront/v1/products/{id} and every resource that embeds products) now includes each add-on category's limits, so apps can enforce them before checkout:

  • addon_categories[].is_required (boolean, false when unset)
  • addon_categories[].max_selectable (integer, or null for no limit)

The internal (Console) payload gains the same two fields. Both already exist on ProductAddonCategory and are editable in the Console.

Variant max is intentionally not exposed. The Console has no field for it and the column defaults to 1, so publishing it would cap every multi-select variant at a single choice.

Tests

  • ProductResourceTest asserts both fields on public and internal payloads, plus the unset case (optional, no limit).
  • Full suite: 580 tests, 0 failures. All changed lines covered.

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (62af547) to head (2aeffa6).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##                main      #118   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      2282      2283    +1     
===========================================
  Files            182       182           
  Lines           9082      9086    +4     
===========================================
+ Hits            9082      9086    +4     
Flag Coverage Δ
backend 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@roncodes
roncodes changed the base branch from main to release/v0.4.25 October 6, 2026 19:14
@roncodes
roncodes merged commit 574e120 into release/v0.4.25 Oct 7, 2026
11 checks passed
@roncodes
roncodes deleted the feat/product-option-limits branch October 7, 2026 05:39
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