Skip to content

Commit

Permalink
feat: add statuslist to credential creation
Browse files Browse the repository at this point in the history
Refs: #2
  • Loading branch information
Phil91 committed Mar 21, 2024
1 parent 296a467 commit 93746d1
Show file tree
Hide file tree
Showing 27 changed files with 257 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ spec:
value: "{{ .Values.issuer.portal.scope }}"
- name: "PORTAL__USERNAME"
value: "empty"
- name: "CREDENTIAL__ISSUERDID"
value: "{{ .Values.issuer.credential.issuerDid }}"
- name: "CREDENTIAL__ISSUERBPN"
value: "{{ .Values.issuer.credential.issuerBpn }}"
- name: "CREDENTIAL__STATUSLISTURL"
value: "{{ .Values.issuer.credential.statusListUrl }}"
- name: "CREDENTIAL__ENCRYPTIONCONFIG__ENCRYPTIONCONFIGINDEX"
value: "{{ .Values.issuer.credential.encryptionConfigIndex }}"
- name: "CREDENTIAL__ENCRYPTIONCONFIGS__0__INDEX"
Expand Down
2 changes: 2 additions & 0 deletions charts/ssi-credential-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ issuer:
clientSecret: ""
credential:
issuerDid: ""
issuerBpn: ""
statusListUrl: ""
encryptionConfigIndex: 0
encryptionConfigs:
index0:
Expand Down
2 changes: 2 additions & 0 deletions consortia/environments/values-beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ingress:

issuer:
swaggerEnabled: true
credential:
issuerBpn: "BPNL00000003CRHK"

issuermigrations:
logging:
Expand Down
2 changes: 2 additions & 0 deletions consortia/environments/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ issuer:
tag: "dev"
imagePullPolicy: "Always"
swaggerEnabled: true
credential:
issuerBpn: "BPNL00000003CRHK"

issuermigrations:
image:
Expand Down
2 changes: 2 additions & 0 deletions consortia/environments/values-int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ingress:

issuer:
swaggerEnabled: true
credential:
issuerBpn: "BPNL00000003CRHK"

issuermigrations:
logging:
Expand Down
2 changes: 2 additions & 0 deletions consortia/environments/values-pen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ingress:

issuer:
swaggerEnabled: true
credential:
issuerBpn: "BPNL00000003CRHK"

issuermigrations:
logging:
Expand Down
2 changes: 2 additions & 0 deletions consortia/environments/values-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ issuer:
tag: "rc"
imagePullPolicy: "Always"
swaggerEnabled: true
credential:
issuerBpn: "BPNL00000003CRHK"

