marketplace refactoring

This commit is contained in:
2025-10-04 13:38:10 +02:00
parent 32be301d83
commit c971674ec2
68 changed files with 1102 additions and 1128 deletions

View File

@@ -98,13 +98,13 @@ class InvalidShopDataException(ValidationException):
class ShopProductAlreadyExistsException(ConflictException):
"""Raised when trying to add a product that already exists in shop."""
def __init__(self, shop_code: str, product_id: str):
def __init__(self, shop_code: str, marketplace_product_id: str):
super().__init__(
message=f"Product '{product_id}' already exists in shop '{shop_code}'",
message=f"MarketplaceProduct '{marketplace_product_id}' already exists in shop '{shop_code}'",
error_code="SHOP_PRODUCT_ALREADY_EXISTS",
details={
"shop_code": shop_code,
"product_id": product_id,
"marketplace_product_id": marketplace_product_id,
},
)
@@ -112,11 +112,11 @@ class ShopProductAlreadyExistsException(ConflictException):
class ShopProductNotFoundException(ResourceNotFoundException):
"""Raised when a shop product relationship is not found."""
def __init__(self, shop_code: str, product_id: str):
def __init__(self, shop_code: str, marketplace_product_id: str):
super().__init__(
resource_type="ShopProduct",
identifier=f"{shop_code}/{product_id}",
message=f"Product '{product_id}' not found in shop '{shop_code}'",
identifier=f"{shop_code}/{marketplace_product_id}",
message=f"MarketplaceProduct '{marketplace_product_id}' not found in shop '{shop_code}'",
error_code="SHOP_PRODUCT_NOT_FOUND",
)