Skip to content

Commit

Permalink
Merge pull request #34 from FromDoppler/doi-1071-default-values-for-e…
Browse files Browse the repository at this point in the history
…mpty-properties

[DOI-1071] Set default values for empty properties
  • Loading branch information
blancfabian authored Sep 19, 2023
2 parents 82257fa + 7b449d6 commit 7259d00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doppler-beplic/Models/Config/DefaultValuesoptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ public class DefaultCustomer
public const string Customer = "Customer";

public string Partner { get; set; } = "DOPPLER";

public string BusinessName { get; set; } = "Sin definir";
public string Address { get; set; } = "Sin definir";
public string Cuit { get; set; } = "Sin definir";
}

public class DefaultPlan
Expand Down
2 changes: 2 additions & 0 deletions doppler-beplic/Services/Classes/BeplicService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public BeplicService(IOptions<DefaulValuesOptions> options, BeplicSdk sdk)
public async Task<UserCreationResponse> CreateUser(UserCreationDTO accountData)
{
accountData.Customer.Partner ??= _options.Customer.Partner;
accountData.Customer.BusinessName ??= _options.Customer.BusinessName;
accountData.Customer.Address ??= _options.Customer.Address;
accountData.Customer.Cuit ??= _options.Customer.Cuit;

var result = new UserCreationResponse();

Expand Down

0 comments on commit 7259d00

Please sign in to comment.