-
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.
Merge pull request #78 from LBHackney-IT/feature/ts-1501-extend-contr…
…act-with-approval-fields [TS-1501] extend AssetContract with additional fields
- Loading branch information
Showing
10 changed files
with
153 additions
and
105 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
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 |
---|---|---|
@@ -1,31 +1,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Hackney.Shared.HousingSearch.Domain.Contract | ||
namespace Hackney.Shared.HousingSearch.Domain.Contract | ||
{ | ||
public class Charges | ||
{ | ||
public Charges() { } | ||
|
||
public static Charges Create(string id, string type, string subType, string frequency, decimal? amount) | ||
{ | ||
return new Charges(id, type, subType, frequency, amount); | ||
} | ||
|
||
private Charges(string id, string type, string subType, string frequency, decimal? amount) | ||
{ | ||
Id = id; | ||
Type = type; | ||
SubType = subType; | ||
Frequency = frequency; | ||
Amount = amount; | ||
} | ||
|
||
public string Id { get; set; } | ||
public string Type { get; set; } | ||
public string SubType { get; set; } | ||
public string Frequency { get; set; } | ||
public decimal? Amount { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,18 @@ | ||
using Hackney.Shared.HousingSearch.Domain.Contract; | ||
using Hackney.Shared.HousingSearch.Gateways.Models.Contract; | ||
using Hackney.Shared.HousingSearch.Gateways.Models.Contract; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Hackney.Shared.HousingSearch.Domain.Contract | ||
{ | ||
public class Contract | ||
{ | ||
public static Contract Create(string id, string targetId, string targetType, IEnumerable<QueryableCharges> charges) | ||
{ | ||
return new Contract( | ||
id, | ||
targetId, | ||
targetType, | ||
charges | ||
); | ||
} | ||
public Contract() { } | ||
|
||
private Contract(string id, string targetId, string targetType, IEnumerable<QueryableCharges> charges) | ||
{ | ||
Id = id; | ||
TargetId = targetId; | ||
TargetType = targetType; | ||
Charges = charges; | ||
} | ||
|
||
public string Id { get; set; } | ||
public string TargetId { get; set; } | ||
public string TargetType { get; set; } | ||
public DateTime? StartDate { get; set; } | ||
public DateTime? ApprovalDate { get; set; } | ||
public bool? IsApproved { get; set; } | ||
public IEnumerable<QueryableCharges> Charges { get; set; } | ||
public IEnumerable<QueryableRelatedPeople> RelatedPeople { get; set; } | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Hackney.Shared.HousingSearch/Domain/Contract/RelatedPeople.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,10 @@ | ||
namespace Hackney.Shared.HousingSearch.Domain.Contract | ||
{ | ||
public class RelatedPeople | ||
{ | ||
public string Id { get; set; } | ||
public string Type { get; set; } | ||
public string SubType { get; set; } | ||
public string Name { 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
14 changes: 6 additions & 8 deletions
14
Hackney.Shared.HousingSearch/Gateways/Models/Assets/QueryableAssetContract.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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
using Hackney.Shared.HousingSearch.Gateways.Models.Contract; | ||
using System; | ||
using Hackney.Shared.HousingSearch.Gateways.Models.Contract; | ||
using Nest; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Hackney.Shared.HousingSearch.Gateways.Models.Assets | ||
{ | ||
public class QueryableAssetContract | ||
{ | ||
public Domain.Contract.Contract Create() | ||
{ | ||
return Domain.Contract.Contract.Create(Id, TargetId, TargetType, Charges); | ||
} | ||
|
||
[Text(Name = "id")] | ||
public string Id { get; set; } | ||
public string TargetId { get; set; } | ||
public string TargetType { get; set; } | ||
public DateTime? StartDate { get; set; } | ||
public DateTime? ApprovalDate { get; set; } | ||
public bool? IsApproved { get; set; } | ||
public IEnumerable<QueryableCharges> Charges { get; set; } | ||
public IEnumerable<QueryableRelatedPeople> RelatedPeople { get; set; } | ||
} | ||
} |
21 changes: 3 additions & 18 deletions
21
Hackney.Shared.HousingSearch/Gateways/Models/Contract/QueryableCharges.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 |
---|---|---|
@@ -1,28 +1,13 @@ | ||
using Hackney.Shared.HousingSearch.Domain.Contract; | ||
using Nest; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Nest; | ||
|
||
namespace Hackney.Shared.HousingSearch.Gateways.Models.Contract | ||
{ | ||
public class QueryableCharges | ||
{ | ||
public Charges Create() | ||
{ | ||
return Charges.Create( | ||
Id, | ||
Type, | ||
SubType, | ||
Frequency, | ||
Amount | ||
); | ||
} | ||
[Text(Name = "id")] | ||
public string Id { get; set; } | ||
[Text(Name = "id")] public string Id { get; set; } | ||
public string Type { get; set; } | ||
public string SubType { get; set; } | ||
public string Frequency { get; set; } | ||
public decimal? Amount { get; set; } | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Hackney.Shared.HousingSearch/Gateways/Models/Contract/QueryableRelatedPeople.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,13 @@ | ||
using Hackney.Shared.HousingSearch.Domain.Contract; | ||
using Nest; | ||
|
||
namespace Hackney.Shared.HousingSearch.Gateways.Models.Contract | ||
{ | ||
public class QueryableRelatedPeople | ||
{ | ||
[Text(Name = "id")] public string Id { get; set; } | ||
public string Type { get; set; } | ||
public string SubType { get; set; } | ||
public string Name { get; set; } | ||
} | ||
} |