Feature: Add deletedAt soft-delete column to accounts table (#81)#270
Open
Ummi-001 wants to merge 1 commit into
Open
Feature: Add deletedAt soft-delete column to accounts table (#81)#270Ummi-001 wants to merge 1 commit into
Ummi-001 wants to merge 1 commit into
Conversation
|
@Ummi-001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@Ummi-001 can you fix CI please |
1 similar comment
Contributor
|
@Ummi-001 can you fix CI please |
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.
Closes #181
Closes #182
Closes #183
Closes #184
What this does
@DeleteDateColumn({ type: 'timestamp', nullable: true }) deletedAt: Date | null;toAccountentity, with a matching@Index('IDX_accounts_deletedAt', ['deletedAt']).1718100008000-AddDeletedAtToAccountsTable.tsadds thedeletedAtcolumn and index, with adown()rollback.AccountsService.findAll()'s query builder now explicitly filtersaccount.deletedAt IS NULL(query builders don't get TypeORM's automatic soft-delete filtering the way repositoryfind/findOnecalls do).ClaimRedemptionProvider's pessimistic-lock query (used during claim redemption) now also filters out soft-deleted accounts, so a soft-deleted account can never be claimed.accounts.service.spec.tsandclaim-redemption.provider.spec.tsto mockandWhereand assert the new filtering behavior. Added a new test case for the soft-delete filter infindAll.migrations.integration.spec.ts's expected migration count from 8 to 9.Known issue — flagging for maintainer review
The full integration test suite (
migrations.integration.spec.ts) has one assertion,expect(result.schemaInSync).toBe(true), that is currently failing after this change. This test spins up a real embedded Postgres, runs all migrations, and compares the resulting schema against TypeORM's entity metadata viacreateSchemaBuilder().log(). After adding the new column/index,schemaInSynccomes backfalse, meaning TypeORM's schema sync detects some difference between our hand-written migration SQL and what the@DeleteDateColumn()/@Index()decorators expect — I wasn't able to pin down the exact mismatch before running out of time on this PR. Flagging this explicitly rather than leaving it silently broken — happy to dig in further if pointed at the specific diff.Testing performed
npm run build: clean, no errors.npm test: 560/561 tests pass; the 1 failure is theschemaInSyncissue described above.