This pull request introduces several important changes to improve user verification and email validation in the Telegram bot. The key changes include adding a new configuration for allowed emails, integrating a user repository for persistence, and updating tests to cover the new functionality.
This pull request introduces several important changes to improve user verification and email validation in the Telegram bot. The key changes include adding a new configuration for allowed emails, integrating a user repository for persistence, and updating tests to cover the new functionality.
User Verification and Email Validation:
src/main/java/com/fmoreno/telegramtaskaiagent/client/TelegramClientConfig.java
: IntegratedUserRepository
to check if a user is allowed to use the bot based on their email. Added logic to verify and save new users if their email is in the allowed list. [1] [2] [3] [4] [5]src/main/java/com/fmoreno/telegramtaskaiagent/config/AllowedEmailsConfig.java
: Added a new configuration class to store a list of allowed emails.Repository and Persistence:
src/main/java/com/fmoreno/telegramtaskaiagent/persistence/UserRepository.java
: Created a repository interface forUserEntity
to handle database operations.src/main/java/com/fmoreno/telegramtaskaiagent/persistence/model/UserEntity.java
: Defined a new entity class to represent users in the database.Configuration Updates:
src/main/java/com/fmoreno/telegramtaskaiagent/config/TelegramBotConfig.java
: Updated to includeUserRepository
and pass it toTelegramClientConfig
. [1] [2]Test Enhancements:
src/test/java/com/fmoreno/telegramtaskaiagent/client/TelegramClientConfigTestIT.java
: Added new tests to verify the email validation logic and user verification process. [1] [2] [3] [4] [5]src/test/java/com/fmoreno/telegramtaskaiagent/agents/ManagerAgentTestIT.java
: Updated method calls to reflect changes inManagerAgent
's methods. [1] [2] [3] [4] [5]