Skip to content

feat: expose meta column and transaction relationships in Orders report schema#207

Open
roncodes wants to merge 1 commit intomainfrom
feature/add-meta-and-transaction-to-report-schema
Open

feat: expose meta column and transaction relationships in Orders report schema#207
roncodes wants to merge 1 commit intomainfrom
feature/add-meta-and-transaction-to-report-schema

Conversation

@roncodes
Copy link
Member

Summary

This PR exposes the meta column and transaction relationships in the Orders report schema, enabling users to query and report on critical financial data and custom metadata associated with orders.

Changes Made

1. Meta Column Exposure

  • Removed meta from excludeColumns array
  • Added formal column definition for meta with JSON type
  • Enabled searchable and filterable capabilities

2. Transaction Relationship

  • Added transaction relationship with auto-join support
  • Exposed key transaction fields:
    • Transaction ID and Gateway Transaction ID
    • Payment gateway information
    • Amount (with currency formatting transformer)
    • Currency, description, type, and status
    • Transaction date

3. Nested Transaction Items

  • Added items as nested relationship under transaction
  • Exposed transaction line item fields:
    • Item amount and currency
    • Item details and codes

4. Financial Computed Columns

  • Total Transaction Amount (sum)
  • Average Transaction Amount
  • Count of Orders with Transactions

Impact

Users can now:

  • Query and filter orders by metadata fields
  • Report on transaction financial data
  • Access transaction line item details
  • Generate financial aggregates across orders
  • Build comprehensive financial reports

Technical Details

  • File modified: server/src/Support/Reporting/FleetOpsReportSchema.php
  • Lines changed: +129, -1
  • Uses existing reporting framework auto-join capabilities
  • No database migrations required (relationships already exist)
  • No UI changes required (report builder automatically adapts)

Testing Recommendations

  • Verify meta column appears in report builder
  • Test transaction relationship joins
  • Verify nested transaction items are accessible
  • Test financial aggregate calculations
  • Validate currency formatting in reports

…rt schema

- Remove 'meta' from excludeColumns to make it available in report builder
- Add meta column definition with JSON type for custom fields and metadata
- Add Transaction relationship with auto-join support for financial reporting
- Include nested TransactionItems relationship for line-item details
- Add computed columns for transaction amount aggregates (sum, avg, count)

This enables users to query and report on:
- Order metadata and custom fields
- Transaction financial data (amount, currency, gateway, status)
- Transaction line items (details, codes, amounts)
- Financial aggregates across orders

Resolves the limitation where users could not report on critical financial
data and custom metadata associated with orders.
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.

1 participant