Skip to content

feat(backend): migrate resolver utilities to TypeScript (7.17)#296

Merged
mzpolini merged 2 commits intomainfrom
claude-code/phase7-backend-migration
Mar 24, 2026
Merged

feat(backend): migrate resolver utilities to TypeScript (7.17)#296
mzpolini merged 2 commits intomainfrom
claude-code/phase7-backend-migration

Conversation

@flyblackbox
Copy link
Copy Markdown
Contributor

Summary

  • Migrates all 12 resolver utility modules from legacy JavaScript to TypeScript with full type annotations (issue 7.17)
  • Creates 7 Mongoose model stubs (Activity, Post, Vote, Comment, Message, MessageRoom, Notification) needed for compilation — to be expanded in issues 7.19-7.22
  • Adds missing deleted/readBy fields to Message type and dayPoints/pointTimestamp to PostDocument
  • Stripe utilities use runtime require() with untyped interfaces to avoid adding the stripe dependency prematurely

Files 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.ts

New model stubs (7):
Activity.ts, Post.ts, Vote.ts, Comment.ts, Message.ts, MessageRoom.ts, Notification.ts

Modified (3):
models/index.ts, types/common.ts, types/mongoose.ts

Test plan

  • pnpm type-check passes clean (0 errors)
  • All 224 existing tests pass
  • 99.69% code coverage maintained
  • Verify model stubs don't conflict with future full model migrations (7.19-7.22)

🤖 Generated with Claude Code

flyblackbox and others added 2 commits February 20, 2026 21:12
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.
@shubham-01-star
Copy link
Copy Markdown
Collaborator

Hey @flyblackbox ,
I've reviewed the PR and pushed the necessary fixes to complete the backend migration:

Cleaned up the typings and ensured all resolver utilities are strictly typed.
Fixed the remaining gaps in the tests to reach 100% coverage (statements, branches, functions, lines).

@flyblackbox
Copy link
Copy Markdown
Contributor Author

Nice work @shubham-01-star! @motirebuma or myself will review and approve soon. Thank you so much 🙏

Copy link
Copy Markdown
Contributor Author

@flyblackbox flyblackbox left a comment

Choose a reason for hiding this comment

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

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

@mzpolini
Copy link
Copy Markdown
Collaborator

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

@shubham-01-star
Copy link
Copy Markdown
Collaborator

Hey @mzpolini,
Yes, I think we should merge them in order. The PR that came first should be merged first, and then #301 and #302 can follow. Since they touch the same resolver utility test files, merging them sequentially should help avoid conflicts.

@mzpolini mzpolini merged commit 163e8a0 into main Mar 24, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants