pub struct TileProps {
pub item_id: String,
pub name: String,
pub price: String,
pub field: String,
pub default_quantity: Option<u32>,
pub categories: Vec<String>,
pub image_url: Option<String>,
pub color: Option<Tone>,
pub stock_badge: Option<String>,
pub price_cents: Option<u64>,
}Expand description
Props for a touch-friendly product tile with quantity controls.
Renders item name, price, and +/- buttons that drive a hidden input via JS. Used for touch-first selection screens (e.g. POS-style order creation).
Fields§
§item_id: String§name: String§price: String§field: String§default_quantity: Option<u32>§categories: Vec<String>Category memberships for client-side filtering. Rendered by
render_tile as a space-separated data-filter-tokens attribute,
emitted only when non-empty; the setupFilters runtime reads it.
Plural because an item may belong to several categories (a one-element
vec covers the singular case).
Token-list constraint: because the attribute is space-separated, spaces
inside a category name are normalized to hyphens at render time
("Bevande calde" becomes the token Bevande-calde). Filter runtimes
must apply the same normalization to category labels before matching.
image_url: Option<String>Optional item image URL. Declared here for the Phase 256 tile visual; not rendered in Phase 254 (D-03).
color: Option<Tone>Optional accent tone for the tile border (Phase 256 visual, D-03).
Maps through an exhaustive match to a full-literal border class in
render_tile; None or Neutral → the default border-border.
stock_badge: Option<String>Optional stock badge text (e.g. “Low”, “Out”). Phase 256 visual (D-03).
price_cents: Option<u64>Machine-readable unit price in integer cents. Rendered as
data-unit-price="{cents}" on the tile root wrapper. The client-computed
running total (SelectionPanel, Phase 256) reads this attribute because
price is a display string that cannot be parsed. Both fields are
expected to agree — the Phase 257 projector emits both from one source.
The runtime treats a missing attribute as 0 cents. Integer cents only —
never float (see PITFALLS.md).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TileProps
impl<'de> Deserialize<'de> for TileProps
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for TileProps
impl JsonSchema for TileProps
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more