Label: complexity: high
Points: 200
Description
There is no SDK method to analyse how quickly payments are arriving for an invoice. This issue adds trackVelocity(address) that computes payment rate analytics across all invoices for an address, identifying fast-filling and stalled invoices.
Technical Context
Involves a new src/velocityTracker.ts. Fetch all invoices for address. For each, compute paymentsPerDay from payment timestamps. Define VelocityReport = { address: string; invoices: Array<{ invoiceId: string; paymentsPerDay: number; trend: 'accelerating' | 'steady' | 'stalling' }> }. Trend based on comparing first-half vs second-half payment rate.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
There is no SDK method to analyse how quickly payments are arriving for an invoice. This issue adds
trackVelocity(address)that computes payment rate analytics across all invoices for an address, identifying fast-filling and stalled invoices.Technical Context
Involves a new
src/velocityTracker.ts. Fetch all invoices for address. For each, computepaymentsPerDayfrom payment timestamps. DefineVelocityReport = { address: string; invoices: Array<{ invoiceId: string; paymentsPerDay: number; trend: 'accelerating' | 'steady' | 'stalling' }> }. Trend based on comparing first-half vs second-half payment rate.Acceptance Criteria
trackVelocity(address: string): Promise<VelocityReport>exportedpaymentsPerDaycomputed from actual payment timestampstrendcorrectly classified for accelerating, steady, and stalling patternsVelocityReporttype exported fromsrc/index.ts'stalling'trend for invoice with decreasing payment rateanytypes