ferrero-opentext/Python-Version/scripts/shared
DJP 0bf3c34cd0 Add asset type mapping from 3-letter codes to DAM codes
Maps frontend naming tool 3-letter codes (EHI, IMG, TVC) to DAM's
lowercase descriptive codes (heroimage, keyvisual, tvc) for uploads.

New File: config/asset_type_mappings.yaml
- 45 asset type mappings from DAM lookup domains
- Maps 3-letter codes to DAM codes
- E-Commerce types: EHI→heroimage, EBS→beautyshot, etc.
- Standard types: IMG→keyvisual, TVC→tvc, etc.
- Expandable as new asset types added

Field Mappings Update (field_mappings.yaml):
- Added FERRERO.FIELD.MKTG.ASSET TYPE to filename_updates
- Source: asset_type (from parsed filename)
- Required: true

Metadata Extractor Updates (metadata_extractor_mvp.py):
- Added _load_asset_type_mappings() method
- Added _map_asset_type() method
- Integrated mapping into _update_fields()
- Logs mappings: "Asset type mapping: EHI -> heroimage"
- Warns if no mapping found (may fail DAM validation)

Example Flow:
1. Filename: ROC_TEST-E2E2_EHI_1x1_DE_de.png
2. Parse: asset_type = "EHI"
3. Map: EHI → "heroimage"
4. Update field: FERRERO.FIELD.MKTG.ASSET TYPE = "heroimage"
5. DAM accepts "heroimage" (valid domain value)

Without Mapping (before):
- Field value: "EHI"
- DAM validation: FAILS (EHI not in domain)

With Mapping (after):
- Field value: "heroimage"
- DAM validation: PASSES 

Complete Mapping List (45 types):
E-Commerce: ECA, ECB, EBS, EBR, EEM, EHI, EIL, EOP, EUG, EWB
Standard: 3RT, APC, BBK, BRC, BSG, CKV, CID, DAT, FLA, FNT, GDT,
         GRG, IMG, FPO, LGL, LOG, MLF, OLV, PAW, PKI, POS, PDM,
         PRI, QRC, SND, SIP, SGL, TVC, VIE

DAM Answer: Uses descriptive lowercase codes, not 3-letter codes.
Frontend uses 3-letter for brevity, backend maps to DAM format.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 13:08:01 -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 master CreativeX score extraction and storage in A1→A2 workflow 2025-11-13 13:56:22 -05:00
filename_parser.py Update filename parser to V2.1 structure with new field positions 2025-11-13 13:41:19 -05:00
filename_parser_v1_backup.py Update filename parser to V2.1 structure with new field positions 2025-11-13 13:41:19 -05:00
metadata_extractor_mvp.py Add asset type mapping from 3-letter codes to DAM codes 2025-11-14 13:08:01 -05:00
notifier.py Integrate CreativeX database lookup into A2→A3 upload workflow 2025-11-11 17:02:25 -05:00