CATcher-org / CATcher-org/CATcher
Increasing atomicity of issue service
- Dominant language
- TypeScript
- Stars
- 92
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
As per #1264 , the current issue service performs both an API request and DTO mapping within the same methods which makes it harder to make individual API calls and work with the returned API objects.
**Describe the solution you'd like**
Ideally, the issue service should have public methods to perform the API call + DTO mapping while maintaining internal/public methods that perform the pure API calls. So the resulting service may look like the one made for `updateIssue` where there is a `updateGithubIssue` for the API call and adjacent `updateIssue` to perform the DTO mapping from the API call from `updateGithubIssue`.
This makes the entire service more composable and easier to extend/modify in the future.
**Describe alternatives you've considered**
Retaining the existing system works too since it currently does not have any major "bugs" that I know of, but having such atomicity would definitely make it easier to debug the system as method calls are now literally comprised of atomic operations that can be more easily inspected and modified without changing large amounts of behavior like in #1264 .
However, this is really up to the team's decision, am more than happy to discuss the nuances in this issue or the subsequent PR :)
**Additional context**
N/A
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing issue service and the updateIssue/updateGithubIssue pattern described in the issue, then review the related context in #1264. Identify which methods combine API calls with DTO mapping and separate those responsibilities consistently. Done means the service exposes composable API-call and mapped-result operations without changing existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100