Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/Nexus.Crypto.SDK/Models/Customer/CustomerModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,42 @@ public class DeleteAccountResponse
{
public string AccountCode { get; set; }
public string AccountStatus { get; set; }
}

public class UpdateCustomerRequest
{
public string? TrustLevelCode { get; set; }
public string? Email { get; set; }
public string? Name { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? Phone { get; set; }
public string? DateOfBirth { get; set; }
public string? CompanyName { get; set; }
public string? Address { get; set; }
public string? City { get; set; }
public string? ZipCode { get; set; }
public string? State { get; set; }
public string? Tag { get; set; }
public string? Status { get; set; }
public string? CountryCode { get; set; }
public RiskQualificationEnum? RiskQualification { get; set; }
public DateTime? LatestReview { get; set; }
public bool? IsReviewRecommended { get; set; }
public string? Comment { get; set; }
public string? Reason { get; set; }
public IDictionary<string, string>? Data { get; set; }
public string[]? FieldsToClear { get; set; }

public int? CurrencyId { get; set; }
public bool? IsBusiness { get; set; }
}

public enum RiskQualificationEnum
{
None,
Low,
Medium,
High,
VeryHigh
}
4 changes: 2 additions & 2 deletions src/Nexus.Crypto.SDK/Services/BaseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public async Task<TResponse> PostAsync<TInput, TResponse>(string endPoint, TInpu
{
var client = await GetApiClient(apiVersion);

var httpResponse = await client.PostAsJsonAsync(endPoint, postObject);
var httpResponse = await client.PostAsJsonAsync(endPoint, postObject, _serializerOptions);

if (!httpResponse.IsSuccessStatusCode)
{
Expand All @@ -112,7 +112,7 @@ public async Task<TResponse> PutAsync<TInput, TResponse>(string endPoint, TInput
{
var client = await GetApiClient(apiVersion);

var httpResponse = await client.PutAsJsonAsync(endPoint, postObject);
var httpResponse = await client.PutAsJsonAsync(endPoint, postObject, _serializerOptions);

if (!httpResponse.IsSuccessStatusCode)
{
Expand Down
10 changes: 9 additions & 1 deletion src/Nexus.Crypto.SDK/Services/CustomerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@ public async Task<CustomResultHolder<DeleteCustomerResponse>> DeleteCustomer(str
{
return await DeleteAsync<CustomResultHolder<DeleteCustomerResponse>>($"customer/{customerCode}", ApiVersion);
}


public async Task<CustomResultHolder<GetCustomer>> UpdateCustomer(string customerCode,
UpdateCustomerRequest request)
{
return await PutAsync<UpdateCustomerRequest, CustomResultHolder<GetCustomer>>(
$"customer/{customerCode}",
request,
ApiVersion);
Comment thread
AsimaksiAnt marked this conversation as resolved.
}
}
1 change: 1 addition & 0 deletions src/Nexus.Crypto.SDK/Services/ICustomerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ Task<CustomResultHolder<PagedResult<GetCustomerTrace>>> GetCustomerTraces(string

Task<CustomResultHolder<DeleteCustomerResponse>> DeleteCustomer(string customerCode);

Task<CustomResultHolder<GetCustomer>> UpdateCustomer(string customerCode, UpdateCustomerRequest request);
}
2 changes: 1 addition & 1 deletion tests/Nexus.Crypto.SDK.Tests/NexusLabelApiSdkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ public async Task GetCustomers_Success()
});

var response = await _logicHelper.ApiService.Customer
.GetCustomers(new System.Collections.Generic.Dictionary<string, string>
.GetCustomers(new Dictionary<string, string>
{
{ "startDate", "2021-01-01T00:00:01Z" },
{ "endDate", "2022-01-01T00:00:03Z" },
Expand Down
Loading