Skip to content

Commit 5c398dd

Browse files
Migrate from Newtonsoft.Json to System.Text.Json
Removed all Newtonsoft.Json dependencies and attributes from DTOs and project files. Updated serialization to use System.Text.Json via Shared.Serialisation.StringSerialiser. Refactored MiddlewareRegistry and Startup to configure System.Text.Json options. Removed obsolete SwaggerDefaultValues and SwaggerJsonConverter classes. Added SerialiserRegistry and JsonSerializerConfiguration for centralized serialization settings. Updated package versions and ensured all tests use the new serialization approach.
1 parent f44ecf9 commit 5c398dd

45 files changed

Lines changed: 82 additions & 488 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

EstateReportingAPI.BusinessLogic/EstateReportingAPI.BusinessLogic.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<ItemGroup>
1010
<PackageReference Include="MediatR" Version="14.1.0" />
1111
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="10.7.1" />
12-
<PackageReference Include="Shared" Version="2026.3.1" />
13-
<PackageReference Include="Shared.Results" Version="2026.3.1" />
14-
<PackageReference Include="TransactionProcessor.Database" Version="2026.4.2-build346" />
12+
<PackageReference Include="Shared" Version="2026.5.6" />
13+
<PackageReference Include="Shared.Results" Version="2026.5.6" />
14+
<PackageReference Include="TransactionProcessor.Database" Version="2026.4.3-build355" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

EstateReportingAPI.Client/EstateReportingAPI.Client.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="ClientProxyBase" Version="2026.3.1" />
11-
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
12-
<PackageReference Include="Shared.Results" Version="2026.3.1" />
10+
<PackageReference Include="ClientProxyBase" Version="2026.5.6" />
11+
<PackageReference Include="Shared.Results" Version="2026.5.6" />
1312
</ItemGroup>
1413

