feat(admin): separate platform CRUD from CMS, add entity selector macro
Some checks failed
Some checks failed
- Move platforms menu from CMS to Platform Admin section with create/edit - Add platform create page, API endpoint, and service method - Remove CMS-specific content from platform list and detail pages - Create shared entity_selector + entity_selected_badge Jinja macros - Create entity-selector.js generalizing store-selector.js for any entity - Add Tom Select merchant filter to stores page with localStorage persistence - Migrate store-products page to use shared macros (remove 53 lines of duped CSS) - Fix broken icons: puzzle→puzzle-piece, building-storefront→store, language→translate, server→cube Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -500,6 +500,29 @@ class PlatformService:
|
||||
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def create_platform(db: Session, data: dict) -> Platform:
|
||||
"""
|
||||
Create a new platform.
|
||||
|
||||
Note: This method does NOT commit the transaction.
|
||||
The caller (API endpoint) is responsible for committing.
|
||||
|
||||
Args:
|
||||
db: Database session
|
||||
data: Dictionary of fields for the new platform
|
||||
|
||||
Returns:
|
||||
Created Platform object (with pending changes)
|
||||
"""
|
||||
platform = Platform()
|
||||
for field, value in data.items():
|
||||
if hasattr(platform, field):
|
||||
setattr(platform, field, value)
|
||||
db.add(platform)
|
||||
logger.info(f"[PLATFORMS] Created platform: {platform.code}")
|
||||
return platform
|
||||
|
||||
@staticmethod
|
||||
def update_platform(
|
||||
db: Session, platform: Platform, update_data: dict
|
||||
|
||||
Reference in New Issue
Block a user