Skip to content

Remove KFS integration and update Aggie Enterprise API#658

Open
jSylvestre wants to merge 3 commits into
masterfrom
JCS/NewAeSchema20260515
Open

Remove KFS integration and update Aggie Enterprise API#658
jSylvestre wants to merge 3 commits into
masterfrom
JCS/NewAeSchema20260515

Conversation

@jSylvestre
Copy link
Copy Markdown
Member

@jSylvestre jSylvestre commented May 15, 2026

The legacy KFS integration components (Purchasing.WS project, IFinancialSystemService) are no longer needed and have been removed. This includes the client-side KFS to AE account conversion logic, which is now expected to be handled by upstream validation or the updated Aggie Enterprise API directly.

Summary by CodeRabbit

Release Notes

  • New Features

    • Updated AggieEnterprise integration with latest API version for improved system compatibility.
  • Bug Fixes

    • Fixed financial segment handling to properly validate data before processing.
  • Refactor

    • Removed legacy Campus Financial System (KFS) integration from order processing workflows.
    • Simplified order submission to focus exclusively on AggieEnterprise processes.
  • Documentation

    • Updated in-app announcements to direct users to AggieEnterprise Updates FAQ instead of legacy system notices.

Review Change Stack

The legacy KFS integration components (Purchasing.WS project, IFinancialSystemService) are no longer needed and have been removed. This includes the client-side KFS to AE account conversion logic, which is now expected to be handled by upstream validation or the updated Aggie Enterprise API directly.
@jSylvestre jSylvestre requested a review from srkirkland as a code owner May 15, 2026 14:36
The legacy KFS integration components (Purchasing.WS project, IFinancialSystemService) are no longer needed and have been removed. This includes the client-side KFS to AE account conversion announcement, which is now obsolete as the system fully transitions to Aggie Enterprise.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@jSylvestre has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 29 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4f63987b-d9b9-40e0-8191-d279183db898

📥 Commits

Reviewing files that changed from the base of the PR and between 3c26a04 and b228bdc.

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

Walkthrough

This PR removes the Purchasing.WS project containing SOAP-based KFS (Campus Financial System) integration and updates all dependent code to use Aggie Enterprise API exclusively. The solution, project files, service contracts, and all implementations are deleted; OrderController and OrderService remove their KFS integration dependencies and logic; tests are updated to remove mocks and fixtures; and the AggieEnterpriseService adds stricter validation with exception throwing instead of fallback logic.

Changes

KFS Integration Removal and Migration to Aggie Enterprise API

