Skip to content

Commit

Permalink
Merge pull request #442 from Laixer/develop
Browse files Browse the repository at this point in the history
v2.9.4
  • Loading branch information
Patrick Nobbe authored Jan 28, 2021
2 parents 08613bd + 4f4c2b0 commit d29cce8
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 46 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/dotnet-core-docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: FunderMaps Docker Container
name: FunderMaps Docker Containers

on:
pull_request:
Expand All @@ -9,14 +9,17 @@ jobs:
build:
name: Build Container
runs-on: ubuntu-latest
strategy:
matrix:
subtool:
- FunderMaps.WebApi
- FunderMaps.Webservice
- FunderMaps.BatchNode
- FunderMaps.Portal
- FunderMaps.Cli

steps:
- uses: actions/checkout@v2

- name: Print version
run: |
find src -type f -exec sed -i "s/@@VERSION@@/$(git describe --long --always)/" {} +
find src -type f -exec sed -i "s/@@COMMIT@@/$(git rev-parse HEAD)/" {} +
- name: Build
run: docker build . --file Dockerfile
run: docker build --build-arg subtool=${{ matrix.subtool }} .
21 changes: 15 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-focal AS build
WORKDIR /source

ARG subtool

RUN test -n "$subtool" || (echo "subtool argument not set" && false)

# Copy and restore app
COPY . .
RUN dotnet restore

# Print version
# Substitute magic variables with version
RUN find . -type f -exec sed -i "s/@@VERSION@@/$(git describe --long --always)/" {} +
RUN find . -type f -exec sed -i "s/@@COMMIT@@/$(git rev-parse HEAD)/" {} +

# Publish app and libraries
RUN dotnet publish -c release -o /app --no-restore
RUN git describe --long --always > /app/VERSION
RUN git rev-parse HEAD > /app/COMMIT
RUN echo "Building $subtool"
WORKDIR "/source/src/$subtool"
RUN dotnet publish -c release -o /app \
&& git describe --long --always > /app/VERSION \
&& git rev-parse HEAD > /app/COMMIT \
&& echo "$subtool" > /app/SUBTOOL

WORKDIR /app
RUN ln -s "$subtool" "entry"

# Build runtime image
# Runtime image
#
# Any FunderMaps application in the repository can
# be called via the CMD=<application> environment
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ version:
find src -type f -exec sed -i "s/@@COMMIT@@/`git rev-parse HEAD`/" {} +

docker:
docker build -t fundermaps . --file Dockerfile
docker build --build-arg subtool=FunderMaps.WebApi -t fundermaps-app:latest .
docker build --build-arg subtool=FunderMaps.Webservice -t fundermaps-webservice:latest .
docker build --build-arg subtool=FunderMaps.BatchNode -t fundermaps-batch:latest .
docker build --build-arg subtool=FunderMaps.Portal -t fundermaps-portal:latest .
docker build --build-arg subtool=FunderMaps.Cli -t fundermaps-cli:latest .

test:
dotnet test
Expand Down
5 changes: 5 additions & 0 deletions src/FunderMaps.AspNetCore/DataTransferObjects/AnalysisDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public record AnalysisDto
/// </summary>
public string ExternalId { get; set; }

/// <summary>
/// Postcode.
/// </summary>
public string PostalCode { get; set; }

/// <summary>
/// Address identifier.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ public record AnalysisRiskPlusDto : AnalysisDto
/// </summary>
public DateTimeOffset ConstructionYear { get; set; }

/// <summary>
/// Built year source.
/// </summary>
public BuiltYearSource ConstructionYearSource { get; set; }

/// <summary>
/// Represents the ground water level.
/// </summary>
Expand Down Expand Up @@ -43,6 +48,21 @@ public record AnalysisRiskPlusDto : AnalysisDto
/// </summary>
public string MonitoringWell { get; set; }

/// <summary>
/// Recovery advised.
/// </summary>
public bool? RecoveryAdvised { get; set; }

/// <summary>
/// Damage cause.
/// </summary>
public FoundationDamageCause? DamageCause { get; set; }

/// <summary>
/// Substructure.
/// </summary>
public Substructure? Substructure { get; set; }

