marketplace refactoring
This commit is contained in:
@@ -30,7 +30,7 @@ app/exceptions/
|
||||
├── auth.py # Authentication/authorization exceptions
|
||||
├── admin.py # Admin operation exceptions
|
||||
├── marketplace.py # Import/marketplace exceptions
|
||||
├── product.py # Product management exceptions
|
||||
├── product.py # MarketplaceProduct management exceptions
|
||||
├── shop.py # Shop management exceptions
|
||||
└── stock.py # Stock management exceptions
|
||||
```
|
||||
@@ -48,10 +48,10 @@ All custom exceptions return a consistent JSON structure:
|
||||
```json
|
||||
{
|
||||
"error_code": "PRODUCT_NOT_FOUND",
|
||||
"message": "Product with ID 'ABC123' not found",
|
||||
"message": "MarketplaceProduct with ID 'ABC123' not found",
|
||||
"status_code": 404,
|
||||
"details": {
|
||||
"resource_type": "Product",
|
||||
"resource_type": "MarketplaceProduct",
|
||||
"identifier": "ABC123"
|
||||
}
|
||||
}
|
||||
@@ -360,7 +360,7 @@ def test_get_all_users_non_admin(client, auth_headers):
|
||||
### Resource Not Found (404)
|
||||
- `USER_NOT_FOUND`: User with specified ID not found
|
||||
- `SHOP_NOT_FOUND`: Shop with specified code/ID not found
|
||||
- `PRODUCT_NOT_FOUND`: Product with specified ID not found
|
||||
- `PRODUCT_NOT_FOUND`: MarketplaceProduct with specified ID not found
|
||||
|
||||
### Business Logic (400)
|
||||
- `CANNOT_MODIFY_SELF`: Admin cannot modify own account
|
||||
@@ -370,7 +370,7 @@ def test_get_all_users_non_admin(client, auth_headers):
|
||||
|
||||
### Validation (422)
|
||||
- `VALIDATION_ERROR`: Pydantic request validation failed
|
||||
- `INVALID_PRODUCT_DATA`: Product data validation failed
|
||||
- `INVALID_PRODUCT_DATA`: MarketplaceProduct data validation failed
|
||||
- `INVALID_SHOP_DATA`: Shop data validation failed
|
||||
|
||||
### Rate Limiting (429)
|
||||
|
||||
Reference in New Issue
Block a user