Add operator info to metrics, projections, and endpoints#566
Conversation
- 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
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | -1 |
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
left a comment
There was a problem hiding this comment.
Inline review comments on the merchant daily performance changes.
| public string Description { get; set; } | ||
|
|
||
| public Int32 Category { get; set; } | ||
| public Int32 Type { get; set; } |
There was a problem hiding this comment.
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}, |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
closes Daily Performance Report Changes #565