docusign / docusign-esign-java-client

The Official Docusign Java Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://javadoc.io/doc/com.docusign/docusign-esign-java/latest/index.html
MIT License
104 stars 95 forks source link

Enumerated Status (and update documentation) #126

Open chtibob69 opened 4 years ago

chtibob69 commented 4 years ago

While looking at com.docusign.esign.model.Envelope::getStatus, we found

@ApiModelProperty(example = "null", value = "Indicates the envelope status. Valid values are:  * sent - The envelope is sent to the recipients.  *created - The envelope is saved as a draft and can be modified and sent later.")
  public String getStatus() {
    return status;
  }

But there is many other status (completed created declined deleted delivered processing sent signed template voided) listed in the API documentation https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/listStatus)

The same applies for com.docusign.esign.model.Signer::getStatus...

Could you update the documentation to match the API ?

Improvement : I think it could be much Java to create specific enum type such as

public enum SignerStateEnum {

    // The recipient is in a draft state. This is only associated with draft envelopes (envelopes with a created status).
    @JsonProperty("created")
    CREATED("created"), //

    // The recipient has been sent an email notification that it is their turn to sign an envelope.
    @JsonProperty("sent")
    SENT("sent"), //

    // The recipient has viewed the documents in an envelope through the DocuSign signing web site. This is not an email delivery of the documents in an envelope.
    @JsonProperty("delivered")
    DELIVERED("delivered"), //
  ...
    @JsonEnumDefaultValue
    UNK("unk");

What's your opinion ?

LarryKlugerDS commented 4 years ago

Thank you for your issue report. Re: definition of the envelope status attribute. I've filed DEVDOCS-1818 to fix this.

Here is my recommendation for the definition: The envelope's status. Values are: completed: The envelope has been completed and all tags have been signed. created: The envelope is created as a draft. It can be modified and sent later. declined: The envelope has been declined by the recipients. delivered: The envelope has been delivered to the recipients. sent: The envelope is sent to the recipients. signed: The envelope has been signed by the recipients. *voided: The envelope is no longer valid and recipients cannot access or sign the envelope.

During object creation, only created and sent values are allowed.

Re: Use enumerated value types for status and for the other API attributes with specific enumerated values. Yup, we agree. The first step is for the DocuSign eSignature Swagger file to be updated with the enumerated type attributes and values. Once that's done, we'll update the SDKs to use the Swagger information to create the enums for the Java SDK.

The first step has been requested and is on the roadmap but it is a large project.

Thank you for using DocuSign.

jasonrberk commented 1 year ago

@LarryKlugerDS you responded back in 2020 and I still don't see enums or constants available?

https://stackoverflow.com/questions/74689092/why-is-the-docusign-java-sdk-is-not-typesafe