Improve reporting: fix existing totals and evaluate new reports

Aperta
#668 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, sql

Direzione di ricerca

This is a planning issue, so agree on the scope before writing code. Start with the summary report actions in Purchasing.Mvc/Controllers/ReportController.cs and the search and aggregation queries in Purchasing.Core/Services/IndexSearchService.cs, which show where the 1,000-order cap applies. Done means full-dataset totals match SQL for sample data, exports cover the whole dataset, and workgroup scope is enforced server-side.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

People report that Purchasing's reporting is limited, but we need to turn that feedback into specific improvements. Start by making existing totals trustworthy, then choose useful additional reports with clear definitions and practical permission scopes.

Keep this as one planning issue for now. New reports below are candidates to discuss, not a committed delivery list. Do not create subissues until we have agreed on the work.

The maintainer reports that the system has run in its current form for roughly a decade, serving thousands of daily users with essentially no operational issues. Preserve that stability. Query changes, small reliability improvements, and an additional reporting index are reasonable options where they solve a concrete need.

Fixing existing totals is the first implementation priority.

The workgroup, primary-organization, and vendor summary reports currently fetch at most 1,000 matching orders from Elasticsearch and count those returned rows in application code. A warning appears at the limit, but the displayed totals can still be incomplete.

  • Calculate totals over the full authorized matching dataset, using SQL aggregation or Elasticsearch aggregation.
  • Clearly define the date basis. Current summaries show the current status of orders created during the selected period; that is different from orders completed during the period.
  • Make entered date ranges behave consistently, including the entire selected end date.
  • Use consistent outcome definitions. Successful completion should distinguish CP/CN from canceled and denied orders; IsComplete alone includes all of these.
  • Decide how historical reports include inactive workgroups and how administrative rollups are displayed without suggesting that overlapping parent/child rows can be summed.
  • Make export coverage explicit and consistent with the report. A spreadsheet containing only the displayed 1,000 rows is not a complete dataset.
  • Verify representative totals against SQL and check report scope enforcement, including workgroup IDs supplied through query parameters.

These fixes should not depend on redesigning the indexing pipeline.

The following new reports look useful. Select the initial set and agree on definitions here before implementation.

Candidate Useful result Likely data/access approach and decisions
Department backlog and aging Open orders by workgroup/status, age buckets, past-needed-date orders, and orders with no recent activity Workgroup-scoped order data. Distinguish order age, time since last activity, and time in the current stage. The first two are simpler.
Monthly request volume and outcomes Demand and completion/cancellation trends Creation-month/current-status reporting is straightforward. Completion-month throughput needs tracking events or a completion-date projection and a definition for reopened/recompleted orders.
Receiving and AP follow-up Completed orders still unreceived, partially received, or marked unpaid, grouped by workgroup or AP assignee Existing order/line data and AP assignment. These are Purchasing's recorded receipt/payment states, not verified financial-system settlement. Discuss how canceled or otherwise resolved items leave the follow-up list.
Permission maintenance Inactive members, inactive conditional approvers, missing conditional alternates, and account assignments needing review SQL configuration data. Include conditional-only assignments in user views. A null named approver can intentionally mean a workgroup pool, so it is not automatically a configuration error.
My requests Requests I created, their status, age, needed date, and receiving progress Creator-based scope may avoid enumerating every order the user can otherwise access.
Account/project allocation Requested amounts by account or chartstring A later candidate requiring more discussion. Use structured splits and allocated amounts, avoid counting the whole order against every split, and define cross-department access.

Permissions should follow the question the report answers. Existing management reports mostly resolve the departmental admin's organizations into authorized workgroups. This is much simpler than calculating every order a person can approve.

  • Department totals and backlog can use an authorized workgroup scope without reproducing all conditional-approver, away/backup, and ad hoc routing rules.
  • Creator and AP-assignee scopes can support focused personal reports.
  • Consider a separate read-only reporting role if managers or purchasers need broader reporting without departmental administration or approval authority. The audience and scope still need agreement.
  • “Which orders can I see?” and “Who can act next?” require the existing order-level access rules. A future “who has access, and why?” diagnostic should reuse those rules.
  • Order-owning workgroup, primary organization, and account-funding organization are different dimensions. Agree on which one each report represents.
  • Validate report scope on the server. Aggregate visibility, detailed order visibility, and permission to act are separate decisions.