1514
<ItemGroup>
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
11
namespace EstateReportingAPI.DataTrasferObjects{
2-
using Newtonsoft.Json;
32
using System;
43

54
public class CalendarDate
65
{
7-
[JsonProperty("date")]
86
public DateTime Date { get; set; }
9-
[JsonProperty("day_of_week")]
107
public String DayOfWeek{ get; set; }
11-
[JsonProperty("day_of_week_number")]
128
public Int32 DayOfWeekNumber{ get; set; }
13-
[JsonProperty("day_of_week_short")]
149
public String DayOfWeekShort{ get; set; }
15-
[JsonProperty("month_name")]
1610
public String MonthName{ get; set; }
17-
[JsonProperty("month_name_short")]
1811
public String MonthNameShort { get; set; }
19-
[JsonProperty("month_number")]
2012
public Int32 MonthNumber { get; set; }
21-
[JsonProperty("week_number")]
2213
public Int32 WeekNumber { get; set; }
23-
[JsonProperty("week_number_string")]
2414
public String WeekNumberString { get; set; }
25-
[JsonProperty("year")]
2615
public Int32 Year { get; set; }
27-
[JsonProperty("year_week_number")]
2816
public String YearWeekNumber { get; set; }
2917
}
3018
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
using Newtonsoft.Json;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Text;
1+
using System;
52

63
namespace EstateReportingAPI.DataTrasferObjects
74
{
85
public class CalendarYear
96
{
10-
[JsonProperty("year")]
117
public Int32 Year{ get; set; }
128
}
139
}
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
namespace EstateReportingAPI.DataTrasferObjects{
2-
using Newtonsoft.Json;
32
using System;
43

54
public class ComparisonDate{
6-
[JsonProperty("order_value")]
75
public Int32 OrderValue{ get; set; }
8-
[JsonProperty("date")]
96
public DateTime Date { get; set; }
10-
[JsonProperty("description")]
117
public String Description { get; set; }
128
}
139
}
Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,86 @@
1-
using Newtonsoft.Json;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43

54
namespace EstateReportingAPI.DataTransferObjects;
65

76
public class Contract
87
{
98
#region Properties
10-
[JsonProperty("estate_id")]
119
public Guid EstateId { get; set; }
12-
[JsonProperty("estate_reporting_id")]
1310
public Int32 EstateReportingId { get; set; }
14-
[JsonProperty("contract_id")]
1511
public Guid ContractId { get; set; }
16-
[JsonProperty("contract_reporting_id")]
1712
public Int32 ContractReportingId { get; set; }
18-
[JsonProperty("description")]
1913
public String Description { get; set; }
20-
[JsonProperty("operator_name")]
2114
public String OperatorName { get; set; }
22-
[JsonProperty("operator_id")]
2315
public Guid OperatorId { get; set; }
24-
[JsonProperty("operator_reporting_id")]
2516
public Int32 OperatorReportingId { get; set; }
26-
[JsonProperty("products")]
2717
public List<ContractProduct> Products { get; set; }
2818
#endregion
2919
}
3020

3121
public class ContractProduct
3222
{
33-
[JsonProperty("contract_id")]
3423
public Guid ContractId { get; set; }
35-
[JsonProperty("contract_product_reporting_id")]
3624
public Int32 ContractProductReportingId { get; set; }
3725

38-
[JsonProperty("product_id")]
3926
public Guid ProductId { get; set; }
40-
[JsonProperty("product_name")]
4127
public String ProductName { get; set; }
42-
[JsonProperty("display_text")]
4328
public String DisplayText { get; set; }
44-
[JsonProperty("product_type")]
4529
public Int32 ProductType { get; set; }
46-
[JsonProperty("value")]
4730
public Decimal? Value { get; set; }
48-
[JsonProperty("transaction_fees")]
4931
public List<ContractProductTransactionFee> TransactionFees { get; set; }
5032
}
5133

5234
public class ContractProductTransactionFee {
53-
[JsonProperty("transaction_fee_id")]
5435
public Guid TransactionFeeId { get; set; }
55-
[JsonProperty("contract_product_transaction_fee_reporting_id")]
5636
public Int32 ContractProductTransactionFeeReportingId { get; set; }
5737

58-
[JsonProperty("description")]
5938
public string? Description { get; set; }
60-
[JsonProperty("calculation_type")]
6139
public Int32 CalculationType { get; set; }
62-
[JsonProperty("fee_type")]
6340
public Int32 FeeType { get; set; }
64-
[JsonProperty("value")]
6541
public Decimal Value { get; set; }
6642
}
6743

6844

6945
public class Estate
7046
{
71-
[JsonProperty("estate_id")]
7247
public Guid EstateId { get; set; }
73-
[JsonProperty("estate_name")]
7448
public string? EstateName { get; set; }
75-
[JsonProperty("reference")]
7649
public string? Reference { get; set; }
77-
[JsonProperty("operators")]
7850
public List<EstateOperator>? Operators { get; set; }
79-
[JsonProperty("merchants")]
8051
public List<EstateMerchant>? Merchants { get; set; }
81-
[JsonProperty("contracts")]
8252
public List<EstateContract>? Contracts { get; set; }
83-
[JsonProperty("users")]
8453
public List<EstateUser>? Users { get; set; }
8554
}
8655

8756
public class EstateUser
8857
{
89-
[JsonProperty("user_id")]
9058
public Guid UserId { get; set; }
91-
[JsonProperty("email_address")]
9259
public string? EmailAddress { get; set; }
93-
[JsonProperty("created_date_time")]
9460
public DateTime CreatedDateTime { get; set; }
9561
}
9662

9763
public class EstateOperator
9864
{
99-
[JsonProperty("operator_id")]
10065
public Guid OperatorId { get; set; }
101-
[JsonProperty("name")]
10266
public string? Name { get; set; }
103-
[JsonProperty("require_custom_merchant_number")]
10467
public bool RequireCustomMerchantNumber { get; set; }
105-
[JsonProperty("require_custom_terminal_number")]
10668
public bool RequireCustomTerminalNumber { get; set; }
107-
[JsonProperty("created_date_time")]
10869
public DateTime CreatedDateTime { get; set; }
10970
}
11071

11172
public class EstateContract
11273
{
113-
[JsonProperty("operator_id")]
11474
public Guid OperatorId { get; set; }
115-
[JsonProperty("contract_id")]
11675
public Guid ContractId { get; set; }
117-
[JsonProperty("name")]
11876
public string? Name { get; set; }
119-
[JsonProperty("operator_name")]
12077
public string? OperatorName { get; set; }
12178
}
12279

12380

12481
public class EstateMerchant
12582
{
126-
[JsonProperty("merchant_id")]
12783
public Guid MerchantId { get; set; }
128-
[JsonProperty("name")]
12984
public string? Name { get; set; }
130-
[JsonProperty("reference")]
13185
public string? Reference { get; set; }
13286
}

EstateReportingAPI.DataTrasferObjects/EstateReportingAPI.DataTransferObjects.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
10+
1111
</ItemGroup>
1212

1313
</Project>
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
using Newtonsoft.Json;
2-
3-
namespace EstateReportingAPI.DataTransferObjects{
1+
namespace EstateReportingAPI.DataTransferObjects{
42
using System;
53

64
public class LastSettlement
75
{
8-
[JsonProperty("settlement_date")]
96
public DateTime SettlementDate { get; set; }
10-
[JsonProperty("sales_value")]
117
public Decimal SalesValue { get; set; }
12-
[JsonProperty("sales_count")]
138
public Int32 SalesCount { get; set; }
14-
[JsonProperty("fees_value")]
159
public Decimal FeesValue { get; set; }
1610
}
1711
}

0 commit comments

Comments
 (0)