kojev
A Kotlin Multiplatform client for Jev that returns your own enums and sealed types instead of raw strings.
A Kotlin Multiplatform client for Jev that returns your own enums and sealed types instead of raw strings.
A decision is a serializable state plus question values. choice takes an enum whose constants each carry a description, noul takes an instruction with optional yes and no criteria, and score takes a rubric ordered from the lowest level. One decide call sends them together and maps each answer back into the caller's own types: the chosen enum constant, the probability of yes, or the rubric level.
What does the customer want?
The state is a Ticket with subject, body, plan and prior contact count. The same request asks which team should handle it, whether the customer is angry, and how urgent the reply is.
Is the customer expressing anger?
The state is a Ticket with subject, body, plan and prior contact count. The same request asks which team should handle it, whether the customer is angry, and how urgent the reply is.
How urgently does this need a response, on a three-level rubric from later to now?
The state is a Ticket with subject, body, plan and prior contact count. The same request asks which team should handle it, whether the customer is angry, and how urgent the reply is.
Question values are declared once as top-level properties, with enum constants that each describe themselves.
The caller builds a small serializable structure for the decision instead of sending the whole record.
decide sends the state and every asked question in a single request to the System One endpoint.
Each answer becomes a typed value, so a chosen option arrives as the caller's enum constant rather than a string.
The client keeps retry and error handling, and a response error carries the provider message to the caller.
The type system carries the question, since a constant without a description does not compile, so a misspelled option cannot reach the request and the same question value can be asked against any state.