When users send very short or vague messages, the bot should intelligently ask for the missing piece of information instead of failing or guessing. This is important for real-world WhatsApp usage where people type in shorthand.
1. Ambiguous / Missing Data Flows
Scenario A: Missing Name
- Input:
Gave 500
- Problem: No customer name or identifier is provided.
- Expected reply:
❓ Who is this for? Please reply with the name (e.g., "For Raju").
Scenario B: Missing Amount
- Input:
Raju came to shop
- Problem: No amount and unclear whether it is a give/receive transaction.
- Expected reply:
❓ I see Raju is here. Did you Give money or Receive money? Please mention the amount.
Acceptance criteria
- Bot detects when:
- Amount is missing but customer is known.
- Customer is missing but an amount/action is present.
- Bot responds with a single, clear follow-up question instead of a generic failure.
- Conversation state is preserved so the follow-up answer can complete the original intent.
2. Data Structure for "Last 2 Entries" (Balance Inquiry)
For balance inquiries, the customer lookup (for example CustomerRepository.findByPhone) should return a structured view including the current balance and recent transactions.
interface CustomerProfile {
id: string;
name: string;
currentBalance: number;
lastTransactions: {
amount: number; // negative for given, positive for received
date: Date;
description: string;
}[];
}
Usage
- For "Balance Inquiry" flows, show:
- Current balance.
- Last 2 transactions from
lastTransactions[0..1] with amount, date, and description.
Implementation tasks
When users send very short or vague messages, the bot should intelligently ask for the missing piece of information instead of failing or guessing. This is important for real-world WhatsApp usage where people type in shorthand.
1. Ambiguous / Missing Data Flows
Scenario A: Missing Name
Gave 500❓ Who is this for? Please reply with the name (e.g., "For Raju").Scenario B: Missing Amount
Raju came to shop❓ I see Raju is here. Did you Give money or Receive money? Please mention the amount.Acceptance criteria
2. Data Structure for "Last 2 Entries" (Balance Inquiry)
For balance inquiries, the customer lookup (for example
CustomerRepository.findByPhone) should return a structured view including the current balance and recent transactions.Usage
lastTransactions[0..1]with amount, date, and description.Implementation tasks
CustomerProfileview in the repository layer.lastTransactionsfor the "Last 2 Entries" section.