Skip to content

feat: Adds four backend features to bring comments to audit parity with posts, aggregate a personalized fan feed, implement the favorites API the frontend already calls, and expose Stellar network config for client discovery. - #1527

Merged
aji70 merged 2 commits into
MyFanss:mainfrom
Emeka000:datasource
Jul 26, 2026

Conversation

@Emeka000

Copy link
Copy Markdown
Contributor

Changes

  • Comments soft-delete + audit (Backend: Add comment soft-delete and audit parity with posts #1434): deletedAt/deletedBy added to Comment; new CommentAuditLog entity + migration; CommentsService.remove() now soft-deletes, writes an audit row, and emits CommentDeletedEvent; all reads filter deletedAt IS NULL; hard delete kept as a separate, non-default hardDelete() method — mirrors the existing Post/PostAuditLog pattern exactly.
  • Personalized fan feed (Backend: Add personalized fan feed endpoint #1435): new feed module — GET /v1/feed/subscriptions (JWT-required, cursor-paginated). SubscriptionsService.getActiveCreatorIdsForFan() resolves the fan's actively-subscribed creators; PostsService.findFeed() returns their published, non-deleted posts via keyset (createdAt+id) cursor pagination. Empty subscriptions → empty page, not an error.
  • Favorites API (Backend: Implement favorites API matching frontend contract #1436): new favorites module — Favorite entity (unique on userId+creatorId), migration, service, and controller matching the existing frontend contract in frontend/src/lib/favorites.ts (GET /v1/favorites → creator ID array, POST/DELETE /v1/favorites/:creatorId). Add is idempotent; missing target creator → 404; listing is always scoped to the caller's own userId.
  • Network discovery config (Backend: Add GET /config/network for Stellar network discovery #1437): new config module — public GET /v1/config/network returning network, networkPassphrase, horizonUrl, rpcUrl derived from STELLAR_NETWORK/env overrides (same passphrase-mapping convention as subscription-chain-reader.service.ts). No secrets in the response.
  • Wired FeedModule, FavoritesModule, and NetworkConfigModule into AppModule; registered the two new migrations in migration.datasource.ts.

Test Plan

Automated tests added or updated

  • Unit tests (backend/src/**/*.spec.ts) — comments.service.spec.ts rewritten for soft-delete/audit/event behavior; posts.service.spec.ts extended with findFeed cursor/filter cases; subscriptions.service.spec.ts extended with getActiveCreatorIdsForFan; new specs for feed.service, feed.controller, favorites.service, favorites.controller, network-config.service, network-config.controller.
  • Integration / e2e tests — not added; existing modules follow the same unit-test-only convention (repos mocked via getRepositoryToken), and AppModule has no TypeOrmModule.forRoot wired yet (pre-existing, see Notes).
  • Frontend tests — no frontend changes.
  • Contract tests — no contract changes.

How to run the tests locally

cd backend && npm install   # not run in this session — see Notes
npm test
Manual verification checklist
 Happy path works end-to-end in a local environment
 Error / edge cases handled gracefully
 No regressions in closely related API or UI flows
 Rate-limiting, auth guards, and feature flags behave as expected where touched
 Linting passes: cd backend && npm run lint
Related issues
Closes #1434, #1435, #1436, #1437

Notes for reviewers
Dependencies were not installed and the build/test suite was not run in this session (per task constraints) — please run npm install && npm test && npm run lint before merging.
Two pre-existing gaps, unrelated to this PR, worth a follow-up ticket: (1) PostsModule, CommentsModule, and LikesModule were already not imported into AppModule before this change; (2) there is no TypeOrmModule.forRoot(...) anywhere in AppModule — only migration.datasource.ts configures a real Postgres connection for the migration CLI. Neither was introduced or worsened here.
contract/Cargo.lock shows as locally modified but was not touched by this work — worth checking before commit/push.

closes #1435 
Closes #1434
closes  #1436
 closes  #1437

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@Emeka000 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! 🚀

Learn more about application limits

@aji70
aji70 merged commit 1384fec into MyFanss:main Jul 26, 2026
2 of 8 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.

2 participants