AURORA-1541: таблица корректировки — подключена к реальному API (#206) #215

Merged
aep merged 29 commits from feat/206-corrections-ui into main 2026-11-02 20:12:17 +03:00
2 changed files with 14 additions and 1 deletions
Showing only changes of commit b26c1d2581 - Show all commits

View File

@ -113,6 +113,19 @@ describe('buildRows и итоги', () => {
expect(rows.filter((r) => r.kind === 'entry')).toHaveLength(8);
expect(rows.filter((r) => r.kind === 'unallocated')).toHaveLength(t.unallocated.length);
});
it('две позиции нераспределённой строки (Д и К) с одинаковыми entry_ids — разные ключи', () => {
const t = table();
const base = t.unallocated[0];
t.unallocated = [
{ ...base, side: 'D', entry_ids: ['e1'] },
{ ...base, side: 'K', entry_ids: ['e1'] },
];
const keys = buildRows(filterTable(t, { ...EMPTY_FILTERS, recordType: 'unallocated' }), new Set())
.filter((r) => r.kind === 'unallocated')
.map((r) => r.key);
expect(keys).toHaveLength(2);
expect(new Set(keys).size).toBe(2);
});
it('visibleTotals по ЭПТ — ИЛС и правилу 3', () => {
const t = table();
const picked = t.aggregates.filter((a) => a.company_1.name === 'ЭПТ' || a.rule_id === 'r3');

View File

@ -130,7 +130,7 @@ export function buildRows(view: ReturnType<typeof filterTable>, expanded: Readon
rows.push({ kind: 'entry', key: `${key}|${side}|${entry.entry_ids.join(',')}`, parentKey: key, side, entry });
}
}
for (const entry of view.unallocated) rows.push({ kind: 'unallocated', key: `u|${entry.entry_ids.join(',')}`, entry });
for (const entry of view.unallocated) rows.push({ kind: 'unallocated', key: `u|${entry.side}|${entry.entry_ids.join(',')}`, entry });
return rows;
}