feat: bulk delete com escopo para mesma série + recorrente só consome limite após data
Aproveitamento parcial da PR #18 (fechada): - Bulk delete: quando todos os selecionados pertencem à mesma série (parcelado/recorrente), abre dialog de escopo com 3 opções ao invés de deletar direto - Recorrente no cartão: despesa recorrente só consome limite quando purchaseDate <= current_date (cartões ativos, inativos e relatório) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -296,6 +296,17 @@ export function LancamentosPage({
|
||||
}, []);
|
||||
|
||||
const handleMultipleBulkDelete = useCallback((items: LancamentoItem[]) => {
|
||||
// Se todos os selecionados são da mesma série (parcelado/recorrente), abrir dialog de escopo
|
||||
const withSeries = items.filter((i) => i.seriesId);
|
||||
const sameSeries =
|
||||
withSeries.length > 0 &&
|
||||
withSeries.length === items.length &&
|
||||
withSeries.every((i) => i.seriesId === withSeries[0]?.seriesId);
|
||||
if (sameSeries && withSeries[0]) {
|
||||
setPendingDeleteData(withSeries[0]);
|
||||
setBulkDeleteOpen(true);
|
||||
return;
|
||||
}
|
||||
setPendingMultipleDeleteData(items);
|
||||
setMultipleBulkDeleteOpen(true);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user