review fixes: complete success path, pool capacity navigation, time parser tests
PR Checks / test-and-build (pull_request) Successful in 24m27s
PR Checks / test-and-build (pull_request) Successful in 24m27s
- DiscordWizardSubmitter.SubmitAsync: confirm success, delete draft, clear context. - GameCreationWizard: pool free-text duration now advances to Capacity. - PreviousStep(Capacity) returns PoolSystemDuration for pools. - Remove unused optional IPlatformMessenger/NpgsqlDataSource from submitter. - Add DiscordTimeParserTests preserving ParseTimeInput coverage.
This commit is contained in:
@@ -12,7 +12,6 @@ using GmRelay.Shared.Platform;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NetCord;
|
||||
using NetCord.Rest;
|
||||
using Npgsql;
|
||||
|
||||
namespace GmRelay.DiscordBot.Features.Sessions.Wizard;
|
||||
|
||||
@@ -32,25 +31,19 @@ public sealed class DiscordWizardSubmitter
|
||||
private readonly IWizardDraftRepository _drafts;
|
||||
private readonly IWizardContextStore _contextStore;
|
||||
private readonly ILogger<DiscordWizardSubmitter> _log;
|
||||
private readonly IPlatformMessenger? _platformMessenger;
|
||||
private readonly NpgsqlDataSource? _dataSource;
|
||||
|
||||
public DiscordWizardSubmitter(
|
||||
CreateSessionHandler shared,
|
||||
RestClient rest,
|
||||
IWizardDraftRepository drafts,
|
||||
IWizardContextStore contextStore,
|
||||
ILogger<DiscordWizardSubmitter> log,
|
||||
IPlatformMessenger? platformMessenger = null,
|
||||
NpgsqlDataSource? dataSource = null)
|
||||
ILogger<DiscordWizardSubmitter> log)
|
||||
{
|
||||
_shared = shared;
|
||||
_rest = rest;
|
||||
_drafts = drafts;
|
||||
_contextStore = contextStore;
|
||||
_log = log;
|
||||
_platformMessenger = platformMessenger;
|
||||
_dataSource = dataSource;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -91,6 +84,15 @@ public sealed class DiscordWizardSubmitter
|
||||
|
||||
created.Add((cmd, result));
|
||||
}
|
||||
|
||||
// Success: replace the wizard message with a confirmation and
|
||||
// clean up the draft so the user can start a new one later.
|
||||
var confirmation = created.Count == 1
|
||||
? $"✅ Создано: {created[0].Command.Title}"
|
||||
: $"✅ Создано: {created[0].Command.Title} и ещё {created.Count - 1} сессия/сессии";
|
||||
await EditDraftMessageAsync(draft, confirmation, Array.Empty<WizardAction>(), ct);
|
||||
await _drafts.DeleteAsync(draft.Id, ct);
|
||||
_contextStore.Remove(draft.Id);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user