feat: Add manual response dialog and update debt status handling

- Introduced ManualResponseDialog component for user-initiated responses when AI analysis is unclear.
- Updated DebtTimeline to include AlertTriangle icon for debts requiring manual review.
- Enhanced supabase functions to handle new debt status 'requires_manual_review' and message type 'manual_response'.
- Implemented email variable processing utilities to support dynamic email content generation.
- Created tests for email variable extraction and replacement functions.
- Updated database schema to accommodate new statuses and message types, including relevant constraints and indexes.
- Adjusted negotiation and email sending logic to ensure proper handling of manual responses and variable replacements.
This commit is contained in:
2025-06-08 01:49:19 -03:00
parent bddc3a344d
commit 7c91b625a6
13 changed files with 1059 additions and 171 deletions

View File

@@ -162,6 +162,7 @@ export function Dashboard() {
"approved",
"awaiting_response",
"counter_negotiating",
"requires_manual_review",
].includes(debt.status)
),
settled: debts.filter((debt) =>
@@ -309,7 +310,7 @@ export function Dashboard() {
</CardContent>
</Card>
) : (
<div className="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6">
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
{debtList.map((debt) => (
<div key={debt.id} className="space-y-4">
<DebtCard debt={debt} onUpdate={fetchDebts} />