Skip to content

Commit

Permalink
Merge pull request #35 from FromDoppler/doi-1071-set-default-values-f…
Browse files Browse the repository at this point in the history
…or-empty-properties

[DOI-1071] Set default values for empty properties
  • Loading branch information
blancfabian authored Sep 19, 2023
2 parents 7259d00 + f46538d commit 8c1db1b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
9 changes: 5 additions & 4 deletions doppler-beplic/Models/Config/DefaultValuesoptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ 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 string Partner { get; set; } = string.Empty;
public string BusinessName { get; set; } = string.Empty;
public string LegalName { get; set; } = string.Empty;
public string Address { get; set; } = string.Empty;
public string Cuit { get; set; } = string.Empty;
}

public class DefaultPlan
Expand Down
12 changes: 6 additions & 6 deletions doppler-beplic/Models/DTO/UserCreationDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ public class UserCreationDTO

public class UserCreationCustomer
{
[JsonProperty("partner")]
public string? Partner { get; set; }
[JsonProperty("cuit")]
public string Cuit { get; set; } = string.Empty;
public string? Cuit { get; set; }
[JsonProperty("address")]
public string Address { get; set; } = string.Empty;
public string? Address { get; set; }
[JsonProperty("razonSocial")]
public string BusinessName { get; set; } = string.Empty;
public string? BusinessName { get; set; }
[JsonProperty("legalName")]
public string LegalName { get; set; } = string.Empty;
public string? LegalName { get; set; }
[JsonProperty("idExternal")]
public string IdExternal { get; set; } = string.Empty;
[JsonProperty("partner")]
public string Partner { get; set; } = string.Empty;
[JsonProperty("apiKey")]
public string ApiKey { get; set; } = string.Empty;
[JsonProperty("plan")]
Expand Down
1 change: 1 addition & 0 deletions doppler-beplic/Services/Classes/BeplicService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public async Task<UserCreationResponse> CreateUser(UserCreationDTO accountData)
{
accountData.Customer.Partner ??= _options.Customer.Partner;
accountData.Customer.BusinessName ??= _options.Customer.BusinessName;
accountData.Customer.LegalName ??= _options.Customer.LegalName;
accountData.Customer.Address ??= _options.Customer.Address;
accountData.Customer.Cuit ??= _options.Customer.Cuit;

Expand Down
7 changes: 7 additions & 0 deletions doppler-beplic/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
"BaseUrl": "https://api.beplic.io/v1"
},
"DefaultValues": {
"Customer": {
"Partner": "DOPPLER",
"BusinessName": "Sin Definir",
"LegalName": "Sin Definir",
"Address": "Sin Definir",
"Cuit": "Sin Definir"
},
"Room": {
"Name": "Sala A",
"Group": "Grupo A",
Expand Down

0 comments on commit 8c1db1b

Please sign in to comment.