dref
v1.0.0
specification.json

Domain catalog

Each item is a global domain document: one JSON envelope with domain-wide defaults, its scopes, and the models that make up the domain. Copy a model, or use it as a starting point.

catalog
orders
Commercev1.0.0
5 models · 2 scopes

Core e-commerce concepts: customers, product catalog, orders, line items, and payment intents.

Domain defaults
formatsdate: YYYY-MM-DDtime: HH:mm:ssdateTime: YYYY-MM-DDTHH:mm:ssZ
Commerce/catalogCustomerentityauthority: clientttl: count: unbounded
PropertyTypeFlagsRules
id
Customer identifier.
String
key
startsWith:cus_
email
Primary contact email.
String
emaillowercasetrimmed
firstName
Customer's given name.
String
notEmptymaxLength:100
lastName
Customer's family name.
String
notEmptymaxLength:100
phone
Optional contact phone number.
String
pattern:^\+?[0-9]{7,15}$trimmed
isActive
Whether the customer is enabled.
Boolean
createdAt
Creation timestamp.
DateTime
updatedAt
Last update timestamp.
DateTime
Customer · model JSON
{
  "name": "Customer",
  "scope": "catalog",
  "authority": "client",
  "properties": [
    {
      "name": "id",
      "type": "String",
      "required": true,
      "key": true,
      "description": "Customer identifier.",
      "rules": [
        {
          "type": "startsWith",
          "param": "cus_"
        }
      ]
    },
    {
      "name": "email",
      "type": "String",
      "required": true,
      "description": "Primary contact email.",
      "rules": [
        {
          "type": "email"
        },
        {
          "type": "lowercase"
        },
        {
          "type": "trimmed"
        }
      ]
    },
    {
      "name": "firstName",
      "type": "String",
      "required": true,
      "description": "Customer's given name.",
      "rules": [
        {
          "type": "notEmpty"
        },
        {
          "type": "maxLength",
          "param": 100
        }
      ]
    },
    {
      "name": "lastName",
      "type": "String",
      "required": true,
      "description": "Customer's family name.",
      "rules": [
        {
          "type": "notEmpty"
        },
        {
          "type": "maxLength",
          "param": 100
        }
      ]
    },
    {
      "name": "phone",
      "type": "String",
      "required": false,
      "description": "Optional contact phone number.",
      "rules": [
        {
          "type": "pattern",
          "param": "^\\+?[0-9]{7,15}
quot; }, { "type": "trimmed" } ] }, { "name": "isActive", "type": "Boolean", "required": false, "description": "Whether the customer is enabled." }, { "name": "createdAt", "type": "DateTime", "required": true, "description": "Creation timestamp." }, { "name": "updatedAt", "type": "DateTime", "required": true, "description": "Last update timestamp." } ] }