Use Elasticsearch where it helps, with targeted improvements when justified. Most summary/timing reports already use it. SQL remains useful for current routing, permissions, and structured account splits. Simple workgroup-scoped SQL reporting does not necessarily need the expensive per-user order-access functions.

Source review raised questions about the indexer's ten-minute lookback, behavior when an update spans multiple 1,000-order batches, and unchecked bulk results. These are investigation topics, not evidence that production is routinely losing data or having outages. Evaluate actual impact before changing established behavior. Small error checks, clearer freshness information, focused update-logic fixes, or a separate reporting projection/index are options to discuss if needed. A broad migration or indexing rewrite is not required for this reporting work.

If adding Elasticsearch aggregations, apply the authorized scope to the aggregation query itself. The existing history query uses post_filter for allowed order IDs, which filters returned rows but does not restrict aggregation results.

Current reporting inventory and source findings

All eight Reports-menu entries require departmental-admin access.

Existing report Source Main limitations
Purchaser Daily Workload SQL OrderTracking and vOrderHistory Selected-day completion events plus current pending orders, not historical backlog. Text-based event matching and purchaser display-name matching complicate attribution.
Purchaser Processing Time by Workgroup opp-orderhistory plus individual SQL order/tracking reads Creation-month cohort; defaults to rerouted orders; 1,000-order cap before further filtering; uses the last reroute and parses event descriptions.
Processing Time by Workgroup opp-ordertracking Full-set indexed averages, but at most 1,000 detail/treemap records. Includes canceled/denied through IsComplete. Selecting an administrative workgroup does not expand its children.
Processing Time by Role opp-ordertracking aggregations One selected actor per role, no separate conditional-approval timing, default top-ten person buckets, and 1,000 detail rows.
Permissions SQL permissions, users, conditional-approval definitions Workgroup view includes conditional primary/secondary approvers. User view omits conditional-only assignments. It does not explain effective access to an individual order.
Order Summary by Workgroup opp-orderhistory plus SQL metadata Counts fetched rows up to 1,000. Inactive workgroups and inheritance rules affect coverage; parent/child rows overlap.
Order Summary by Primary Organization Same Same cap; attribution uses the workgroup's current primary organization rather than funding splits or historical organization.
Order Summary by Vendor Same Same cap; vendor display strings include address information and can fragment a supplier into multiple groups. Reports order counts rather than spending.

Other reporting includes order history/admin/AP lists with exports, a Workload endpoint absent from the Reports menu, single-order PDFs, and an overall statistics endpoint. History lists return at most 1,000 displayed rows. The older Workload view has no date filter and joins historical activity to current membership.

The timing index flattens events into one order record with selected approver/account-manager/purchaser actors and elapsed calendar durations. It cannot fully explain conditional approvals, repeated approvals, handoffs, or time spent waiting. Avoid treating these durations as individual labor or performance measures without discussing their meaning.

The current Aggie Enterprise financial-officer lookup returns no officer and IsExternal = false. A new external-account report cannot rely on that flag alone. Account classification and legacy/current routing behavior need discussion.

Sources reviewed at 685bc30:

These are source-level findings. Production completeness, query performance, and the frequency or impact of indexing edge cases have not been measured in this assessment.

Existing requests provide useful background and remain separate:

  • #375: department reporting for unreceived and partially received orders.
  • #354: receiving, payment, and days-without-activity reporting.
  • #413: resolving follow-up without falsely marking canceled/unfulfilled items received.
  • #301: monthly/custom-date purchaser workload.
  • #453: supervisor workload delivery and a possible weekly view.
Lingua principale
C#
Stelle
7
Fork
5
Merge medio
9h 3m
PR unite (30g)
5

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ucdavis/Purchasing

Tutte le issue di ucdavis/Purchasing

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.