Skip to content

Commit

Permalink
Add District entity and update GeocoderController
Browse files Browse the repository at this point in the history
to include District information
  • Loading branch information
yorickdewid committed Apr 24, 2024
1 parent a9fed73 commit 0eff893
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
44 changes: 44 additions & 0 deletions src/FunderMaps.Core/Entities/District.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using FunderMaps.Core.DataAnnotations;
using System.ComponentModel.DataAnnotations;

namespace FunderMaps.Core.Entities;

/// <summary>
/// District entity.
/// </summary>
public sealed class District : IEntityIdentifier<string>
{
/// <summary>
/// Entity identifier.
/// </summary>
public string Identifier => Id;

/// <summary>
/// Unique identifier.
/// </summary>
[Required, Geocoder]
public string Id { get; set; } = default!;

/// <summary>
/// District name.
/// </summary>
[Required]
public string Name { get; set; } = default!;

/// <summary>
/// Is water district.
/// </summary>
public bool Water { get; set; }

/// <summary>
/// External data source id.
/// </summary>
[Required]
public string ExternalId { get; set; } = default!;

/// <summary>
/// Municipality identifier.
/// </summary>
[Geocoder]
public string? MunicipalityId { get; set; }
}
4 changes: 2 additions & 2 deletions src/FunderMaps.WebApi/Controllers/GeocoderController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed class GeocoderInfo
public Building Building { get; set; } = default!;
public Address Address { get; set; } = default!;
public Neighborhood? Neighborhood { get; set; }
// TODO: Add Wijk
public District? District { get; set; }
// TODO: Add Municipality
// TODO: Add Province
}
Expand Down Expand Up @@ -56,7 +56,7 @@ public Task<Neighborhood> GetNeighborhoodAsync(string id)

// GET: api/geocoder/{id}
/// <summary>
/// Get building by identifier.
/// Get geocoder information by identifier.
/// </summary>
/// <remarks>
/// Cache response for 8 hours. Building will not change often.
Expand Down

0 comments on commit 0eff893

Please sign in to comment.