From ac0704c6c5aaa9aa4f17bc6ef274e54f9aef6650 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 1 May 2021 00:54:53 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- server/AyaNova/Controllers/CustomerController.cs | 6 +++--- server/AyaNova/Controllers/UnitController.cs | 6 +++--- server/AyaNova/models/dto/AddressRecord.cs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8fd97968..0e2049e9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -53,7 +53,7 @@ "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", - "AYANOVA_SERVER_TEST_MODE": "true", + "AYANOVA_SERVER_TEST_MODE": "false", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\" diff --git a/server/AyaNova/Controllers/CustomerController.cs b/server/AyaNova/Controllers/CustomerController.cs index a5aca187..c3097be5 100644 --- a/server/AyaNova/Controllers/CustomerController.cs +++ b/server/AyaNova/Controllers/CustomerController.cs @@ -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("", "", "", "", "", "")) })); } diff --git a/server/AyaNova/Controllers/UnitController.cs b/server/AyaNova/Controllers/UnitController.cs index e8256367..a849f612 100644 --- a/server/AyaNova/Controllers/UnitController.cs +++ b/server/AyaNova/Controllers/UnitController.cs @@ -152,11 +152,11 @@ namespace AyaNova.Api.Controllers /// - /// Get service (physical) address for this Unit + /// Get service address for this Unit /// /// /// Service address - [HttpGet("service-address/{id}")] + [HttpGet("address/{id}")] public async Task 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) })); } diff --git a/server/AyaNova/models/dto/AddressRecord.cs b/server/AyaNova/models/dto/AddressRecord.cs index 447c5956..d17bfc1e 100644 --- a/server/AyaNova/models/dto/AddressRecord.cs +++ b/server/AyaNova/models/dto/AddressRecord.cs @@ -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); }