feat(fees): add manual name mappings for 20 companies in fee import
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-03-19 19:43:39 +01:00
parent dcde30b232
commit 105f5701b6

View File

@ -43,6 +43,30 @@ PREFERRED_SHEETS = {
2025: '2025 MK', # Use Magda's updated version
}
# Manual name mapping: Excel name → Company ID (for names that don't auto-match)
MANUAL_NAME_MAP = {
'CRIS TAP': 27,
'EURA TECH': 34,
'HEBEL, MASIAK': 80,
'HILL OB.': 35,
'ISSRFID': 136,
'Informatyk 1 Mateusz Kurpet': 112,
'KANCELARIA -ŁUKASZ GILEWICZ': 81,
'KBS': 42,
'Konkol Piekarnia': 132,
'LITWIC & LITWIC': 47,
'MIZAK KANCELARIA': 95,
'NOWAK CHŁOD.': 26,
'PODRÓRZE I MY': 98,
'RADCA SKWARŁO': 40,
'ROUNDTWO': 60,
'TK CHOPIN': 25,
'WTBS': 135,
'Your Welcome/': 118,
'ORLEX DESIGNE': 96,
'ORLEX INVEST': 96,
}
def normalize_name(name):
"""Normalize company name for matching."""
@ -221,7 +245,11 @@ def import_fees(excel_path, target_year=None, all_years=False, dry_run=False):
print(f'\n=== {sheet_name} (rok {year}) — {len(records)} firm ===')
for rec in records:
# Match company
# Match company — first check manual map
manual_id = MANUAL_NAME_MAP.get(rec['name'])
if manual_id:
company = db.query(Company).filter_by(id=manual_id).first()
else:
company = company_map.get(rec['name'].upper())
if not company:
# Try partial match