Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

pending payout support

Pedro Ladeira281950e3aa41
diff --git a/apps/web/lib/ai/build-system-prompt.ts b/apps/web/lib/ai/build-system-prompt.ts
index c2cbfedca0..66725daab5 100644
--- a/apps/web/lib/ai/build-system-prompt.ts
+++ b/apps/web/lib/ai/build-system-prompt.ts
@@ -34,6 +34,15 @@ const BASE_SYSTEM_PROMPT = `
To create a support ticket: ALWAYS call requestSupportTicket first (never createSupportTicket directly). After the user submits the upload form and confirms, call createSupportTicket.
`.trim();
+const PARTNERS_PENDING_PAYOUT_PROMPT = `
+ For questions about pending payouts, payout timing, payout schedule, or when the partner will get paid:
+ 1. Call getProgramPerformance first and explain using their actual data (holding period, minimum payout threshold, payout status).
+ 2. Close with: "If you have further questions about the payout schedule, reach out to the {program name} support team at {supportEmail}." Use the supportEmail from getProgramPerformance. If supportEmail is missing, direct them to the program's help center or messaging in the partner dashboard — do not invent an email.
+ 3. End with "Do you have any other questions?" to keep the conversation open.
+ 4. Do NOT offer to create a Dub support ticket for these questions — they are program-specific.
+ Still offer a Dub support ticket when: the partner explicitly asks to speak with Dub or create a ticket.
+ `.trim();
+
function buildAccountSpecificPrompt(context: GlobalChatContext): string[] {
if (!context.accountType) return [];
@@ -64,6 +73,9 @@ export function buildSystemPrompt(globalContext?: GlobalChatContext): string {
? CONTEXT_SYSTEM_PROMPTS[globalContext?.chatLocation]
: "",
BASE_SYSTEM_PROMPT,
+ globalContext?.accountType === "partner"
+ ? PARTNERS_PENDING_PAYOUT_PROMPT
+ : "",
...accountSpecificPrompts,
].join("\n\n");