Skip to main content

Services overview

This section covers everything in the application/persistence planes that isn't itself a generator: CRUD services, *Behavior lifecycle hooks, register writers/readers, the posting service, lookup services, handlers, and the job scheduler.

Notable cross-cutting rules:

  • All *Behavior hooks (OnNewAsync/OnOpenAsync/OnBeforeSaveAsync/OnSaveAsync, plus OnSubmitAsync/OnUnsubmitAsync for documents) are ValueTask.
  • Documents write registers — and post to the chart-of-accounts subsystem — only inside OnSubmitAsync/OnDeleteAsync, via the ISubmitScope parameter passed into the hook. Register writer interfaces and IPostingService are keyed DI services, not resolvable by ordinary constructor injection, specifically so this is the only legal path to a register write or a posting.
  • OnDelete hooks fire before entity removal (OnBeforeDeleteAsync), not after — plan any cleanup logic accordingly.
  • Handlers (IHandler/ILocalHandler) are independent, keyed backend services — not document-tied — used for things like cross-document price lookups. Declarative local handlers bind via [HandlerTrigger(Type, Event, Target)]; don't wire a local handler's cascade inside a remote handler's own orchestrator — cascade at the Razor call site or leave it declarative-only.

See Generated API Reference for the concrete service catalog once the XML doc sync has run, and Register Engine / Chart of Accounts / Posting for the two accounting-adjacent subsystems in more depth.