issuermigrations:
image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public IAsyncEnumerable<UseCaseParticipationTransferData> GetUseCaseParticipatio
.Where(t => t.VerifiedCredentialTypeAssignedKind!.VerifiedCredentialTypeKindId == VerifiedCredentialTypeKindId.FRAMEWORK)
.Select(t => new
{
UseCase = t.VerifiedCredentialTypeAssignedUseCase!.UseCase,
t.VerifiedCredentialTypeAssignedUseCase!.UseCase,
TypeId = t.Id,
ExternalTypeDetails = t.VerifiedCredentialTypeAssignedExternalType!.VerifiedCredentialExternalType!.VerifiedCredentialExternalTypeDetailVersions
})
Expand Down Expand Up @@ -126,9 +126,9 @@ public IAsyncEnumerable<SsiCertificateTransferData> GetSsiCertificates(string bp
.ToAsyncEnumerable();

/// <inheritdoc />
public CompanySsiDetail CreateSsiDetails(string bpnl, VerifiedCredentialTypeId verifiedCredentialTypeId, Guid docId, CompanySsiDetailStatusId companySsiDetailStatusId, Guid userId, Action<CompanySsiDetail>? setOptionalFields)
public CompanySsiDetail CreateSsiDetails(string bpnl, VerifiedCredentialTypeId verifiedCredentialTypeId, CompanySsiDetailStatusId companySsiDetailStatusId, string issuerBpn, Guid userId, Action<CompanySsiDetail>? setOptionalFields)
{
var detail = new CompanySsiDetail(Guid.NewGuid(), bpnl, verifiedCredentialTypeId, companySsiDetailStatusId, userId, DateTimeOffset.UtcNow);
var detail = new CompanySsiDetail(Guid.NewGuid(), bpnl, verifiedCredentialTypeId, companySsiDetailStatusId, issuerBpn, userId, DateTimeOffset.UtcNow);
setOptionalFields?.Invoke(detail);
return _context.CompanySsiDetails.Add(detail).Entity;
}
Expand Down Expand Up @@ -165,7 +165,7 @@ public Task<bool> CheckSsiDetailsExistsForCompany(string bpnl, VerifiedCredentia
x.VerifiedCredentialTypeKindId != VerifiedCredentialTypeKindId.FRAMEWORK)
.Select(x => new ValueTuple<bool, IEnumerable<Guid>>(
true,
x.VerifiedCredentialType!.VerifiedCredentialTypeAssignedExternalType!.VerifiedCredentialExternalType!.VerifiedCredentialExternalTypeDetailVersions.Select(x => x.Id)
x.VerifiedCredentialType!.VerifiedCredentialTypeAssignedExternalType!.VerifiedCredentialExternalType!.VerifiedCredentialExternalTypeDetailVersions.Select(v => v.Id)
))
.SingleOrDefaultAsync();

Expand Down Expand Up @@ -216,7 +216,7 @@ public IQueryable<CompanySsiDetail> GetAllCredentialDetails(CompanySsiDetailStat
/// <inheritdoc />
public void AttachAndModifyCompanySsiDetails(Guid id, Action<CompanySsiDetail>? initialize, Action<CompanySsiDetail> updateFields)
{
var entity = new CompanySsiDetail(id, null!, default, default, Guid.Empty, default);
var entity = new CompanySsiDetail(id, null!, default, default, null!, Guid.Empty, DateTimeOffset.MinValue);
initialize?.Invoke(entity);
_context.Attach(entity);
updateFields.Invoke(entity);
Expand Down Expand Up @@ -270,7 +270,7 @@ public IAsyncEnumerable<CredentialExpiryData> GetExpiryData(DateTimeOffset now,
}

public void RemoveSsiDetail(Guid companySsiDetailId) =>
_context.CompanySsiDetails.Remove(new CompanySsiDetail(companySsiDetailId, null!, default, default, Guid.Empty, default));
_context.CompanySsiDetails.Remove(new CompanySsiDetail(companySsiDetailId, null!, default, default, null!, Guid.Empty, DateTimeOffset.MinValue));

public void CreateProcessData(Guid companySsiDetailId, JsonDocument schema, VerifiedCredentialTypeKindId credentialTypeKindId, Action<CompanySsiProcessData>? setOptionalFields)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ public interface ICompanySsiDetailsRepository
/// </summary>
/// <param name="bpnl">Id of the company</param>
/// <param name="verifiedCredentialTypeId">Id of the credential types</param>
/// <param name="docId">id of the document</param>
/// <param name="companySsiDetailStatusId">id of detail status</param>
/// <param name="issuerBpn">bpn of the credential issuer</param>
/// <param name="userId">Id of the creator</param>
/// <param name="processId">Id of the linked Process</param>
/// <param name="setOptionalFields">sets the optional fields</param>
/// <returns>The created entity</returns>
CompanySsiDetail CreateSsiDetails(string bpnl, VerifiedCredentialTypeId verifiedCredentialTypeId, Guid docId, CompanySsiDetailStatusId companySsiDetailStatusId, Guid userId, Action<CompanySsiDetail>? setOptionalFields);
CompanySsiDetail CreateSsiDetails(string bpnl, VerifiedCredentialTypeId verifiedCredentialTypeId, CompanySsiDetailStatusId companySsiDetailStatusId, string issuerBpn, Guid userId, Action<CompanySsiDetail>? setOptionalFields);

/// <summary>
/// Checks whether the credential details are already exists for the company and the given version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class AuditCompanySsiDetail20240228 : IAuditEntityV1

public Guid Id { get; set; }
public string Bpnl { get; set; } = null!;
public string IssuerBpn { get; set; } = null!;
public VerifiedCredentialTypeId VerifiedCredentialTypeId { get; set; }
public CompanySsiDetailStatusId CompanySsiDetailStatusId { get; set; }
public DateTimeOffset DateCreated { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,25 @@ public class CompanySsiDetail : IAuditableV1, IBaseEntity
private CompanySsiDetail()
{
Bpnl = null!;
IssuerBpn = null!;
Documents = new HashSet<Document>();
}

public CompanySsiDetail(Guid id, string bpnl, VerifiedCredentialTypeId verifiedCredentialTypeId, CompanySsiDetailStatusId companySsiDetailStatusId, Guid creatorUserId, DateTimeOffset dateCreated)
public CompanySsiDetail(Guid id, string bpnl, VerifiedCredentialTypeId verifiedCredentialTypeId, CompanySsiDetailStatusId companySsiDetailStatusId, string issuerBpn, Guid creatorUserId, DateTimeOffset dateCreated)
: this()
{
Id = id;
Bpnl = bpnl;
VerifiedCredentialTypeId = verifiedCredentialTypeId;
CompanySsiDetailStatusId = companySsiDetailStatusId;
IssuerBpn = issuerBpn;
CreatorUserId = creatorUserId;
DateCreated = dateCreated;
}

public Guid Id { get; set; }
public string Bpnl { get; set; }
public string IssuerBpn { get; set; }
public VerifiedCredentialTypeId VerifiedCredentialTypeId { get; set; }
public CompanySsiDetailStatusId CompanySsiDetailStatusId { get; set; }
public DateTimeOffset DateCreated { get; set; }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 93746d1

Please sign in to comment.