-
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] use factory to build contract domain entity
- Loading branch information
1 parent
4c24acb
commit f9c978c
Showing
8 changed files
with
113 additions
and
114 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
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
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; } | ||
} | ||
} | ||
} |
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