"""Synthetic source rows with coordinates and an extraction with offsetting errors."""
source = [{'id': f'R{i:02}', 'cell': f'B{i+1}', 'amount': 100*i, 'unit': 'KRW'} for i in range(1,13)]
extracted = [dict(row) for row in source if row['id'] != 'R07']
extracted[0]['amount'] = 800  # R01 should be 100: +700 offsets missing R07.
assert sum(r['amount'] for r in source) == sum(r['amount'] for r in extracted) == 7800
by_id = {r['id']: r for r in extracted}
missing = [r['id'] for r in source if r['id'] not in by_id]
mismatch = [r['id'] for r in source if r['id'] in by_id and r['amount'] != by_id[r['id']]['amount']]
assert missing == ['R07'] and mismatch == ['R01']
print('PASS: total 7800 is equal; missing R07/B8; wrong amount R01/B2')
