From 5d7cdf67bef61445fbb2ccfe60fd2f030328b376 Mon Sep 17 00:00:00 2001 From: dev1lfreak Date: Wed, 10 Jun 2026 19:24:41 +0300 Subject: [PATCH] fix: mr conflict rollback --- .../repositories/i_user_repository.py | 9 --- src/application/commands/__init__.py | 22 +++----- src/presentation/dependencies/commands.py | 56 ++++--------------- 3 files changed, 19 insertions(+), 68 deletions(-) diff --git a/src/application/abstractions/repositories/i_user_repository.py b/src/application/abstractions/repositories/i_user_repository.py index 4702708..eff4843 100644 --- a/src/application/abstractions/repositories/i_user_repository.py +++ b/src/application/abstractions/repositories/i_user_repository.py @@ -2,7 +2,6 @@ from abc import ABC, abstractmethod from datetime import datetime from src.application.domain.entities import UserEntity -from src.application.domain.entities.organization import PartySearchEntity class IUserRepository(ABC): @@ -27,14 +26,6 @@ class IUserRepository(ABC): async def exists_by_email(self, email: str) -> bool: raise NotImplementedError - @abstractmethod - async def search_individuals(self, *, query: str, limit: int, offset: int) -> list[PartySearchEntity]: - raise NotImplementedError - - @abstractmethod - async def count_individuals(self, *, query: str) -> int: - raise NotImplementedError - @abstractmethod async def get_password_hash(self, user_id: str) -> str: raise NotImplementedError diff --git a/src/application/commands/__init__.py b/src/application/commands/__init__.py index 06f0f6c..635cf30 100644 --- a/src/application/commands/__init__.py +++ b/src/application/commands/__init__.py @@ -1,27 +1,23 @@ +from src.application.commands.admin_login import AdminLoginCommand +from src.application.commands.admin_logout import AdminLogoutCommand from src.application.commands.admin_jwt_refresh import AdminJwtRefreshCommand from src.application.commands.get_admin_me import GetAdminMeCommand from src.application.commands.create_organization import CreateOrganizationCommand from src.application.commands.create_organization_wallets import CreateOrganizationWalletsCommand -from src.application.commands.put_organization_document import PutOrganizationDocumentCommand +from src.application.commands.upload_organization_document import UploadOrganizationDocumentCommand +from src.application.commands.set_password import SetPasswordCommand from src.application.commands.organization_commands import ( ListOrganizationsCommand, GetOrganizationCommand, - SearchPartiesCommand, UpdateOrganizationCommand, ) from src.application.commands.organization_document_commands import ( ListOrganizationDocumentsCommand, GetOrganizationDocumentCommand, ) -from src.application.commands.organization_wallet_commands import ( - GetOrganizationMnemonicCommand, - GetOrganizationSecretKeysCommand, - ListOrganizationWalletsCommand, -) from src.application.commands.purchase_request_commands import ( ListPurchaseRequestsCommand, GetPurchaseRequestCommand, - UpdatePurchaseRequestCommand, UpdatePurchaseRequestStatusCommand, SetPurchaseRequestQuoteCommand, ) @@ -33,19 +29,15 @@ __all__ = [ 'GetAdminMeCommand', 'CreateOrganizationCommand', 'CreateOrganizationWalletsCommand', - 'PutOrganizationDocumentCommand', + 'UploadOrganizationDocumentCommand', 'ListOrganizationsCommand', 'GetOrganizationCommand', - 'SearchPartiesCommand', 'UpdateOrganizationCommand', 'ListPurchaseRequestsCommand', 'GetPurchaseRequestCommand', - 'UpdatePurchaseRequestCommand', 'UpdatePurchaseRequestStatusCommand', 'SetPurchaseRequestQuoteCommand', 'ListOrganizationDocumentsCommand', 'GetOrganizationDocumentCommand', - 'ListOrganizationWalletsCommand', - 'GetOrganizationMnemonicCommand', - 'GetOrganizationSecretKeysCommand', -] \ No newline at end of file + 'SetPasswordCommand', +] diff --git a/src/presentation/dependencies/commands.py b/src/presentation/dependencies/commands.py index 5cd04be..75546f4 100644 --- a/src/presentation/dependencies/commands.py +++ b/src/presentation/dependencies/commands.py @@ -10,21 +10,17 @@ from src.application.commands import ( GetAdminMeCommand, CreateOrganizationCommand, CreateOrganizationWalletsCommand, - GetOrganizationMnemonicCommand, - GetOrganizationSecretKeysCommand, GetOrganizationCommand, - ListOrganizationWalletsCommand, GetPurchaseRequestCommand, ListOrganizationsCommand, GetOrganizationDocumentCommand, ListOrganizationDocumentsCommand, ListPurchaseRequestsCommand, - SearchPartiesCommand, SetPurchaseRequestQuoteCommand, UpdateOrganizationCommand, - UpdatePurchaseRequestCommand, UpdatePurchaseRequestStatusCommand, - PutOrganizationDocumentCommand, + UploadOrganizationDocumentCommand, + SetPasswordCommand, ) from src.application.contracts import IHashService, IJwtService, ILogger from src.infrastructure.config import settings @@ -96,32 +92,11 @@ def get_create_organization_wallets_command( return CreateOrganizationWalletsCommand(uow, logger) -def get_list_organization_wallets_command( +def get_upload_organization_document_command( uow: IUnitOfWork = Depends(get_unit_of_work), logger: ILogger = Depends(get_logger), -) -> ListOrganizationWalletsCommand: - return ListOrganizationWalletsCommand(uow, logger) - - -def get_get_organization_mnemonic_command( - uow: IUnitOfWork = Depends(get_unit_of_work), - logger: ILogger = Depends(get_logger), -) -> GetOrganizationMnemonicCommand: - return GetOrganizationMnemonicCommand(uow, logger) - - -def get_get_organization_secret_keys_command( - uow: IUnitOfWork = Depends(get_unit_of_work), - logger: ILogger = Depends(get_logger), -) -> GetOrganizationSecretKeysCommand: - return GetOrganizationSecretKeysCommand(uow, logger) - - -def get_put_organization_document_command( - uow: IUnitOfWork = Depends(get_unit_of_work), - logger: ILogger = Depends(get_logger), -) -> PutOrganizationDocumentCommand: - return PutOrganizationDocumentCommand(uow, get_s3_documents_service(), logger) +) -> UploadOrganizationDocumentCommand: + return UploadOrganizationDocumentCommand(uow, get_s3_documents_service(), logger) def get_list_organizations_command( @@ -131,13 +106,6 @@ def get_list_organizations_command( return ListOrganizationsCommand(uow, logger) -def get_search_parties_command( - uow: IUnitOfWork = Depends(get_unit_of_work), - logger: ILogger = Depends(get_logger), -) -> SearchPartiesCommand: - return SearchPartiesCommand(uow, logger) - - def get_get_organization_command( uow: IUnitOfWork = Depends(get_unit_of_work), logger: ILogger = Depends(get_logger), @@ -187,15 +155,15 @@ def get_update_purchase_request_status_command( return UpdatePurchaseRequestStatusCommand(uow, logger) -def get_update_purchase_request_command( - uow: IUnitOfWork = Depends(get_unit_of_work), - logger: ILogger = Depends(get_logger), -) -> UpdatePurchaseRequestCommand: - return UpdatePurchaseRequestCommand(uow, logger) - - def get_set_purchase_request_quote_command( uow: IUnitOfWork = Depends(get_unit_of_work), logger: ILogger = Depends(get_logger), ) -> SetPurchaseRequestQuoteCommand: return SetPurchaseRequestQuoteCommand(uow, logger) + +def get_set_password_command( + uow: IUnitOfWork = Depends(get_unit_of_work), + hash_service: IHashService = Depends(get_hash_service), + logger: ILogger = Depends(get_logger), +) -> SetPasswordCommand: + return SetPasswordCommand(uow, hash_service, logger)