feat(showcase): shop app — i64 money + ?active filter (Phase 3)#525
Merged
Conversation
Adds the second sub-app. Exercises framework surfaces not covered by
phase 2:
- `unique = true` constraint via #[rustango(unique)] on SKU
- `Option<i64>` round-trip with null ≠ 0 distinction (stock)
- `#[rustango(default = "true")]` rendered into DDL DEFAULT
- Query-param-driven `.filter_op()`: GET /shop/products?active=true
- ASC ordering (re-confirms phase-2 fix)
## Routes
GET /shop/products[?active=…] — list, optionally filtered
GET /shop/products/{id} — retrieve, 404 on miss
POST /shop/products — create
## Why cents, not Decimal
#[derive(Model)] doesn't accept `Decimal` today despite `FieldType::Decimal`
existing in the framework — see #524. Cents (i64) is the common
e-commerce shape anyway; will swap to `Decimal` once #524 lands.
## Playwright
6 new tests under e2e/tests/shop/: create + retrieve round-trip,
null stock, ?active=true filter, ?active=false filter, unique SKU
collision, 404. Suite is now 13/13 passing locally (2 smoke + 5 blog
+ 6 shop).
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
Phase 3 of the E2E showcase plan. Adds the `shop` sub-app exercising framework surfaces not covered by phase 2:
Routes
Why cents, not Decimal
`#[derive(Model)]` doesn't accept `rust_decimal::Decimal` despite the framework's `FieldType::Decimal` existing — see #524 filed as part of this PR. Cents (i64) is the common e-commerce shape anyway. Will swap to `Decimal` once #524 lands.
Playwright
6 new tests under `e2e/tests/shop/`. Suite is now 13/13 passing locally (2 smoke + 5 blog + 6 shop).
CI matrix
Same shape as phase 2 — runs each of the 13 tests against postgres / mysql / sqlite.