Skip to content

Commit

Permalink
fix(document): adjust validation to allow the issuer to display docum…
Browse files Browse the repository at this point in the history
…ents of credentials

Refs: #225
  • Loading branch information
Phil91 committed Jul 31, 2024
1 parent 9ae194e commit 2cbda34
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void AttachAndModifyCredential(Guid credentialId, Action<CompanySsiDetail
.Where(x => x.Id == documentId)
.Select(x => new ValueTuple<bool, bool, string, DocumentStatusId, byte[], MediaTypeId>(
true,
x.CompanySsiDetails.Any(c => c.Bpnl == bpnl),
x.CompanySsiDetails.Any(c => c.Bpnl == bpnl || c.IssuerBpn == bpnl),
x.DocumentName,
x.DocumentStatusId,
x.DocumentContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,21 @@ public async Task GetDocumentById_ReturnsExpectedDocument()
result.MediaTypeId.Should().Be(MediaTypeId.PNG);
}

[Fact]
public async Task GetDocumentById_WithIssuerBpn_ReturnsExpected()
{
// Arrange
var sut = await CreateSut();

// Act
var result = await sut.GetDocumentById(new Guid("e020787d-1e04-4c0b-9c06-bd1cd44724b1"), "BPNL000003ISSUER");

// Assert
result.Exists.Should().BeTrue();
result.IsSameCompany.Should().BeTrue();
result.MediaTypeId.Should().Be(MediaTypeId.PNG);
}

[Fact]
public async Task GetDocumentById_WithWrongBpn_ReturnsExpected()
{
Expand Down

0 comments on commit 2cbda34

Please sign in to comment.