Skip to content

feat(showcase): shop app — i64 money + ?active filter (Phase 3)#525

Merged
ujeenet merged 1 commit into
developfrom
feat/e2e-showcase-phase3-shop
May 23, 2026
Merged

feat(showcase): shop app — i64 money + ?active filter (Phase 3)#525
ujeenet merged 1 commit into
developfrom
feat/e2e-showcase-phase3-shop

Conversation

@ujeenet
Copy link
Copy Markdown
Owner

@ujeenet ujeenet commented May 23, 2026

Summary

Phase 3 of the E2E showcase plan. Adds the `shop` sub-app exercising framework surfaces not covered by phase 2:

  • `unique` constraint via `#[rustango(unique)]` on SKU
  • `Option` nullable round-trip (null `stock` ≠ 0 stock)
  • `#[rustango(default = "true")]` rendered through DDL → DB default
  • Query-param-driven filtering: `GET /shop/products?active=true` → `.filter_op("active", Op::Eq, true)`

Routes

Method Path Result
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 `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.

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).
@ujeenet ujeenet merged commit 47ca3a1 into develop May 23, 2026
11 checks passed
@ujeenet ujeenet deleted the feat/e2e-showcase-phase3-shop branch May 23, 2026 12:34
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