Commit graph

14 commits

Author SHA1 Message Date
nickviljoen
28586308d7 Docs: Refresh A1 empty-folder doc and LTD asset type notes
A1_RETRY_LOGIC.md updated to reflect the 2026-04-28 rework: empty
folders are now treated as expected workflow (silent skip + one-time
warning at poll 20, no auto permanent-fail), while the original
3-strikes-then-permanently-fail behavior is preserved for genuine
folder errors via the mark_failed_at_max flag.

README.md adds LTD (Licensing Translation Document) to the asset type
override section alongside EOL, and notes that empty overrides remove
fields while non-empty overrides on non-MVP fields are appended.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 18:19:06 +02:00
nickviljoen
d83e41707c Docs: Update README with asset type mapping changes and current date
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 17:44:55 +02:00
nickviljoen
03c5ab65a8 Docs: Update README and CLAUDE.md with folder-only template and EOL workflow
Added documentation for template-based folder-only mode (-N flag),
asset type overrides (EOL), environment-specific field mappings,
and updated config file references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 21:33:35 +02:00
DJP
59295ab9a2 feat: Formalize and document prefix-based tracking IDs for master and regular files, and correct a country code mapping. 2025-12-06 10:54:12 -05:00
DJP
533c1f5245 Update documentation with new services and deployment steps 2025-12-01 22:55:32 -05:00
DJP
491fc8e938 feat: Add A1→A3 campaign advance script, introduce systemd service for orchestrator, and ref 2025-11-24 13:50:16 -05:00
DJP
0af15563bc feat: Implement new Python script locking, relocate PHP workflow, and update Python scripts and documentation. 2025-11-21 17:20:34 -05:00
DJP
0c2edc560f Add targeted campaign status update script
Created update_campaign_status.py - targeted campaign status control:
- Update specific campaign by number (--camp C000000078)
- Or search by partial campaign name (--camp "CONTENT SCALING")
- Set to any status (--status A1, A2, A3, etc.)
- Searches all statuses to find the campaign
- If multiple matches, lets user choose
- Interactive yes/no confirmation
- Shows current and target status
- Supports --auth-pfx for mTLS authentication

Usage examples:
  python scripts/update_campaign_status.py --camp C000000078 --status A2
  python scripts/update_campaign_status.py --camp "KINDER" --status A4
  python scripts/update_campaign_status.py --camp C000000551 --status A1 --auth-pfx

Features:
- Required flags: --camp and --status
- Searches across all statuses (A1-A6, B1-B2)
- Partial name matching (case insensitive)
- Multiple match handling with user selection
- Clear success/failure feedback

Updated README with complete documentation and examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:49:46 -05:00
DJP
a2e1058d20 Add interactive campaign status management scripts
Created 2 new interactive scripts for manual campaign status control:

1. reset_campaign_to_a1.py
   - Resets any campaign from any A# status back to A1
   - Allows filtering by specific status (--status A2, A3, A4, etc.)
   - Interactive yes/no confirmation for each campaign
   - Shows campaign name, number, and current status
   - Processes one at a time, waits for user input
   - Summary statistics at the end

2. advance_a1_to_a3.py
   - Advances A1 campaigns directly to A3 (skips A2)
   - Useful for testing A2→A3 upload workflow
   - Interactive yes/no confirmation for each campaign
   - Shows campaign details before advancing
   - Summary statistics at the end

Both scripts:
- Support --auth-pfx flag for mTLS authentication
- Process campaigns one at a time (not batch)
- Wait for user input before proceeding
- Provide clear feedback on success/failure
- Useful for testing and manual workflow control

Updated README.md with complete documentation and examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 15:23:26 -05:00
DJP
d7d2e7b1d2 Enhance README with comprehensive database queries and script options
Added sections:
1. Script Options & Flags - Detailed usage for all 7 scripts
   - All authentication options (OAuth2 vs mTLS)
   - A2→A3 testing flags (--keep-files, --A3update)
   - Help command examples
   - Flag combinations

2. Enhanced Database Queries section
   - Quick command-line queries for all tables
   - View A1→A2 downloads (master_assets)
   - View A2→A3 uploads (derivative_assets)
   - View campaign status and webhooks
   - Advanced SQL queries (global master relationships, tracking ID lineage)
   - Database management commands (backup, table sizes)

3. Expanded Authentication section
   - Comparison table (OAuth2 vs mTLS)
   - Switching between auth methods
   - Cron examples for both methods
   - Comprehensive testing instructions

The README now provides complete reference for:
- Running any script with any authentication method
- Querying the database for all workflow data
- Understanding available options and flags
- Troubleshooting authentication issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 19:53:07 -05:00
michael
81fe0a5120 changed database port 2025-11-05 13:51:30 -06:00
DJP
d818a8b6a8 Update comprehensive README and reorganize documentation files
Major README overhaul with complete deployment and configuration guide.
Moved old docs to tests/ folder for archive.

README.md UPDATES (880 lines - completely rewritten):
✓ Table of contents with navigation
✓ Complete overview of all 4 workflows + daily report
✓ Detailed authentication section (OAuth2 vs mTLS)
✓ Box-config.json location explanation
✓ Server deployment step-by-step guide
✓ Database setup (Docker + native PostgreSQL)
✓ Cron job examples for all workflows
✓ Comprehensive troubleshooting section
✓ Security checklist
✓ Monitoring and log rotation details
✓ Common SQL queries
✓ File structure diagram

