using Fluxor;
using Koogle.Application.DTOs;
namespace Koogle.Web.Store.PersonState;
///
/// Fluxor state for person management.
///
[FeatureState]
public record PersonState
{
///
/// List of all persons for the current club.
///
public IReadOnlyList Persons { get; init; } = [];
///
/// Currently selected person for editing.
///
public PersonDto? SelectedPerson { get; init; }
///
/// Indicates whether a person operation is in progress.
///
public bool IsLoading { get; init; }
///
/// Error message if operation failed.
///
public string? Error { get; init; }
///
/// Private constructor for Fluxor initialization.
///
private PersonState() { }
///
/// Creates the initial state.
///
public static PersonState Initial => new()
{
Persons = [],
SelectedPerson = null,
IsLoading = false,
Error = null
};
}