Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Changes for match-ticket, match-ticket-assignment services hook refactor #8991

Merged
merged 6 commits into from
Oct 22, 2023

Conversation

MoizAdnan
Copy link
Member

@MoizAdnan MoizAdnan commented Oct 5, 2023

Summary

🤖 Generated by Copilot at 7180bc4

The pull request refactors the matchmaking services and hooks for match tickets and match ticket assignments, using the KnexService base class and helper functions to simplify the code and avoid duplication. It also removes unnecessary arguments from the service constructors and updates the imports accordingly.

References

#8871

Explanation

🤖 Generated by Copilot at 7180bc4

  • Simplify imports and extend KnexService in MatchTicketService and MatchTicketAssignmentService classes (link, link, link, link)
  • Move ticket assignment logic from MatchTicketAssignmentService class to getTicketAssigment function in match-ticket-assignment.hooks.ts (link, link, link)
  • Remove app argument from MatchTicketAssignmentService constructor in match-ticket-assignment.ts (link)
  • Move ticket creation, deletion, and retrieval logic from MatchTicketService class to ensureId, getEmulationTicket, createInEmulation, and skipDeleteInEmulation functions in match-ticket.hooks.ts (link, link, link, link)
  • Remove app argument from MatchTicketService constructor in match-ticket.ts (link)
  • Update imports in match-ticket-assignment.hooks.ts and match-ticket.hooks.ts to add or remove modules as needed (link, link, link)

🤖 Generated by Copilot at 7180bc4

The pull request was quite a refactor
It made the code much more compact or
It used KnexService and hooks
To simplify the looks
Of MatchTicket and MatchTicketAssignment actors

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

@MoizAdnan MoizAdnan marked this pull request as ready for review October 18, 2023 02:41
import {
matchTicketDataResolver,
matchTicketExternalResolver,
matchTicketQueryResolver,
matchTicketResolver
} from './match-ticket.resolvers'

const ensureId = async (context: HookContext<MatchTicketService>) => {
if (typeof context.id !== 'string' || context.id.length === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

You can use disallow-non-id.ts. Search for disallowNonId in our code

@hanzlamateen hanzlamateen merged commit d92b107 into dev Oct 22, 2023
12 of 13 checks passed
@hanzlamateen hanzlamateen deleted the match-hooks branch October 22, 2023 09:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants