Skip to content

Commit

Permalink
Add ApprovalStatus to Contract and AssetContract
Browse files Browse the repository at this point in the history
  • Loading branch information
martapederiva committed Sep 6, 2024
1 parent 7a2e381 commit 20b0523
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void CanConvertQueryableAssetContractEntityToDomain()
domainContract.StartDate.Should().Be(queryableAssetContract.StartDate);
domainContract.ApprovalDate.Should().Be(queryableAssetContract.ApprovalDate);
domainContract.IsApproved.Should().Be(queryableAssetContract.IsApproved);
domainContract.ApprovalStatus.Should().Be(queryableAssetContract.ApprovalStatus);
domainContract.IsActive.Should().Be(queryableAssetContract.IsActive);
domainContract.Charges.Should().BeEquivalentTo(queryableAssetContract.Charges);
domainContract.RelatedPeople.Should().BeEquivalentTo(queryableAssetContract.RelatedPeople);
Expand Down
2 changes: 2 additions & 0 deletions Hackney.Shared.HousingSearch/Domain/Asset/Contract.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Hackney.Shared.HousingSearch.Domain.Contract;
using Hackney.Shared.HousingSearch.Domain.Enums;
using System;
using System.Collections.Generic;

Expand All @@ -12,6 +13,7 @@ public class Contract
public DateTime? StartDate { get; set; }
public DateTime? ApprovalDate { get; set; }
public bool? IsApproved { get; set; }
public ApprovalStatus ApprovalStatus { get; set; }
public bool? IsActive { get; set; }
public IEnumerable<Charges> Charges { get; set; }
public IEnumerable<RelatedPeople> RelatedPeople { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions Hackney.Shared.HousingSearch/Domain/Contract/Contract.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Hackney.Shared.HousingSearch.Gateways.Models.Contract;
using Hackney.Shared.HousingSearch.Domain.Enums;
using System;
using System.Collections.Generic;

Expand All @@ -12,6 +13,7 @@ public class Contract
public DateTime? StartDate { get; set; }
public DateTime? ApprovalDate { get; set; }
public bool? IsApproved { get; set; }
public ApprovalStatus ApprovalStatus { get; set; }
public bool? IsActive { get; set; }
public IEnumerable<QueryableCharges> Charges { get; set; }
public IEnumerable<QueryableRelatedPeople> RelatedPeople { get; set; }
Expand Down
12 changes: 12 additions & 0 deletions Hackney.Shared.HousingSearch/Domain/Enums/ApprovalStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;

namespace Hackney.Shared.HousingSearch.Domain.Enums
{
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum ApprovalStatus
{
PendingApproval,
Approved,
PendingReapproval
}
}
1 change: 1 addition & 0 deletions Hackney.Shared.HousingSearch/Factories/DomainFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public static Domain.Asset.Contract ToDomain(this QueryableAssetContract entity)
StartDate = entity.StartDate,
ApprovalDate = entity.ApprovalDate,
IsApproved = entity.IsApproved,
ApprovalStatus = entity.ApprovalStatus,
IsActive = entity.IsActive,
Charges = entity.Charges?.ToDomain(),
RelatedPeople = entity.RelatedPeople?.ToDomain(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Hackney.Shared.HousingSearch.Gateways.Models.Contract;
using Hackney.Shared.HousingSearch.Domain.Enums;
using Nest;
using System.Collections.Generic;

Expand All @@ -14,6 +15,7 @@ public class QueryableAssetContract
public DateTime? StartDate { get; set; }
public DateTime? ApprovalDate { get; set; }
public bool? IsApproved { get; set; }
public ApprovalStatus ApprovalStatus { get; set; }
public bool? IsActive { get; set; }
public IEnumerable<QueryableCharges> Charges { get; set; }
public IEnumerable<QueryableRelatedPeople> RelatedPeople { get; set; }
Expand Down

0 comments on commit 20b0523

Please sign in to comment.