A utility type for branding primitives to ensure type safety with unique identifiers.
dyna-record brands some attributes on its own behalf — ForeignKey,
NullableForeignKey, Searchable — and strips those brands
from every caller-facing input, so create, update, and search filters
all accept the plain underlying value. A brand you define with this type is
treated as the opposite: it exists precisely so that a bare value fails, so
it is never stripped and a caller must supply the branded value.
The rule in one line: dyna-record strips its own brands, never yours.
A utility type for branding primitives to ensure type safety with unique identifiers.
dyna-record brands some attributes on its own behalf — ForeignKey, NullableForeignKey, Searchable — and strips those brands from every caller-facing input, so
create,update, and search filters all accept the plain underlying value. A brand you define with this type is treated as the opposite: it exists precisely so that a bare value fails, so it is never stripped and a caller must supply the branded value.The rule in one line: dyna-record strips its own brands, never yours.