Skip to content

Refactor response models #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions MatchTraderBApi/Enums/MTrSystemType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Runtime.Serialization;

namespace MatchTraderBApi.Enums;

public enum MTrSystemType
{
[EnumMember(Value = "MT4")]
MT4,

[EnumMember(Value = "MT5")]
MT5,

[EnumMember(Value = "QFX")]
QFX,
}
2 changes: 1 addition & 1 deletion MatchTraderBApi/Models/Dtos/General/MTrBranch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class MTrBranch
public string Uuid { get; set; }

[JsonPropertyName("partnerId")]
public string PartnerId { get; set; }
public long? PartnerId { get; set; }

[JsonPropertyName("created")]
public DateTime Created { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MTrMailingConfiguration
public string EmailHost { get; set; }

[JsonPropertyName("emailPort")]
public int? EmailPort { get; set; } // Nullable int for emailPort
public int? EmailPort { get; set; }

[JsonPropertyName("emailTls")]
public bool EmailTls { get; set; }
Expand Down
16 changes: 8 additions & 8 deletions MatchTraderBApi/Models/Dtos/General/MTrOffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class MTrOffer
public long? PartnerId { get; set; }

[JsonPropertyName("created")]
public string Created { get; set; }
public DateTime Created { get; set; }

[JsonPropertyName("updated")]
public string Updated { get; set; }
public DateTime Updated { get; set; }

[JsonPropertyName("name")]
public string Name { get; set; }
Expand All @@ -23,10 +23,10 @@ public class MTrOffer
public string Currency { get; set; }

[JsonPropertyName("demo")]
public bool Demo { get; set; }
public bool IsDemo { get; set; }

[JsonPropertyName("hidden")]
public bool Hidden { get; set; }
public bool IsHidden { get; set; }

[JsonPropertyName("description")]
public string Description { get; set; }
Expand All @@ -35,16 +35,16 @@ public class MTrOffer
public string? MoneyManager { get; set; }

[JsonPropertyName("initialDeposit")]
public double InitialDeposit { get; set; }
public decimal InitialDeposit { get; set; }

[JsonPropertyName("leverage")]
public double Leverage { get; set; }
public int Leverage { get; set; }

[JsonPropertyName("verificationRequired")]
public bool VerificationRequired { get; set; }
public bool IsVerificationRequired { get; set; }

[JsonPropertyName("tradingAccountAutoCreation")]
public bool TradingAccountAutoCreation { get; set; }
public bool IsTradingAccountAutoCreation { get; set; }

[JsonPropertyName("groupName")]
public string GroupName { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion MatchTraderBApi/Models/Dtos/General/MTrOfferBranch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class MTrOfferBranch
public long? PartnerId { get; set; }

[JsonPropertyName("created")]
public string Created { get; set; }
public DateTime Created { get; set; }

[JsonPropertyName("name")]
public string Name { get; set; }
Expand Down
9 changes: 5 additions & 4 deletions MatchTraderBApi/Models/Dtos/General/MTrOfferSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
using MatchTraderBApi.Enums;

namespace MatchTraderBApi.Models.Dtos.General;

Expand All @@ -11,17 +12,17 @@ public class MTrOfferSystem
public long? PartnerId { get; set; }

[JsonPropertyName("created")]
public string Created { get; set; }
public DateTime Created { get; set; }

[JsonPropertyName("name")]
public string Name { get; set; }

[JsonPropertyName("demo")]
public bool Demo { get; set; }
public bool IsDemo { get; set; }

[JsonPropertyName("active")]
public bool Active { get; set; }
public bool IsActive { get; set; }

[JsonPropertyName("systemType")]
public string SystemType { get; set; }
public MTrSystemType SystemType { get; set; }
}
4 changes: 2 additions & 2 deletions MatchTraderBApi/Models/Dtos/General/MTrRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class MTrRole
public long? PartnerId { get; set; }

[JsonPropertyName("created")]
public string created { get; set; }
public DateTime created { get; set; }

[JsonPropertyName("updated")]
public string updated { get; set; }
public DateTime updated { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System.Text.Json.Serialization;
using MatchTraderBApi.Models.Dtos;
using MatchTraderBApi.Models.Dtos.General;

namespace MatchTraderBApi.Models.Responses.General;

public class MTrGetBranchesResponse
{
[JsonPropertyName("branches")]
public List<MTrBranch> Branches { get; set; }
[JsonPropertyName("branches")]
public List<MTrBranch> Branches { get; set; } = [];
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace MatchTraderBApi.Models.Responses.General;
public class MTrGetOffersResponse
{
[JsonPropertyName("offers")]
public List<MTrOffer> Offers { get; set; }
public List<MTrOffer> Offers { get; set; } = [];
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.Json.Serialization;
using MatchTraderBApi.Models.Dtos;
using MatchTraderBApi.Models.Dtos.General;

namespace MatchTraderBApi.Models.Responses.General;
Expand Down