Closed mit-27 closed 3 weeks ago
@mit-27 is attempting to deploy a commit to the Panora Team on Vercel.
A member of the Team first needs to authorize it.
Latest commit: a53062a9fd3c1e8c83314a6d7742ba8fb52ed5b9
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
The changes introduce cursor-based pagination to the CRM API's contact management. This includes modifications to the contact.controller.ts
and contact.service.ts
to handle pagination parameters, and the creation of a GetContactsQueryDto
for structured query handling. Additionally, the contact sync schedule has been updated to run every 2 minutes for testing purposes.
Files | Change Summary |
---|---|
packages/api/src/crm/contact/contact.controller.ts |
Added UsePipes , ValidationPipe , and GetContactsQueryDto imports; updated getContacts method. |
packages/api/src/crm/contact/services/contact.service.ts |
Added pagination logic and modified getUnifiedContacts method to handle pageSize and cursor . |
packages/api/src/crm/contact/sync/sync.service.ts |
Changed cron schedule for syncing contacts from every 8 hours to every 2 minutes for testing. |
packages/api/src/crm/contact/types/dto/get-contacts-query.dto.ts |
Created GetContactsQueryDto for handling pagination query parameters. |
sequenceDiagram
participant User
participant Controller
participant Service
participant Database
User->>+Controller: GetContacts(pageSize, cursor)
Controller->>+Service: getUnifiedContacts(pageSize, cursor)
Service->>+Database: Fetch contacts with cursor
Database-->>-Service: Return contacts, prev_cursor, next_cursor
Service-->>-Controller: Return contacts, prev_cursor, next_cursor
Controller-->>-User: Return paginated contacts
Objective (Issue #) | Addressed | Explanation |
---|---|---|
Implement cursor-based pagination (#430) | ✅ | |
Ensure pagination parameters are handled in controller (#430) | ✅ | |
Update cron schedule for contact syncing (#430) | ✅ |
In fields of code, where data flows, A rabbit hops, where logic grows. With cursors set and pages turned, Contact lists are now well-learned. Syncs that tick like clockwork fine, Every two minutes, right on time. Hopping through the data stream, CodeRabbit makes the system gleam. 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Hello @naelob and @rflihxyz , currently I have added cursor pagination for GET: crm/contacts Unified API to validate the format of the response. Let me know if there are any changes required. then Upon your approval, I will implement cursor pagination for all unified APIs. Thanks.
API response Format
{ data: [...], prev_cursor: value, next_cursor: value }
Summary by CodeRabbit
New Features
- Introduced pagination support in the contact list with
pageSize
andcursor
parameters.Improvements
- Enhanced contact retrieval with more efficient pagination logic.
Testing Enhancements
- Adjusted contact sync schedule to every 2 minutes for testing purposes.
It sounds good for me.
/bounty 200
/attempt #479
with your implementation plan/claim #479
in the PR body to claim the bounty/livestream
once liveThank you for contributing to panoratech/Panora!
Add a bounty • Share on socials
Attempt | Started (GMT+0) | Review |
---|---|---|
🟢 @mit-27 | Jun 11, 2024, 1:02:13 PM | #479 |
/attempt #479
/claim #479
Algora profile | Completed bounties | Tech | Active attempts | Options |
---|---|---|---|---|
@mit-27 | 1 panoratech bounty | TypeScript, Python, Jupyter Notebook & more |
Cancel attempt |
💡 @mit-27 submitted a pull request that claims the bounty. You can visit your bounty board to reward.
🎉🎈 @mit-27 has been awarded $200! 🎈🎊
/claim #479
Hello @naelob and @rflihxyz , currently I have added cursor pagination for GET: crm/contacts Unified API to validate the format of the response. Let me know if there are any changes required. then Upon your approval, I will implement cursor pagination for all unified APIs. Thanks.
API response Format
Summary by CodeRabbit
New Features
pageSize
andcursor
parameters.Improvements
Testing Enhancements