Skip to content

Commit

Permalink
feat: Add content-type field to sign request (#850)
Browse files Browse the repository at this point in the history
* feat: add  field to sign request
  • Loading branch information
congminh1254 authored Aug 23, 2022
1 parent cafa53c commit 054d3e1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Box.V2.Test/BoxSignRequestsManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public async Task CreateSignRequest_RequiredParams_Success()
Assert.AreEqual(1, response.Signers.Count);
Assert.AreEqual("[email protected]", response.Signers[0].Email);
Assert.AreEqual("12345", response.ParentFolder.Id);
Assert.AreEqual(1, response.Signers[0].Inputs.Count);
Assert.IsTrue(response.Signers[0].Inputs[0].CheckboxValue.Value);
Assert.AreEqual(BoxSignRequestSingerInputContentType.checkbox, response.Signers[0].Inputs[0].ContentType);
}

[TestMethod]
Expand Down Expand Up @@ -153,6 +156,9 @@ public async Task CreateSignRequest_OptionalParams_Success()
Assert.AreEqual("12345", response.SourceFiles[0].Id);
Assert.AreEqual(1, response.Signers.Count);
Assert.AreEqual("[email protected]", response.Signers[0].Email);
Assert.AreEqual(1, response.Signers[0].Inputs.Count);
Assert.IsTrue(response.Signers[0].Inputs[0].CheckboxValue.Value);
Assert.AreEqual(BoxSignRequestSingerInputContentType.checkbox, response.Signers[0].Inputs[0].ContentType);
Assert.AreEqual("12345", response.ParentFolder.Id);
Assert.IsTrue(response.IsDocumentPreparationNeeded);
Assert.IsTrue(response.AreRemindersEnabled);
Expand Down Expand Up @@ -236,6 +242,9 @@ public async Task GetSignRequestById_Success()
Assert.AreEqual("12345", response.SourceFiles[0].Id);
Assert.AreEqual(1, response.Signers.Count);
Assert.AreEqual("[email protected]", response.Signers[0].Email);
Assert.AreEqual(1, response.Signers[0].Inputs.Count);
Assert.IsTrue(response.Signers[0].Inputs[0].CheckboxValue.Value);
Assert.AreEqual(BoxSignRequestSingerInputContentType.checkbox, response.Signers[0].Inputs[0].ContentType);
Assert.AreEqual("12345", response.ParentFolder.Id);
Assert.IsTrue(response.IsDocumentPreparationNeeded);
Assert.IsTrue(response.AreRemindersEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"checkbox_value": true,
"date_value": "2021-04-26T08:12:13.982Z",
"type": "text",
"page_index": 4
"page_index": 4,
"content_type": "checkbox"
}
],
"embed_url": "https://example.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"checkbox_value": true,
"date_value": "2021-04-26T08:12:13.982Z",
"type": "text",
"page_index": 4
"page_index": 4,
"content_type": "checkbox"
}
],
"embed_url": "https://example.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"checkbox_value": true,
"date_value": "2021-04-26T08:12:13.982Z",
"type": "text",
"page_index": 4
"page_index": 4,
"content_type": "checkbox"
}
],
"embed_url": "https://example.com"
Expand Down
3 changes: 2 additions & 1 deletion Box.V2.Test/Fixtures/BoxSignRequest/GetSignRequest200.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"checkbox_value": true,
"date_value": "2021-04-26T08:12:13.982Z",
"type": "text",
"page_index": 4
"page_index": 4,
"content_type": "checkbox"
}
],
"embed_url": "https://example.com"
Expand Down
27 changes: 27 additions & 0 deletions Box.V2/Models/BoxSignRequestSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public class BoxSignRequestSignerInput
{
public const string FieldType = "type";
public const string FieldCheckboxValue = "checkbox_value";
public const string FieldContentType = "content_type";
public const string FieldDateValue = "date_value";
public const string FieldDocumentTagId = "document_tag_id";
public const string FieldPageIndex = "page_index";
Expand All @@ -114,6 +115,13 @@ public class BoxSignRequestSignerInput
[JsonProperty(PropertyName = FieldCheckboxValue)]
public virtual bool? CheckboxValue { get; private set; }

/// <summary>
/// Content type of input.
/// </summary>
[JsonProperty(PropertyName = FieldContentType)]
[JsonConverter(typeof(StringEnumConverter))]
public virtual BoxSignRequestSingerInputContentType ContentType { get; private set; }

/// <summary>
/// Date prefill value.
/// </summary>
Expand Down Expand Up @@ -150,6 +158,25 @@ public enum BoxSignRequestSingerInputType
checkbox
}

/// <summary>
/// Content type of input.
/// </summary>
public enum BoxSignRequestSingerInputContentType
{
initial,
stamp,
signature,
company,
title,
email,
full_name,
first_name,
last_name,
text,
date,
checkbox
}

/// <summary>
/// Final decision made by the signer.
/// </summary>
Expand Down

0 comments on commit 054d3e1

Please sign in to comment.