Attribute Types Reference

This document describes the seven attribute types supported by notifito, their wire formats, validation rules, and matching behavior.

Overview

notifito uses a closed set of seven attribute types. This set is shared by three consumers:

  1. Widget: Renders form inputs based on type
  2. Server-side validation: Validates submissions against type rules
  3. Matching engine: Compares subscription and event attributes

Adding an eighth type requires teaching all three consumers about it, so the set does not grow.


The Seven Types

1. enum

Single or multiple selection from a predefined list of options.

Wire Format (Scalar):
json
"42"
Wire Format (Multiple):
json
["41", "42"]
Definition:
json
{

"key": "size",

"label": "Size",

"type": "enum",

"options": ["40", "41", "42", "43"],

"required": true,

"matchable": true,

"multiple": false

}

Validation Rules: Matching Behavior: Widget Rendering:

3. decimal

Floating-point numbers with optional range constraints.

Wire Format (Scalar):
json
10.5
Wire Format (Interval):
json
{"min": 10.0, "max": 12.5}
Definition:
json
{

"key": "price",

"label": "Price",

"type": "decimal",

"required": true,

"matchable": true

}

Validation Rules: Matching Behavior: Widget Rendering:

4. date

ISO 8601 date values.

Wire Format:
json
"2026-09-01"
Definition:
json
{

"key": "appointment",

"label": "Appointment Date",

"type": "date",

"required": true,

"matchable": true

}

Validation Rules: Matching Behavior: Widget Rendering:

5. date_range

Start and end dates representing a range.

Wire Format:
json
{

"from": "2026-09-01",

"to": "2026-09-05"

}

Definition:
json
{

"key": "stay",

"label": "Stay Dates",

"type": "date_range",

"required": true,

"matchable": true

}

Validation Rules: Matching Behavior: Widget Rendering:

6. boolean

True/false values.

Wire Format:
json
true
Definition:
json
{

"key": "gift_wrap",

"label": "Gift Wrap",

"type": "boolean",

"required": false,

"matchable": true

}

Validation Rules: Matching Behavior: Widget Rendering:

7. text

Free-text values with a maximum length.

Wire Format:
json
"Leave at door"
Definition:
json
{

"key": "notes",

"label": "Special Notes",

"type": "text",

"required": false,

"matchable": false

}

Validation Rules: Matching Behavior: Widget Rendering:

Wire Format Summary

TypeScalar FormInterval FormNullable
enum"42"—No
enum (multiple)["41", "42"]—No
integer42{"min": 40, "max": 44}Yes (bounds)
decimal10.5{"min": 10, "max": 12.5}Yes (bounds)
date"2026-09-01"—No
date_range{"from": "...", "to": "..."}—Yes (bounds)
booleantrue—No
text"hello"—No

Matching Behavior Summary

TypeMatching Rule
enumExact equality (single) or set intersection (multiple)
integerExact equality or range containment
decimalExact equality or range containment
dateExact equality
date_rangeRange overlap
booleanExact equality
textExact equality (case-sensitive)

Wildcard Rules

This ensures sellers never under-notify due to missing attributes.


Schema Definition

Attribute Definition Structure

json
{

"key": "size",

"label": "Size",

"type": "enum",

"options": ["40", "41", "42"],

"required": true,

"matchable": true,

"multiple": false

}

FieldTypeRequiredDescription
keystringYesLowercase snake_case identifier
labelstringYesDisplay label
typestringYesOne of the seven types
optionsarrayConditionalRequired for enum type
requiredbooleanNoDefault: false
matchablebooleanNoDefault: true
multiplebooleanNoDefault: false (enum only)

Key Rules


Examples by Industry

E-commerce (Sneaker Store)

json
[

{

"key": "size",

"label": "Size",

"type": "enum",

"options": ["40", "41", "42", "43"],

"required": true,

"matchable": true,

"multiple": false

},

{

"key": "color",

"label": "Color",

"type": "enum",

"options": ["red", "blue", "black"],

"required": false,

"matchable": true,

"multiple": false

}

]

Hospitality (Hotel)

json
[

{

"key": "stay",

"label": "Stay Dates",

"type": "date_range",

"required": true,

"matchable": true

},

{

"key": "guests",

"label": "Number of Guests",

"type": "integer",

"required": true,

"matchable": true

}

]

Healthcare (Clinic)

json
[

{

"key": "appointment",

"label": "Appointment Date",

"type": "date",

"required": true,

"matchable": true

},

{

"key": "practitioner",

"label": "Practitioner",

"type": "enum",

"options": ["Dr Ng", "Dr Okafor", "Any"],

"required": false,

"matchable": true

}

]