[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:
+5
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user