ferrero-opentext/Python-Version/scripts
DJP 15eb47fc43 Add CreativeX fields to asset representation if missing from master metadata
Fixes issue where CreativeX score field was not appearing in final upload
because it didn't exist in the master metadata from DAM.

Problem:
- Master metadata from A1→A2 doesn't include CREATIVEX fields (new fields)
- _update_creativex_fields() only UPDATED existing fields
- If field not present, it logged error but didn't add the field
- Result: CREATIVEX score missing from upload, only URL appeared

Solution:
- Check if CREATIVEX Score field exists in mvp_fields
- If NOT found: Create and append field with proper structure
- If found: Update value as before
- Same logic for CREATIVEX URL field

Field Structures Created:

CREATIVEX Score (FERRERO.TAB.FIELD.CREATIVEX):
- Type: MetadataTableField (tabular field)
- Parent: FERRERO.TABULAR.FIELD.PLATFORMRATING
- Data type: INTEGER
- Value structure: {'value': {'value': score}}

CREATIVEX URL (FERRERO.FIELD.CREATIVEX LINK):
- Type: MetadataField (regular field)
- Data type: CHAR
- Value structure: {'value': {'value': url}}

Logging:
- Changed from ERROR to WARNING when field not found
- Logs "adding it now" instead of just error
- Confirms field added with value

Impact:
Both CreativeX fields will now appear in uploads even if master
metadata doesn't have them (common for older campaigns downloaded
before CreativeX integration).

Testing:
Run with --dryrun to verify both CREATIVEX fields in JSON output.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 12:44:17 -05:00
..
shared Add CreativeX fields to asset representation if missing from master metadata 2025-11-13 12:44:17 -05:00
a1_to_a2_download.py Fix timestamp bug in campaign status recording 2025-11-05 16:34:46 -05:00
a2_to_a3_upload.py Complete Python automation implementation - All components built 2025-10-30 16:49:14 -04:00
a2_to_a3_upload_polling.py Fix CreativeX lookup to use original Box filename not stripped version 2025-11-13 12:29:55 -05:00
a4_webhook_monitor.py Update A4 webhook monitor to process all campaigns at once 2025-11-05 17:34:24 -05:00
a5_to_a6_download.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
advance_a1_to_a3.py Add interactive campaign status management scripts 2025-11-07 15:23:26 -05:00
b1_to_b2_download.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
creativex_scoring_storing.py Remove email notification when no CreativeX files found 2025-11-11 20:58:09 -05:00
daily_report.py Add daily summary report with comprehensive statistics 2025-11-04 16:34:44 -05:00
reset_campaign_to_a1.py Add interactive campaign status management scripts 2025-11-07 15:23:26 -05:00
test_connection.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
test_mtls_cert.py Add optional mTLS certificate authentication with --auth-pfx flag 2025-11-04 18:01:23 -05:00
test_mtls_debug.py Add separate mTLS base URL configuration for certificate authentication 2025-11-05 08:25:31 -05:00
update_campaign_status.py Add targeted campaign status update script 2025-11-09 12:49:46 -05:00