Skip to content

Add proxy REST endpoint for Estate Reporting API transaction summary #699

Description

@StuartFerguson

@## Summary
Add a REST endpoint in TransactionProcessorACL that tunnels through to the Estate Reporting API implementation in the local D:\Projects\TransactionProcessing\EstateReportingAPI codebase.

Target endpoint

  • Base route: api/reporting
  • Handler group: ReportingEndpoints
  • Method: POST
  • Route to expose:
    merchantdailyperformancesummary
  • Existing upstream alias also present:
    dailymerchaantprformancesummary

Upstream handler

group.MapPost("merchantdailyperformancesummary", ReportingHandlers.GetMerchantDailyPerformanceSummary) .WithStandardProduces<MerchantDailyPerformanceSummaryResponse>();

Example request payload

{
  "merchantReportingId": 12345,
  "startDate": "2026-07-01T00:00:00Z",
  "endDate": "2026-07-01T23:59:59Z"
}

Example response payload

{
  "metrics": [
    {
      "title": "Total Sales Count",
      "value": 6,
      "description": "All sales transactions in the range",
      "category": 0
    },
    {
      "title": "Total Sales Value",
      "value": 123.45,
      "description": "All sales value in the range",
      "category": 1
    },
    {
      "title": "Successful Sales Count",
      "value": 3,
      "description": "Authorised sales count in the range",
      "category": 2
    },
    {
      "title": "Failed Sales Count",
      "value": 3,
      "description": "Declined sales count in the range",
      "category": 4
    },
    {
      "title": "Average Sales Count",
      "value": 6,
      "description": "Average sales count per day in the range",
      "category": 6
    },
    {
      "title": "Average Sales Value",
      "value": 20.57,
      "description": "Average value per sale in the range",
      "category": 7
    },
    {
      "title": "Top Product Sales Count",
      "value": 6,
      "description": "Safaricom Contract Product",
      "category": 8
    }
  ],
  "drillDownTransactions": [
    {
      "reference": "0006",
      "product": "Safaricom Contract Product",
      "status": "Failed",
      "amount": 10.0,
      "transactionDateTime": "2026-07-01T15:00:00Z"
    }
  ]
}

Expected behavior

Expose a matching endpoint in TransactionProcessorACL that forwards requests to the Estate Reporting API transaction summary handler and returns the same response contract.

Implementation notes

  • Preserve the request/response shape used by MerchantDailyPerformanceSummary.
  • Keep the endpoint path consistent with the reporting routing conventions in TransactionProcessorACL.
  • Ensure errors from the downstream API are surfaced clearly.

Acceptance criteria

  • A client can call the new endpoint from TransactionProcessorACL.
  • The endpoint forwards to the Estate Reporting API transaction summary handler.
  • The response matches MerchantDailyPerformanceSummaryResponse.
  • Basic success and failure cases are covered by tests if the repo has test coverage for this area.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions