using System.Text.Json.Nodes;
using SPTarkov.Server.Core.Models.Eft.Profile;
namespace SPTarkov.Server.Core.Migration;
public interface IProfileMigration
{
///
/// The name of the migration
///
public abstract string MigrationName { get; }
///
/// An IEnumerable of migrations that need to come before the current one
///
public abstract IEnumerable PrerequisiteMigrations { get; }
///
/// Allows for adding checks if the profile in question can migrate
///
/// The profile to check
///
/// Returns true if the profile can migrate, returns false if not
public bool CanMigrate(JsonObject profile, IEnumerable previouslyRanMigrations);
///
/// Migrate the profile, this should be used to handle and fix old data that has been removed from the record
/// or a general incompatibility due to different typing
///
/// The profile to migrate
/// Returns the migrated profile on success, or null if it failed
public JsonObject? Migrate(JsonObject profile);
///
/// Handles post migration of the profile, this can be used to fill new types with (old) data gotten from
///
/// Should return true if successful, should return false if not
public bool PostMigrate(SptProfile profile);
}