From 29c6e29816e0c8ef34379880d2c5e9a306d92009 Mon Sep 17 00:00:00 2001 From: Lee Wright <258036@NTTDATA.COM> Date: Tue, 16 Jul 2024 15:13:12 -0700 Subject: [PATCH] WIP --- .../InCustodyProvisioning/InCustodyService.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/backend/webapi/Kafka/Consumer/InCustodyProvisioning/InCustodyService.cs b/backend/webapi/Kafka/Consumer/InCustodyProvisioning/InCustodyService.cs index 6451d878..bb0a47e6 100644 --- a/backend/webapi/Kafka/Consumer/InCustodyProvisioning/InCustodyService.cs +++ b/backend/webapi/Kafka/Consumer/InCustodyProvisioning/InCustodyService.cs @@ -133,10 +133,11 @@ private async Task CreateInCustodyAccessRequest(ExtendedUserRepre if (party != null) { - logger.LogPartyAlreadyPresent(party.Jpdid); + logger.LogPartyAlreadyPresent(party.Jpdid, party.Id); } else { + party = new Party { UserId = keycloakUser.Id, @@ -146,6 +147,13 @@ private async Task CreateInCustodyAccessRequest(ExtendedUserRepre Email = keycloakUser.Username }; + var altId = new PartyAlternateId + { + Name = "CSNumber", + Value = value.CSNumber, + Party = party + }; + context.Parties.Add(party); await context.SaveChangesAsync(); party = context.Parties.Where(p => p.Jpdid == keycloakUser.Username).FirstOrDefault(); @@ -255,8 +263,8 @@ public static partial class InCustodyServiceLoggingExtensions public static partial void LogIDPNotFound(this ILogger logger, string realm, string idp); [LoggerMessage(11, LogLevel.Error, "Failed to complete in-custody onboarding {msg}")] public static partial void LogInCustodyServiceException(this ILogger logger, string msg, Exception ex); - [LoggerMessage(12, LogLevel.Information, "Party already present {party}")] - public static partial void LogPartyAlreadyPresent(this ILogger logger, string party); + [LoggerMessage(12, LogLevel.Information, "Party already present {party} {partyId}")] + public static partial void LogPartyAlreadyPresent(this ILogger logger, string party, int partyId); [LoggerMessage(13, LogLevel.Information, "Access request {accessRequestId} already present for party {party}")] public static partial void LogAccessRequestAlreadyPresent(this ILogger logger, string party, int accessRequestId);