Refactor: Move WebOrdering Handlers and Services to New Project
Refactor: Move WebOrdering Handlers and Services to New Project
Author: Duane Gerken
Date: 2026-04-20
Status: Planning — Option B approved
Overview
This document describes the detailed steps and effort estimates for extracting the WebOrdering handler classes and their supporting services from Gops.OrderManagement into two new assemblies:
Northstar.WebOrdering.Shared— shared DTOs, data models, and service interfaces (consumed by bothGops.OrderManagementand the new handlers/services project)Gops.WebOrdering— all WebOrdering handlers, services, and AutoMapper profiles
The goal is to improve separation of concerns, break the circular dependency cleanly, reduce the size of Gops.OrderManagement, and make the WebOrdering layer independently testable and deployable.
Assembly Structure After Refactor
Northstar.WebOrdering.Shared (new)
Data\ ← 53+ WebOrdering DTOs moved here
Services\Checks\Contracts\ ← ICheckService, IWebOrderingValidationService, IWebOrderingCompatibilityManager
Services\OrderEntryEvents\Contracts\ ← IOrderEntryEventNotifier
Gops.WebOrdering (new)
Handlers\ ← 63 handler classes + MapperProfiles + Models
Services\Checks\ ← CheckService, CheckService.Coupons, WebOrderingValidationService, WebOrderingCompatibilityManager
Services\OrderEntryEvents\ ← OrderEntryEventNotifier + Entities
Gops.OrderManagement (existing — shrinks)
WebOrderManager.cs ← stays (references Northstar.WebOrdering.Shared for DTOs)
Helpers\OrderItemComponentsAssignerHelper.cs ← stays
Extensions\ISessionManagerExtensions.cs ← stays
Extensions\ICacheManagerExtensions.cs ← stays
IWebOrderHandler.cs ← stays
[all other non-WebOrdering code] ← staysDependency graph (no cycles):
Northstar.WebOrdering.Shared ← Gops.OrderManagement
← Gops.WebOrdering
← Gops.AlertManagement
← Gops.TableManagement
← Gops.WebServices
Gops.OrderManagement ← Gops.WebOrdering
← Gops.WebServicesWhat Moves Where
Into Northstar.WebOrdering.Shared
Source (in Gops.OrderManagement) | New namespace |
|---|---|
|
|
|
|
|
|
|
|
|
|
Into Gops.WebOrdering
Source (in Gops.OrderManagement) | New namespace |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Stays in Gops.OrderManagement
IWebOrderHandler.csandWebOrderManager.csHelpers\OrderItemComponentsAssignerHelper.csExtensions\ISessionManagerExtensions.csExtensions\ICacheManagerExtensions.csAll internal managers (
IOrderManager,IComboManager,IAdjustmentManager, etc.)
Detailed Steps & Estimates
Step 1 — Create Northstar.WebOrdering.Shared
Estimate: 1.5 hours
Add new Class Library project
Northstar.WebOrdering.Sharedto the solution.Target the same .NET framework version as
Gops.OrderManagement.Add minimal dependencies only — this project should be lean:
Newtonsoft.Json(NuGet) — if any DTOs use JSON attributesNo project references to other Gops assemblies (interfaces should use only primitive/framework types in their signatures where possible; if they require types from other assemblies, add those references carefully)
Move
Data\WebOrdering\(53+ DTO files) intoNorthstar.WebOrdering.Shared\Data\.Move the four interface files (
ICheckService,IWebOrderingValidationService,IWebOrderingCompatibilityManager,IOrderEntryEventNotifier) into appropriate subfolders.Update all namespace declarations to
Northstar.WebOrdering.Shared.*.Remove moved files from
Gops.OrderManagement.csproj.
Step 2 — Update Gops.OrderManagement to reference Northstar.WebOrdering.Shared
Estimate: 1.5 hours
Add project reference to
Northstar.WebOrdering.SharedinGops.OrderManagement.csproj.Update
usingstatements in the four files that stay and use the moved types:WebOrderManager.cs(lines 43, 55, 158, 164, 168)Helpers\OrderItemComponentsAssignerHelper.cs(lines 29, 50, 74–75, 101–103, 217+)Extensions\ISessionManagerExtensions.cs(lines 28, 107, 119, 122, 154)Extensions\ICacheManagerExtensions.cs(lines 15, 30, 46, 173, 190)
Build
Gops.OrderManagementalone and confirm it compiles cleanly before proceeding.
Step 3 — Create Gops.WebOrdering
Estimate: 1 hour
Add new Class Library project
Gops.WebOrderingto the solution.Target the same .NET framework version.
Add project/package references:
Dependency | Source |
|---|---|
| Project reference |
| Project reference (for |
| Project reference |
| Project reference |
| Project reference |
| Project reference |
| Project reference |
| Project reference |
| Project reference |
| Project reference |
| Project reference |
| Project reference |
| Project reference |
| NuGet |
| NuGet |
| NuGet (match version in |
| Project/NuGet |
Step 4 — Move Services into Gops.WebOrdering
Estimate: 2 hours
Move from Gops.OrderManagement\Services\ into Gops.WebOrdering\Services\:
Checks\CheckService.cs+Checks\CheckService.Coupons.csChecks\WebOrderingValidationService.csChecks\WebOrderingCompatibilityManager.csOrderEntryEvents\OrderEntryEventNotifier.csOrderEntryEvents\Entities\PublishedMessage\(6 entity classes)
Update namespace declarations. Remove from Gops.OrderManagement.csproj.
Step 5 — Move Handler Files into Gops.WebOrdering
Estimate: 2 hours
Move all of Handlers\WebOrdering\ (63 handlers, MapperProfiles, Models) into Gops.WebOrdering\Handlers\. Update namespace declarations. Remove from Gops.OrderManagement.csproj.
Step 6 — Add InternalsVisibleTo to new assembly
Estimate: 15 minutes
Add to Gops.WebOrdering\Properties\AssemblyInfo.cs:
[assembly: InternalsVisibleTo("NorthStar.OrderManagement.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]Step 7 — Update all consuming projects
Estimate: 2.5 hours
For each project below: add project reference(s) to .csproj and update using statements in each file.
Gops.WebServices — add references to both Northstar.WebOrdering.Shared and Gops.WebOrdering:
File | Change |
|---|---|
| Update |
| Update |
| Update |
| Update |
| Update |
| Update |
| Update |
Gops.AlertManagement — add references to Northstar.WebOrdering.Shared and Gops.WebOrdering:
AlertManager.cs: updateusingforCheckGetHandler(handlers namespace) andWebOrderingCheck(shared namespace)
Gops.TableManagement — add reference to Northstar.WebOrdering.Shared:
Contracts\IWebTableHandler.cs,IWebTableManager.cs,WebTable\ResetTableHandler.cs,WebTable\WebTableDataHandler.cs,WebTableManager.cs: updateusingfor DTO andICheckServicenamespaces
Step 8 — Clean up Gops.OrderManagement
Estimate: 30 minutes
Remove stale using statements for any moved namespaces. Confirm IWebOrderHandler, WebOrderManager, and all internal managers compile cleanly with only the Northstar.WebOrdering.Shared reference for DTO types.
Step 9 — Build and fix compile errors
Estimate: 3–5 hours
Build the full solution. Work through errors in order: Northstar.WebOrdering.Shared first, then Gops.OrderManagement, then Gops.WebOrdering, then consuming projects. Expect the most errors in CheckService (1,359 lines) and Gops.AlertManagement (direct concrete instantiation).
Step 10 — Update and run tests
Estimate: 2–3 hours
Add project references to
Northstar.WebOrdering.SharedandGops.WebOrderinginGops.UnitTests.csproj.Update
usingstatements inCheckServiceTests.cs(concreteCheckServiceinstantiation on lines 76–77, 89, 99, 110).Run full test suite; fix any failures.
Step 11 — Smoke test end-to-end
Estimate: 2 hours
Deploy to local/dev. Exercise all handler categories. Verify DI resolution, AutoMapper mappings, and OrderEntryEventNotifier observable streams.
Step 12 — Code review and merge
Estimate: 2–3 hours
PR to develop. Confirm no dead code left in Gops.OrderManagement, all tests pass, and the dependency graph matches the diagram above.
Total Effort Estimate
Step | Description | Estimate |
|---|---|---|
1 | Create | 1.5 hrs |
2 | Update | 1.5 hrs |
3 | Create | 1 hr |
4 | Move Services | 2 hrs |
5 | Move Handler files | 2 hrs |
6 | InternalsVisibleTo | 15 min |
7 | Update all consuming projects (WebServices, AlertManagement, TableManagement) | 2.5 hrs |
8 | Clean up Gops.OrderManagement | 30 min |
9 | Build & fix compile errors | 3–5 hrs |
10 | Update & run tests | 2–3 hrs |
11 | Smoke test | 2 hrs |
12 | Code review & merge | 2–3 hrs |
Total |
| 24–31 hours |
Risk Summary
Risk | Severity | Resolution |
|---|---|---|
AutoMapper hardcoded in | MEDIUM | Update one |
Test direct instantiation of | MEDIUM | Update |
| MEDIUM | Add project references + update |
| MEDIUM | Add project reference + update 5–6 files |
| LOW | Add 2 lines to |