@encatch/schema 1.2.0-beta.11 → 1.2.0-beta.13

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.
package/dist/esm/index.js CHANGED
@@ -1487,18 +1487,24 @@ var paymentsUpiAmountConfigSchema = z2.discriminatedUnion("mode", [
1487
1487
  defaultAmount: z2.number().positive().optional().describe("Optional initial amount shown to the respondent")
1488
1488
  }),
1489
1489
  z2.object({
1490
- mode: z2.literal("question_mapping").describe("Amount is resolved from a previous question answer"),
1491
- sourceQuestionId: z2.string().describe(
1492
- "ID of the prior question whose answer determines the amount"
1493
- ),
1494
- mappings: z2.array(
1490
+ mode: z2.literal("question_mappings").describe("Amount is summed from one or more previous question answers"),
1491
+ sources: z2.array(
1495
1492
  z2.object({
1496
- answerValue: z2.string().describe("Previous question answer value to match"),
1497
- amount: z2.number().positive().describe("Amount to request in INR when this answer matches"),
1498
- label: z2.string().max(120).optional().describe("Optional display label for this mapped amount")
1493
+ sourceQuestionId: z2.string().describe(
1494
+ "ID of the prior question whose answer contributes to the amount"
1495
+ ),
1496
+ mappings: z2.array(
1497
+ z2.object({
1498
+ answerValue: z2.string().describe("Previous question answer value to match"),
1499
+ amount: z2.number().nonnegative().describe(
1500
+ "Amount to add in INR when this answer is selected"
1501
+ ),
1502
+ label: z2.string().max(120).optional().describe("Optional display label for this mapped amount")
1503
+ })
1504
+ ).min(1).describe("Answer-to-amount mappings for this source question")
1499
1505
  })
1500
- ).min(1).describe("Answer-to-amount mappings"),
1501
- fallbackAmount: z2.number().positive().optional().describe("Optional amount to use when no mapping matches")
1506
+ ).min(1).describe("Previous question sources that contribute to the amount"),
1507
+ fallbackAmount: z2.number().nonnegative().optional().describe("Optional amount to use when no source mapping matches")
1502
1508
  })
1503
1509
  ]).superRefine((data, ctx) => {
1504
1510
  if (data.mode !== "range") return;
@@ -1527,6 +1533,9 @@ var paymentsUpiQuestionSchema = questionSchema.extend({
1527
1533
  amount: paymentsUpiAmountConfigSchema.describe(
1528
1534
  "How the requested INR amount is determined"
1529
1535
  ),
1536
+ sourceEmailQuestionId: z2.string().optional().describe(
1537
+ "Optional ID of the email question whose answer is used for form submission receipt emails"
1538
+ ),
1530
1539
  transactionNote: z2.string().max(80).optional().describe(
1531
1540
  "Short note included in the UPI intent; the platform may append the Encatch reference"
1532
1541
  ),
@@ -1672,6 +1681,7 @@ var PaymentsUpiAnswerSchema = z3.object({
1672
1681
  currency: z3.literal("INR").describe("Currency for UPI payments"),
1673
1682
  payeeVpa: z3.string().describe("UPI VPA shown to the respondent"),
1674
1683
  payeeName: z3.string().optional().describe("Payee display name shown to the respondent"),
1684
+ sourceEmail: z3.string().optional().describe("Email address resolved from the configured source email question"),
1675
1685
  upiIntentUri: z3.string().optional().describe("Generated UPI intent URI shown to the respondent"),
1676
1686
  selfReported: z3.literal(true).describe(
1677
1687
  "Always true: Encatch records this answer but does not verify the payment"