mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-25 23:18:56 -07:00
170 lines
4.5 KiB
C#
170 lines
4.5 KiB
C#
using System.Text.Json.Serialization;
|
|
using RadicadeServer.RecNet.Avatar;
|
|
using RadicadeServer.RecNet.Enums;
|
|
using RadicadeServer.RecNet.Enums.Players;
|
|
using RadicadeServer.RecNet.Enums.Store;
|
|
using RadicadeServer.RecNet.Inventions;
|
|
using RadicadeServer.RecNet.Responses;
|
|
using RadicadeServer.RecNet.Store;
|
|
|
|
namespace RadicadeServer.RecNet.Storefront
|
|
{
|
|
public enum BalanceType
|
|
{
|
|
Free = 0,
|
|
Paid = 1,
|
|
Promotional = 2
|
|
}
|
|
|
|
public class StorefrontBalanceDTO
|
|
{
|
|
public CurrencyType Currency { get; set; }
|
|
public BalanceType Type { get; set; }
|
|
public long Amount { get; set; }
|
|
}
|
|
|
|
public class StorefrontItemDTO
|
|
{
|
|
public int Id { get; set; }
|
|
public string Name { get; set; } = null!;
|
|
public long Price { get; set; }
|
|
}
|
|
|
|
public class StorefrontResponseDTO
|
|
{
|
|
public List<StorefrontItemDTO> Items { get; set; } = new();
|
|
}
|
|
|
|
public class AdCarouselItemDTO
|
|
{
|
|
public int AdCarouselItemId { get; set; }
|
|
public string ImageName { get; set; } = string.Empty;
|
|
public string Title { get; set; } = string.Empty;
|
|
public string Description { get; set; } = string.Empty;
|
|
public List<int> PurchasableItemIds { get; set; } = new();
|
|
|
|
public int Id { get; set; }
|
|
public string ImageUrl { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class StorefrontPurchaseResponseDTO
|
|
{
|
|
public StorefrontBalanceDTO BalanceUpdate { get; set; } = null!;
|
|
}
|
|
|
|
|
|
public class RewardBalanceModificationDTO
|
|
{
|
|
public StorefrontBalanceAddTypes BalanceAddType { get; set; }
|
|
public int BaseAward { get; set; }
|
|
public int BonusAward { get; set; }
|
|
public int RateLimit { get; set; }
|
|
public int CurrentCount { get; set; }
|
|
public int Total { get; set; }
|
|
public Platforms Platform { get; set; } = Platforms.All;
|
|
public bool BalanceInGiftBox { get; set; }
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public enum StorefrontRateLimitTypes
|
|
{
|
|
Interval = 0,
|
|
PerDay = 1
|
|
}
|
|
|
|
public class StorefrontBalanceAddConfigDTO
|
|
{
|
|
public StorefrontBalanceAddTypes BalanceAddType { get; set; }
|
|
|
|
public CurrencyType CurrencyType { get; set; }
|
|
|
|
public int BaseAward { get; set; }
|
|
|
|
public int BonusAwardMin { get; set; }
|
|
|
|
public int BonusAwardMax { get; set; }
|
|
|
|
public StorefrontRateLimitTypes RateLimitType { get; set; } = StorefrontRateLimitTypes.PerDay;
|
|
|
|
public float MaxPartialMultiplier { get; set; } = 1f;
|
|
|
|
public float Multiplier { get; set; } = 1f;
|
|
|
|
public int RateLimit { get; set; }
|
|
|
|
public int CurrentCount { get; set; }
|
|
|
|
public int Total { get; set; }
|
|
|
|
public bool BalanceInGiftBox { get; set; }
|
|
|
|
public bool IgnorePartialMultiplier { get; set; }
|
|
}
|
|
|
|
public class BalanceUpdateEntry<T>
|
|
{
|
|
public UpdateResponseTypes UpdateResponse { get; set; }
|
|
public T? Data { get; set; }
|
|
}
|
|
|
|
public class BalanceUpdateResponse<T> : BalanceResponse
|
|
{
|
|
public List<BalanceUpdateEntry<T>> BalanceUpdates { get; set; } = new();
|
|
}
|
|
|
|
public class PurchaseBalanceUpdateEntry<T>
|
|
{
|
|
public UpdateResponseTypes UpdateResponse { get; set; }
|
|
public List<T> Data { get; set; } = new();
|
|
}
|
|
|
|
public class PurchaseBalanceUpdateResponse<T> : BalanceResponse
|
|
{
|
|
public List<PurchaseBalanceUpdateEntry<T>> BalanceUpdates { get; set; } = new();
|
|
}
|
|
|
|
public class BalanceResponseDTO
|
|
{
|
|
public StorefrontBalanceAddTypes BalanceAddType { get; set; }
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public long? Delta { get; set; }
|
|
|
|
public long Balance { get; set; }
|
|
public CurrencyType CurrencyType { get; set; }
|
|
}
|
|
|
|
public enum PurchaseStatus
|
|
{
|
|
OK,
|
|
TooManyRequests,
|
|
NotEnoughCredit,
|
|
AlreadyOwned,
|
|
NoItemAvailable,
|
|
CouponNotApplicable,
|
|
RequestedPriceDoesNotMatch
|
|
}
|
|
|
|
public class InventionPurchaseResponseDTO
|
|
{
|
|
public class BalanceResponse : BalanceResponseDTO
|
|
{
|
|
public class InventionData
|
|
{
|
|
public PurchaseStatus Status { get; set; }
|
|
public Invention Invention { get; set; } = null!;
|
|
}
|
|
public List<InventionData> Result { get; set; } = null!;
|
|
}
|
|
|
|
public Invention InventionResponse { get; set; } = null!;
|
|
public BalanceResponse BalanceUpdateResponse { get; set; } = null!;
|
|
}
|
|
}
|