SuggestionHandler

Handler for one concrete Suggestion subtype. Multiple handlers may register for the same type — for example a SuggestedBiller could be processed by both an entity-promoter (writing the Org to the KG) and a biller-index writer.

Why a runtime type field rather than a reified generic. Spring auto-wiring of List<SuggestionHandler<*>> erases the type argument; the drainer needs a runtime key for groupBy dispatch. Exposing Class<T> keeps the handler implementation type-safe while letting the registry classify at the boundary.

Properties

Link copied to clipboard
abstract val type: Class<T>

The concrete subtype this handler accepts.

Functions

Link copied to clipboard
abstract fun apply(contextId: <Error class: unknown class>, suggestions: List<T>)

Apply suggestions in bulk. Implementations may batch the write to the underlying store (Drivine, DICE repo, app-domain persistence) — the drainer hands the full group at once.