-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#21 added controller to space adding and updated space model storing
- Loading branch information
Showing
17 changed files
with
179 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace AlgoTecture.Domain.Models; | ||
|
||
public class SpaceDetails | ||
{ | ||
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; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace AlgoTecture.Domain.Models; | ||
|
||
public class SubSpaceDetails | ||
{ | ||
public string Levels { get; set; } | ||
|
||
public string Area { get; set; } | ||
|
||
public string FloorArea { get; set; } | ||
|
||
public string Flats { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
AlgoTecture.Libraries.Reservations.Tests/Serialization/ClassToJsonSerializationTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using AlgoTecture.Domain.Models; | ||
using AlgoTecture.Libraries.Spaces.Models.Dto; | ||
using Newtonsoft.Json; | ||
using NUnit.Framework; | ||
|
||
namespace AlgoTecture.Libraries.Reservations.Tests.Serialization; | ||
|
||
public class ClassToJsonSerializationTests | ||
{ | ||
[Test] | ||
public void ConversationClassToJsonSimpleTest() | ||
{ | ||
var addSpaceModel = new AddSpaceModel | ||
{ | ||
UtilizationTypeId = 1, | ||
SpaceAddress = "Unterstaldig 1 6106 Werthenstein", | ||
Latitude = 47.04173191647986, | ||
Longitude = 8.097301555686508, | ||
SpaceProperty = new AddSpacePropertyModel | ||
{ | ||
Name = string.Empty, | ||
Description = string.Empty, | ||
SpaceDetails = new SpaceDetails | ||
{ | ||
BuildingYear = "2023", | ||
BuildingName = string.Empty, | ||
Levels = "3", | ||
Area = "456.4", | ||
Flats = "1", | ||
FloorArea = "674", | ||
BuildingClass = "Gebäude mit 1 Wohnung", | ||
BuildingCategory = "Andere Wohngebäude", | ||
PlaceName = "Werthenstein", | ||
MunicipalityId = "1009", | ||
MunicipalityName = "Werthenstein" | ||
}, | ||
SubSpaces = new List<AddSubSpaceModel>() | ||
{ | ||
new AddSubSpaceModel | ||
{ | ||
UtilizationTypeId = 1, | ||
Description = string.Empty, | ||
SubSpaceDetails = new SubSpaceDetails | ||
{ | ||
Levels = "1", | ||
Area = "300", | ||
Flats = "1", | ||
FloorArea = "477", | ||
} | ||
}, | ||
new AddSubSpaceModel | ||
{ | ||
UtilizationTypeId = 1, | ||
Description = string.Empty, | ||
SubSpaceDetails = new SubSpaceDetails | ||
{ | ||
Levels = "2", | ||
Area = "200", | ||
Flats = "1", | ||
FloorArea = "287", | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
void Code() => JsonConvert.SerializeObject(addSpaceModel); | ||
|
||
var serializedModel = JsonConvert.SerializeObject(addSpaceModel); | ||
|
||
Assert.That(Code, Throws.Nothing); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
AlgoTecture.Libraries.Spaces/Models/Dto/AddSpacePropertyModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using AlgoTecture.Domain.Models; | ||
|
||
namespace AlgoTecture.Libraries.Spaces.Models.Dto; | ||
|
||
public class AddSpacePropertyModel | ||
{ | ||
public string Name { get; set; } | ||
|
||
public string Description { get; set; } | ||
|
||
public SpaceDetails SpaceDetails { get; set; } | ||
|
||
public List<AddSubSpaceModel> SubSpaces { get; set; } | ||
} |
25 changes: 25 additions & 0 deletions
25
AlgoTecture.Libraries.Spaces/Models/Dto/AddSubSpaceModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using AlgoTecture.Domain.Models; | ||
|
||
namespace AlgoTecture.Libraries.Spaces.Models.Dto; | ||
|
||
public class AddSubSpaceModel | ||
{ | ||
public AddSubSpaceModel() | ||
{ | ||
_subSpaces = new List<AddSubSpaceModel>(); | ||
} | ||
|
||
private List<AddSubSpaceModel> _subSpaces; | ||
|
||
public SubSpaceDetails SubSpaceDetails { get; set; } | ||
|
||
public int UtilizationTypeId { get; set; } | ||
|
||
public string Description { get; set; } | ||
|
||
public List<AddSubSpaceModel> Subspaces | ||
{ | ||
get { return _subSpaces; } | ||
set { _subSpaces = value; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters