ferrero-opentext/Python-Version/scripts
DJP 39a41df21d Fix CreativeX lookup to use original Box filename not stripped version
Changes database lookup strategy to match on full filename as it appears
in Box and in the CreativeX PDF report filename field.

Critical Design Change:

Old (incorrect):
- Strip job number and tracking ID from Box filename
- Lookup: NUT_PL_pl_TEST-E2E_EHI_1x1.png
- Database has: 6487512_NUT_PL_pl_TEST-E2E_EHI_1x1_7xXgKp.png
- RESULT: No match found, uses defaults

New (correct):
- Use original Box filename for lookup
- Lookup: 6487512_NUT_PL_pl_TEST-E2E_EHI_1x1_7xXgKp.png
- Database has: 6487512_NUT_PL_pl_TEST-E2E_EHI_1x1_7xXgKp.png
- RESULT: Match found, uses actual score

Rationale:
The CreativeX PDF report contains a "filename" field that stores the
actual asset filename including job number and tracking ID. This is
the name that gets extracted by LlamaExtract and stored in database.

The A2→A3 workflow receives files from Box with the SAME filename
structure (job_brand_country_lang_subject_trackingID.ext).

Therefore, we match on the complete original filename, not the stripped
version.

Database Storage Pattern:
- CreativeX PDF named: anything.pdf (name doesn't matter)
- PDF contains field: filename = "6487512_NUT_PL_pl_TEST-E2E_EHI_1x1_7xXgKp.png"
- Database stores: filename = "6487512_NUT_PL_pl_TEST-E2E_EHI_1x1_7xXgKp.png"
- A2→A3 receives: 6487512_NUT_PL_pl_TEST-E2E_EHI_1x1_7xXgKp.png from Box
- Lookup matches exactly

Clean filename still used for DAM upload, only the lookup is on original.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 12:29:55 -05:00
..
shared Add verbose debugging to _set_field_value for CreativeX troubleshooting 2025-11-13 12:16:53 -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