Skip to content

Add operator info to metrics, projections, and endpoints#566

Merged
StuartFerguson merged 2 commits into
mainfrom
bug/#565_daily_performance_changes
Jul 9, 2026
Merged

Add operator info to metrics, projections, and endpoints#566
StuartFerguson merged 2 commits into
mainfrom
bug/#565_daily_performance_changes

Conversation

@StuartFerguson

Copy link
Copy Markdown
Member
  • Added OperatorName to performance projections and queries
  • Updated MetricItem with Type property and new categories
  • Included operator in top product metric grouping/description
  • Extended DrillDownTransaction with Operator property
  • Updated TransactionHandler to format product with operator name
  • Removed duplicate/misspelled endpoint mapping
    closes Daily Performance Report Changes #565

- Added OperatorName to performance projections and queries
- Updated MetricItem with Type property and new categories
- Included operator in top product metric grouping/description
- Extended DrillDownTransaction with Operator property
- Updated TransactionHandler to format product with operator name
- Removed duplicate/misspelled endpoint mapping
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · -1 duplication

Metric Results
Complexity 0
Duplication -1

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@StuartFerguson StuartFerguson left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline review comments on the merchant daily performance changes.

public string Description { get; set; }

public Int32 Category { get; set; }
public Int32 Type { get; set; }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type is now part of the model, but it also needs to be projected through the handler and response contract. Otherwise clients still only see Category, and the new identifier is effectively dropped.

new() { Title = "Failed Sales Value", Value = failedSalesValue, Description = "Declined sales value in the range", Category = 5 },
new() { Title = "Average Sales Count", Value = averageSalesCount, Description = "Average sales count per day in the range", Category = 6 },
new() { Title = "Average Sales Value", Value = averageSalesValue, Description = "Average value per sale in the range", Category = 7 }
new() { Title = "Total Sales Count", Value = totalSalesCount, Description = "All sales transactions in the range", Category = 1, Type = 0},

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This renumbers the base metric categories, but the empty-summary path still uses the old values. The response will now emit two different category schemes depending on whether data exists.

Value = topProduct.SalesCount,
Description = topProduct.ProductName ?? "Unknown product",
Category = 8
Description = $"{topProduct.OperatorName} {topProduct.ProductName}" ?? "Unknown product",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback never triggers because the interpolated string is not null. If either name can be missing, use explicit null/empty checks on the operands instead.

from t in context.Transactions
join m in context.Merchants on t.MerchantId equals m.MerchantId
join cp in context.ContractProducts on new { t.ContractProductId, t.ContractId } equals new { cp.ContractProductId, cp.ContractId }
join op in context.Operators on t.OperatorId equals op.OperatorId

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now an inner join on operators. Any transaction without a matching operator row will disappear from the summary, which can undercount totals compared with the rest of the reporting code.

@StuartFerguson StuartFerguson merged commit 0f899e2 into main Jul 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daily Performance Report Changes

1 participant