Description
Creators currently have no structured follow-up strategy for overdue invoices beyond manually resending the invoice link. This issue implements a configurable reminder escalation flow where creators define a sequence of reminder actions (email notification, activity feed alert, on-chain memo notification) at intervals after the due date, and the system automatically executes each step. The escalation state is visible on the invoice page and can be paused or cancelled by the creator.
Technical Context
Create components/invoice/EscalationFlowBuilder.tsx on the invoice detail page allowing creators to add escalation steps with { delayDays, channels: ('email'|'feed'|'memo')[], message }. Persist the escalation config in the invoice record via PATCH /api/invoices/[id]. Implement app/api/cron/escalation/route.ts as a Next.js Cron Route (or Vercel Cron) that runs daily, queries overdue invoices with active escalation flows, computes which steps are due, and dispatches them. Email dispatch uses nodemailer or Resend SDK. On-chain memo notifications use a zero-amount Stellar transaction with memo text to the payer's address. Track each dispatched step in an EscalationLog table. Surface escalation status on app/invoice/[id]/page.tsx as a timeline showing past and upcoming steps.
Acceptance Criteria
Description
Creators currently have no structured follow-up strategy for overdue invoices beyond manually resending the invoice link. This issue implements a configurable reminder escalation flow where creators define a sequence of reminder actions (email notification, activity feed alert, on-chain memo notification) at intervals after the due date, and the system automatically executes each step. The escalation state is visible on the invoice page and can be paused or cancelled by the creator.
Technical Context
Create
components/invoice/EscalationFlowBuilder.tsxon the invoice detail page allowing creators to add escalation steps with{ delayDays, channels: ('email'|'feed'|'memo')[], message }. Persist the escalation config in the invoice record viaPATCH /api/invoices/[id]. Implementapp/api/cron/escalation/route.tsas a Next.js Cron Route (or Vercel Cron) that runs daily, queries overdue invoices with active escalation flows, computes which steps are due, and dispatches them. Email dispatch usesnodemaileror Resend SDK. On-chain memo notifications use a zero-amount Stellar transaction with memo text to the payer's address. Track each dispatched step in anEscalationLogtable. Surface escalation status onapp/invoice/[id]/page.tsxas a timeline showing past and upcoming steps.Acceptance Criteria
EscalationLogwith status (success/failure), channel, timestamp, and any error message