Layer / File(s) Summary
Solution and project structure cleanup
Purchasing.sln, Purchasing.Mvc/Purchasing.Mvc.csproj, Purchasing.Tests/Purchasing.Tests.csproj
Solution file updated to Visual Studio 18, Purchasing.WS project removed from solution, and all project references to Purchasing.WS deleted. WCF service reference metadata files (svcmap, xsd, svcinfo) also removed.
OrderController KFS integration removal
Purchasing.Mvc/Controllers/OrderController.cs
Removed IFinancialSystemService dependency injection, commented out using directive, and replaced GetKfsStatus endpoint with null-returning stub.
OrderService KFS logic removal
Purchasing.Mvc/Services/OrderService.cs
Removed IFinancialSystemService dependency, disabled WillOrderBeSentToKfs eligibility check (returns false), and commented out entire KFS submission/reference assignment block in Complete method.
Dependency injection configuration
Purchasing.Mvc/ComponentInstaller.cs
Removed Windsor container registration for IFinancialSystemService and commented out using directive.
Test infrastructure updates
Purchasing.Tests/ControllerTests/OrderControllerTests/*, Purchasing.Tests/ServiceTests/OrderServiceTests/*, Purchasing.Tests/Purchasing.Tests.csproj
Removed Purchasing.WS using directives from all test files; removed IFinancialSystemService mock fields, initializations, and constructor arguments from test setup; removed test project reference to Purchasing.WS.
AggieEnterprise service validation
Purchasing.Core/Purchasing.Core.csproj, Purchasing.Core/Services/AggieEnterpriseService.cs
Updated AggieEnterpriseApi NuGet package from 0.2.247 to 0.3.14; replaced KFS fallback logic with exception throw when FinancialSegmentString is null/whitespace.
User-facing content
Purchasing.Mvc/Views/Home/Index.cshtml
Replaced KFS account conversion shutdown notice with Aggie Enterprise Updates FAQ link announcement.

🎯 4 (Complex) | ⏱️ ~60 minutes

🐰 A project takes its final bow,
KFS and SOAP say goodbye somehow,
Aggie Enterprise leads the way,
One system now saves the day!
✨ 📦

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove KFS integration and update Aggie Enterprise API' clearly and concisely summarizes the main changes: removal of KFS (Campus Financial System) integration and an Aggie Enterprise API version update.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch JCS/NewAeSchema20260515

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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.Core/Services/AggieEnterpriseService.cs`:
- Around line 510-513: The code currently throws a generic Exception when
split.FinancialSegmentString is null and ConvertKfsAccount silently returns
empty for non-empty input, causing misleading failures; update ConvertKfsAccount
to return a clear failure (null or a Result/Error object) or throw a specific
MigrationException when it cannot convert, and change LookupAccount to handle
missing FinancialSegmentString by returning a controlled error result instead of
throwing; then update callers such as UploadOrder and validation paths to catch
that specific failure and translate it into a user-safe SubmitResult/validation
error (do not leave a raw Exception), referencing ConvertKfsAccount,
LookupAccount, UploadOrder, validation callers and SubmitResult to locate places
to change.

In `@Purchasing.Mvc/Services/OrderService.cs`:
- Around line 586-593: The WillOrderBeSentToKfs method currently always returns
false which lets completion silently succeed for deprecated KFS order types;
restore the original guard logic in WillOrderBeSentToKfs to return true when
newOrderType.Id == OrderType.Types.KfsDocument AND
_financialSystemService.AllowedType(kfsDocType), and then update the completion
path (the Complete(...) method) to call WillOrderBeSentToKfs and, when it
indicates a KFS document that cannot/should not be submitted, prevent silent
success by throwing a clear exception (e.g., InvalidOperationException) or
returning a failure result so non-AE/KFS orders are not marked completed without
explicit external submission handling; ensure you update any callers of
Complete(...) to handle the new error/return behavior.
🪄 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

Run ID: 1c806d73-2b57-47a4-86ab-324893b6ef11

📥 Commits

Reviewing files that changed from the base of the PR and between 2487e4f and 3c26a04.

📒 Files selected for processing (53)
  • Purchasing.Core/Purchasing.Core.csproj
  • Purchasing.Core/Services/AggieEnterpriseService.cs
  • Purchasing.Mvc/ComponentInstaller.cs
  • Purchasing.Mvc/Controllers/OrderController.cs
  • Purchasing.Mvc/Purchasing.Mvc.csproj
  • Purchasing.Mvc/Services/OrderService.cs
  • Purchasing.Mvc/Views/Home/Index.cshtml
  • Purchasing.Tests/ControllerTests/OrderControllerTests/OrderControllerTestsInit.cs
  • Purchasing.Tests/ControllerTests/OrderControllerTests/OrderControllerTestsMapping.cs
  • Purchasing.Tests/ControllerTests/OrderControllerTests/OrderControllerTestsMethodsPart03.cs
  • Purchasing.Tests/ControllerTests/OrderControllerTests/OrderControllerTestsReflection.cs
  • Purchasing.Tests/Purchasing.Tests.csproj
  • Purchasing.Tests/ServiceTests/OrderServiceTests/OrderServiceTestsInit.cs
  • Purchasing.Tests/ServiceTests/OrderServiceTests/OrderServiceTestsReRouteApprovalsForExistingOrder01.cs
  • Purchasing.WS/AccountInfo.cs
  • Purchasing.WS/App_Readme/Elmah.txt
  • Purchasing.WS/AzureStorageService.cs
  • Purchasing.WS/FinancialDocumentStatus.cs
  • Purchasing.WS/FinancialRoleSystemService.cs
  • Purchasing.WS/FinancialSystemService.cs
  • Purchasing.WS/IFinancialRoleSystemService.cs
  • Purchasing.WS/IFinancialSystemService.cs
  • Purchasing.WS/Purchasing.WS.csproj
  • Purchasing.WS/Service References/AzureStorage/Microsoft.SqlServer.Management.Dac.ServiceTypes.xsd
  • Purchasing.WS/Service References/AzureStorage/Microsoft.SqlServer.Management.Dac.Services.wsdl
  • Purchasing.WS/Service References/AzureStorage/Purchasing.WS.AzureStorage.ExportResponse.datasource
  • Purchasing.WS/Service References/AzureStorage/Reference.cs
  • Purchasing.WS/Service References/AzureStorage/Reference.svcmap
  • Purchasing.WS/Service References/AzureStorage/configuration.svcinfo
  • Purchasing.WS/Service References/AzureStorage/configuration91.svcinfo
  • Purchasing.WS/Service References/AzureStorage/dotnet-svcutil.params.json
  • Purchasing.WS/Service References/AzureStorage/service.wsdl
  • Purchasing.WS/Service References/AzureStorage/service.xsd
  • Purchasing.WS/Service References/AzureStorage/service1.xsd
  • Purchasing.WS/Service References/FinancialRoleService/Purchasing.WS.FinancialRoleService.simpleAccountInfo.datasource
  • Purchasing.WS/Service References/FinancialRoleService/Reference.cs
  • Purchasing.WS/Service References/FinancialRoleService/Reference.svcmap
  • Purchasing.WS/Service References/FinancialRoleService/configuration.svcinfo
  • Purchasing.WS/Service References/FinancialRoleService/configuration91.svcinfo
  • Purchasing.WS/Service References/FinancialRoleService/dotnet-svcutil.params.json
  • Purchasing.WS/Service References/FinancialRoleService/financialSystemRoleServiceSOAP2.wsdl
  • Purchasing.WS/Service References/PurchaseDocumentService/Purchasing.WS.PurchaseDocumentService.documentCreationResult.datasource
  • Purchasing.WS/Service References/PurchaseDocumentService/Purchasing.WS.PurchaseDocumentService.purchaseRequisitionStatusInfo.datasource
  • Purchasing.WS/Service References/PurchaseDocumentService/Reference.cs
  • Purchasing.WS/Service References/PurchaseDocumentService/Reference.svcmap
  • Purchasing.WS/Service References/PurchaseDocumentService/configuration.svcinfo
  • Purchasing.WS/Service References/PurchaseDocumentService/configuration91.svcinfo
  • Purchasing.WS/Service References/PurchaseDocumentService/dotnet-svcutil.params.json
  • Purchasing.WS/Service References/PurchaseDocumentService/purchaseDocumentsInterfaceServiceSOAP.wsdl
  • Purchasing.WS/Service References/PurchaseDocumentService/purchasingDocumentsInterfaceServiceSOAP1.wsdl
  • Purchasing.WS/SubmitResult.cs
  • Purchasing.WS/appsettings.json
  • Purchasing.sln
💤 Files with no reviewable changes (39)
  • Purchasing.WS/Service References/AzureStorage/configuration91.svcinfo
  • Purchasing.WS/Service References/FinancialRoleService/Purchasing.WS.FinancialRoleService.simpleAccountInfo.datasource
  • Purchasing.WS/Service References/FinancialRoleService/dotnet-svcutil.params.json
  • Purchasing.WS/Service References/AzureStorage/service.xsd
  • Purchasing.WS/Purchasing.WS.csproj
  • Purchasing.WS/Service References/PurchaseDocumentService/configuration.svcinfo
  • Purchasing.WS/Service References/AzureStorage/configuration.svcinfo
  • Purchasing.WS/Service References/AzureStorage/service1.xsd
  • Purchasing.Mvc/Purchasing.Mvc.csproj
  • Purchasing.WS/Service References/PurchaseDocumentService/purchaseDocumentsInterfaceServiceSOAP.wsdl
  • Purchasing.WS/Service References/PurchaseDocumentService/Reference.svcmap
  • Purchasing.WS/Service References/PurchaseDocumentService/Purchasing.WS.PurchaseDocumentService.documentCreationResult.datasource
  • Purchasing.WS/App_Readme/Elmah.txt
  • Purchasing.WS/Service References/AzureStorage/Microsoft.SqlServer.Management.Dac.ServiceTypes.xsd
  • Purchasing.WS/appsettings.json
  • Purchasing.WS/Service References/AzureStorage/Microsoft.SqlServer.Management.Dac.Services.wsdl
  • Purchasing.WS/Service References/FinancialRoleService/configuration.svcinfo
  • Purchasing.WS/IFinancialRoleSystemService.cs
  • Purchasing.WS/Service References/FinancialRoleService/Reference.svcmap
  • Purchasing.WS/Service References/AzureStorage/Reference.svcmap
  • Purchasing.WS/FinancialDocumentStatus.cs
  • Purchasing.WS/SubmitResult.cs
  • Purchasing.WS/Service References/AzureStorage/service.wsdl
  • Purchasing.WS/Service References/PurchaseDocumentService/configuration91.svcinfo
  • Purchasing.WS/Service References/PurchaseDocumentService/dotnet-svcutil.params.json
  • Purchasing.WS/Service References/PurchaseDocumentService/purchasingDocumentsInterfaceServiceSOAP1.wsdl
  • Purchasing.WS/FinancialSystemService.cs
  • Purchasing.WS/Service References/PurchaseDocumentService/Purchasing.WS.PurchaseDocumentService.purchaseRequisitionStatusInfo.datasource
  • Purchasing.WS/IFinancialSystemService.cs
  • Purchasing.WS/Service References/AzureStorage/Reference.cs
  • Purchasing.WS/FinancialRoleSystemService.cs
  • Purchasing.WS/Service References/FinancialRoleService/configuration91.svcinfo
  • Purchasing.WS/Service References/FinancialRoleService/financialSystemRoleServiceSOAP2.wsdl
  • Purchasing.WS/Service References/FinancialRoleService/Reference.cs
  • Purchasing.WS/AccountInfo.cs
  • Purchasing.WS/AzureStorageService.cs
  • Purchasing.WS/Service References/PurchaseDocumentService/Reference.cs
  • Purchasing.Mvc/Views/Home/Index.cshtml
  • Purchasing.WS/Service References/AzureStorage/dotnet-svcutil.params.json

Comment on lines 510 to +513
if (string.IsNullOrWhiteSpace(split.FinancialSegmentString))
{
var chart = split.Account.Split('-')[0];
var account = split.Account.Split('-')[1];


var distributionResult = await _aggieClient.KfsConvertAccount.ExecuteAsync(chart, account, split.SubAccount);
var distributionData = distributionResult.ReadData();
if (distributionData.KfsConvertAccount.GlSegments != null)
{
var tempGlSegments = new GlSegments(distributionData.KfsConvertAccount.GlSegments);
if (string.IsNullOrWhiteSpace(tempGlSegments.Account) || tempGlSegments.Account == "000000")
{
//770000
Log.Warning($"Natural Account of 000000 detected. Substituting {_options.DefaultNaturalAccount}");
tempGlSegments.Account = _options.DefaultNaturalAccount;
}
rtValue.FinincialSegmentString = tempGlSegments.ToSegmentString();
}
else
{
if (distributionData.KfsConvertAccount.PpmSegments != null)
{
rtValue.IsPPm = true;
var tempPpmSegments = new PpmSegments(distributionData.KfsConvertAccount.PpmSegments);
if (string.IsNullOrWhiteSpace(tempPpmSegments.ExpenditureType) || tempPpmSegments.ExpenditureType == "000000")
{
//770000
Log.Warning($"Natural Account (ExpenditureType) of 000000 detected. Substituting {_options.DefaultNaturalAccount}");
tempPpmSegments.ExpenditureType = _options.DefaultNaturalAccount;
}
rtValue.FinincialSegmentString = tempPpmSegments.ToSegmentString();
}
else
{
//TODO: REMOVE THIS!!!!
Log.Error("No GL Segments found for {chart}-{account}-{subAccount} FAKING IT!!!!", chart, account, split.SubAccount);
rtValue.FinincialSegmentString = $"3110-13U02-ADNO006-{_options.DefaultNaturalAccount}-43-000-0000000000-000000-0000-000000-000000";
}
}
throw new Exception("FinancialSegmentString is null or whitespace. This should have been caught in validation. If you are seeing this error, please contact support.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Avoid silent conversion failure and generic hard-throw in account migration paths.

ConvertKfsAccount(...) now always returns empty for non-empty input, while LookupAccount(...) throws on missing FinancialSegmentString. This combination can cause misleading validation failures and hard runtime breaks instead of a clear migration error path.

Suggested direction for explicit deprecation behavior
 public async Task<string> ConvertKfsAccount(string account, bool updateNaturalAccount = true)
 {
     if(string.IsNullOrWhiteSpace(account))
     {
         return String.Empty;
     }
-    return String.Empty;
+    throw new NotSupportedException(
+        "KFS-to-Aggie Enterprise conversion is no longer supported. Use a valid FinancialSegmentString.");
 }
// Also ensure UploadOrder/validation callers catch this and return a user-safe SubmitResult
// instead of surfacing an unhandled exception.

Also applies to: 904-912

🤖 Prompt for 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.

In `@Purchasing.Core/Services/AggieEnterpriseService.cs` around lines 510 - 513,
The code currently throws a generic Exception when split.FinancialSegmentString
is null and ConvertKfsAccount silently returns empty for non-empty input,
causing misleading failures; update ConvertKfsAccount to return a clear failure
(null or a Result/Error object) or throw a specific MigrationException when it
cannot convert, and change LookupAccount to handle missing
FinancialSegmentString by returning a controlled error result instead of
throwing; then update callers such as UploadOrder and validation paths to catch
that specific failure and translate it into a user-safe SubmitResult/validation
error (do not leave a raw Exception), referencing ConvertKfsAccount,
LookupAccount, UploadOrder, validation callers and SubmitResult to locate places
to change.

Comment on lines 586 to 593
public bool WillOrderBeSentToKfs(OrderType newOrderType, string kfsDocType = null)
{
if (newOrderType.Id == OrderType.Types.KfsDocument && _financialSystemService.AllowedType(kfsDocType))
{
return true;
}
//if (newOrderType.Id == OrderType.Types.KfsDocument && _financialSystemService.AllowedType(kfsDocType))
//{
// return true;
//}
return false;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Block completion for deprecated KFS order types instead of silently succeeding.

With KFS submission removed, Complete(...) can still mark non-AE/KFS orders as completed without any external submission or explicit failure. That creates false-success completion states.

Proposed guard in completion path
 public async Task<string[]> Complete(Order order, OrderType newOrderType, string kfsDocType = null)
 {
+    if (newOrderType?.Id == OrderType.Types.KfsDocument)
+    {
+        return new[] { "KFS integration has been removed. Please complete this order as Aggie Enterprise." };
+    }
+
     order.StatusCode = _repositoryFactory.OrderStatusCodeRepository.GetById(OrderStatusCode.Codes.Complete);
     order.OrderType = newOrderType;
     order.KfsDocType = kfsDocType;

Also applies to: 606-619, 621-635

🤖 Prompt for 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.

In `@Purchasing.Mvc/Services/OrderService.cs` around lines 586 - 593, The
WillOrderBeSentToKfs method currently always returns false which lets completion
silently succeed for deprecated KFS order types; restore the original guard
logic in WillOrderBeSentToKfs to return true when newOrderType.Id ==
OrderType.Types.KfsDocument AND _financialSystemService.AllowedType(kfsDocType),
and then update the completion path (the Complete(...) method) to call
WillOrderBeSentToKfs and, when it indicates a KFS document that cannot/should
not be submitted, prevent silent success by throwing a clear exception (e.g.,
InvalidOperationException) or returning a failure result so non-AE/KFS orders
are not marked completed without explicit external submission handling; ensure
you update any callers of Complete(...) to handle the new error/return behavior.

Continues the deprecation of KFS-specific UI components as part of the transition to Aggie Enterprise. The KFS review section is no longer needed.
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