Skip to content

Commit

Permalink
[TS-1501] introduce enum for Contract TargetType
Browse files Browse the repository at this point in the history
  • Loading branch information
LBHJHeppinstall committed Jul 15, 2024
1 parent 2480685 commit 4a2f5f9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Hackney.Shared.HousingSearch/Domain/Asset/Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Contract
{
public string Id { get; set; }
public string TargetId { get; set; }
public string TargetType { get; set; }
public TargetType TargetType { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? ApprovalDate { get; set; }
public bool? IsApproved { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Hackney.Shared.HousingSearch/Domain/Contract/Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Contract
{
public string Id { get; set; }
public string TargetId { get; set; }
public string TargetType { get; set; }
public TargetType TargetType { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? ApprovalDate { get; set; }
public bool? IsApproved { get; set; }
Expand Down
14 changes: 14 additions & 0 deletions Hackney.Shared.HousingSearch/Domain/Contract/Enums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Runtime.Serialization;
using Elasticsearch.Net;

namespace Hackney.Shared.HousingSearch.Domain.Contract
{
[Serializable]
[StringEnum]
public enum TargetType
{
[EnumMember(Value = "Asset")]
Asset
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Hackney.Shared.HousingSearch.Gateways.Models.Contract;
using Nest;
using System.Collections.Generic;
using Hackney.Shared.HousingSearch.Domain.Contract;

namespace Hackney.Shared.HousingSearch.Gateways.Models.Assets
{
Expand All @@ -10,7 +11,7 @@ public class QueryableAssetContract
[Text(Name = "id")]
public string Id { get; set; }
public string TargetId { get; set; }
public string TargetType { get; set; }
public TargetType TargetType { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? ApprovalDate { get; set; }
public bool? IsApproved { get; set; }
Expand Down

0 comments on commit 4a2f5f9

Please sign in to comment.