#741 — Revenue calculated based on Batch table

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

Created: 2025-11-13 · Updated: 2025-12-29

Description

Refactor the /api/v1/partner/merchants/{merchant_id}/volumetrend endpoint considering changes:

AC:

  • There is a pros cons table explaining to select the best method to perform the calculation:
    • Query on the fly
    • A View in postgres
    • A materialized view in postgres
  • Data is coming from master_tables /batches
  • Optional input for aggregation method (daily, weekly, monthly) and data range
  • Matching response to previous on an active EMS merchant
  • Matching response to luqra UI on an active Luqra merchant
  • Volume calculation on the merchants table has been updated to the new calculation method

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets