Conversation
WalkthroughReplaces inline schedule transformation with a shared transformer Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
…v2 endpoints in prod
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
21c4684
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/platform/libraries/schedules.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
packages/platform/libraries/schedules.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/platform/libraries/schedules.ts
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/platform/libraries/schedules.ts
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts (1)
76-89: Consider pagination for scalability.The endpoint fetches all user schedules without pagination. While this may be acceptable for the current atom use case, consider adding optional pagination parameters (limit/offset or cursor-based) to handle users with many schedules as the platform scales.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts
🧬 Code graph analysis (1)
apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts (3)
apps/api/v2/src/modules/users/users.repository.ts (1)
UserWithProfile(10-13)packages/platform/types/api.ts (1)
ApiResponse(33-35)packages/platform/libraries/schedules.ts (2)
GetAvailabilityListHandlerReturn(17-17)DuplicateScheduleHandlerReturn(21-21)
🔇 Additional comments (2)
apps/api/v2/src/modules/atoms/controllers/atoms.schedules.controller.ts (2)
28-32: LGTM!The imports are well-structured, with type-only imports properly declared and handlers co-located with their return types.
128-142: Ownership validation present in duplicate schedule handler. The handler checksschedule.userId === ctx.user.idand throwsUNAUTHORIZEDotherwise, preventing unauthorized duplication.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/platform/atoms/hooks/schedules/useAtomCreateSchedule.ts(2 hunks)packages/platform/examples/base/src/pages/availability/index.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
packages/platform/atoms/hooks/schedules/useAtomCreateSchedule.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/platform/atoms/hooks/schedules/useAtomCreateSchedule.tspackages/platform/examples/base/src/pages/availability/index.tsx
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/platform/atoms/hooks/schedules/useAtomCreateSchedule.tspackages/platform/examples/base/src/pages/availability/index.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Always use
t()for text localization in frontend code; direct text embedding should trigger a warning
Files:
packages/platform/examples/base/src/pages/availability/index.tsx
🧬 Code graph analysis (1)
packages/platform/examples/base/src/pages/availability/index.tsx (2)
packages/platform/examples/base/src/pages/availability/[scheduleId].tsx (1)
Availability(12-104)packages/platform/examples/base/src/components/Navbar/index.tsx (1)
Navbar(7-48)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (2)
packages/platform/atoms/hooks/schedules/useAtomCreateSchedule.ts (1)
9-9: LGTM! Cache invalidation correctly extends to the new schedules list.The import and cache invalidation for
SchedulesQueryKeyproperly ensure that the list of all schedules is refreshed after a schedule is created, maintaining consistency with the existing pattern for invalidating the individual schedule cache.Also applies to: 39-39
packages/platform/examples/base/src/pages/availability/index.tsx (1)
9-21: LGTM! Well-structured availability page.The component correctly renders the Navbar and both atoms (CreateSchedule and ListSchedules) with appropriate props. The
getScheduleUrlcallback properly maps schedule IDs to the expected route structure, and thedata-testidattributes enable effective E2E testing.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/lemon-rice-smile.md (1)
5-5: Clarify the summary sentence.The wording is a bit awkward (“also another atom introduced”). Rephrasing makes the changeset summary clearer.
-This PR adds an atom to list a user's schedule. Furthermore, there was also another atom introduced which can be used to create a new schedule for a user. +This PR adds an atom that lists a user's schedules and introduces another atom that can create a new schedule for a user.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.changeset/lemon-rice-smile.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/lemon-rice-smile.md
[grammar] ~5-~5: There might be a mistake here.
Context: ...sed to create a new schedule for a user.
(QB_NEW_EN)
|
@supalarry regarding this comment on PR #24404
I can confirm this is the case, I have the create schedule atom and list schedules on the same page and as soon as I create a new schedule it can be seen in the list atom. You can test it in the |
What does this PR do?
Visual Demo
loom video : https://www.loom.com/share/8e020a4848d543548c519d3a7cd532c6?sid=90ec6908-4ce9-4875-85c3-884684474090
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
This can be tested in the examples app for platform in the
/availabilitypage