From 8018cb6496a7310e29d475a6865d7d24c3f36a76 Mon Sep 17 00:00:00 2001 From: Lisoveliy Date: Thu, 24 Jul 2025 20:19:38 +0300 Subject: [PATCH] feat: added boilerplate cap for next stage of user prepare --- JOBot.TClient/Services/PrepareUserService.cs | 7 +++++++ JOBot.TClient/Statements/PrepareUserState.cs | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/JOBot.TClient/Services/PrepareUserService.cs b/JOBot.TClient/Services/PrepareUserService.cs index 443f8b0..d83b666 100644 --- a/JOBot.TClient/Services/PrepareUserService.cs +++ b/JOBot.TClient/Services/PrepareUserService.cs @@ -98,4 +98,11 @@ public class PrepareUserService(ITelegramBotClient bot, User.UserClient userClie string.Format(TextResource.AskForAuth, [url.RegistrationUrl]), cancellationToken: ct); } + + public async Task SelectCv(Update update, CancellationToken ct = default) + { + ArgumentNullException.ThrowIfNull(update.Message?.From); + + await _bot.SendMessage(update.Message.From.Id, "Давайте выберем одно из доступных резюме:", cancellationToken: ct); //TODO: https://git.lisoveliy.su/Lisoveliy/JOBot/issues/9 + } } \ No newline at end of file diff --git a/JOBot.TClient/Statements/PrepareUserState.cs b/JOBot.TClient/Statements/PrepareUserState.cs index b989aec..338c40b 100644 --- a/JOBot.TClient/Statements/PrepareUserState.cs +++ b/JOBot.TClient/Statements/PrepareUserState.cs @@ -1,7 +1,6 @@ using JOBot.Proto; using JOBot.TClient.Services; using Telegram.Bot.Types; -using User = JOBot.Proto.User; namespace JOBot.TClient.Statements; @@ -38,7 +37,7 @@ public class PrepareUserState(PrepareUserService prepareUserService, MenuService } /// - /// Continue prepare stage + /// Check user logged /// /// /// @@ -50,6 +49,21 @@ public class PrepareUserState(PrepareUserService prepareUserService, MenuService await prepareUserService.Auth(update, ct); return; } + await OnAuthStage(user, update, ct); + } + + /// + /// Check user selected CV + /// + /// + /// + /// + private async Task OnAuthStage(GetUserResponse user, Update update, CancellationToken ct = default) + { + if (string.IsNullOrEmpty(user.CVUrl)) + { + await prepareUserService.SelectCv(update, ct); + } await menuService.RenderMenu(update, ct); //boilerplate } } \ No newline at end of file