fix: resolve architecture validation errors
- Create platform_service.py to move DB queries from platforms.py API - Create platform.py exceptions for PlatformNotFoundException - Update platforms.py API to use platform_service - Update vendor/content_pages.py to use vendor_service - Add get_vendor_by_id_optional method to VendorService - Fix platforms.js: add centralized logger and init guard - Fix content-page-edit.html: use modal macro instead of inline modal All 21 architecture validation errors resolved. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -257,6 +257,19 @@ class VendorService:
|
||||
|
||||
return vendor
|
||||
|
||||
def get_vendor_by_id_optional(self, db: Session, vendor_id: int) -> Vendor | None:
|
||||
"""
|
||||
Get vendor by ID, returns None if not found.
|
||||
|
||||
Args:
|
||||
db: Database session
|
||||
vendor_id: Vendor ID to find
|
||||
|
||||
Returns:
|
||||
Vendor object or None if not found
|
||||
"""
|
||||
return db.query(Vendor).filter(Vendor.id == vendor_id).first()
|
||||
|
||||
def get_active_vendor_by_code(self, db: Session, vendor_code: str) -> Vendor:
|
||||
"""
|
||||
Get active vendor by vendor_code for public access (no auth required).
|
||||
|
||||
Reference in New Issue
Block a user