appa dn plugin udpates for integrationa dn final touches

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-13 09:23:54 +00:00
parent e053655962
commit d2b733640c
13 changed files with 236 additions and 337 deletions

View File

@@ -523,28 +523,36 @@ class ContentImage(models.Model):
### SiteIntegration
**⚠️ Note:** For WordPress, `Site.wp_api_key` is the **SINGLE source of truth** for API authentication. SiteIntegration is used for sync tracking and future multi-platform support.
```python
class SiteIntegration(models.Model):
id = UUIDField(primary_key=True)
name = CharField(max_length=255)
site = ForeignKey(Site, related_name='integrations')
platform = CharField(max_length=50) # wordpress
platform = CharField(max_length=50) # wordpress, shopify (future)
# Credentials (encrypted)
url = URLField()
username = CharField(max_length=255)
api_key = CharField(max_length=255) # Application password
# Configuration
external_site_url = URLField()
config_json = JSONField(default=dict) # Platform-specific settings
credentials_json = JSONField(default=dict) # Reserved for future platforms (NOT for WordPress)
# Cached structure
# Sync Tracking
sync_enabled = BooleanField(default=True)
sync_status = CharField(max_length=50) # pending/syncing/completed/error
last_sync_at = DateTimeField(null=True)
sync_error = TextField(null=True)
# Connection
connection_status = CharField(max_length=50) # connected/error
is_active = BooleanField(default=True)
# Cached WordPress structure (from initial sync)
categories = JSONField(default=list)
tags = JSONField(default=list)
authors = JSONField(default=list)
post_types = JSONField(default=list)
# Status
is_active = BooleanField(default=True)
last_sync_at = DateTimeField(null=True)
structure_updated_at = DateTimeField(null=True)
created_at = DateTimeField(auto_now_add=True)