feat: implement initial user entity and define Prisma schema for sybi…#260
Merged
Merged
Conversation
…l resistance and wallet management
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.
changes Made (BE-203: Prisma ↔ TypeORM Desync)
Closes #203
prisma/schema.prisma
Fixed missing } closing SybilExplanation (syntax error)
Added walletAddress String @unique and worldcoinVerifiedAt DateTime? to User model to match TypeORM
Added worldIdVerifications WorldIdVerification[] back-reference to User (required by Prisma relation rules)
Added explanation SybilExplanation? back-reference to SybilScore
Added @@Map("world_id_verifications") to WorldIdVerification for naming consistency
src/entities/user.entity.ts (was pre-applied on branch)
Canonical TypeORM User now has all 7 required fields: id, walletAddress, reputation, worldcoinVerified, worldcoinVerifiedAt, createdAt, updatedAt, plus wallets relation
src/modules/users/entities/user.entity.ts (was pre-applied on branch)
Changed from duplicate UserEntity class to export { User as UserEntity } re-export
src/generated/client/internal/class.ts
Added get worldIdVerification(): any and get sybilExplanation(): any to PrismaClient interface (bridges the stale client until prisma generate can run with network access)
src/identity/worldcoin/worldcoin.service.spec.ts
Fixed 3 partial-object mock casts (as unknown as WorldIdVerification)
Added jest.mock for PrismaService and SybilResistanceService to prevent @libsql/win32-x64-msvc native binary load failure during unit tests
Result: 27/27 tests pass (14 entity sync + 13 worldcoin service). Pre-existing failures in other suites are unrelated @libsql binary / empty-spec issues.