diff --git a/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/IssuerBusinessLogic.cs b/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/IssuerBusinessLogic.cs index cec93cf1..1d183d5e 100644 --- a/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/IssuerBusinessLogic.cs +++ b/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/IssuerBusinessLogic.cs @@ -489,7 +489,7 @@ private async Task HandleCredentialProcessCreation( var documentContent = Encoding.UTF8.GetBytes(schema); var hash = SHA512.HashData(documentContent); var documentRepository = _repositories.GetInstance(); - var docId = documentRepository.CreateDocument("schema.json", documentContent, + var docId = documentRepository.CreateDocument($"{typeId}.json", documentContent, hash, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, x => { x.IdentityId = _identity.IdentityId; diff --git a/tests/issuer/SsiCredentialIssuer.Service.Tests/BusinessLogic/IssuerBusinessLogicTests.cs b/tests/issuer/SsiCredentialIssuer.Service.Tests/BusinessLogic/IssuerBusinessLogicTests.cs index 79883421..5649a794 100644 --- a/tests/issuer/SsiCredentialIssuer.Service.Tests/BusinessLogic/IssuerBusinessLogicTests.cs +++ b/tests/issuer/SsiCredentialIssuer.Service.Tests/BusinessLogic/IssuerBusinessLogicTests.cs @@ -687,7 +687,7 @@ public async Task CreateBpnCredential_ReturnsExpected() await _sut.CreateBpnCredential(data, CancellationToken.None); // Assert - A.CallTo(() => _documentRepository.CreateDocument("schema.json", A._, A._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A>._)) + A.CallTo(() => _documentRepository.CreateDocument("BUSINESS_PARTNER_NUMBER.json", A._, A._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A>._)) .MustHaveHappenedOnceExactly(); A.CallTo(() => _companySsiDetailsRepository.CreateSsiDetails(_identity.Bpnl, VerifiedCredentialTypeId.BUSINESS_PARTNER_NUMBER, CompanySsiDetailStatusId.ACTIVE, IssuerBpnl, _identity.IdentityId, A>._)) .MustHaveHappenedOnceExactly(); @@ -759,7 +759,7 @@ public async Task CreateMembershipCredential_ReturnsExpected() await _sut.CreateMembershipCredential(data, CancellationToken.None); // Assert - A.CallTo(() => _documentRepository.CreateDocument("schema.json", A._, A._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A>._)) + A.CallTo(() => _documentRepository.CreateDocument("MEMBERSHIP_CERTIFICATE.json", A._, A._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A>._)) .MustHaveHappenedOnceExactly(); A.CallTo(() => _companySsiDetailsRepository.CreateSsiDetails(_identity.Bpnl, VerifiedCredentialTypeId.MEMBERSHIP_CERTIFICATE, CompanySsiDetailStatusId.ACTIVE, IssuerBpnl, _identity.IdentityId, A>._)) .MustHaveHappenedOnceExactly(); @@ -926,7 +926,7 @@ public async Task CreateFrameworkCredential_ReturnsExpected() await _sut.CreateFrameworkCredential(data, CancellationToken.None); // Assert - A.CallTo(() => _documentRepository.CreateDocument("schema.json", A._, A._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A>._)) + A.CallTo(() => _documentRepository.CreateDocument("TRACEABILITY_FRAMEWORK.json", A._, A._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A>._)) .MustHaveHappenedOnceExactly(); A.CallTo(() => _companySsiDetailsRepository.CreateSsiDetails(_identity.Bpnl, VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK, CompanySsiDetailStatusId.PENDING, IssuerBpnl, _identity.IdentityId, A>._)) .MustHaveHappenedOnceExactly();