using System.Text.Json.Serialization;
using SPTarkov.Server.Core.Models.Common;
using SPTarkov.Server.Core.Models.Eft.Profile;

namespace SPTarkov.Server.Core.Models.Eft.Common.Tables;

public record ProfileSides
{
    [JsonPropertyName("descriptionLocaleKey")]
    public string? DescriptionLocaleKey { get; set; }

    [JsonPropertyName("usec")]
    public TemplateSide? Usec { get; set; }

    [JsonPropertyName("bear")]
    public TemplateSide? Bear { get; set; }
}

public record TemplateSide
{
    [JsonPropertyName("character")]
    public PmcData? Character { get; set; }

    [JsonPropertyName("suits")]
    public List<MongoId>? Suits { get; set; }

    [JsonPropertyName("dialogues")]
    public Dictionary<MongoId, Dialogue>? Dialogues { get; set; }

    [JsonPropertyName("userbuilds")]
    public UserBuilds? UserBuilds { get; set; }

    [JsonPropertyName("trader")]
    public ProfileTraderTemplate? Trader { get; set; }

    [JsonPropertyName("equipmentBuilds")]
    public object? EquipmentBuilds { get; set; }

    [JsonPropertyName("weaponbuilds")]
    public object? WeaponBuilds { get; set; }
}

public record ProfileTraderTemplate
{
    [JsonPropertyName("initialLoyaltyLevel")]
    public Dictionary<MongoId, int?>? InitialLoyaltyLevel { get; set; }

    [JsonPropertyName("initialStanding")]
    public Dictionary<string, double?>? InitialStanding { get; set; }

    [JsonPropertyName("setQuestsAvailableForStart")]
    public bool? SetQuestsAvailableForStart { get; set; }

    [JsonPropertyName("setQuestsAvailableForFinish")]
    public bool? SetQuestsAvailableForFinish { get; set; }

    [JsonPropertyName("initialSalesSum")]
    public int? InitialSalesSum { get; set; }

    [JsonPropertyName("jaegerUnlocked")]
    public bool? JaegerUnlocked { get; set; }

    /// <summary>
    ///     How many days is usage of the flea blocked for upon profile creation
    /// </summary>
    [JsonPropertyName("fleaBlockedDays")]
    public int? FleaBlockedDays { get; set; }

    /// <summary>
    ///     What traders default to being locked on profile creation
    /// </summary>
    [JsonPropertyName("lockedByDefaultOverride")]
    public HashSet<MongoId>? LockedByDefaultOverride { get; set; }

    /// <summary>
    ///     What traders should have their clothing unlocked/purchased on creation
    /// </summary>
    [JsonPropertyName("purchaseAllClothingByDefaultForTrader")]
    public HashSet<MongoId>? PurchaseAllClothingByDefaultForTrader { get; set; }
}
