[598][@ant] fix: списание — учитывать legacy inventory_id при блокировке кандидатов — не разблокировать партии старых проектов после перехода на inventory_ids[]

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
ant
2026-06-14 11:46:54 +00:00
parent a6f620304b
commit f6fd706bf0
@@ -122,6 +122,11 @@ export class MarketplaceWriteoffProposalRepositoryAdapter
for (const row of rows) {
for (const item of row.items ?? []) {
for (const id of item.inventory_ids ?? []) ids.add(id);
// Обратная совместимость: проекты, созданные до агрегации партий,
// хранят одиночный inventory_id — учитываем и его, иначе их партии
// ошибочно «разблокируются» и всплывут в кандидатах.
const legacyId = (item as { inventory_id?: string | null }).inventory_id;
if (legacyId) ids.add(legacyId);
}
}
return [...ids];