---
Core vocabulary for the URL shortener.

These types are shared across the analytics and links contexts. Because
commons declarations mix into each using context, each context gets its own
nominal copy — but they remain structurally compatible, so values can cross
context boundaries via the structural-projection mechanism.

Refined String types (rather than opaque) so that their underlying string
representation serialises directly across HTTP and Service Binding boundaries.
---
commons shortener.core

---
A short code identifying a shortened link: six to eight alphanumeric
characters. The refinement is validated whenever a ShortCode is constructed
from untrusted input (an HTTP path segment, a request body, a deserialised
cross-context payload).
---
type ShortCode = String where Matches("[a-zA-Z0-9]{6,8}")

---
A target URL. Constrained to look like an http(s) URL. Validated on
construction from untrusted input.
---
type Url = String where Matches("https?://.+")
