014b5edd31
PR Checks / test-and-build (pull_request) Successful in 15m52s
Add format and location steps to the Telegram /newsession wizard, persist offline addresses in sessions.location_address, and render online links/offline addresses in schedule messages. Bump version to 3.10.0.
67 lines
2.1 KiB
C#
67 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace GmRelay.Shared.Features.Sessions.CreateSession.Wizard;
|
|
|
|
public enum WizardCreationType { Single, Pool }
|
|
|
|
public enum WizardVisibility { Public, Club, Members }
|
|
|
|
[JsonConverter(typeof(JsonStringEnumConverter<WizardSessionFormat>))]
|
|
public enum WizardSessionFormat { Online, Offline }
|
|
|
|
public sealed class WizardSlotInput
|
|
{
|
|
public DateTimeOffset ScheduledAt { get; set; }
|
|
public int MaxPlayers { get; set; }
|
|
public bool Waitlist { get; set; }
|
|
}
|
|
|
|
public sealed class WizardSingleInput
|
|
{
|
|
public DateTimeOffset? ScheduledAt { get; set; }
|
|
public int? MaxPlayers { get; set; }
|
|
}
|
|
|
|
public sealed class WizardPayload
|
|
{
|
|
public WizardCreationType? Type { get; set; }
|
|
public string? Title { get; set; }
|
|
public string? Description { get; set; }
|
|
public string? ImageFileId { get; set; }
|
|
public string? ImageUrl { get; set; }
|
|
public string? System { get; set; }
|
|
public int? DurationMinutes { get; set; }
|
|
public WizardSessionFormat? Format { get; set; }
|
|
public string? JoinLink { get; set; }
|
|
public string? LocationAddress { get; set; }
|
|
public WizardVisibility? Visibility { get; set; }
|
|
public Guid? ClubId { get; set; }
|
|
public bool? PublishInShowcase { get; set; }
|
|
public bool? Waitlist { get; set; }
|
|
public WizardSingleInput? Single { get; set; }
|
|
public WizardPoolInput? Pool { get; set; }
|
|
|
|
// Wizard-flow metadata (not a wizard step input).
|
|
[JsonIgnore]
|
|
public int RetryCount { get; set; }
|
|
}
|
|
|
|
public sealed class WizardPoolInput
|
|
{
|
|
public List<WizardSlotInput> Slots { get; set; } = new();
|
|
}
|
|
|
|
[JsonSerializable(typeof(WizardPayload))]
|
|
[JsonSerializable(typeof(WizardSingleInput))]
|
|
[JsonSerializable(typeof(WizardPoolInput))]
|
|
[JsonSerializable(typeof(WizardSlotInput))]
|
|
[JsonSourceGenerationOptions(
|
|
WriteIndented = false,
|
|
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
|
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public partial class WizardPayloadJsonContext : JsonSerializerContext
|
|
{
|
|
}
|