ferrero-opentext/Python-Version/scripts/shared
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
..
__pycache__ Update comprehensive README and reorganize documentation files 2025-11-05 10:57:11 -05:00
__init__.py Start Python automation - Foundation components 2025-10-30 16:38:26 -04:00
box_client.py Implement V2 naming convention updates and folder structure support 2025-11-05 18:33:35 -05:00
config_loader.py Add country code mapping system (ISO -> DAM codes) 2025-11-05 19:15:26 -05:00
dam_client.py Implement V2 naming convention updates and folder structure support 2025-11-05 18:33:35 -05:00
database.py Add version tracking and remove .0 decimals from CreativeX scores 2025-11-11 16:55:07 -05:00
filename_parser.py Implement V2 naming convention updates and folder structure support 2025-11-05 18:33:35 -05:00
metadata_extractor_mvp.py Add CreativeX fields to asset representation if missing from master metadata 2025-11-13 12:44:17 -05:00
notifier.py Integrate CreativeX database lookup into A2→A3 upload workflow 2025-11-11 17:02:25 -05:00