← All package workshops
Data modeling / INTERACTIVE WORKSHOP

Build nested typed specifications

NestedTerms v2.0.0

Edit term/tag datasets and replay membership or ancestry edits. Compare persisted slugs with the package’s current hierarchy calculation after a parent rename.

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.

EXPLORE THE PACKAGE

What you can exercise here.

INTERACTIVE

Taxonomy construction and queries

Terms, typed values, hierarchical slug creation, cycle/cross-term guards, descendants and HasTags membership.

INTERACTIVE

Parent edit semantics

Stored child slugs are shown faithfully; parent edits do not pretend to cascade into descendants.

HOST INTEGRATION

Application-specific casts and policies

Custom models/casts, authorization, migrations of existing data and any descendant cascade policy belong to the host.

UNDERSTAND THE BEHAVIOR

Typed tags and stored hierarchy are separate facts.

Create terms and typed tags, edit ancestry, and replay membership operations against actual package models. Compare saved slugs with the hierarchy computed after an edit.

01

Rows have explicit references and types

Terms and tags are numbered from 1 in builder order. Parents must already exist and belong to the same term. The value editor preserves JSON types: enter false as a boolean and an object for JSON, then inspect runtime_type in the result.

02

Changing a parent does not rewrite every child

Rename and reparent invoke package model events and ancestry guards. Each returned tag includes its persisted slug and computed_hierarchy_slug. A parent rename can make these differ on descendants until those rows are explicitly updated.

03

Membership and activity are independent

Sync replaces product membership; attach and detach change selected memberships. Setting a tag inactive does not detach it. Compare product_tags with active_product_tags and the separate active term/tag scopes.

04

Replay exposes rejected mutations

Cycle and cross-term operations are rejected through the actual model. Commands run against a fresh fixture each time; removing all commands creates the taxonomy without product membership. Soft-deleted tags can be restored explicitly.

GO FURTHER

Try the boundary cases.

  1. Build structured specifications

    Use Typed JSON and boolean tags, or add a JSON tag with {"width":120,"unit":"mm"} and a boolean tag with false. Sync their IDs. Expected: runtime_type shows the actual returned types and tags_by_term groups memberships by their term.

  2. Observe stored descendant slugs

    Run Rename a parent and inspect descendants. Expected: the parent uses its new slug while a child may retain its previous stored slug; computed_hierarchy_slug reveals the newly derived hierarchy. This is a data-maintenance decision, not an automatic recursive rename.

  3. Attempt invalid ancestry

    Replay Reject a cycle and Reject cross-term parent one command at a time. Expected: each illegal operation is reported as rejected and the existing valid hierarchy is retained. Move a child to a valid parent in the same term to compare success.

  4. Separate active scope from membership

    Run Explicit active-tag scope. Expected: tag 2 stays in product_tags but disappears from active_product_tags. Then try attach, detach, delete and restore; inspect the soft-delete marker and actual membership after every prefix.

COMPOSE THE RESPONSIBILITIES

Useful alone.
Better when the boundaries fit.

NestedTerms describes classification and typed attributes. Stow records a chosen product and its options; Priceable selects a saved offer. Applications decide who may edit taxonomy and whether a classification affects eligibility or pricing.

Stow Priceable Read every API and recipe