feat(backend): migrate resolver utilities to TypeScript (7.17)#296
feat(backend): migrate resolver utilities to TypeScript (7.17)#296
Conversation
Migrate all resolver utility modules from legacy JS to TypeScript with proper typing. Add model stubs for Activity, Post, Vote, Comment, Message, MessageRoom, and Notification to support compilation. Stripe utilities use runtime require() pending package installation in a later issue. - 8 new resolver utility files: common, activities, notifications, posts, scores, messages, reputation, stripe (4 files) - 7 new model stubs (to be expanded in issues 7.19-7.22) - Updated common.ts: added deleted/readBy to Message interface - Updated mongoose.ts: added dayPoints/pointTimestamp to PostDocument - All 224 tests pass, type-check clean Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…comprehensive unit tests for resolver utilities.
|
Hey @flyblackbox , Cleaned up the typings and ensured all resolver utilities are strictly typed. |
|
Nice work @shubham-01-star! @motirebuma or myself will review and approve soon. Thank you so much 🙏 |
flyblackbox
left a comment
There was a problem hiding this comment.
Excellent job! I found it interesting that there is a trending algorithm still present from an earlier version. Also I love the reputation score bits. Will look for a second review for merge approval
|
hello @shubham-01-star 👋 ! do you advise this merged 1st followed by #301 and #302 ? I wanted to help review but notice they are touching the same resolver utility test files |
Summary
deleted/readByfields toMessagetype anddayPoints/pointTimestamptoPostDocumentrequire()with untyped interfaces to avoid adding thestripedependency prematurelyFiles changed (22 files, +805 lines)
New resolver utilities (12):
common.ts,activities.ts,notifications.ts,posts.ts,scores.ts,messages.ts,reputation.ts,stripe/getStripeAuth.ts,stripe/createStripeCustomer.ts,stripe/createStripePaymentMethod.ts,stripe/index.ts,utils/index.tsNew model stubs (7):
Activity.ts,Post.ts,Vote.ts,Comment.ts,Message.ts,MessageRoom.ts,Notification.tsModified (3):
models/index.ts,types/common.ts,types/mongoose.tsTest plan
pnpm type-checkpasses clean (0 errors)🤖 Generated with Claude Code