diff --git a/AlgoTecture.TelegramBot/Controllers/MainController.cs b/AlgoTecture.TelegramBot/Controllers/MainController.cs index 5a71a46..c2b709b 100644 --- a/AlgoTecture.TelegramBot/Controllers/MainController.cs +++ b/AlgoTecture.TelegramBot/Controllers/MainController.cs @@ -133,12 +133,12 @@ public async Task PressToManageContract() } [Action] - private async Task PressAddressToRentButton(string geoAdminFeatureId) + private async Task PressAddressToRentButton(TelegramToAddressModel telegramToAddressModel) { var chatId = Context.GetSafeChatId(); if (!chatId.HasValue) return; - var targetAddress = _telegramToAddressResolver.TryGetAddressListByChatId(chatId.Value).FirstOrDefault(x => x.FeatureId == geoAdminFeatureId); + var targetAddress = _telegramToAddressResolver.TryGetAddressListByChatId(chatId.Value).FirstOrDefault(x => x.FeatureId == telegramToAddressModel.FeatureId); var targetSpace = await _spaceGetter.GetByCoordinates(targetAddress.latitude, targetAddress.longitude); @@ -146,9 +146,10 @@ private async Task PressAddressToRentButton(string geoAdminFeatureId) if (targetSpace == null) { - var formattedGeoAdminFeatureId = !string.IsNullOrEmpty(geoAdminFeatureId) ? geoAdminFeatureId.Split('_')[0] : string.Empty; + var formattedGeoAdminFeatureId = !string.IsNullOrEmpty(telegramToAddressModel.FeatureId) ? telegramToAddressModel.FeatureId.Split('_')[0] : string.Empty; PushL("This space will soon be available for rent. Go to space properties or /start to try again"); - var urlToAddressProperties = $"https://algotecture.io/webapi-qrcode/spacePropertyPage?featureId={formattedGeoAdminFeatureId}"; + + var urlToAddressProperties = $"https://algotecture.io/webapi-qrcode/spacePropertyPage?featureId={formattedGeoAdminFeatureId}&label={telegramToAddressModel.Address}"; RowButton("Go to space properties", urlToAddressProperties); await SendOrUpdate(); } @@ -194,7 +195,7 @@ private async Task EnterAddress() Address = label.label }; telegramToAddressList.Add(telegramToAddressModel); - RowButton(label.label, Q(PressAddressToRentButton, label.featureId)); + RowButton(label.label, Q(PressAddressToRentButton, telegramToAddressModel)); } if (!labels.Any()) diff --git a/AlgoTecture.WebApi.QrCode/Models/GeoAdminBuildingViewModel.cs b/AlgoTecture.WebApi.QrCode/Models/GeoAdminBuildingViewModel.cs new file mode 100644 index 0000000..2ae4e57 --- /dev/null +++ b/AlgoTecture.WebApi.QrCode/Models/GeoAdminBuildingViewModel.cs @@ -0,0 +1,26 @@ +namespace AlgoTecture.WebApi.QrCode.Models; + +public class GeoAdminBuildingViewModel +{ + public string BuildingYear { get; set; } + + public string BuildingCategory { get; set; } + + public string BuildingClass { get; set; } + + public string BuildingName { get; set; } + + public string Levels { get; set; } + + public string Area { get; set; } + + public string FloorArea { get; set; } + + public string Flats { get; set; } + + public string PlaceName { get; set; } + + public string MunicipalityId { get; set; } + + public string MunicipalityName { get; set; } +} \ No newline at end of file diff --git a/AlgoTecture.WebApi.QrCode/Pages/SpacePropertyPage.cshtml b/AlgoTecture.WebApi.QrCode/Pages/SpacePropertyPage.cshtml index 53425de..7448681 100644 --- a/AlgoTecture.WebApi.QrCode/Pages/SpacePropertyPage.cshtml +++ b/AlgoTecture.WebApi.QrCode/Pages/SpacePropertyPage.cshtml @@ -4,22 +4,22 @@ ViewData["Title"] = "Home page"; }
- @Model.GeoAdminBuilding.BuildingName + @Model.LabelAddress
@{
    -
  1. Municipality Name: @Model.GeoAdminBuilding.MunicipalityName
  2. -
  3. Municipality Id: @Model.GeoAdminBuilding.MunicipalityId
  4. -
  5. Place Name: @Model.GeoAdminBuilding.PlaceName
  6. -
  7. Building Name: @Model.GeoAdminBuilding.BuildingName
  8. -
  9. Building Year: @Model.GeoAdminBuilding.BuildingYear
  10. -
  11. Building Category: @Model.GeoAdminBuilding.BuildingCategory
  12. -
  13. Building Class: @Model.GeoAdminBuilding.BuildingClass
  14. -
  15. Levels: @Model.GeoAdminBuilding.Levels
  16. -
  17. Area: @Model.GeoAdminBuilding.Area
  18. -
  19. Floor Area: @Model.GeoAdminBuilding.FloorArea
  20. -
  21. Flats: @Model.GeoAdminBuilding.Flats
  22. +
  23. Municipality Name: @Model.GeoAdminBuildingView.MunicipalityName
  24. +
  25. Municipality Id: @Model.GeoAdminBuildingView.MunicipalityId
  26. +
  27. Place Name: @Model.GeoAdminBuildingView.PlaceName
  28. +
  29. Building Name: @Model.GeoAdminBuildingView.BuildingName
  30. +
  31. Building Year: @Model.GeoAdminBuildingView.BuildingYear
  32. +
  33. Building Category: @Model.GeoAdminBuildingView.BuildingCategory
  34. +
  35. Building Class: @Model.GeoAdminBuildingView.BuildingClass
  36. +
  37. Levels: @Model.GeoAdminBuildingView.Levels
  38. +
  39. Area: @Model.GeoAdminBuildingView.Area
  40. +
  41. Floor Area: @Model.GeoAdminBuildingView.FloorArea
  42. +
  43. Flats: @Model.GeoAdminBuildingView.Flats