PresentmentModel

A model which can be used to drive UI for presentment.

This model is designed to be shared by a mechanism (the code communicating with a credential reader) and the UI layer (which displays UI to the user). Typically the mechanism will also include a PromptModel bound to the UI so things like consent prompts and authentication dialogs are displayed in the UI.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
sealed class State

State hierarchy.

Properties

Link copied to clipboard

The set of Documents currently selected to be returned.

Link copied to clipboard

The DocumentStore being used for presentment.

Link copied to clipboard

The DocumentTypeRepository to provide information about document types.

Link copied to clipboard
val numRequestsServed: StateFlow<Int>

The number of requests served from the reader.

Link copied to clipboard

The current state of the model.

Functions

Link copied to clipboard
fun reset(documentStore: DocumentStore, documentTypeRepository: DocumentTypeRepository, preselectedDocuments: List<Document>)

Resets the model.

Link copied to clipboard

Should be called by the UI layer when the user cancels the transaction.

Link copied to clipboard
fun setCompleted(error: Throwable?)

Should be called by the mechanism when the transaction is complete.

Link copied to clipboard

Should be called by the mechanism when connecting to the credential reader, if applicable

Link copied to clipboard
fun setDocumentsSelected(selectedDocuments: List<Document>)

Should be called by the mechanism when the user selects a particular set of documents.

Link copied to clipboard

Should be called by the mechanism when transmitting the response to the credential reader.

Link copied to clipboard

Should be called by the mechanism when waiting for the credential reader to send a request.

Link copied to clipboard

Should be called by the mechanism when waiting for the user to provide input (consent prompt or authentication).