Types go brrr

This commit is contained in:
Cj
2025-01-07 06:22:07 -05:00
parent cab9a47282
commit b7ec4eb715
19 changed files with 289 additions and 1 deletions
+3
View File
@@ -1,7 +1,10 @@
using Core.Models.Common;
using Core.Models.Eft.Bot;
using Core.Models.Eft.Common;
using Core.Models.Eft.Common.Tables;
using Core.Models.Spt.Bots;
using Core.Models.Spt.Config;
using Condition = Core.Models.Spt.Config.Condition;
namespace Core.Controllers;
+2
View File
@@ -1,3 +1,5 @@
using Core.Models.Eft.InRaid;
namespace Core.Controllers;
public class InRaidController
+1
View File
@@ -1,5 +1,6 @@
using Core.Models.Eft.Common;
using Core.Models.Eft.ItemEvent;
using Core.Models.Eft.Repair;
namespace Core.Controllers;
+1
View File
@@ -2,6 +2,7 @@ using Core.Models.Eft.Common;
using Core.Models.Eft.Common.Tables;
using Core.Models.Eft.ItemEvent;
using Core.Models.Eft.Ragfair;
using Core.Models.Eft.Trade;
using Core.Models.Enums;
namespace Core.Controllers;
+3
View File
@@ -1,3 +1,6 @@
using Core.Models.Eft.Weather;
using Core.Models.Spt.Weather;
namespace Core.Controllers;
public class WeatherController
+2 -1
View File
@@ -1,5 +1,6 @@
using Core.Models.Eft.Common;
using Core.Models.Eft.ItemEvent;
using Core.Models.Eft.Wishlist;
namespace Core.Controllers;
@@ -14,7 +15,7 @@ public class WishlistController
/// <returns></returns>
public ItemEventRouterResponse AddToWishList(
PmcData pmcData,
AddItemToWishlistRequest request,
AddToWishlistRequest request,
string sessionId)
{
throw new NotImplementedException();
@@ -0,0 +1,36 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class AddOfferRequestData
{
[JsonPropertyName("Action")]
public string Action { get; set; }
[JsonPropertyName("sellInOnePiece")]
public bool SellInOnePiece { get; set; }
[JsonPropertyName("items")]
public List<string> Items { get; set; }
[JsonPropertyName("requirements")]
public List<Requirement> Requirements { get; set; }
}
public class Requirement
{
[JsonPropertyName("_tpl")]
public string Template { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("level")]
public int Level { get; set; }
[JsonPropertyName("side")]
public int Side { get; set; }
[JsonPropertyName("onlyFunctional")]
public bool OnlyFunctional { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class ExtendOfferRequestData
{
[JsonPropertyName("offerId")]
public string OfferId { get; set; }
[JsonPropertyName("renewalTime")]
public int RenewalTime { get; set; }
}
@@ -0,0 +1,10 @@
using System.Text.Json.Serialization;
using Core.Models.Common;
namespace Core.Models.Eft.Ragfair;
public class GetItemPriceResult : MinMax
{
[JsonPropertyName("avg")]
public int Avg { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class GetMarketPriceRequestData
{
[JsonPropertyName("templateId")]
public string TemplateId { get; set; }
}
@@ -0,0 +1,18 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class GetOffersResult
{
[JsonPropertyName("categories")]
public Dictionary<string, int>? Categories { get; set; }
[JsonPropertyName("offers")]
public List<RagfairOffer> Offers { get; set; }
[JsonPropertyName("offersCount")]
public int OffersCount { get; set; }
[JsonPropertyName("selectedCategory")]
public string SelectedCategory { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class GetRagfairOfferByIdRequest
{
[JsonPropertyName("id")]
public int Id { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class RemoveOfferRequestData
{
[JsonPropertyName("Action")]
public string Action { get; set; }
[JsonPropertyName("offerId")]
public string OfferId { get; set; }
}
@@ -0,0 +1,87 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class SearchRequestData
{
[JsonPropertyName("page")]
public int Page { get; set; }
[JsonPropertyName("limit")]
public int Limit { get; set; }
[JsonPropertyName("sortType")]
public RagfairSort SortType { get; set; }
[JsonPropertyName("sortDirection")]
public int SortDirection { get; set; }
[JsonPropertyName("currency")]
public int Currency { get; set; }
[JsonPropertyName("priceFrom")]
public int PriceFrom { get; set; }
[JsonPropertyName("priceTo")]
public int PriceTo { get; set; }
[JsonPropertyName("quantityFrom")]
public int QuantityFrom { get; set; }
[JsonPropertyName("quantityTo")]
public int QuantityTo { get; set; }
[JsonPropertyName("conditionFrom")]
public int ConditionFrom { get; set; }
[JsonPropertyName("conditionTo")]
public int ConditionTo { get; set; }
[JsonPropertyName("oneHourExpiration")]
public bool OneHourExpiration { get; set; }
[JsonPropertyName("removeBartering")]
public bool RemoveBartering { get; set; }
[JsonPropertyName("offerOwnerType")]
public OfferOwnerType OfferOwnerType { get; set; }
[JsonPropertyName("onlyFunctional")]
public bool OnlyFunctional { get; set; }
[JsonPropertyName("updateOfferCount")]
public bool UpdateOfferCount { get; set; }
[JsonPropertyName("handbookId")]
public string HandbookId { get; set; }
[JsonPropertyName("linkedSearchId")]
public string LinkedSearchId { get; set; }
[JsonPropertyName("neededSearchId")]
public string NeededSearchId { get; set; }
[JsonPropertyName("buildItems")]
public BuildItems BuildItems { get; set; }
[JsonPropertyName("buildCount")]
public int BuildCount { get; set; }
[JsonPropertyName("tm")]
public int Tm { get; set; }
[JsonPropertyName("reload")]
public int Reload { get; set; }
}
public enum OfferOwnerType
{
ANYOWNERTYPE = 0,
TRADEROWNERTYPE = 1,
PLAYEROWNERTYPE = 2,
}
public class BuildItems
{
// Define properties for BuildItems here if needed
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class SendRagfairReportRequestData
{
[JsonPropertyName("offerId")]
public int OfferId { get; set; }
}
@@ -0,0 +1,18 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ragfair;
public class StorePlayerOfferTaxAmountRequestData
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("tpl")]
public string Tpl { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("fee")]
public double Fee { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Repair;
public class BaseRepairActionDataRequest
{
[JsonPropertyName("Action")]
public string Action { get; set; }
}
@@ -0,0 +1,24 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Repair;
public class RepairActionDataRequest : BaseRepairActionDataRequest
{
[JsonPropertyName("Action")]
public string Action { get; set; } = "Repair";
[JsonPropertyName("repairKitsInfo")]
public List<RepairKitsInfo> RepairKitsInfo { get; set; }
[JsonPropertyName("target")]
public string Target { get; set; } // item to repair
}
public class RepairKitsInfo
{
[JsonPropertyName("_id")]
public string Id { get; set; } // id of repair kit to use
[JsonPropertyName("count")]
public int Count { get; set; } // amount of units to reduce kit by
}
@@ -0,0 +1,24 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Repair;
public class TraderRepairActionDataRequest : BaseRepairActionDataRequest
{
[JsonPropertyName("Action")]
public string Action { get; set; } = "TraderRepair";
[JsonPropertyName("tid")]
public string TId { get; set; }
[JsonPropertyName("repairItems")]
public List<RepairItem> RepairItems { get; set; }
}
public class RepairItem
{
[JsonPropertyName("_id")]
public string Id { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
}