Skip to content

Add Merchant Settlement History report and view#569

Merged
StuartFerguson merged 3 commits intomainfrom
copilot/add-merchant-settlement-history
Jan 8, 2026
Merged

Add Merchant Settlement History report and view#569
StuartFerguson merged 3 commits intomainfrom
copilot/add-merchant-settlement-history

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 8, 2026

Adds historical settlement visibility per merchant to support queries and statement generation.

Changes

Data Model

  • MerchantSettlementHistoryModel with settlement date, unique reference, transaction count, and net amount paid
  • GetMerchantSettlementHistoryQuery supporting estate, merchant, and date range filters

Mock Data Service

  • Generates weekly settlements with unique references: STL-{yyyyMMdd}-{merchant}-{counter}
  • Transaction counts (50-500), fee calculations (1.5-2.5%), net amounts (gross - fees)
  • Reconciles with existing LastSettlementModel calculation pattern

UI Components

  • /reporting/merchant-settlement-history - Standalone report with merchant filter, date range, summary cards, and tabular view
  • Settlement History tab in /merchants/{id} view - Shows last 10 settlements with link to full report
  • Navigation link in reporting dashboard under Settlement Reporting section
// Settlement reference generation ensures uniqueness
var settlementRef = $"STL-{currentDate:yyyyMMdd}-{merchant.MerchantReference ?? merchant.MerchantId.ToString().Substring(0, 8)}-{settlementCounter:D4}";
// Example: STL-20260108-MERCHANT01-0001

// Net amount calculation compatible with settlement summary
var netAmount = grossAmount - fees;

Data Reconciliation

Settlement history uses consistent calculation with settlement summary reports:

  • Net/Settlement Amount = Gross Amount - Fees
  • Fee percentages and transaction patterns align with existing TodaysSettlementModel and LastSettlementModel
Original prompt

This section details on the original issue you should resolve

<issue_title>Issue: Merchant Settlement History</issue_title>
<issue_description>Description: Provide historical settlement visibility per merchant.
Business Value: Supports merchant queries and statement generation.

Data Requirements

  • Settlement date
  • Settlement reference
  • Transaction count
  • Net amount paid

Acceptance Criteria

  • Settlement references are unique.
  • Totals reconcile with Settlement Summary Report.
    </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 8, 2026 16:54
…page

Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add historical settlement visibility for merchants Add Merchant Settlement History report and view Jan 8, 2026
Copilot AI requested a review from StuartFerguson January 8, 2026 17:00
@StuartFerguson StuartFerguson marked this pull request as ready for review January 8, 2026 18:06
@StuartFerguson StuartFerguson merged commit 5a8fe74 into main Jan 8, 2026
4 of 5 checks passed
@github-actions github-actions Bot deleted the copilot/add-merchant-settlement-history branch March 10, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue: Merchant Settlement History

2 participants