-
Notifications
You must be signed in to change notification settings - Fork 890
Stripe sync admin #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stripe sync admin #538
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughA new admin action for syncing all Stripe customers to the database was implemented, along with a corresponding React component and UI integration. The admin page now displays both the original and new sync components. The version number was incremented to reflect these changes. Changes
Sequence Diagram(s)sequenceDiagram
participant Admin as Admin User
participant UI as Admin Page UI
participant Action as adminSyncAllStripeCustomersToDbAction
participant Stripe as Stripe API
participant DB as Database
Admin->>UI: Click "Sync All Stripe Customers to DB"
UI->>Action: Trigger sync action
Action->>Stripe: Fetch all Stripe customers (paginated)
loop For each customer
Action->>DB: Find user by email
alt User exists and has premium
Action->>DB: Update Stripe customer ID if mismatched
else User missing or no premium
Action->>Action: Log warning
end
end
Action->>UI: Return success message
UI->>Admin: Show toast notification
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
apps/web/app/(app)/admin/AdminSyncStripe.tsxOops! Something went wrong! :( ESLint: 9.28.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by apps/web/utils/actions/admin.tsOops! Something went wrong! :( ESLint: 9.28.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by apps/web/app/(app)/admin/page.tsxOops! Something went wrong! :( ESLint: 9.28.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (6)`apps/web/**/*.{ts,tsx}`: Use TypeScript with strict null checks Path aliases: U...
📄 Source: CodeRabbit Inference Engine (apps/web/CLAUDE.md) List of files the instruction was applied to:
`apps/web/app/**/*`: NextJS app router structure with (app) directory
📄 Source: CodeRabbit Inference Engine (apps/web/CLAUDE.md) List of files the instruction was applied to:
`apps/web/**/*.tsx`: Follow tailwindcss patterns with prettier-plugin-tailwindcs...
📄 Source: CodeRabbit Inference Engine (apps/web/CLAUDE.md) List of files the instruction was applied to:
`**/*.tsx`: For API GET requests to server, use the `swr` package Use `result?.serverError` with `toastError` and `toastSuccess` for error handling; success toast is optional
📄 Source: CodeRabbit Inference Engine (.cursor/rules/data-fetching.mdc) List of files the instruction was applied to:
`**/*.tsx`: Use React Hook Form with Zod for validation Validate form inputs before submission Show validation errors inline next to form fields
📄 Source: CodeRabbit Inference Engine (.cursor/rules/form-handling.mdc) List of files the instruction was applied to:
`**/*.{ts,tsx}`: Define validation schemas using Zod Apply the same validation in both client and server Use descriptive error messages
📄 Source: CodeRabbit Inference Engine (.cursor/rules/form-handling.mdc) List of files the instruction was applied to:
🧠 Learnings (3)apps/web/app/(app)/admin/page.tsx (14)
apps/web/app/(app)/admin/AdminSyncStripe.tsx (11)
apps/web/utils/actions/admin.ts (9)
🧬 Code Graph Analysis (1)apps/web/app/(app)/admin/page.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (8)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit
New Features
Chores