← All package workshops
Commerce / INTERACTIVE WORKSHOP

Build and inspect model baskets

Stow v2.1.0

Edit a fictional product catalog, build a command sequence and inspect real Stow lines, package model events, inverse memberships, cloning, source retention and soft deletion.

01 / CONFIGURE

Choose a scenario. Change the inputs or build a sequence of commands.

02 / RUN

Execute the installed package against a new fictional example.

03 / INSPECT

Follow the result, actual calls, generated output and integration code.

THE WORKBENCH

Make it your example.

Your server-side changes are temporary. External-service examples use local response fixtures. Start with sample data.

Execution result

Waiting for your first run
No execution yetEdit inputs ↑

Start with a preset, or change the input and run it.

The behavior is the example.

Your result will show the values, decisions and generated output from the actual package.

THE SAME PACKAGE, IN THE BROWSER

A basket with no server round-trip.

Use the published browser adapter directly. Observe mutation notifications, stored-data normalization, migration, quantity limits and recovery from a failed adapter.

Inspection kit

Safety pack

Field meter

Test stored data and legacy migration

This replaces only this panel’s memory adapter. Browser storage is untouched.

Current package snapshot

Calls and subscriptions

    EXPLORE THE PACKAGE

    What you can exercise here.

    INTERACTIVE

    Eloquent collection lifecycle

    Add/change/remove, options, clone/merge, deletion, inverse membership and actual package events.

    INTERACTIVE

    Browser adapter

    The separate browser panel imports the published module; this server fixture exercises Eloquent.

    HOST INTEGRATION

    Application commerce policy

    Checkout, prices, authorization, tenancy and durable concurrent edits remain host concerns.

    HOST INTEGRATION

    UUID and ULID subject migrations

    The package supports configurable fresh morph key migrations. This fixture uses integer subject IDs; converting saved production data requires its own ownership and migration review.

    UNDERSTAND THE BEHAVIOR

    A line is a model plus its normalized options.

    Build a catalog and replay a basket sequence. Inspect real Eloquent lines, inverse membership and model events; then compare the independent browser adapter below.

    01

    The builders are the fixture

    Catalog rows become fictional products numbered from 1. Commands target cart or saved and may use a current line position. Run next command replays the selected prefix from fresh records; it does not continue an earlier server session. Clear sequence leaves empty baskets.

    02

    Matching options combine quantities

    Adding the same product with the same normalized options updates one line. A different finish creates another line. Clone copies lines into a saved basket; merge adds their quantities while retaining the source. Inspect both baskets and product membership counts.

    03

    Ownership and deletion remain visible

    A wrong-basket change asks the saved basket to modify a cart line and is rejected. Delete soft-deletes the basket and its lines. These package guards do not replace application authorization, inventory checks or accepted-price snapshots.

    04

    Browser storage has its own contract

    The browser panel calls the published adapter directly, with subscription events and detached snapshots. Tab memory is the default; browser persistence is explicit. Its quantity ceiling and stored-data fixtures belong to this host example, not to the Eloquent API.

    GO FURTHER

    Try the boundary cases.

    1. Build and replay a real order

      Clear sequence. Append two additions for product 1, quantities 2 and 3, both with {"finish":"black"}; append a white addition. Replay each prefix. Expected: one black line with quantity 5 and a separate white line. Change or remove a line using its current position.

    2. Prove clone and merge semantics

      Start with one cart line of quantity 2, then clone and merge from saved. Expected: cart quantity 4, saved quantity 2, and inverse product membership in both baskets. Use Compare runs after removing merge to isolate its effect.

    3. Check ownership and retained copies

      Run Cross-basket guard, then Clone then delete the source. Expected: the first reports a rejected change; the second retains the saved copy while the original basket and its lines are marked deleted. Inspect package events as well as the final lines.

    4. Exercise browser recovery

      In the browser panel add a product, test a detached snapshot, and load the duplicates, malformed JSON, unsupported version and legacy fixtures. Expected: normalization or rejection is visible in the adapter log. Switch to storage failure and mutate: memory remains usable while persistence failure is reported. Reloading the page clears tab-only data.

    COMPOSE THE RESPONSIBILITIES

    Useful alone.
    Better when the boundaries fit.

    Stow owns membership, quantities and option identity. Priceable can resolve authoritative prices for those products; NestedTerms can describe catalog attributes. The application owns stock, customer access, checkout and durable order snapshots.

    Priceable NestedTerms Read every API and recipe