Skip to content

feat(prices): add management command to fix missing currency#1124

Open
Kinjal0007 wants to merge 2 commits intoopenfoodfacts:mainfrom
Kinjal0007:feat/fix-missing-currency
Open

feat(prices): add management command to fix missing currency#1124
Kinjal0007 wants to merge 2 commits intoopenfoodfacts:mainfrom
Kinjal0007:feat/fix-missing-currency

Conversation

@Kinjal0007
Copy link

Problem

Some Price entries have null currency, which causes issues for clients like Smoothie that assume currency is always present.

Fix

This PR adds a non-breaking management command fix_missing_price_currency:

  • Reports records with missing currency
  • With --write, fills currency using:
    • proof.currency if available
    • fallback from location.osm_address_country_code

Notes

  • Does not change model or validation behavior
  • Keeps existing API contract
  • Provides a safe way to clean legacy records

Usage

make cli args="fix_missing_price_currency"
make cli args="fix_missing_price_currency --write"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant