Skip to content

Jcs/auto populate po - #661

Open
jSylvestre wants to merge 6 commits into
masterfrom
JCS/AutoPopulatePO
Open

Jcs/auto populate po#661
jSylvestre wants to merge 6 commits into
masterfrom
JCS/AutoPopulatePO

Conversation

@jSylvestre

@jSylvestre jSylvestre commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Order reviews can automatically retrieve and save available purchase order numbers from Aggie Enterprise after authorization.
    • Organization details display the parent organization, including a link and identifier when available.
    • Updated messaging explains that Aggie Enterprise orders uploaded from PrePurchasing can be edited.
  • Bug Fixes

    • Orders without eligible details or an available purchase order number remain unchanged.
  • Updates

    • Removed the Aggie Enterprise announcement from the home page.

When an Aggie Enterprise order is in 'Complete' status, has a reference number, and is missing a PO number, attempt to retrieve the PO number from Aggie Enterprise during the order review process.
@jSylvestre
jSylvestre requested a review from srkirkland as a code owner August 3, 2026 21:56
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jSylvestre, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 13a42813-1d44-4f52-aef4-54b74bf15c30

📥 Commits

Reviewing files that changed from the base of the PR and between 48a8f67 and 572b379.

📒 Files selected for processing (1)
  • Purchasing.Mvc/Views/Help/Index.cshtml
📝 Walkthrough

Walkthrough

The change adds automatic Aggie Enterprise PO-number population during order review. It also adds parent organization details and updates Aggie Enterprise messaging in the views.

Changes

Aggie Enterprise PO population

Layer / File(s) Summary
PO lookup and persistence
Purchasing.Mvc/Services/OrderService.cs
The service validates order eligibility, retrieves and trims the PO number, emits an update event, and persists the order.
Review integration and validation
Purchasing.Mvc/Controllers/OrderController.cs, Purchasing.Tests/ServiceTests/OrderServiceTests/OrderServiceTestsMisc01.cs
The review action invokes PO population after authorization. Tests cover successful updates, missing PO numbers, and ineligible orders.

Parent organization display

Layer / File(s) Summary
Parent organization rendering
Purchasing.Mvc/Views/Organization/Details.cshtml
The view displays a parent organization link when available and n/a otherwise.

Aggie Enterprise messaging

Layer / File(s) Summary
View messaging updates
Purchasing.Mvc/Views/Home/Index.cshtml, Purchasing.Mvc/Views/Order/_ReviewSubmit.cshtml
The home-page announcement is disabled. The purchaser status message now describes editing PrePurchasing-uploaded orders.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: srkirkland

Sequence Diagram(s)

sequenceDiagram
  participant OrderController
  participant OrderService
  participant AggieEnterprise
  participant OrderPersistence
  OrderController->>OrderService: TryPopulatePoNumberFromAggieEnterprise(order)
  OrderService->>AggieEnterprise: Look up order by reference number
  AggieEnterprise-->>OrderService: Return PO number
  OrderService->>OrderPersistence: Emit update event and persist order
  OrderService-->>OrderController: Continue review
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: automatic population of purchase order numbers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch JCS/AutoPopulatePO

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Purchasing.Mvc/Services/OrderService.cs`:
- Line 663: Update the Try-based order status lookup flow around
_aggieEnterpriseService.LookupOrderStatus in OrderService to catch lookup
exceptions and return false, allowing OrderController.Review to render the order
instead of propagating a 500. Add a test covering a thrown LookupOrderStatus
failure and verify that no event is emitted and no persistence occurs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d0e8a7c-5821-468b-ba7c-44590cd8aa73

📥 Commits

Reviewing files that changed from the base of the PR and between 2487e4f and 441b5bb.

📒 Files selected for processing (4)
  • Purchasing.Mvc/Controllers/OrderController.cs
  • Purchasing.Mvc/Services/OrderService.cs
  • Purchasing.Mvc/Views/Organization/Details.cshtml
  • Purchasing.Tests/ServiceTests/OrderServiceTests/OrderServiceTestsMisc01.cs

Comment thread Purchasing.Mvc/Services/OrderService.cs Outdated
Wrap the PO number auto-population logic in a try-catch block to gracefully handle potential exceptions. If an error occurs during the Aggie Enterprise service lookup or order persistence, the process will fail silently by returning false, preventing unhandled exceptions from disrupting the application.
Remove the outdated Aggie Enterprise announcement from the homepage.
Update the purchaser status message on the order review page to reflect the August 2026 timeline for editing uploaded orders within Aggie Enterprise.
Simplify help section descriptions and update styling for improved clarity and user experience.
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.

2 participants