public async ValueTask <ResultGrpcResponse> RegisterAsync(RegisterPersonalDataGrpcModel request) { var isInternal = Regex.IsMatch(request.Email, ServiceLocator.SettingsModel.InternalAccountPatterns); var pd = request.ToDomainModel(isInternal); await ServiceLocator.PersonalDataRepository.CreateAsync(pd, ServiceLocator.EncodingKey); var logData = ToJson(pd); /* * var log = new AuditLogGrpcModel * { * TraderId = request.Id, * ProcessId = request.AuditLog.ProcessId, * Ip = request.AuditLog.Ip, * ServiceName = request.AuditLog.ServiceName, * Context = request.AuditLog.Context, * Before = string.Empty, * UpdatedData = logData, * After = logData * }; * * await ServiceLocator.AuditLogServiceGrpc.RegisterEventAsync(log); */ return(new ResultGrpcResponse { Ok = true }); }
public static PersonalDataPostgresEntity ToDomainModel(this RegisterPersonalDataGrpcModel src, bool isInternal) { if (src == null) { return(null); } return(new PersonalDataPostgresEntity { Id = src.Id, Email = src.Email, IsInternal = isInternal, CountryOfResidence = src.CountryOfResidence, CountryOfRegistration = src.CountryOfRegistration, IpOfRegistration = src.IpOfRegistration, KYC = (int)PersonalDataKycStatus.NotVerified }); }