#781 — Add Authorization KPIs

Repo: Twill-AI/facade State: closed | Status: done Assignee: Ahmad1809

Created: 2025-11-25 · Updated: 2025-12-23

Description

Extend DbMerchantKPI table to support authorization metrics with flexible time periods.

  • Each of the following should have values for all-time, last-30-days, last-90-days, month-to-date, last-year:

  • Total Authorizations Count

  • Total Authorization Amount

  • Total Approved Authorizations Count

  • Total Approved Amount

  • Total Declined Authorizations Count

  • Total Declined Amount

  • Approved Ratio by Count

  • Approved Ratio by Amount

  • Declined Ratio by Count

  • Declined Ratio by Amount

  • Total Processing Fees

  • Total Refund Count

  • Total Refund Amount

  • Job updates incrementally using only necessary data.

  • Return values in get merchant detail detail endpoint

  • endpoint added for master to refresh the kpis manually

Existing KPI patterns for reference: calculate metrics → bulk upload → query endpoint → background sync

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets