mirror of
https://github.com/FranP-code/inbox-negotiator.git
synced 2025-10-13 00:42:26 +00:00
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:
@@ -506,6 +506,8 @@ serve(async (req) => {
|
||||
debt.metadata?.aiEmail,
|
||||
);
|
||||
|
||||
console.log({ analysis });
|
||||
|
||||
// Store the conversation message
|
||||
const { error: messageError } = await supabaseClient
|
||||
.from("conversation_messages")
|
||||
@@ -557,11 +559,11 @@ serve(async (req) => {
|
||||
nextAction = analysis.suggestedNextAction;
|
||||
break;
|
||||
case "request_info":
|
||||
newStatus = "awaiting_response";
|
||||
newStatus = "requires_manual_review";
|
||||
nextAction = "escalate_to_user";
|
||||
break;
|
||||
default:
|
||||
newStatus = "awaiting_response";
|
||||
newStatus = "requires_manual_review";
|
||||
nextAction = "escalate_to_user";
|
||||
}
|
||||
|
||||
@@ -670,6 +672,12 @@ serve(async (req) => {
|
||||
});
|
||||
}
|
||||
|
||||
console.log({
|
||||
shouldAutoRespond,
|
||||
analysisIntent: analysis.intent,
|
||||
analysisConfidence: analysis.confidence,
|
||||
});
|
||||
|
||||
// If auto-response is recommended and confidence is high, trigger negotiation
|
||||
if (
|
||||
shouldAutoRespond && analysis.confidence > 0.8 &&
|
||||
|
||||
Reference in New Issue
Block a user