KEY SECTIONS ADDED:
1. What's Included - All 5 scripts explained
2. Quick Start - Local setup guide
3. Server Deployment - 6-step process with commands
4. Workflows - Detailed process for each (A1→A2, A5→A6, B1→B2, A2→A3, Daily Report)
5. Authentication - OAuth2 vs mTLS with examples
6. Configuration - All .env variables documented
7. Database - Schema, setup, queries
8. Monitoring - Logs, emails, database queries
9. Troubleshooting - Common issues + solutions
10. File Structure - Complete directory tree

BOX-CONFIG.JSON LOCATION DOCUMENTED:
✓ Must be one folder up from Python-Version
✓ Referenced as ../Box-config.json in config.yaml
✓ Server deployment instructions include copying both files
✓ Troubleshooting section explains file not found errors

MTLS DOCUMENTATION:
✓ Different base URL explained (dev-auth.app-api.ferrero.com)
✓ --auth-pfx flag usage
✓ Whitelisted IP requirement noted
✓ Certificate testing commands

REORGANIZATION:
- Moved old DEPLOYMENT.md → tests/DEPLOYMENT.md (archive)
- Moved old WORKFLOW_DIAGRAMS.md → tests/WORKFLOW_DIAGRAMS.md (archive)
- New DEPLOYMENT_GUIDE.md is the current deployment doc
- README.md is now comprehensive one-stop documentation

Changes:
- Python-Version/README.md (completely rewritten, 880 lines)
- Moved 2 old docs to tests/ folder
- Added test files to tests/ folder

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 10:57:11 -05:00
DJP
2943277047 Add comprehensive DEPLOYMENT.md and update README for production server
Created DEPLOYMENT.md:
 Complete step-by-step production server deployment guide
 Python 3.6 server requirements and setup
 Virtual environment creation
 Credential configuration
 Connection testing procedures
 Cron job setup (A1→A2 every 5 minutes)
 Webhook server setup (A2→A3)
 Process monitoring scripts
 Security best practices (file permissions, .env protection)
 Troubleshooting guide (all common issues)
 Debugging procedures
 Health check scripts
 Log monitoring
 Configuration update procedures (add fields, change recipients, etc.)
 Emergency procedures (stop/start/restart)

Updated README.md:
 Added references to DEPLOYMENT.md
 Updated with correct Box folder IDs
 Production-ready status
 Clear documentation hierarchy
 Make.com webhook integration noted
 Email configuration documented

Key Documentation:
- DEPLOYMENT.md: Production server deployment (complete guide)
- README.md: Quick reference and local testing
- PYTHON_AUTOMATION_PLAN.md: Architecture and design

All guides updated with:
- Correct Box folders (348304357505 for A1→A2, 348526703108 for A2→A3)
- Folder naming: C000000078-Campaign_Name
- Make.com webhook URL
- SMTP/Mailgun email configuration
- Single-run mode (process one campaign and exit)
- All-done checks before status updates

Ready for production deployment on Python 3.6 server!

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 18:59:12 -04:00
DJP
b4e004c822 Complete Python automation implementation - All components built
MAJOR MILESTONE: Complete Python automation system created!

Components Implemented:
 Box Client (box_client.py)
   - JWT authentication via boxsdk
   - Upload with tracking ID suffix
   - Download files
   - Campaign folder creation
   - Connection testing

 Database Client (database.py)
   - PostgreSQL connection pooling
   - generate_unique_tracking_id()
   - store_master_asset() with full_metadata JSONB
   - get_master_asset(tracking_id)
   - check_campaign_upload_complete() - ALL-DONE CHECK!
   - store_derivative_asset()
   - Connection testing

 Filename Parser (filename_parser.py)
   - V2 naming convention parser (ported from PHP)
   - parse_filename() - 10 components
   - strip_upload_components() - Remove Job# and Tracking ID
   - Strict validation with detailed errors

 Metadata Extractor MVP (metadata_extractor_mvp.py)
   - Extract 28 MVP fields from master
   - Update fields from V2 filename (Description, Language, State)
   - Add missing fields with defaults
   - Build asset representation for upload

 Notifier (notifier.py)
   - Mailgun email integration
   - Outgoing webhook sender
   - Email templates (success, error, partial, critical)
   - Configurable recipients

Main Scripts:
 A1→A2 Download (a1_to_a2_download.py)
   - Poll DAM every 5 minutes for A1 campaigns
   - Download all master assets
   - Upload to Box with tracking IDs
   - Store in DB with full metadata
   - ALL-DONE CHECK before status update
   - Update A1→A2 only if all assets successful
   - Send webhook with campaign ID/number
   - Email notifications

 A2→A3 Upload (a2_to_a3_upload.py)
   - Flask webhook receiver for Box uploads
   - Signature validation
   - Async task queue processing
   - Parse V2 filenames
   - Load master metadata
   - Extract MVP fields
   - Upload to DAM
   - ALL-DONE CHECK for campaign
   - Update A2→A3 when all assets uploaded
   - Send webhook notifications

 Test Connection Script (test_connection.py)
   - Verify DAM, Box, Database connectivity
   - Quick health check

 README.md
   - Complete setup guide
   - Usage instructions
   - Configuration examples
   - Troubleshooting

Key Features:
- Python 3.6+ compatible (server requirement)
- Virtual environment isolated
- Configuration-driven (YAML files)
- Easy field updates (no code changes)
- Environment switching (staging/production)
- Comprehensive error handling
- Email + webhook notifications
- Retry logic
- All-done checks before status updates
- Campaign webhook notifications

Ready for testing locally with Python 3.10!

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 16:49:14 -04:00