/// <summary>
/// Client document identifier.
/// </summary>
Expand All @@ -63,11 +83,21 @@ public record AnalysisRiskPlusDto : AnalysisDto
/// </summary>
public RecoveryDocumentType? RecoveryType { get; set; }

/// <summary>
/// Foundation recovery status.
/// </summary>
public RecoveryStatus? RecoveryStatus { get; set; }

/// <summary>
/// Building surface area in m^2.
/// </summary>
public double? SurfaceArea { get; set; }

/// <summary>
/// Address living surface area in square meters.
/// </summary>
public double? LivingArea { get; set; }

/// <summary>
/// Foundation bearing ground layer.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/FunderMaps.Core/FunderMaps.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Scriban" Version="3.3.3" />
<PackageReference Include="Scriban" Version="3.4.1" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions src/FunderMaps.Core/Types/BuiltYearSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace FunderMaps.Core.Types
{
/// <summary>
/// Represents an external data source.
/// </summary>
public enum BuiltYearSource
{
/// <summary>
/// Basis Registratie Gebouwen (BAG).
/// </summary>
Bag = 0,

/// <summary>
/// FunderMaps registered data.
/// </summary>
Fundermaps = 1,
}
}
35 changes: 35 additions & 0 deletions src/FunderMaps.Core/Types/Products/AnalysisProduct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public sealed class AnalysisProduct : ProductBase
/// </summary>
public string ExternalId { get; set; }

/// <summary>
/// Postal code
/// </summary>
public string PostalCode { get; set; }

/// <summary>
/// Represents the external data source of this building.
/// </summary>
Expand All @@ -29,6 +34,11 @@ public sealed class AnalysisProduct : ProductBase
/// </summary>
public DateTimeOffset ConstructionYear { get; set; }

/// <summary>
/// Built year source.
/// </summary>
public BuiltYearSource ConstructionYearSource { get; set; }

/// <summary>
/// Address identifier.
/// </summary>
Expand Down Expand Up @@ -76,6 +86,21 @@ public sealed class AnalysisProduct : ProductBase
/// </summary>
public string MonitoringWell { get; set; }

/// <summary>
/// Recovery advised.
/// </summary>
public bool? RecoveryAdvised { get; set; }

/// <summary>
/// Damage cause.
/// </summary>
public FoundationDamageCause? DamageCause { get; set; }

/// <summary>
/// Substructure.
/// </summary>
public Substructure? Substructure { get; set; }

/// <summary>
/// Client document identifier.
/// </summary>
Expand All @@ -96,11 +121,21 @@ public sealed class AnalysisProduct : ProductBase
/// </summary>
public RecoveryDocumentType? RecoveryType { get; set; }

/// <summary>
/// Foundation recovery status.
/// </summary>
public RecoveryStatus? RecoveryStatus { get; set; }

/// <summary>
/// Building surface area in square meters.
/// </summary>
public double? SurfaceArea { get; set; }

/// <summary>
/// Address living surface area in square meters.
/// </summary>
public double? LivingArea { get; set; }

/// <summary>
/// Foundation bearing ground layer.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/FunderMaps.Data/FunderMaps.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="5.0.1.1" />
<PackageReference Include="Npgsql" Version="5.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/FunderMaps.Data/Providers/NpgsqlDbProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ static NpgsqlDbProvider()
NpgsqlConnection.GlobalTypeMapper.MapEnum<AuditStatus>("report.audit_status");
NpgsqlConnection.GlobalTypeMapper.MapEnum<BaseMeasurementLevel>("report.base_measurement_level");
NpgsqlConnection.GlobalTypeMapper.MapEnum<BuildingType>("geocoder.building_type");
NpgsqlConnection.GlobalTypeMapper.MapEnum<BuiltYearSource>("report.built_year_source");
NpgsqlConnection.GlobalTypeMapper.MapEnum<BundleStatus>("maplayer.bundle_status");
NpgsqlConnection.GlobalTypeMapper.MapEnum<ConstructionPile>("report.construction_pile");
NpgsqlConnection.GlobalTypeMapper.MapEnum<CrackType>("report.crack_type");
Expand Down
Loading

0 comments on commit d29cce8

Please sign in to comment.