This commit is contained in:
@@ -194,9 +194,9 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
return Ok(ApiOkResponse.Response(new
|
||||
{
|
||||
customerpost = new PostalAddressRecord(cust.PostAddress, cust.PostCity, cust.PostRegion, cust.PostCountry, cust.PostCode),
|
||||
customerphys = new AddressRecord(cust.Address, cust.City, cust.Region, cust.Country, cust.Latitude, cust.Longitude),
|
||||
headofficepost = (head != null ? new PostalAddressRecord(head.PostAddress, head.PostCity, head.PostRegion, head.PostCountry, head.PostCode) : new PostalAddressRecord("", "", "", "", ""))
|
||||
customerpost = new PostalAddressRecord(cust.Name, cust.PostAddress, cust.PostCity, cust.PostRegion, cust.PostCountry, cust.PostCode),
|
||||
customerphys = new AddressRecord(cust.Name, cust.Address, cust.City, cust.Region, cust.Country, cust.Latitude, cust.Longitude),
|
||||
headofficepost = (head != null ? new PostalAddressRecord(head.Name, head.PostAddress, head.PostCity, head.PostRegion, head.PostCountry, head.PostCode) : new PostalAddressRecord("", "", "", "", "", ""))
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -152,11 +152,11 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get service (physical) address for this Unit
|
||||
/// Get service address for this Unit
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Service address</returns>
|
||||
[HttpGet("service-address/{id}")]
|
||||
[HttpGet("address/{id}")]
|
||||
public async Task<IActionResult> GetUnitServiceAddress([FromRoute] long id)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
@@ -171,7 +171,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
return Ok(ApiOkResponse.Response(new
|
||||
{
|
||||
unit = new AddressRecord(unt.Address, unt.City, unt.Region, unt.Country, unt.Latitude, unt.Longitude)
|
||||
unit = new AddressRecord(unt.Serial, unt.Address, unt.City, unt.Region, unt.Country, unt.Latitude, unt.Longitude)
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
//physical
|
||||
public record AddressRecord(string Address, string City, string Region, string Country, decimal? Latitude, decimal? Longitude);
|
||||
public record AddressRecord(string Name, string Address, string City, string Region, string Country, decimal? Latitude, decimal? Longitude);
|
||||
//postal
|
||||
public record PostalAddressRecord(string PostAddress, string PostCity, string PostRegion, string PostCountry, string PostCode);
|
||||
public record PostalAddressRecord(string Name, string PostAddress, string PostCity, string PostRegion, string PostCountry, string PostCode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user