@naniteninja/dashboard-components-lib 2.4.2 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8656,6 +8656,16 @@ function buildAmbiguousLocationText(s) {
|
|
|
8656
8656
|
if (typeof count === 'number' && count > 1) {
|
|
8657
8657
|
return `There are ${count} ${place} locations in that area. Please ask the prospect to specify which one.`;
|
|
8658
8658
|
}
|
|
8659
|
+
// Nothing found and exactly one found both used to fall through to the generic line below,
|
|
8660
|
+
// which told the matcher the suggestion was "ambiguous" and left them to guess why. Neither
|
|
8661
|
+
// is ambiguity: one means the place is not in the client's area at all, the other means
|
|
8662
|
+
// there is a single result nobody has confirmed is the right one.
|
|
8663
|
+
if (count === 0) {
|
|
8664
|
+
return `No ${place} found in that area. Please ask the prospect to suggest somewhere else.`;
|
|
8665
|
+
}
|
|
8666
|
+
if (count === 1) {
|
|
8667
|
+
return `Only one ${place} found in that area. Please ask the prospect to confirm the exact address.`;
|
|
8668
|
+
}
|
|
8659
8669
|
return s.ambiguousReason || 'Prospect suggested an ambiguous location. Please ask them to be specific.';
|
|
8660
8670
|
}
|
|
8661
8671
|
const FIVE_MINUTES_MS = 5 * 60 * 1000;
|
|
@@ -8691,7 +8701,34 @@ function extractShortName(address) {
|
|
|
8691
8701
|
const short = parts[0].trim();
|
|
8692
8702
|
return short.length > 20 ? `${short.slice(0, 20)}...` : short;
|
|
8693
8703
|
}
|
|
8704
|
+
/**
|
|
8705
|
+
* What to show the matcher once the prospect has taken up something the matcher offered.
|
|
8706
|
+
*
|
|
8707
|
+
* The two routes leave the same shape behind — an accepted location and time — so the
|
|
8708
|
+
* status fields alone cannot say who agreed to what. Read as though it were the other
|
|
8709
|
+
* route, this one announced "Client has ACCEPTED …", which is the wrong party: on this
|
|
8710
|
+
* route the client was told, not asked, and it is the prospect who accepted.
|
|
8711
|
+
*/
|
|
8712
|
+
function buildMatcherProposedText(s) {
|
|
8713
|
+
const lines = [];
|
|
8714
|
+
const loc = s.location?.trim() || '';
|
|
8715
|
+
const timeParts = [s.time, s.day, s.date].filter((v) => v && v !== 'unknown').join(', ');
|
|
8716
|
+
if (loc && (s.locationStatus === 'accepted' || s.locationStatus === 'auto_accepted')) {
|
|
8717
|
+
lines.push(`Prospect ACCEPTED your location: ${loc}`);
|
|
8718
|
+
}
|
|
8719
|
+
if (timeParts && s.timeStatus === 'accepted') {
|
|
8720
|
+
lines.push(`Prospect ACCEPTED your time: ${timeParts}`);
|
|
8721
|
+
}
|
|
8722
|
+
// Marked as the matcher's but nothing agreed yet — the offer is still with the prospect.
|
|
8723
|
+
if (lines.length === 0) {
|
|
8724
|
+
return 'Awaiting the prospect on your suggestion';
|
|
8725
|
+
}
|
|
8726
|
+
return lines.join(' | ');
|
|
8727
|
+
}
|
|
8694
8728
|
function buildSplitSuggestionText(s) {
|
|
8729
|
+
// The matcher-proposed route has its own wording and shares none of the logic below.
|
|
8730
|
+
if (s.proposedBy === 'matcher')
|
|
8731
|
+
return buildMatcherProposedText(s);
|
|
8695
8732
|
const lines = [];
|
|
8696
8733
|
const locStatus = s.locationStatus;
|
|
8697
8734
|
const timeStatus = s.timeStatus;
|