@qcobro/common 1.39.0 → 1.39.3

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.
@@ -1,22 +1,31 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * A gestión answers up to three independent questions, one per axis. They were previously
4
- * flattened into a single `outcome` enum, which is why no value meant one thing: `WRONG_NUMBER`
5
- * described both a carrier rejection (a delivery failure) and a human saying "that's not me"
6
- * (a delivery *success* carrying a valuable finding), and `OTHER` served as dispatch
7
- * placeholder, escalation marker, and unclassifiable-conversation catch-all at once.
4
+ * flattened into a single enum (then also confusingly called `outcome`, before the axis
5
+ * split introduced `resultado` since renamed to today's `outcome` below, a coincidence of
6
+ * naming across two unrelated eras, not the same field), which is why no value meant one
7
+ * thing: `WRONG_NUMBER` described both a carrier rejection (a delivery failure) and a human
8
+ * saying "that's not me" (a delivery *success* carrying a valuable finding), and `OTHER`
9
+ * served as dispatch placeholder, escalation marker, and unclassifiable-conversation
10
+ * catch-all at once.
8
11
  */
9
12
  /** Did the attempt reach the account holder's device or inbox? Never null. */
10
- export declare const entregaSchema: z.ZodEnum<{
13
+ export declare const deliverySchema: z.ZodEnum<{
11
14
  DISPATCHED: "DISPATCHED";
12
15
  DELIVERED: "DELIVERED";
13
16
  FAILED: "FAILED";
14
17
  }>;
15
- export type Entrega = z.infer<typeof entregaSchema>;
18
+ export type Delivery = z.infer<typeof deliverySchema>;
16
19
  /**
17
- * Why delivery failed. Set if and only if `entrega` is `FAILED`. The values are chosen so a
20
+ * Why delivery failed. Set if and only if `delivery` is `FAILED`. The values are chosen so a
18
21
  * retry policy can branch on them: `NO_ANSWER` and `BUSY` are transient, `INVALID_DESTINATION`
19
22
  * and `CHANNEL_UNSUPPORTED` are permanent for that contact point.
23
+ *
24
+ * `OUTCOME_UNKNOWN` and `NOT_ORIGINATED` are voice-only, both written by the voice
25
+ * completion sweep from Fonoster's call detail record rather than a live completion
26
+ * signal: `OUTCOME_UNKNOWN` when the call connected and cleared normally but QCobro's own
27
+ * completion signal never arrived, `NOT_ORIGINATED` when the provider has no record of the
28
+ * call at all. Both are transient — the account stays eligible for a retry.
20
29
  */
21
30
  export declare const deliveryReasonSchema: z.ZodEnum<{
22
31
  NO_ANSWER: "NO_ANSWER";
@@ -26,6 +35,8 @@ export declare const deliveryReasonSchema: z.ZodEnum<{
26
35
  CHANNEL_UNSUPPORTED: "CHANNEL_UNSUPPORTED";
27
36
  INVALID_DESTINATION: "INVALID_DESTINATION";
28
37
  REJECTED: "REJECTED";
38
+ OUTCOME_UNKNOWN: "OUTCOME_UNKNOWN";
39
+ NOT_ORIGINATED: "NOT_ORIGINATED";
29
40
  }>;
30
41
  export type DeliveryReason = z.infer<typeof deliveryReasonSchema>;
31
42
  /**
@@ -34,17 +45,17 @@ export type DeliveryReason = z.infer<typeof deliveryReasonSchema>;
34
45
  * `VOICEMAIL` is reachable only on `VOICE_AI` and needs AMD before it can actually be
35
46
  * detected (issue #83); it is defined now so the enum needs no second migration later.
36
47
  */
37
- export declare const caminoSchema: z.ZodEnum<{
48
+ export declare const pathSchema: z.ZodEnum<{
38
49
  ENGAGED: "ENGAGED";
39
50
  ABANDONED: "ABANDONED";
40
51
  VOICEMAIL: "VOICEMAIL";
41
52
  }>;
42
- export type Camino = z.infer<typeof caminoSchema>;
53
+ export type Path = z.infer<typeof pathSchema>;
43
54
  /**
44
55
  * What came of the engagement. Nullable and single-valued; null is the common case and means
45
56
  * nothing came of it, which is a real and frequent answer rather than missing data.
46
57
  */
47
- export declare const resultadoSchema: z.ZodEnum<{
58
+ export declare const outcomeSchema: z.ZodEnum<{
48
59
  PAYMENT_PROMISE: "PAYMENT_PROMISE";
49
60
  NEW_TERMS: "NEW_TERMS";
50
61
  PAID: "PAID";
@@ -56,15 +67,15 @@ export declare const resultadoSchema: z.ZodEnum<{
56
67
  WRONG_PARTY: "WRONG_PARTY";
57
68
  RESOLVED: "RESOLVED";
58
69
  }>;
59
- export type Resultado = z.infer<typeof resultadoSchema>;
70
+ export type Outcome = z.infer<typeof outcomeSchema>;
60
71
  /**
61
- * Channels with an inbound path, and therefore the only ones that can observe a `camino` or
62
- * produce a `resultado`. `SMS` has no inbound ingestion at all, so both axes are not merely
72
+ * Channels with an inbound path, and therefore the only ones that can observe a `path` or
73
+ * produce an `outcome`. `SMS` has no inbound ingestion at all, so both axes are not merely
63
74
  * usually-null there — they are unreachable. `VOICE_PRERECORDED` is the one exception: it has
64
75
  * no inbound path of its own, but reaching call completion (the script played to the end,
65
76
  * with or without an optional DTMF menu — see `prerecorded-audio`) always sets
66
- * `camino: ENGAGED`, and the opt-out digit specifically also sets `resultado: OPT_OUT` — no
67
- * other camino/resultado value is reachable. See {@link isAllowedOnPrerecorded} for that
77
+ * `path: ENGAGED`, and the opt-out digit specifically also sets `outcome: OPT_OUT` — no
78
+ * other path/outcome value is reachable. See {@link isAllowedOnPrerecorded} for that
68
79
  * narrow carve-out.
69
80
  */
70
81
  export declare const CHANNEL_CAN_ENGAGE: readonly ["VOICE_AI", "EMAIL", "WHATSAPP"];
@@ -91,17 +102,6 @@ export declare const paymentPromiseStatusSchema: z.ZodEnum<{
91
102
  CANCELLED: "CANCELLED";
92
103
  }>;
93
104
  export type PaymentPromiseStatus = z.infer<typeof paymentPromiseStatusSchema>;
94
- /**
95
- * The axes are independent, but two combinations are incoherent rather than merely unusual,
96
- * so they are rejected before the write rather than stored and worked around by every reader:
97
- *
98
- * - a failure reason without a failure (or a failure without a reason) — the reason is the
99
- * only thing that makes `FAILED` actionable;
100
- * - an interaction recorded on a channel that cannot observe one.
101
- *
102
- * Note there is deliberately no rule tying `resultado` to `entrega`: a `FAILED` delivery can
103
- * still carry a `resultado` when someone answers and hangs up on a wrong-party identification.
104
- */
105
105
  export declare const createContactLogSchema: z.ZodObject<{
106
106
  portfolioAccountId: z.ZodString;
107
107
  campaignId: z.ZodOptional<z.ZodString>;
@@ -116,7 +116,7 @@ export declare const createContactLogSchema: z.ZodObject<{
116
116
  }>;
117
117
  contactedAt: z.ZodString;
118
118
  durationSeconds: z.ZodOptional<z.ZodNumber>;
119
- entrega: z.ZodDefault<z.ZodEnum<{
119
+ delivery: z.ZodDefault<z.ZodEnum<{
120
120
  DISPATCHED: "DISPATCHED";
121
121
  DELIVERED: "DELIVERED";
122
122
  FAILED: "FAILED";
@@ -129,13 +129,15 @@ export declare const createContactLogSchema: z.ZodObject<{
129
129
  CHANNEL_UNSUPPORTED: "CHANNEL_UNSUPPORTED";
130
130
  INVALID_DESTINATION: "INVALID_DESTINATION";
131
131
  REJECTED: "REJECTED";
132
+ OUTCOME_UNKNOWN: "OUTCOME_UNKNOWN";
133
+ NOT_ORIGINATED: "NOT_ORIGINATED";
132
134
  }>>;
133
- camino: z.ZodOptional<z.ZodEnum<{
135
+ path: z.ZodOptional<z.ZodEnum<{
134
136
  ENGAGED: "ENGAGED";
135
137
  ABANDONED: "ABANDONED";
136
138
  VOICEMAIL: "VOICEMAIL";
137
139
  }>>;
138
- resultado: z.ZodOptional<z.ZodEnum<{
140
+ outcome: z.ZodOptional<z.ZodEnum<{
139
141
  PAYMENT_PROMISE: "PAYMENT_PROMISE";
140
142
  NEW_TERMS: "NEW_TERMS";
141
143
  PAID: "PAID";
@@ -165,6 +167,81 @@ export declare const createContactLogSchema: z.ZodObject<{
165
167
  providerMessageId: z.ZodOptional<z.ZodString>;
166
168
  }, z.core.$strip>;
167
169
  export type CreateContactLogInput = z.infer<typeof createContactLogSchema>;
170
+ /**
171
+ * REST-facing variant of {@link createContactLogSchema}. `.strict()` rejects any key that
172
+ * isn't one of the known fields — named in a `400` — rather than the base schema's default
173
+ * of silently stripping it. Internal callers (tRPC, the campaigns engine) are TypeScript-typed
174
+ * against `CreateContactLogInput` already, so a stray key there is a compile error, not
175
+ * something worth defending against at runtime; `POST /api/contact-logs` is the one boundary
176
+ * an integrator outside this codebase posts to directly. It exists specifically to catch an
177
+ * integrator still posting the pre-rename Spanish field names (`entrega`/`camino`/`resultado`)
178
+ * — silently stripped by the lenient schema, which would write a `DISPATCHED` row with no
179
+ * outcome and still answer `201`.
180
+ */
181
+ export declare const createContactLogSchemaStrict: z.ZodObject<{
182
+ portfolioAccountId: z.ZodString;
183
+ campaignId: z.ZodOptional<z.ZodString>;
184
+ agentTemplateId: z.ZodOptional<z.ZodString>;
185
+ paymentPromiseId: z.ZodOptional<z.ZodString>;
186
+ agentType: z.ZodEnum<{
187
+ SMS: "SMS";
188
+ VOICE_PRERECORDED: "VOICE_PRERECORDED";
189
+ VOICE_AI: "VOICE_AI";
190
+ EMAIL: "EMAIL";
191
+ WHATSAPP: "WHATSAPP";
192
+ }>;
193
+ contactedAt: z.ZodString;
194
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
195
+ delivery: z.ZodDefault<z.ZodEnum<{
196
+ DISPATCHED: "DISPATCHED";
197
+ DELIVERED: "DELIVERED";
198
+ FAILED: "FAILED";
199
+ }>>;
200
+ deliveryReason: z.ZodOptional<z.ZodEnum<{
201
+ NO_ANSWER: "NO_ANSWER";
202
+ BUSY: "BUSY";
203
+ UNREACHABLE: "UNREACHABLE";
204
+ PROVIDER_ERROR: "PROVIDER_ERROR";
205
+ CHANNEL_UNSUPPORTED: "CHANNEL_UNSUPPORTED";
206
+ INVALID_DESTINATION: "INVALID_DESTINATION";
207
+ REJECTED: "REJECTED";
208
+ OUTCOME_UNKNOWN: "OUTCOME_UNKNOWN";
209
+ NOT_ORIGINATED: "NOT_ORIGINATED";
210
+ }>>;
211
+ path: z.ZodOptional<z.ZodEnum<{
212
+ ENGAGED: "ENGAGED";
213
+ ABANDONED: "ABANDONED";
214
+ VOICEMAIL: "VOICEMAIL";
215
+ }>>;
216
+ outcome: z.ZodOptional<z.ZodEnum<{
217
+ PAYMENT_PROMISE: "PAYMENT_PROMISE";
218
+ NEW_TERMS: "NEW_TERMS";
219
+ PAID: "PAID";
220
+ CALLBACK_REQUESTED: "CALLBACK_REQUESTED";
221
+ DISPUTE_RAISED: "DISPUTE_RAISED";
222
+ INFORMATION_REQUEST: "INFORMATION_REQUEST";
223
+ REFUSED: "REFUSED";
224
+ OPT_OUT: "OPT_OUT";
225
+ WRONG_PARTY: "WRONG_PARTY";
226
+ RESOLVED: "RESOLVED";
227
+ }>>;
228
+ notes: z.ZodOptional<z.ZodString>;
229
+ debtAmountSnapshot: z.ZodOptional<z.ZodNumber>;
230
+ aiSummary: z.ZodOptional<z.ZodString>;
231
+ aiSentiment: z.ZodOptional<z.ZodEnum<{
232
+ POSITIVE: "POSITIVE";
233
+ NEUTRAL: "NEUTRAL";
234
+ NEGATIVE: "NEGATIVE";
235
+ HOSTILE: "HOSTILE";
236
+ }>>;
237
+ aiDebtReason: z.ZodOptional<z.ZodString>;
238
+ aiResult: z.ZodOptional<z.ZodString>;
239
+ aiNextStep: z.ZodOptional<z.ZodString>;
240
+ intentMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
241
+ channelData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
242
+ providerRef: z.ZodOptional<z.ZodString>;
243
+ providerMessageId: z.ZodOptional<z.ZodString>;
244
+ }, z.core.$strict>;
168
245
  /**
169
246
  * Input to reserve a campaign attempt before the provider call (the engine's
170
247
  * at-most-once step). Increments the attempt counters; writes no gestión.
@@ -1 +1 @@
1
- {"version":3,"file":"contactLog.d.ts","sourceRoot":"","sources":["../../src/schemas/contactLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;GAMG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,aAAa;;;;EAAgD,CAAC;AAC3E,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;EAQ/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AA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;AAyF9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA2D,CAAC;AAC/F,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEL,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;iBAK/B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;;;;;iBAGrC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEnF;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -2,17 +2,26 @@ import { z } from "zod";
2
2
  import { agentTypeSchema } from "./agentTemplates.js";
3
3
  /**
4
4
  * A gestión answers up to three independent questions, one per axis. They were previously
5
- * flattened into a single `outcome` enum, which is why no value meant one thing: `WRONG_NUMBER`
6
- * described both a carrier rejection (a delivery failure) and a human saying "that's not me"
7
- * (a delivery *success* carrying a valuable finding), and `OTHER` served as dispatch
8
- * placeholder, escalation marker, and unclassifiable-conversation catch-all at once.
5
+ * flattened into a single enum (then also confusingly called `outcome`, before the axis
6
+ * split introduced `resultado` since renamed to today's `outcome` below, a coincidence of
7
+ * naming across two unrelated eras, not the same field), which is why no value meant one
8
+ * thing: `WRONG_NUMBER` described both a carrier rejection (a delivery failure) and a human
9
+ * saying "that's not me" (a delivery *success* carrying a valuable finding), and `OTHER`
10
+ * served as dispatch placeholder, escalation marker, and unclassifiable-conversation
11
+ * catch-all at once.
9
12
  */
10
13
  /** Did the attempt reach the account holder's device or inbox? Never null. */
11
- export const entregaSchema = z.enum(["DISPATCHED", "DELIVERED", "FAILED"]);
14
+ export const deliverySchema = z.enum(["DISPATCHED", "DELIVERED", "FAILED"]);
12
15
  /**
13
- * Why delivery failed. Set if and only if `entrega` is `FAILED`. The values are chosen so a
16
+ * Why delivery failed. Set if and only if `delivery` is `FAILED`. The values are chosen so a
14
17
  * retry policy can branch on them: `NO_ANSWER` and `BUSY` are transient, `INVALID_DESTINATION`
15
18
  * and `CHANNEL_UNSUPPORTED` are permanent for that contact point.
19
+ *
20
+ * `OUTCOME_UNKNOWN` and `NOT_ORIGINATED` are voice-only, both written by the voice
21
+ * completion sweep from Fonoster's call detail record rather than a live completion
22
+ * signal: `OUTCOME_UNKNOWN` when the call connected and cleared normally but QCobro's own
23
+ * completion signal never arrived, `NOT_ORIGINATED` when the provider has no record of the
24
+ * call at all. Both are transient — the account stays eligible for a retry.
16
25
  */
17
26
  export const deliveryReasonSchema = z.enum([
18
27
  "NO_ANSWER",
@@ -21,7 +30,9 @@ export const deliveryReasonSchema = z.enum([
21
30
  "PROVIDER_ERROR",
22
31
  "CHANNEL_UNSUPPORTED",
23
32
  "INVALID_DESTINATION",
24
- "REJECTED"
33
+ "REJECTED",
34
+ "OUTCOME_UNKNOWN",
35
+ "NOT_ORIGINATED"
25
36
  ]);
26
37
  /**
27
38
  * What path the interaction took once delivered. Null when no interaction was observed —
@@ -29,12 +40,12 @@ export const deliveryReasonSchema = z.enum([
29
40
  * `VOICEMAIL` is reachable only on `VOICE_AI` and needs AMD before it can actually be
30
41
  * detected (issue #83); it is defined now so the enum needs no second migration later.
31
42
  */
32
- export const caminoSchema = z.enum(["ENGAGED", "ABANDONED", "VOICEMAIL"]);
43
+ export const pathSchema = z.enum(["ENGAGED", "ABANDONED", "VOICEMAIL"]);
33
44
  /**
34
45
  * What came of the engagement. Nullable and single-valued; null is the common case and means
35
46
  * nothing came of it, which is a real and frequent answer rather than missing data.
36
47
  */
37
- export const resultadoSchema = z.enum([
48
+ export const outcomeSchema = z.enum([
38
49
  "PAYMENT_PROMISE",
39
50
  "NEW_TERMS",
40
51
  "PAID",
@@ -47,13 +58,13 @@ export const resultadoSchema = z.enum([
47
58
  "RESOLVED"
48
59
  ]);
49
60
  /**
50
- * Channels with an inbound path, and therefore the only ones that can observe a `camino` or
51
- * produce a `resultado`. `SMS` has no inbound ingestion at all, so both axes are not merely
61
+ * Channels with an inbound path, and therefore the only ones that can observe a `path` or
62
+ * produce an `outcome`. `SMS` has no inbound ingestion at all, so both axes are not merely
52
63
  * usually-null there — they are unreachable. `VOICE_PRERECORDED` is the one exception: it has
53
64
  * no inbound path of its own, but reaching call completion (the script played to the end,
54
65
  * with or without an optional DTMF menu — see `prerecorded-audio`) always sets
55
- * `camino: ENGAGED`, and the opt-out digit specifically also sets `resultado: OPT_OUT` — no
56
- * other camino/resultado value is reachable. See {@link isAllowedOnPrerecorded} for that
66
+ * `path: ENGAGED`, and the opt-out digit specifically also sets `outcome: OPT_OUT` — no
67
+ * other path/outcome value is reachable. See {@link isAllowedOnPrerecorded} for that
57
68
  * narrow carve-out.
58
69
  */
59
70
  export const CHANNEL_CAN_ENGAGE = ["VOICE_AI", "EMAIL", "WHATSAPP"];
@@ -61,18 +72,18 @@ export const CHANNEL_CAN_ENGAGE = ["VOICE_AI", "EMAIL", "WHATSAPP"];
61
72
  export function channelCanEngage(agentType) {
62
73
  return CHANNEL_CAN_ENGAGE.includes(agentType);
63
74
  }
64
- const PRERECORDED_ALLOWED_CAMINO = new Set(["ENGAGED"]);
65
- const PRERECORDED_ALLOWED_RESULTADO = new Set(["OPT_OUT"]);
75
+ const PRERECORDED_ALLOWED_PATH = new Set(["ENGAGED"]);
76
+ const PRERECORDED_ALLOWED_OUTCOME = new Set(["OPT_OUT"]);
66
77
  /**
67
78
  * `VOICE_PRERECORDED`'s one carve-out from {@link channelCanEngage}: call completion sets
68
- * `camino: ENGAGED`, and the opt-out digit specifically also sets `resultado: OPT_OUT` — and
69
- * nothing else. `ABANDONED`/`VOICEMAIL` and every other `resultado` value stay unreachable,
79
+ * `path: ENGAGED`, and the opt-out digit specifically also sets `outcome: OPT_OUT` — and
80
+ * nothing else. `ABANDONED`/`VOICEMAIL` and every other `outcome` value stay unreachable,
70
81
  * exactly as for any other one-way channel.
71
82
  */
72
83
  function isAllowedOnPrerecorded(field, value) {
73
- return field === "camino"
74
- ? PRERECORDED_ALLOWED_CAMINO.has(value)
75
- : PRERECORDED_ALLOWED_RESULTADO.has(value);
84
+ return field === "path"
85
+ ? PRERECORDED_ALLOWED_PATH.has(value)
86
+ : PRERECORDED_ALLOWED_OUTCOME.has(value);
76
87
  }
77
88
  export const aiSentimentSchema = z.enum(["POSITIVE", "NEUTRAL", "NEGATIVE", "HOSTILE"]);
78
89
  /**
@@ -94,10 +105,10 @@ const createContactLogFields = z.object({
94
105
  contactedAt: z.string().min(1),
95
106
  durationSeconds: z.number().int().nonnegative().optional(),
96
107
  /** Defaults to the dispatch-time state, so a dispatch call site need not spell it out. */
97
- entrega: entregaSchema.default("DISPATCHED"),
108
+ delivery: deliverySchema.default("DISPATCHED"),
98
109
  deliveryReason: deliveryReasonSchema.optional(),
99
- camino: caminoSchema.optional(),
100
- resultado: resultadoSchema.optional(),
110
+ path: pathSchema.optional(),
111
+ outcome: outcomeSchema.optional(),
101
112
  notes: z.string().optional(),
102
113
  debtAmountSnapshot: z.number().nonnegative().optional(),
103
114
  aiSummary: z.string().optional(),
@@ -130,26 +141,26 @@ const createContactLogFields = z.object({
130
141
  * only thing that makes `FAILED` actionable;
131
142
  * - an interaction recorded on a channel that cannot observe one.
132
143
  *
133
- * Note there is deliberately no rule tying `resultado` to `entrega`: a `FAILED` delivery can
134
- * still carry a `resultado` when someone answers and hangs up on a wrong-party identification.
144
+ * Note there is deliberately no rule tying `outcome` to `delivery`: a `FAILED` delivery can
145
+ * still carry an `outcome` when someone answers and hangs up on a wrong-party identification.
135
146
  */
136
- export const createContactLogSchema = createContactLogFields.superRefine((value, ctx) => {
137
- if (value.entrega === "FAILED" && !value.deliveryReason) {
147
+ function refineContactLogAxes(value, ctx) {
148
+ if (value.delivery === "FAILED" && !value.deliveryReason) {
138
149
  ctx.addIssue({
139
150
  code: "custom",
140
151
  path: ["deliveryReason"],
141
- message: "deliveryReason is required when entrega is FAILED"
152
+ message: "deliveryReason is required when delivery is FAILED"
142
153
  });
143
154
  }
144
- if (value.entrega !== "FAILED" && value.deliveryReason) {
155
+ if (value.delivery !== "FAILED" && value.deliveryReason) {
145
156
  ctx.addIssue({
146
157
  code: "custom",
147
158
  path: ["deliveryReason"],
148
- message: `deliveryReason is only valid when entrega is FAILED (got ${value.entrega})`
159
+ message: `deliveryReason is only valid when delivery is FAILED (got ${value.delivery})`
149
160
  });
150
161
  }
151
162
  if (!channelCanEngage(value.agentType)) {
152
- for (const field of ["camino", "resultado"]) {
163
+ for (const field of ["path", "outcome"]) {
153
164
  const fieldValue = value[field];
154
165
  if (!fieldValue)
155
166
  continue;
@@ -163,7 +174,22 @@ export const createContactLogSchema = createContactLogFields.superRefine((value,
163
174
  });
164
175
  }
165
176
  }
166
- });
177
+ }
178
+ export const createContactLogSchema = createContactLogFields.superRefine(refineContactLogAxes);
179
+ /**
180
+ * REST-facing variant of {@link createContactLogSchema}. `.strict()` rejects any key that
181
+ * isn't one of the known fields — named in a `400` — rather than the base schema's default
182
+ * of silently stripping it. Internal callers (tRPC, the campaigns engine) are TypeScript-typed
183
+ * against `CreateContactLogInput` already, so a stray key there is a compile error, not
184
+ * something worth defending against at runtime; `POST /api/contact-logs` is the one boundary
185
+ * an integrator outside this codebase posts to directly. It exists specifically to catch an
186
+ * integrator still posting the pre-rename Spanish field names (`entrega`/`camino`/`resultado`)
187
+ * — silently stripped by the lenient schema, which would write a `DISPATCHED` row with no
188
+ * outcome and still answer `201`.
189
+ */
190
+ export const createContactLogSchemaStrict = createContactLogFields
191
+ .strict()
192
+ .superRefine(refineContactLogAxes);
167
193
  /**
168
194
  * Input to reserve a campaign attempt before the provider call (the engine's
169
195
  * at-most-once step). Increments the attempt counters; writes no gestión.
@@ -1 +1 @@
1
- {"version":3,"file":"contactLog.js","sourceRoot":"","sources":["../../src/schemas/contactLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;GAMG;AAEH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG3E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,WAAW;IACX,MAAM;IACN,aAAa;IACb,gBAAgB;IAChB,qBAAqB;IACrB,qBAAqB;IACrB,UAAU;CACX,CAAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAG1E;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IACpC,iBAAiB;IACjB,WAAW;IACX,MAAM;IACN,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,SAAS;IACT,SAAS;IACT,aAAa;IACb,UAAU;CACX,CAAC,CAAC;AAGH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAE7E,oEAAoE;AACpE,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAQ,kBAAwC,CAAC,QAAQ,CA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;CACtB,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;CACrC,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACnC,CAAC,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * The structured decision the EMAIL/WHATSAPP autopilots return for an inbound reply.
4
- * Validated so a model can't drive the loop with malformed output. `resultado` mirrors the
5
- * contact-log resultado axis; `objective` carries promise details when the reply implies one.
4
+ * Validated so a model can't drive the loop with malformed output. `outcome` mirrors the
5
+ * contact-log outcome axis; `objective` carries promise details when the reply implies one.
6
6
  *
7
- * `replyBody`/`resultado`/`objective` use `.nullish()`, not `.optional()`: Gemini's
7
+ * `replyBody`/`outcome`/`objective` use `.nullish()`, not `.optional()`: Gemini's
8
8
  * `responseMimeType: "application/json"` mode fills every key it considered rather than
9
- * omitting the ones that don't apply, so a plain reply with no resultado comes back as
10
- * `"resultado": null` (not an absent key) — `.optional()` alone rejects that.
9
+ * omitting the ones that don't apply, so a plain reply with no outcome comes back as
10
+ * `"outcome": null` (not an absent key) — `.optional()` alone rejects that.
11
11
  */
12
12
  export declare const emailAutopilotDecisionSchema: z.ZodObject<{
13
13
  action: z.ZodEnum<{
@@ -17,7 +17,7 @@ export declare const emailAutopilotDecisionSchema: z.ZodObject<{
17
17
  escalate: "escalate";
18
18
  }>;
19
19
  replyBody: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
- resultado: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ outcome: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
21
  objective: z.ZodOptional<z.ZodNullable<z.ZodObject<{
22
22
  amount: z.ZodOptional<z.ZodNumber>;
23
23
  dueDate: z.ZodOptional<z.ZodString>;
@@ -1,18 +1,18 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * The structured decision the EMAIL/WHATSAPP autopilots return for an inbound reply.
4
- * Validated so a model can't drive the loop with malformed output. `resultado` mirrors the
5
- * contact-log resultado axis; `objective` carries promise details when the reply implies one.
4
+ * Validated so a model can't drive the loop with malformed output. `outcome` mirrors the
5
+ * contact-log outcome axis; `objective` carries promise details when the reply implies one.
6
6
  *
7
- * `replyBody`/`resultado`/`objective` use `.nullish()`, not `.optional()`: Gemini's
7
+ * `replyBody`/`outcome`/`objective` use `.nullish()`, not `.optional()`: Gemini's
8
8
  * `responseMimeType: "application/json"` mode fills every key it considered rather than
9
- * omitting the ones that don't apply, so a plain reply with no resultado comes back as
10
- * `"resultado": null` (not an absent key) — `.optional()` alone rejects that.
9
+ * omitting the ones that don't apply, so a plain reply with no outcome comes back as
10
+ * `"outcome": null` (not an absent key) — `.optional()` alone rejects that.
11
11
  */
12
12
  export const emailAutopilotDecisionSchema = z.object({
13
13
  action: z.enum(["reply", "ignore", "resolve", "escalate"]),
14
14
  replyBody: z.string().nullish(),
15
- resultado: z.string().nullish(),
15
+ outcome: z.string().nullish(),
16
16
  objective: z
17
17
  .object({
18
18
  amount: z.number().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/schemas/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,MAAM,EAA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,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC"}
@@ -35,7 +35,7 @@ export type VoiceConversationEvent = z.infer<typeof voiceConversationEventSchema
35
35
  * `answered` says the callee picked up, `scriptCompleted` says the message actually
36
36
  * played out to the end. A call can be answered and play nothing — a network element
37
37
  * that answers and clears immediately, or a session that dies mid-verb — and only the
38
- * pair distinguishes that from a real delivery. `entrega` is DELIVERED only when both
38
+ * pair distinguishes that from a real delivery. `delivery` is DELIVERED only when both
39
39
  * hold; see `recordPrerecordedOutcome`.
40
40
  *
41
41
  * `scriptCompleted` is never a claim that a human listened, only that we played it.
@@ -46,6 +46,13 @@ export type VoiceConversationEvent = z.infer<typeof voiceConversationEventSchema
46
46
  * when the script did not play — the time on the line is real either way.
47
47
  * `scriptDurationSeconds` is the nominal length of the synthesized clip, stored so a
48
48
  * future report can compare it against the answered duration.
49
+ *
50
+ * `recordingFile` is the name Fonoster recorded the call under, derived from the voice
51
+ * request (see `recordingFileNameForCall`). Only the name is carried, not a URL: the
52
+ * console composes the URL on read from the deployment's `recordingBaseUrl`, so moving
53
+ * the recordings host fixes every historical gestión rather than only later ones. Voz IA
54
+ * reports a whole URL instead — the autopilot runs inside Fonoster and already knows the
55
+ * base; here we do not, so we report the half we do know.
49
56
  */
50
57
  export declare const prerecordedCompletionSchema: z.ZodObject<{
51
58
  providerRef: z.ZodString;
@@ -53,6 +60,7 @@ export declare const prerecordedCompletionSchema: z.ZodObject<{
53
60
  scriptCompleted: z.ZodDefault<z.ZodBoolean>;
54
61
  answeredSeconds: z.ZodNumber;
55
62
  scriptDurationSeconds: z.ZodOptional<z.ZodNumber>;
63
+ recordingFile: z.ZodOptional<z.ZodString>;
56
64
  at: z.ZodString;
57
65
  }, z.core.$strip>;
58
66
  export type PrerecordedCompletionInput = z.infer<typeof prerecordedCompletionSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"voiceEvent.d.ts","sourceRoot":"","sources":["../../src/schemas/voiceEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;EAAyD,CAAC;AAC3F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,wCAAoC,CAAC;AAExE,eAAO,MAAM,4BAA4B;;;;;;;;;;;iBAQvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,2BAA2B;;;;;;;iBAOtC,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC;;;;;iBAK5C,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAEjG,uFAAuF;AACvF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,GAC9D,cAAc,EAAE,CAQlB"}
1
+ {"version":3,"file":"voiceEvent.d.ts","sourceRoot":"","sources":["../../src/schemas/voiceEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;EAAyD,CAAC;AAC3F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,wCAAoC,CAAC;AAExE,eAAO,MAAM,4BAA4B;;;;;;;;;;;iBAQvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;iBAQtC,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC;;;;;iBAK5C,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAEjG,uFAAuF;AACvF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,GAC9D,cAAc,EAAE,CAQlB"}
@@ -27,7 +27,7 @@ export const voiceConversationEventSchema = z.object({
27
27
  * `answered` says the callee picked up, `scriptCompleted` says the message actually
28
28
  * played out to the end. A call can be answered and play nothing — a network element
29
29
  * that answers and clears immediately, or a session that dies mid-verb — and only the
30
- * pair distinguishes that from a real delivery. `entrega` is DELIVERED only when both
30
+ * pair distinguishes that from a real delivery. `delivery` is DELIVERED only when both
31
31
  * hold; see `recordPrerecordedOutcome`.
32
32
  *
33
33
  * `scriptCompleted` is never a claim that a human listened, only that we played it.
@@ -38,6 +38,13 @@ export const voiceConversationEventSchema = z.object({
38
38
  * when the script did not play — the time on the line is real either way.
39
39
  * `scriptDurationSeconds` is the nominal length of the synthesized clip, stored so a
40
40
  * future report can compare it against the answered duration.
41
+ *
42
+ * `recordingFile` is the name Fonoster recorded the call under, derived from the voice
43
+ * request (see `recordingFileNameForCall`). Only the name is carried, not a URL: the
44
+ * console composes the URL on read from the deployment's `recordingBaseUrl`, so moving
45
+ * the recordings host fixes every historical gestión rather than only later ones. Voz IA
46
+ * reports a whole URL instead — the autopilot runs inside Fonoster and already knows the
47
+ * base; here we do not, so we report the half we do know.
41
48
  */
42
49
  export const prerecordedCompletionSchema = z.object({
43
50
  providerRef: z.string().min(1),
@@ -45,6 +52,7 @@ export const prerecordedCompletionSchema = z.object({
45
52
  scriptCompleted: z.boolean().default(false),
46
53
  answeredSeconds: z.number().int().nonnegative(),
47
54
  scriptDurationSeconds: z.number().int().nonnegative().optional(),
55
+ recordingFile: z.string().min(1).optional(),
48
56
  at: z.string().min(1)
49
57
  });
50
58
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"voiceEvent.js","sourceRoot":"","sources":["../../src/schemas/voiceEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAG3F;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,SAAS,EAAE,oBAAoB;IAC/B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,C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AAE;IACrB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC/C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACtB,CAAC,CAAC;AASH,6EAA6E;AAC7E,MAAM,UAAU,oBAAoB,CAClC,WAA+D;IAE/D,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;aAC3E,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -22,7 +22,7 @@ export interface EvalStepResult {
22
22
  }[];
23
23
  /** EMAIL/WHATSAPP (the autopilot decision actually taken). */
24
24
  action?: EmailAutopilotAction;
25
- resultado?: string | null;
25
+ outcome?: string | null;
26
26
  }
27
27
  export interface EvalScenarioSummary {
28
28
  ref: string;
@@ -1 +1 @@
1
- {"version":3,"file":"agentEvaluations.d.ts","sourceRoot":"","sources":["../../src/types/agentEvaluations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IAC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IAC9F,sBAAsB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACpE,SAAS,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1C,WAAW,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7F,cAAc,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CACjG;AAED,wFAAwF;AACxF,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE;QACb,gBAAgB,CAAC,IAAI,EAAE;YACrB,KAAK,EAAE;gBAAE,EAAE,EAAE,MAAM,CAAC;gBAAC,YAAY,EAAE,MAAM,CAAA;aAAE,CAAC;YAC5C,OAAO,EAAE;gBACP,aAAa,EAAE,IAAI,CAAC;gBACpB,sBAAsB,EAAE,IAAI,CAAC;gBAC7B,SAAS,EAAE,IAAI,CAAC;gBAChB,WAAW,EAAE,IAAI,CAAC;gBAClB,cAAc,EAAE,IAAI,CAAC;aACtB,CAAC;SACH,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;KACnC,CAAC;CACH"}
@@ -1,6 +1,6 @@
1
1
  import type { AgentType } from "../schemas/agentTemplates.js";
2
2
  import type { CampaignStatus, CampaignPauseReason, CreateCampaignInput, UpdateCampaignInput, UpdateCampaignStatusInput, DeleteCampaignInput } from "../schemas/campaigns.js";
3
- import type { Entrega, DeliveryReason, Camino, Resultado, PaymentPromiseStatus, CreateContactLogInput, UpdatePaymentPromiseInput, FollowUpPaymentPromiseInput } from "../schemas/contactLog.js";
3
+ import type { Delivery, DeliveryReason, Path, Outcome, PaymentPromiseStatus, CreateContactLogInput, UpdatePaymentPromiseInput, FollowUpPaymentPromiseInput } from "../schemas/contactLog.js";
4
4
  export interface CampaignRecord {
5
5
  id: string;
6
6
  workspaceRef: string;
@@ -39,10 +39,10 @@ export interface AccountContactLogRecord {
39
39
  agentType: AgentType;
40
40
  contactedAt: Date;
41
41
  durationSeconds: number | null;
42
- entrega: Entrega;
42
+ delivery: Delivery;
43
43
  deliveryReason: DeliveryReason | null;
44
- camino: Camino | null;
45
- resultado: Resultado | null;
44
+ path: Path | null;
45
+ outcome: Outcome | null;
46
46
  notes: string | null;
47
47
  debtAmountSnapshot: number | null;
48
48
  aiSummary: string | null;