Skip to content

Commit

Permalink
chore: Sign request support multiple documents (#911)
Browse files Browse the repository at this point in the history
* chore: Sign request support multiple documents

* Update integration tests
  • Loading branch information
congminh1254 authored Jul 11, 2023
1 parent f00f2af commit fc19c5d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BoxSharedItemsManagerIntegrationTest : TestInFolder
public async Task SharedItemsAsync_ForSharedFolder_ShouldReturnSharedFolder()
{
var folder = await CreateFolder();
var password = "secret";
var password = "Secret123";
var sharedLinkReq = new BoxSharedLinkRequest()
{
Access = BoxSharedLinkAccessType.open,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ public class BoxSignRequestManagerIntegrationTest : TestInFolder
public async Task CreateSignRequestAsync_ForCorrectSignRequestCreateRequest_ShouldCreateNewSignRequest()
{
var fileToSign = await CreateSmallFile(FolderId);
var fileToSign2 = await CreateSmallFile(FolderId);
var signRequestCreateRequest = new BoxSignRequestCreateRequest()
{
SourceFiles = new List<BoxSignRequestCreateSourceFile>()
{
new BoxSignRequestCreateSourceFile()
{
Id = fileToSign.Id
},
new BoxSignRequestCreateSourceFile()
{
Id = fileToSign2.Id
}
},
Signers = new List<BoxSignRequestSignerCreate>()
Expand All @@ -44,6 +49,7 @@ public async Task CreateSignRequestAsync_ForCorrectSignRequestCreateRequest_Shou
BoxSignRequest signRequest = await UserClient.SignRequestsManager.CreateSignRequestAsync(signRequestCreateRequest);
Assert.IsNotNull(signRequest.Id);
Assert.AreEqual(signRequestCreateRequest.SourceFiles[0].Id, signRequest.SourceFiles[0].Id);
Assert.AreEqual(signRequestCreateRequest.SourceFiles[1].Id, signRequest.SourceFiles[1].Id);
Assert.AreEqual(signRequestCreateRequest.RedirectUrl.ToString(), signRequest.RedirectUrl.ToString());
Assert.AreEqual(signRequestCreateRequest.DeclinedRedirectUrl.ToString(), signRequest.DeclinedRedirectUrl.ToString());
Assert.AreEqual(signRequestCreateRequest.ParentFolder.Id, signRequest.ParentFolder.Id);
Expand Down
2 changes: 1 addition & 1 deletion Box.V2/Models/BoxSignRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class BoxSignRequest : BoxEntity
public virtual BoxFile SigningLog { get; private set; }

/// <summary>
/// List of files to create a signing document from. This is currently limited to one file. Only the ID and type fields are required for each file.
/// List of files to create a signing document from. This is currently limited to ten files. Only the ID and type fields are required for each file.
/// </summary>
[JsonProperty(PropertyName = FieldSourceFiles)]
public virtual List<BoxFile> SourceFiles { get; private set; }
Expand Down
4 changes: 2 additions & 2 deletions Box.V2/Models/Request/BoxSignRequestCreateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class BoxSignRequestCreateRequest
public List<BoxSignRequestSignerCreate> Signers { get; set; }

/// <summary>
/// List of files to create a signing document from.This is currently limited to one file.Only the ID and type fields are required for each file.
/// List of files to create a signing document from. This is currently limited to ten files. Only the ID and type fields are required for each file.
/// </summary>
[JsonProperty(PropertyName = "source_files")]
public List<BoxSignRequestCreateSourceFile> SourceFiles { get; set; }
Expand All @@ -94,7 +94,7 @@ public class BoxSignRequestCreateRequest
}

/// <summary>
/// List of files to create a signing document from.This is currently limited to one file.Only the ID and type fields are required for each file.
/// List of files to create a signing document from. This is currently limited to ten files. Only the ID and type fields are required for each file.
/// </summary>
public class BoxSignRequestCreateSourceFile
{
Expand Down
2 changes: 1 addition & 1 deletion docs/sign-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Create Sign Request
------------------------

The `SignRequestsManager.CreateSignRequestAsync(BoxSignRequestCreateRequest signRequestCreateRequest)`
method will create a Sign Request. You need to provide at least one file (from which the signing document will be created) and at least one signer to receive the Sign Request.
method will create a Sign Request. You need to provide at least one file and up to ten files (from which the signing document will be created) with at least one signer to receive the Sign Request.

<!-- sample post_sign_requests -->
```c#
Expand Down

0 comments on commit fc19c5d

Please sign in to comment.