Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft 14 #312

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

babisRoutis
Copy link
Contributor

@babisRoutis babisRoutis commented Sep 3, 2024

Closes #309
Closes #295
Closes #294
Closes #316

@babisRoutis
Copy link
Contributor Author

@vafeini Added in scope #316

We need to
a) Re-work the response of the deferred endpoint, since now a transaction_id corresponds to one or more credentials
b) Re-work IssuedCredential. The IssuedCredential.Deferred must be removed
c) Re-work on the SubmissionOutcome. We need to add Sumbission.SuccessDeferred

@babisRoutis
Copy link
Contributor Author

The following change was necessary:

Submission outcome has now three possible states: Success (or Issued), Deferred, Failed.

sealed interface SubmissionOutcome : java.io.Serializable {

    /**
     * State that denotes the successful submission of an issuance request
     * @param credentials The outcome of the issuance request.
     * If the issuance request was a batch request, it will contain the results of each issuance request.
     * If it was a single issuance request list will contain only one result.
     */
    data class Success(val credentials: List<IssuedCredential>) : SubmissionOutcome

    /**
     * Credential could not be issued immediately. An identifier is returned from server to be used later on
     * to request the credential from issuer's Deferred Credential Endpoint.
     *
     * @param transactionId  A string identifying a Deferred Issuance transaction.
     */
    data class Deferred(val transactionId: TransactionId) : SubmissionOutcome

    /**
     * State that denotes that the credential issuance request has failed
     *
     * @param error The error that caused the failure of the request
     */
    data class Failed(val error: CredentialIssuanceError) : SubmissionOutcome
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant