feat(calendar): agrupar parcelas da mesma série em evento único

Lançamentos parcelados com o mesmo seriesId agora são consolidados em
um único evento do tipo 'installment' no calendário, exibindo 'Nx de
R$ X' em vez de repetir o mesmo item N vezes. Legenda e modal de
detalhes atualizados para refletir o novo tipo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Felipe Coutinho
2026-04-20 19:50:02 +00:00
parent cbc17c8513
commit f747405264
5 changed files with 95 additions and 4 deletions

View File

@@ -20,6 +20,11 @@ export const EVENT_TYPE_STYLES: Record<
wrapper: "bg-primary/10 text-primary dark:bg-primary/5 dark:text-primary",
dot: "bg-primary",
},
installment: {
wrapper:
"bg-amber-100 text-amber-600 dark:bg-amber-900/10 dark:text-amber-500",
dot: "bg-amber-500",
},
boleto: {
wrapper: "bg-info/10 text-info dark:bg-info/5 dark:text-info",
dot: "bg-info",
@@ -39,6 +44,8 @@ const buildEventLabel = (event: CalendarEvent) => {
case "transaction":
case "boleto":
return event.transaction.name;
case "installment":
return event.transaction.name;
case "card":
return event.card.name;
default:
@@ -51,6 +58,8 @@ const buildEventComplement = (event: CalendarEvent) => {
case "transaction":
case "boleto":
return formatCurrencyValue(event.transaction.amount);
case "installment":
return `${event.installmentCount}x de ${formatCurrencyValue(event.installmentValue)}`;
case "card":
return event.card.totalDue !== null
? formatCurrencyValue(event.card.totalDue)