fix: mr conflict rollback

This commit is contained in:
2026-06-10 19:24:41 +03:00
parent 18c9c1e01a
commit 5d7cdf67be
3 changed files with 19 additions and 68 deletions

View File

@@ -2,7 +2,6 @@ from abc import ABC, abstractmethod
from datetime import datetime from datetime import datetime
from src.application.domain.entities import UserEntity from src.application.domain.entities import UserEntity
from src.application.domain.entities.organization import PartySearchEntity
class IUserRepository(ABC): class IUserRepository(ABC):
@@ -27,14 +26,6 @@ class IUserRepository(ABC):
async def exists_by_email(self, email: str) -> bool: async def exists_by_email(self, email: str) -> bool:
raise NotImplementedError 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 @abstractmethod
async def get_password_hash(self, user_id: str) -> str: async def get_password_hash(self, user_id: str) -> str:
raise NotImplementedError raise NotImplementedError

View File

@@ -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.admin_jwt_refresh import AdminJwtRefreshCommand
from src.application.commands.get_admin_me import GetAdminMeCommand from src.application.commands.get_admin_me import GetAdminMeCommand
from src.application.commands.create_organization import CreateOrganizationCommand from src.application.commands.create_organization import CreateOrganizationCommand
from src.application.commands.create_organization_wallets import CreateOrganizationWalletsCommand 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 ( from src.application.commands.organization_commands import (
ListOrganizationsCommand, ListOrganizationsCommand,
GetOrganizationCommand, GetOrganizationCommand,
SearchPartiesCommand,
UpdateOrganizationCommand, UpdateOrganizationCommand,
) )
from src.application.commands.organization_document_commands import ( from src.application.commands.organization_document_commands import (
ListOrganizationDocumentsCommand, ListOrganizationDocumentsCommand,
GetOrganizationDocumentCommand, GetOrganizationDocumentCommand,
) )
from src.application.commands.organization_wallet_commands import (
GetOrganizationMnemonicCommand,
GetOrganizationSecretKeysCommand,
ListOrganizationWalletsCommand,
)
from src.application.commands.purchase_request_commands import ( from src.application.commands.purchase_request_commands import (
ListPurchaseRequestsCommand, ListPurchaseRequestsCommand,
GetPurchaseRequestCommand, GetPurchaseRequestCommand,
UpdatePurchaseRequestCommand,
UpdatePurchaseRequestStatusCommand, UpdatePurchaseRequestStatusCommand,
SetPurchaseRequestQuoteCommand, SetPurchaseRequestQuoteCommand,
) )
@@ -33,19 +29,15 @@ __all__ = [
'GetAdminMeCommand', 'GetAdminMeCommand',
'CreateOrganizationCommand', 'CreateOrganizationCommand',
'CreateOrganizationWalletsCommand', 'CreateOrganizationWalletsCommand',
'PutOrganizationDocumentCommand', 'UploadOrganizationDocumentCommand',
'ListOrganizationsCommand', 'ListOrganizationsCommand',
'GetOrganizationCommand', 'GetOrganizationCommand',
'SearchPartiesCommand',
'UpdateOrganizationCommand', 'UpdateOrganizationCommand',
'ListPurchaseRequestsCommand', 'ListPurchaseRequestsCommand',
'GetPurchaseRequestCommand', 'GetPurchaseRequestCommand',
'UpdatePurchaseRequestCommand',
'UpdatePurchaseRequestStatusCommand', 'UpdatePurchaseRequestStatusCommand',
'SetPurchaseRequestQuoteCommand', 'SetPurchaseRequestQuoteCommand',
'ListOrganizationDocumentsCommand', 'ListOrganizationDocumentsCommand',
'GetOrganizationDocumentCommand', 'GetOrganizationDocumentCommand',
'ListOrganizationWalletsCommand', 'SetPasswordCommand',
'GetOrganizationMnemonicCommand', ]
'GetOrganizationSecretKeysCommand',
]

View File

@@ -10,21 +10,17 @@ from src.application.commands import (
GetAdminMeCommand, GetAdminMeCommand,
CreateOrganizationCommand, CreateOrganizationCommand,
CreateOrganizationWalletsCommand, CreateOrganizationWalletsCommand,
GetOrganizationMnemonicCommand,
GetOrganizationSecretKeysCommand,
GetOrganizationCommand, GetOrganizationCommand,
ListOrganizationWalletsCommand,
GetPurchaseRequestCommand, GetPurchaseRequestCommand,
ListOrganizationsCommand, ListOrganizationsCommand,
GetOrganizationDocumentCommand, GetOrganizationDocumentCommand,
ListOrganizationDocumentsCommand, ListOrganizationDocumentsCommand,
ListPurchaseRequestsCommand, ListPurchaseRequestsCommand,
SearchPartiesCommand,
SetPurchaseRequestQuoteCommand, SetPurchaseRequestQuoteCommand,
UpdateOrganizationCommand, UpdateOrganizationCommand,
UpdatePurchaseRequestCommand,
UpdatePurchaseRequestStatusCommand, UpdatePurchaseRequestStatusCommand,
PutOrganizationDocumentCommand, UploadOrganizationDocumentCommand,
SetPasswordCommand,
) )
from src.application.contracts import IHashService, IJwtService, ILogger from src.application.contracts import IHashService, IJwtService, ILogger
from src.infrastructure.config import settings from src.infrastructure.config import settings
@@ -96,32 +92,11 @@ def get_create_organization_wallets_command(
return CreateOrganizationWalletsCommand(uow, logger) return CreateOrganizationWalletsCommand(uow, logger)
def get_list_organization_wallets_command( def get_upload_organization_document_command(
uow: IUnitOfWork = Depends(get_unit_of_work), uow: IUnitOfWork = Depends(get_unit_of_work),
logger: ILogger = Depends(get_logger), logger: ILogger = Depends(get_logger),
) -> ListOrganizationWalletsCommand: ) -> UploadOrganizationDocumentCommand:
return ListOrganizationWalletsCommand(uow, logger) return UploadOrganizationDocumentCommand(uow, get_s3_documents_service(), 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)
def get_list_organizations_command( def get_list_organizations_command(
@@ -131,13 +106,6 @@ def get_list_organizations_command(
return ListOrganizationsCommand(uow, logger) 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( def get_get_organization_command(
uow: IUnitOfWork = Depends(get_unit_of_work), uow: IUnitOfWork = Depends(get_unit_of_work),
logger: ILogger = Depends(get_logger), logger: ILogger = Depends(get_logger),
@@ -187,15 +155,15 @@ def get_update_purchase_request_status_command(
return UpdatePurchaseRequestStatusCommand(uow, logger) 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( def get_set_purchase_request_quote_command(
uow: IUnitOfWork = Depends(get_unit_of_work), uow: IUnitOfWork = Depends(get_unit_of_work),
logger: ILogger = Depends(get_logger), logger: ILogger = Depends(get_logger),
) -> SetPurchaseRequestQuoteCommand: ) -> SetPurchaseRequestQuoteCommand:
return SetPurchaseRequestQuoteCommand(uow, logger) 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)