-
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.
[TS-1501] extend AssetContract with additional fields
- Loading branch information
1 parent
9844fd1
commit 2f7b84a
Showing
6 changed files
with
102 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,48 @@ | ||
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) | ||
public static Contract Create(string id, string targetId, string targetType, DateTime? startDate, DateTime? approvalDate, | ||
bool? isApproved, IEnumerable<QueryableCharges> charges, IEnumerable<QueryableRelatedPeople> relatedPeople) | ||
{ | ||
return new Contract( | ||
id, | ||
targetId, | ||
targetType, | ||
charges | ||
startDate, | ||
approvalDate, | ||
isApproved, | ||
charges, | ||
relatedPeople | ||
); | ||
} | ||
public Contract() { } | ||
|
||
private Contract(string id, string targetId, string targetType, IEnumerable<QueryableCharges> charges) | ||
private Contract(string id, string targetId, string targetType, DateTime? startDate, DateTime? approvalDate, | ||
bool? isApproved, IEnumerable<QueryableCharges> charges, IEnumerable<QueryableRelatedPeople> relatedPeople) | ||
{ | ||
Id = id; | ||
TargetId = targetId; | ||
TargetType = targetType; | ||
StartDate = startDate; | ||
ApprovalDate = approvalDate; | ||
IsApproved = isApproved; | ||
TargetType = targetType; | ||
Charges = charges; | ||
RelatedPeople = relatedPeople; | ||
} | ||
|
||
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; } | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
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,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Nest; | ||
|
||
namespace Hackney.Shared.HousingSearch.Domain.Contract | ||
{ | ||
public class RelatedPeople | ||
{ | ||
public RelatedPeople() { } | ||
|
||
public static RelatedPeople Create(string id, string type, string subType, string name) | ||
{ | ||
return new RelatedPeople(id, type, subType, name); | ||
} | ||
|
||
private RelatedPeople(string id, string type, string subType, string name) | ||
{ | ||
Id = id; | ||
Type = type; | ||
SubType = subType; | ||
Name = name; | ||
} | ||
|
||
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
12 changes: 8 additions & 4 deletions
12
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,26 @@ | ||
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); | ||
return Domain.Contract.Contract.Create(Id, TargetId, TargetType, StartDate, ApprovalDate, IsApproved, | ||
Charges, RelatedPeople); | ||
} | ||
|
||
[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; } | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
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,23 @@ | ||
using Hackney.Shared.HousingSearch.Domain.Contract; | ||
using Nest; | ||
|
||
namespace Hackney.Shared.HousingSearch.Gateways.Models.Contract | ||
{ | ||
public class QueryableRelatedPeople | ||
{ | ||
public RelatedPeople Create() | ||
{ | ||
return RelatedPeople.Create( | ||
Id, | ||
Type, | ||
SubType, | ||
Name | ||
); | ||
} | ||
[Text(Name = "id")] | ||
public string Id { get; set; } | ||
public string Type { get; set; } | ||
public string SubType { get; set; } | ||
public string Name { get; set; } | ||
} | ||
} |