@peopl-health/nexus 5.51.0-dev.7631 → 5.51.0-dev.7632

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.
@@ -104,13 +104,14 @@ async function handler(args = {}, context = {}) {
104
104
  }
105
105
  try {
106
106
  const observedAt = runtime.patientInput?.observedAt;
107
+ if (typeof observedAt !== 'string' || Number.isNaN(new Date(observedAt).getTime())) {
108
+ return JSON.stringify({ success: false, error: 'support_routing_source_time_missing', data: {} });
109
+ }
107
110
  const recommendation = new SupportRoutingRecommendation({
108
111
  patientId: runtime.patientCode,
109
112
  origin: 'chat',
110
113
  sourceId: runtime.turnId,
111
- createdAt: typeof observedAt === 'string' && !Number.isNaN(new Date(observedAt).getTime())
112
- ? new Date(observedAt).toISOString()
113
- : new Date().toISOString(),
114
+ createdAt: new Date(observedAt).toISOString(),
114
115
  decisions: (args.decisions || []).map((decision) => normalizedDecision(decision, runtime.turnId)),
115
116
  });
116
117
  if (!isRuntimeLive(runtime)) return inactiveTurn();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "5.51.0-dev.7631",
3
+ "version": "5.51.0-dev.7632",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",