Database Integration:
- IDGenerator now connects to PostgreSQL (localhost:5433)
- Generates tracking IDs with uniqueness check against master_assets table
- Fallback to random if database unavailable
- Direct PDO connection to ferrero_tracking database
DatabaseClient:
- Stores master assets in PostgreSQL
- Records: tracking_id, opentext_id, Box links, full metadata JSON
- Updates on conflict (upsert pattern)
- Stores box_file_id and box_url for reference
Box Metadata Enhancement:
- Uses Box metadata template API (enterprise/ferreroDAMMetadata)
- Stores full DAM metadata JSON in 'Ferrero-DAM-Metadata' field
- Fallback to file description if template not configured
- Handles template conflicts (updates existing)
Box Upload Results Now Show:
- Unique tracking ID (from database)
- Box file links (clickable)
- Database storage status
- ID source (database_direct, random, etc.)
Complete workflow: DAM → Download → Generate ID → Upload to Box → Store in DB
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Box OAuth requires app to be configured for client credentials grant.
Using developer token as fallback (valid 60 minutes).
User needs to:
1. Go to https://app.box.com/developers/console
2. Generate new Developer Token
3. Update token in code (expires hourly)
OR configure Box app for OAuth 2.0 client credentials grant.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Box app is not configured for enterprise client credentials.
Using standard client_credentials grant without subject type.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
New Box Integration Features:
- BoxClient class for Box API operations
- IDGenerator for 6-character unique IDs (A-Z a-z 0-9)
- Auto-create campaign folders in Box
- Rename files with unique ID suffix (filename_ID.ext)
- Upload metadata JSON to Box custom fields
- Track Box file IDs and URLs
Download Workflow Enhancement:
- New button: '📥📦 Download & Upload to Box'
- Downloads from DAM → Uploads to Box
- Each file gets unique 6-char ID
- Creates campaign folder: {campaign_id}_{campaign_name}
- Results show: original → renamed filename with ID
Box Configuration:
- Developer Token: e7Q1kS6rOM1tH2ezzCg4KgRfcyNW2JHI
- Root Folder: 348304357505
- OAuth creds in Box-config.json
ID Generation:
- Phase 1: Random 6-char (current)
- Phase 2: PostgreSQL DB via REST API (ready to integrate)
Metadata Storage:
- Stored in Box file description (custom metadata field later)
- Full DAM metadata JSON preserved
- Includes: asset_id, campaign info, all metadata fields
Ready for testing! Download workflow now stores assets in Box with tracking.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>