Enhancement: SDA (Supporting Documents for Approval) asset type

Adds SDA as a new asset type for License claim translations supporting
the EOL (External Legal Opinion) workflow.

- SDA maps to externallegalopinion in DAM (same as EOL).
- Field overrides match EOL (Agency = "-", Prod Company = "-",
  Languages = Global, IP Right = Yes, Licensing = No, validity dates
  removed) plus a fixed Description: "Translation of License claim -
  For approval purposes only".
- Added asset_type_overrides section to field_mappings_ppr.yaml; it
  was missing, so EOL overrides weren't actually applying on PPR.
  Both EOL and SDA blocks are now defined for both PPR and PROD.
- _apply_asset_type_overrides now appends a simple string field when
  the override targets a field not yet in mvp_fields, so the SDA
  description is set even if the filename has no subject_title.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
nickviljoen 2026-04-28 16:08:03 +02:00
parent 90f326aecb
commit 0f49cc6cbc
4 changed files with 43 additions and 1 deletions

View file

@ -48,6 +48,7 @@ VIE: visualidentityelements # Brand Visual Identity Elements
# External Legal Opinion
EOL: externallegalopinion # External Legal Opinion (triggers field overrides)
SDA: externallegalopinion # Supporting Documents for Approval - License claim translations (triggers field overrides)
# Note: If a 3-letter code is not in this mapping, it will be passed through as-is
# and may fail DAM validation if the code doesn't exist in DAM's domain

View file

@ -76,3 +76,26 @@ defaults:
FERRERO.MARKETING.FIELD.VIDEO_POST_PROD_COMPANY: "Oliver Marketing Ltd"
FERRERO.MARKETING.FIELD.AUDIO_POST_PROD_COMPANY: "Oliver Marketing Ltd"
FERRERO.MARKET.PROD_COMPANY: "-" # Production House
# Asset type overrides (keyed by 3-letter asset type code)
# Applied AFTER normal field updates and forced values
# Overrides specific fields when a matching asset type is detected in the filename
asset_type_overrides:
EOL: # External Legal Opinion - selected as asset type in naming tool
FERRERO.MARKETING.FIELD.AGENCY NAME: "-"
FERRERO.MARKET.PROD_COMPANY: "-"
MAIN_LANGUAGES: "Global"
FERRERO.MARKET.FIELD.IPRIGHT: "Yes"
FERRERO.MARKET.FIELD.LICENSIN: "No"
FERRERO.FIELD.ASSET VALIDITY START PERIOD: "" # Remove validity dates for EOL
FERRERO.FIELD.ASSET VALIDITY END PERIOD: "" # Remove validity dates for EOL
SDA: # Supporting Documents for Approval - License claim translations supporting EOL
FERRERO.MARKETING.FIELD.AGENCY NAME: "-"
FERRERO.MARKET.PROD_COMPANY: "-"
MAIN_LANGUAGES: "Global"
FERRERO.MARKET.FIELD.IPRIGHT: "Yes"
FERRERO.MARKET.FIELD.LICENSIN: "No"
FERRERO.FIELD.ASSET VALIDITY START PERIOD: "" # Remove validity dates for SDA
FERRERO.FIELD.ASSET VALIDITY END PERIOD: "" # Remove validity dates for SDA
ARTESIA.FIELD.ASSET DESCRIPTION: "Translation of License claim - For approval purposes only"

View file

@ -89,3 +89,13 @@ asset_type_overrides:
FERRERO.MARKET.FIELD.LICENSIN: "No"
FERRERO.FIELD.ASSET VALIDITY START PERIOD: "" # Remove validity dates for EOL
FERRERO.FIELD.ASSET VALIDITY END PERIOD: "" # Remove validity dates for EOL
SDA: # Supporting Documents for Approval - License claim translations supporting EOL
FERRERO.MARKETING.FIELD.AGENCY NAME: "-"
FERRERO.MARKET.PROD_COMPANY: "-"
MAIN_LANGUAGES: "Global"
FERRERO.MARKET.FIELD.IPRIGHT: "Yes"
FERRERO.MARKET.FIELD.LICENSIN: "No"
FERRERO.FIELD.ASSET VALIDITY START PERIOD: "" # Remove validity dates for SDA
FERRERO.FIELD.ASSET VALIDITY END PERIOD: "" # Remove validity dates for SDA
ARTESIA.FIELD.ASSET DESCRIPTION: "Translation of License claim - For approval purposes only"

View file

@ -403,7 +403,15 @@ class MetadataExtractorMVP:
break
if not field_found:
logger.warning("Asset type override field '{}' not found in MVP fields - skipping".format(field_id))
# Field not present yet (e.g. description has no subject_title from filename).
# Append as a simple string field so the override still takes effect. Tabular
# / domained overrides aren't supported here — they should already be in
# mvp_fields via _add_missing_fields.
mvp_fields.append({
'id': field_id,
'value': {'value': {'type': 'string', 'value': override_value}}
})
logger.info("Asset type override: {} = {} (added missing field)".format(field_id, override_value))
return mvp_fields