Currently, RegistrarAction is a single explicitly defined type that must handle both registration and renewal cases.
This includes having the event field being defined as a type union.
It would be better to define separate types: RegistrarActionRegistration and RegistrarActionRenewal and then define RegistrarAction as a type union of those two types.
This would allow for nice specializations of each case's data model which will also be nice for type system conveniences, etc.
This can also help to simplify the way some fields / invariants are documented.
Currently,
RegistrarActionis a single explicitly defined type that must handle both registration and renewal cases.This includes having the
eventfield being defined as a type union.It would be better to define separate types:
RegistrarActionRegistrationandRegistrarActionRenewaland then defineRegistrarActionas a type union of those two types.This would allow for nice specializations of each case's data model which will also be nice for type system conveniences, etc.
This can also help to simplify the way some fields / invariants are documented.