🔄 Refactor: Remove Business Logic from Controllers & Introduce DTO-Oriented Services#4559
Draft
MrAdder wants to merge 17 commits intoVATSIM-UK:mainfrom
Draft
🔄 Refactor: Remove Business Logic from Controllers & Introduce DTO-Oriented Services#4559MrAdder wants to merge 17 commits intoVATSIM-UK:mainfrom
MrAdder wants to merge 17 commits intoVATSIM-UK:mainfrom
Conversation
Latest batch of updates
…ps://github.com/MrAdder/core into refactor-remove-business-logic-from-controllers
5 tasks
Contributor
Author
|
This will need testing fully I have tested locally everything that I can think of and pages, updated tests to reflect changes if required for changes in business logic |
Contributor
Author
|
This I am converting to draft till others are merged just incase of conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #4550
🎯 Purpose of this PR
This refactor removes business logic from controllers and reorganises data handling through service-layer DTO-style structures.
Primary goals:
There are no intended functional changes.
🧱 What Changed
✅ Business Logic Extraction
Controllers previously responsible for:
Now delegate to services which return structured data objects.
🧩 DTO-Oriented Structure
Service methods now:
This lays groundwork for formal DTO adoption later.
🗂️ Services Introduced / Expanded
CtsBookingsServiceOAuthUserProfileServicePositionValidationServiceHeathrowGroundS1EligibilityServicePasswordManagementServiceForgotPasswordFlowServiceLocalBanDisplayService🔍 Reviewer Focus Areas
1. Behavioural Parity
Because logic moved layers, please verify:
Assume differences are accidental unless stated otherwise.
2. DTO / Response Construction
Main architectural change:
Check for:
3. High-Risk Functional Areas
CTS Bookings API
OAuth Profile Endpoint
Heathrow Ground S1 Eligibility
Password & Reset Flow
Position Validation
🚫 Not Intended to Change
🧭 Architectural Context
This PR is part of an ongoing effort to:
Future follow-ups may introduce:
✅ Reviewer Checklist
auth()->id())Thanks for reviewing — this is a structural change touching multiple domains, so regression-focused feedback is especially helpful 👍