-
Notifications
You must be signed in to change notification settings - Fork 4
refactor(game-session-schedule): add support for cascade deletion #600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
6xtvo
wants to merge
40
commits into
master
Choose a base branch
from
545-cascade-deletion-gamesession
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
4ab183b
refactor(game-sessions): cascade deletion
6xtvo e1c546c
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 9cca008
refactor: revert changes
6xtvo 4901e9b
feat(game-session-schedule): add cascade deletion
6xtvo 3b41900
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo afeb253
refactor: revert commit
6xtvo 7669707
refactor: merge
6xtvo 313c08f
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 8df6a74
refactor(game-session-schedule): refactor transactions
6xtvo adac403
refactor: merge
6xtvo 8c8ae03
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 355406d
refactor: merge
6xtvo 5de1088
refactor: merge
6xtvo 69668ab
refactor: add methods to booking data service
6xtvo c85c560
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 715b99f
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 703d652
feat: merge branches
6xtvo 9fcae39
fix: resolver conflicts
6xtvo 40c44fa
refactor: use transaction adapter methods
6xtvo 9f551d9
feat: implement booking data service for deletion
6xtvo 60d3815
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 507ac15
refactor(comments): update testing description
6xtvo 542a9d8
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo e127832
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 36dbcbb
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 3a31302
test(game-session-schedule): add tests for transactions
6xtvo 6486519
test(game-session-schedule): fix tests
6xtvo 2ac4dee
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo ad4b923
refactor(game-session-schedule): allow dynamic game session querying
6xtvo 7f0c7d3
refactor: merge with master
6xtvo e7208af
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo ec0190c
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo d09f0f6
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo f60b2c4
refactor(biome): resolve biome issues
6xtvo 1cfe0db
refactor(bookings): add booking and game session data service methods
6xtvo 3820969
refactor(mocks): remove unneeded mock
6xtvo 8aafd51
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 2dff7c5
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo 7fae86c
refactor(game-session-schedule): add transaction support for service …
6xtvo 29cac12
Merge branch 'master' into 545-cascade-deletion-gamesession
6xtvo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -286,7 +286,7 @@ export default class BookingDataService { | |
| * | ||
| * @param userId The ID of the user to bulk delete bookings for | ||
| * @param transactionId an optional transaction ID for the request, useful for tracing | ||
| * @returns the deleted {@link Booking} documents if it exists, otherwise returns an empty array | ||
|
|
||
| */ | ||
| public async deleteBookingsByUserId( | ||
| userId: string, | ||
|
|
@@ -304,4 +304,27 @@ export default class BookingDataService { | |
| }) | ||
| ).docs | ||
| } | ||
|
|
||
| /** | ||
| * Deletes all bookings related to a game session schedule. | ||
| * | ||
| * @param scheduleId the ID of the game session schedule whose bookings are to be deleted | ||
| * @param transactionID an optional transaction ID for the request, useful for tracing | ||
| */ | ||
| public async deleteRelatedBookingsByScheduleId( | ||
| scheduleId: string, | ||
|
Comment on lines
+313
to
+315
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for consistency, stick for
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also should be |
||
| transactionID?: string | number, | ||
| ): Promise<void> { | ||
| await payload.delete({ | ||
| collection: "booking", | ||
| where: { | ||
| "gameSession.gameSessionSchedule": { | ||
| equals: scheduleId, | ||
| }, | ||
| }, | ||
| req: { | ||
| transactionID, | ||
| }, | ||
| }) | ||
| } | ||
| } | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we've shifted to use
deleteRelatedDocs