Changelog - 2026-11-08
A statuses subpath, and status checks that read the code
Behaviour changeIn one line. A browser bundle can import Statuses and CommonStatuses from @venizia/ignis-kernel/statuses, and an app can add its own status codes by extending Statuses.
What changed
- A new entry,
@venizia/ignis-kernel/statuses. It exportsStatusesandCommonStatusesand imports nothing else. The root export is unchanged. - The category checks read the leading digit.
isInitial,isPending,isActive,isCompleted,isInactiveandisFailedare true for a code that starts with0,1,2,3,4and5. A code an app adds is checked like a built-in one. isValidchecks the shape of a code. It is true forNNN_NAME: a digit0to5, two digits, an underscore, then upper-case letters, digits and underscores. It no longer checks membership of the built-in list, so a well-formed code the framework does not define is now valid. To accept only the built-in statuses, useStatuses.SCHEME_SET.has(status).- Seven new statuses.
OPEN(105_OPEN) andSUBMITTED(106_SUBMITTED) join the pending group;READY(206_READY),PUBLISHED(207_PUBLISHED) andISSUED(208_ISSUED) the active one;RESOLVED(306_RESOLVED) the completed one;VOIDED(508_VOIDED) the failed one. Each is in its group set and inSCHEME_SET. - The leading-digit rule is for
Statusesand the classes that extend it. A domain class that uses theNNN_prefix as an ordinal step number must not go through these checks. - The
*_SCHEME_SETsets andCommonStatusesare unchanged. The sets stay the list of the built-in statuses, andCommonStatuses.isValidstill checks its own five.
typescript
import { Statuses } from '@venizia/ignis-kernel/statuses';
class OrderStatuses extends Statuses {
static readonly SHIPPING = '209_SHIPPING';
}
OrderStatuses.isActive(OrderStatuses.SHIPPING); // trueWho is affected
- Code that relied on
Statuses.isValidrejecting a well-formed code the framework does not define. It now returns true. CheckStatuses.SCHEME_SET.has(status)where you need the built-in list. - A subclass of
Statusesthat already defines one of the seven codes, or one of the seven names, for another meaning. The new constant is inherited, so pick another code. - Everyone else. No action needed.
Details
| File | Package |
|---|---|
src/common/statuses/common.ts | kernel |
src/statuses.ts | kernel |