fix: correct service methods and add inventory schema model
Services: - admin_service: Add source_url to import job response, fix vendor_name to use vendor.name relationship instead of vendor_name field - marketplace_product_service: Include reserved_quantity and available_quantity in InventoryLocationResponse - vendor_service: Fix _get_product_by_id_or_raise to use database ID (int) instead of marketplace_product_id (str) Schema: - Add InventorySummaryResponse model for marketplace product service 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -539,16 +539,16 @@ class VendorService:
|
||||
)
|
||||
|
||||
def _get_product_by_id_or_raise(
|
||||
self, db: Session, marketplace_product_id: str
|
||||
self, db: Session, marketplace_product_id: int
|
||||
) -> MarketplaceProduct:
|
||||
"""Get product by ID or raise exception."""
|
||||
"""Get marketplace product by database ID or raise exception."""
|
||||
product = (
|
||||
db.query(MarketplaceProduct)
|
||||
.filter(MarketplaceProduct.marketplace_product_id == marketplace_product_id)
|
||||
.filter(MarketplaceProduct.id == marketplace_product_id)
|
||||
.first()
|
||||
)
|
||||
if not product:
|
||||
raise MarketplaceProductNotFoundException(marketplace_product_id)
|
||||
raise MarketplaceProductNotFoundException(str(marketplace_product_id))
|
||||
return product
|
||||
|
||||
def _product_in_catalog(
|
||||
|
||||
Reference in New Issue
Block a user