120 lines
4.2 KiB
C#
120 lines
4.2 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace FsToolbox.Cli.Tasks
|
|
{
|
|
public static partial class StoreTasks
|
|
{
|
|
#region Record StoreInformation
|
|
|
|
/// <summary>
|
|
/// Store information including the calendar interval for automatic slot creation.
|
|
/// </summary>
|
|
/// <param name="Id">The store identifier.</param>
|
|
/// <param name="Name">The store name.</param>
|
|
/// <param name="CalendarInterval">Interval in seconds before a slot's time when it is automatically created.</param>
|
|
public record StoreInformation(int Id, string Name, int CalendarInterval);
|
|
|
|
#endregion
|
|
|
|
#region Record Member
|
|
|
|
/// <summary>
|
|
/// Detailed store member information including verification and team status flags.
|
|
/// </summary>
|
|
/// <param name="Id">The member identifier.</param>
|
|
/// <param name="Name">The member name.</param>
|
|
/// <param name="Team_Active">The member's active status within the team.</param>
|
|
/// <param name="Verified">The verification state of the member.</param>
|
|
public record Member(int Id, string Name, TeamActiveStatus Team_Active, VerifiedStatus Verified);
|
|
|
|
#endregion
|
|
|
|
#region Record FoodsaverProfile
|
|
|
|
/// <summary>
|
|
/// Minimal foodsaver profile information for store logs.
|
|
/// </summary>
|
|
/// <param name="Id">The foodsaver identifier.</param>
|
|
/// <param name="Name">The foodsaver display name.</param>
|
|
/// <param name="Avatar">The foodsaver avatar URL (relative).</param>
|
|
/// <param name="IsSleeping">Indicates whether the foodsaver is sleeping.</param>
|
|
public record FoodsaverProfile(int Id, string Name, string? Avatar, bool IsSleeping);
|
|
|
|
#endregion
|
|
|
|
#region Record StoreLogEntry
|
|
|
|
/// <summary>
|
|
/// Represents a store log entry with foodsaver and action information.
|
|
/// </summary>
|
|
public record StoreLogEntry(
|
|
[property: JsonPropertyName("performed_at")] DateTime PerformedAt,
|
|
[property: JsonPropertyName("action_id")] int ActionId,
|
|
[property: JsonPropertyName("date_reference")] DateTime? DateReference,
|
|
[property: JsonPropertyName("content")] string? Content,
|
|
[property: JsonPropertyName("reason")] string? Reason,
|
|
[property: JsonPropertyName("acting_foodsaver")] FoodsaverProfile? ActingFoodsaver,
|
|
[property: JsonPropertyName("affected_foodsaver")] FoodsaverProfile? AffectedFoodsaver);
|
|
|
|
#endregion
|
|
|
|
#region Record Pickup
|
|
|
|
/// <summary>
|
|
/// Represents a pickup date and the occupied slots for that date.
|
|
/// </summary>
|
|
/// <param name="Date">The pickup date string.</param>
|
|
/// <param name="OccupiedSlots">The slots already assigned for the date.</param>
|
|
public record Pickup(string Date, List<Slot> OccupiedSlots);
|
|
|
|
#endregion
|
|
|
|
#region Record Profile
|
|
|
|
/// <summary>
|
|
/// Minimal profile information for a store member.
|
|
/// </summary>
|
|
/// <param name="Id">The Foodsharing profile identifier.</param>
|
|
/// <param name="Name">The profile display name.</param>
|
|
public record Profile(int Id, string Name);
|
|
|
|
#endregion
|
|
|
|
#region Record Slot
|
|
|
|
/// <summary>
|
|
/// Describes a booked slot and the profile occupying it.
|
|
/// </summary>
|
|
/// <param name="IsConfirmed">Indicates whether the slot is confirmed.</param>
|
|
/// <param name="Profile">The profile assigned to the slot.</param>
|
|
public record Slot(bool IsConfirmed, Profile Profile);
|
|
|
|
#endregion
|
|
|
|
#region Enum TeamActiveStatus
|
|
|
|
/// <summary>
|
|
/// Indicates whether a team member is active or only available as a jumper.
|
|
/// </summary>
|
|
public enum TeamActiveStatus
|
|
{
|
|
Jumper = 2,
|
|
Active = 1
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Enum VerifiedStatus
|
|
|
|
/// <summary>
|
|
/// Specifies whether a member has completed verification.
|
|
/// </summary>
|
|
public enum VerifiedStatus
|
|
{
|
|
Unverified = 0,
|
|
Verified = 1
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |