Skip to content

Conversation

@anandani4136
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings September 17, 2025 07:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the subscription system from an email-based model to a user-based model. Instead of storing email addresses directly in subscription lists, subscriptions are now linked to user IDs with a foreign key relationship to the authInfo table.

  • Subscription data model changed from storing arrays of emails to individual user-mailing list records
  • API endpoints updated to handle user-based subscriptions with proper authorization checks
  • New endpoints added for user subscription management and unsubscription functionality

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/services/subscription/subscription-schema.ts Updates Zod validators and Mongoose schema to use userId instead of email arrays
src/services/subscription/subscription-router.ts Refactors all endpoints to work with user-based subscriptions and adds new user management endpoints
src/services/subscription/subscription-router.test.ts Updates all tests to use userId-based subscriptions and adds tests for new endpoints
src/database.types.ts Updates TypeScript types to reflect new subscription table structure
docker/init-scripts/01-schema.sql Modifies database schema to use userId with foreign key constraint and composite primary key

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

RitamNandi
RitamNandi previously approved these changes Sep 17, 2025
Copy link
Collaborator

@Timothy-Gonzalez Timothy-Gonzalez left a comment

Choose a reason for hiding this comment

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

Several syntax issues but @anandani4136 said this was tested & we'll fix later, good for prod since we need it now

@anandani4136 anandani4136 merged commit cd042af into main Sep 18, 2025
5 checks passed
@anandani4136 anandani4136 deleted the update-subscriptions branch September 18, 2025 06:19
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.

5 participants