Commit Graph

62 Commits

Author SHA1 Message Date
Artemy 65a43c09d3 Refactor message service and move tests to Application.Tests
Renamed IMessageService to IMessageCommandService and updated all usages accordingly. Moved and renamed test files from Govor.API.Tests to the new Govor.Application.Tests project, updating namespaces to match. Refactored message-related services and controllers to use the new naming and structure. Added Govor.Application.Tests project to the solution.
2025-07-10 18:05:10 +07:00
Artemy a43a26b307 FriendsHubTests 2025-07-10 16:12:32 +07:00
Artemy 437bedb117 Refactor friend request services and add SignalR error handling
Split IFriendRequestService into command and query interfaces, refactor related services and tests, and update dependency injection. Add HubResult response model and a SignalR HubExceptionFilter for consistent error handling. Move and update FriendsHub to use new command service and result pattern. Update username validation to allow digits after Cyrillic letters. Add new controllers and configuration for SignalR. Remove obsolete IFriendRequestService and related code.
2025-07-10 15:31:57 +07:00
Artemy b1f3aa0266 rework and starts for new friends system 2025-07-08 22:28:04 +07:00
Artemy 92c1ff6458 IUserGroupsService + tests 2025-07-07 21:06:04 +07:00
Artemy a68feb4a17 Refactor group existence checks and add group repo tests
Renamed IGroupsExist and related methods from Exists to Exist for consistency. Added integration tests for GroupRepository. Introduced entity configurations for ChatGroup, GroupAdmins, GroupInvitation, and updated GroupMembership configuration. Updated usages and tests to match new method names and improved equality checks for ChatGroup.
2025-07-07 20:49:20 +07:00
Artemy 42be589a26 Update ChatGroupValidatorTests.cs 2025-07-07 19:46:45 +07:00
Artemy baeafad007 PrivateChatsRepositoryTests 2025-07-07 19:33:47 +07:00
Artemy 2cb6a93060 Add private chat support and group model enhancements
Introduces repositories, validators, and integration tests for private chats. Refactors group-related models to support invitations and memberships, updates group repository interfaces and implementations, and enhances message service logic to handle private chat creation and retrieval. Also registers new services and validators in DI, and updates related tests.
2025-07-07 13:55:29 +07:00
Artemy 66819a015a Refactor media attachments to use MediaFile entity
This commit introduces the MediaFile entity and updates the media attachments model, repositories, and related logic to reference MediaFile instead of storing file metadata directly in MediaAttachments. Controller, service, and SignalR request/response contracts are updated to support the new structure. Database configurations and validators are also adjusted accordingly. This refactor improves media management and normalization in the data model.
2025-07-06 21:09:12 +07:00
Artemy 6062113655 Add unit tests and implement group repository interfaces
Introduces comprehensive unit tests for MessageService covering send, edit, and delete message scenarios. Adds and implements IGroupsRepository, IGroupsReader, and IGroupsWriter interfaces with method stubs in GroupRepository. Updates ChatGroup model with Description and ImageId fields, and registers GroupRepository in DI. Fixes parameter order in SendMessage record.
2025-07-06 15:44:45 +07:00
Artemy 89f14c134f VerifyFriendshipTests 2025-07-06 14:22:50 +07:00
Artemy d170c6270f hot fix for friends controller 2025-07-03 19:46:53 +07:00
Artemy 565d3249e5 Add online pinging and friendship verification features
Introduces OnlinePingingController and related integration/unit tests for user online status updates. Adds PingHandlerService with memory cache throttling, IPingHandlerService interface, and service registration. Implements VerifyFriendship service and interface for friendship validation, with exception handling. Refactors CurrentUserService for improved user ID extraction and testability. Updates ChatsHub to verify friendship before messaging. Cleans up MediaController and optimizes UsersRepository queries by removing unnecessary includes.
2025-07-02 19:16:49 +07:00
Artemy 0669614a5e async Task<string> GenerateJwtTokenAsync(User user) 2025-07-02 15:26:27 +07:00
Artemy e061725a99 downcast to .net 8.x 2025-07-01 19:17:01 +07:00
Artemy 5883f3e340 hot fix 2025-07-01 13:25:55 +07:00
Artemy f855b91155 Completed the development of tests for FriendsController 2025-07-01 11:43:11 +07:00
Artemy 8e245ea044 Test for SendRequest action 2025-06-30 19:27:29 +07:00
Artemy ab426979d0 Update AuthControllerTests.cs 2025-06-30 19:04:35 +07:00
Artemy 494c12df49 MySQL migration 2025-06-30 18:59:05 +07:00
Artemy f53ee6644b Refactor user context handling with CurrentUserService
Introduced ICurrentUserService and its implementation to centralize retrieval of the current user's ID from claims. Updated FriendsController to use this service instead of direct claim access. Registered the service and IHttpContextAccessor in DI. Added integration tests for FriendsController. Moved UsernameValidator to Infrastructure/Validators.
2025-06-30 17:37:02 +07:00
Artemy a659c73357 Final Friends Service Tests 2025-06-30 16:54:58 +07:00
Artemy 681a55c198 Update FriendsServiceTests.cs 2025-06-30 16:34:31 +07:00
Artemy 523e55508b Update FriendsServiceTests.cs 2025-06-30 14:44:15 +07:00
Artemy 86a96cdb0a Create FriendsServiceTests.cs 2025-06-30 14:18:54 +07:00
Artemy 7aa1b1831a Improve friends search and error handling in API
Refactored FriendsController to provide more precise error responses and input validation. Enhanced FriendsService to handle new exception types and improved user search logic. Added tests for user search, updated repository to throw on empty search results, and implemented User equality override. Cleaned up Program.cs controller JSON options.
2025-06-30 12:47:53 +07:00
Artemy 05298c004c FriendsController 2025-06-27 19:12:31 +07:00
Artemy ec44347bbe Add username validation and initial friends feature
Introduced a UsernameValidator with Cyrillic and length checks, integrated into AuthService and registration flow. Added InvalidUsernameException and related interface. Updated User model to support friend requests, added FriendsController (stub), and configured Friendship entity in EF Core. Adjusted UserValidator max name length and removed navigation properties from PrivateChat.
2025-06-27 16:36:56 +07:00
Artemy 9b9cd73a96 Add friendship feature with models, repository, and tests
Introduces Friendship and PrivateChat models, repository interfaces, and implementations for managing friendships. Adds validators and comprehensive unit and integration tests for friendship logic. Updates InviteUserController with new endpoints and restricts access to admin role. Removes unnecessary project references from Govor.API.csproj and registers new DbSets in GovorDbContext.
2025-06-27 15:09:28 +07:00
Artemy 4f3f4ec066 Refactor to introduce Govor.Application and Govor.Contracts layers
Moved service implementations and interfaces from Govor.API and Govor.Core to new Govor.Application and Govor.Contracts projects. Updated namespaces and references throughout the solution. Added custom exception classes for authentication and invite services. Adjusted dependency injection and project references to use the new structure. This refactor improves separation of concerns and prepares the codebase for better maintainability and scalability.
2025-06-25 15:16:14 +07:00
Artemy 5693190b1c Add unit tests for InvitationGenerator and JwtService
Introduces unit tests for the InvitationGenerator and JwtService classes. The tests cover invitation code generation, repository interaction, code uniqueness, and JWT token generation and validation.
2025-06-25 14:33:41 +07:00
Artemy e40489db40 AuthControllerTests 2025-06-25 14:08:54 +07:00
Artemy 76094af15b Invitation globale work
+ tests
+ new services
+ InvitationDto and IInvitationReqest
2025-06-24 21:20:43 +07:00
Artemy f99ec0b17b InvitesRepositoryTests
+ other reworks
2025-06-24 19:17:27 +07:00
Artemy 9893013bcc Invitation Validator Tests 2025-06-24 15:33:36 +07:00
Artemy 6e856a65db InvitationValidator 2025-06-24 15:24:14 +07:00
Artemy 672fc95823 Admins Repository
+ tests
2025-06-24 15:14:45 +07:00
Artemy ce013eae49 Registration rework
+ InvitesRepository
+ AdminsRepository
+ rework jwt
2025-06-24 14:27:08 +07:00
Artemy e7b7c402e1 Finished MediaAttachments
the functionality and tests are completed
2025-06-22 16:05:36 +07:00
Artemy 4956a175c5 MediaAttachmentsTests init 2025-06-22 15:37:20 +07:00
Artemy b75c0d3f5a Finished MessageRepository
+ Tests
2025-06-22 14:32:01 +07:00
Artemy 972b4fb83c more tests and fichers for MessagesRepository 2025-06-22 12:48:48 +07:00
Artemy b1c0a4b0e2 MessageRepositoryTests
+ Given_ValidSenderId_When_FindBySenderIdAsync_Then_ReturnMessages
+ Given_InvalidSenderId_When_FindBySenderId_Should_Throw_NotFoundByKeyException
2025-06-22 12:21:27 +07:00
Artemy 203bb5e5a4 MessageRepository + Tests
+ GetAllAsync rework
+ FindByIdAsync
+ rework FindBySenderAndReceiverIdAsync
2025-06-22 12:07:06 +07:00
Artemy a6e8ba1a65 Update models Messages 2025-06-22 11:45:25 +07:00
Artemy c9aad0c466 LocalStorageServiceTsts finished 2025-06-21 15:25:11 +07:00
Artemy 7831e4838a rework messages
+ addition LocalStorageService
+ tests
2025-06-21 14:53:15 +07:00
Artemy 3f1c050149 Addition Tests for MessageRepository
+ MessagesValidator tests
2025-06-20 14:02:08 +07:00
Artemy 3526cde06f Messages first init 2025-06-20 13:32:29 +07:00