Skip to content

Dev To Main Sync#285

Merged
iamitprakash merged 4 commits intomainfrom
develop
Oct 18, 2025
Merged

Dev To Main Sync#285
iamitprakash merged 4 commits intomainfrom
develop

Conversation

@AnujChhikara
Copy link
Contributor

@AnujChhikara AnujChhikara commented Oct 18, 2025

Date: 18 Oct 2025

Developer Name: @AnujChhikara


Issue Ticket Number

PRs going in Sync

Description

  • Added the poc change functionality in the team update api

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Staging Proof
Screen.Recording.2025-10-18.at.10.50.16.PM.mov

Description by Korbit AI

What change is being made?

Refactor dev-to-main team/update flow to centralize validation and simplify patch handling:

  • Introduce new error messages for team operations and wire them through validations.
  • Extend and adjust repository and service logic to validate admin/membership before updates, and to update POC via a simplified interface.
  • Update serializer to require poc_id and remove unnecessary optional fields.
  • Update API view to delegate to the service and streamline error handling.
  • Adjust tests (integration and unit) to cover new validation paths and updated flow.

Key changes include:

  • New messages: USER_NOT_TEAM_MEMBER, POC_NOT_PROVIDED.
  • Exception handling import adjusted for UserNotFoundException.
  • Task repository: poc_id considered when fetching POC teams.
  • UpdateTeamSerializer: poc_id is now required; removed obsolete field handling.
  • TeamService: new methods _validate_is_user_team_admin and _validate_is_user_team_member; update_team signature changed to (team_id, poc_id, user_id); admin/member validations enforced; improved auditing and error responses.
  • Team view: patch flow now calls TeamService.update_team(team_id, poc_id, user_id) and handles ApiErrorResponse consistently.
  • Tests updated to reflect new logic, error messages, and interfaces.

Why are these changes being made?

To enforce proper authorization checks and input validation when updating a team, centralize business logic in the service layer, and simplify the API surface. This improves security (admin/membership validation), reduces coupling in views/serializers, and aligns error reporting with a consistent ApiError framework.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@AnujChhikara AnujChhikara self-assigned this Oct 18, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 18, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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 to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Design Misleading Serializer Name ▹ view
Performance Inconsistent error handling return type ▹ view
Performance Uncached role validation queries ▹ view
Readability Missing Type Hint for Team Parameter ▹ view
Error Handling Missing poc_id validation before conversion ▹ view
Functionality Inconsistent error response format ▹ view
Error Handling Missing response type validation ▹ view
Files scanned
File Path Reviewed
todo/serializers/update_team_serializer.py
todo/constants/messages.py
todo/exceptions/exception_handler.py
todo/repositories/task_repository.py
todo/views/team.py
todo/services/team_service.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@iamitprakash iamitprakash merged commit 7d183b9 into main Oct 18, 2025
4 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