Skip to content
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

Alex/cos 3309 set new orgs as prospect leads by default #7296

Merged

Conversation

alexopenline
Copy link
Contributor

@alexopenline alexopenline commented May 24, 2024

Proposed changes

Changes

What types of changes does your code introduce? Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build related changes
  • Documentation Update (if none of the other choices apply)
  • Other (please describe below)

Additional context

Summary by CodeRabbit

  • New Features

    • Introduced new organization stages: READY_TO_BUY, ONBOARDING, INITIAL_VALUE, RECURRING_VALUE, MAX_VALUE, PENDING_CHURN.
    • Added CHURN as a new table ID type.
  • Updates

    • Renamed organization relationship STRANGER to NOT_A_FIT.
    • Removed organization stages: INTERESTED, CLOSED_WON, CLOSED_LOST, NURTURE.
  • Enhancements

    • Improved logic for setting organization stages based on relationship and stage input.
    • Added default handling for churn table view definition if not found.

@alexopenline alexopenline marked this pull request as ready for review May 24, 2024 17:07
Copy link
Contributor

coderabbitai bot commented May 24, 2024

Walkthrough

The changes across the codebase primarily involve renaming and reordering enums in the OrganizationRelationship and OrganizationStage categories, adding new values, and updating corresponding mappings and logic. These updates improve the granularity and accuracy of organization stages and relationships, and introduce new handling for churn scenarios.

Changes

File Path Change Summary
.../customer-os-api-sdk/graph/generated/generated.go Renamed and reordered enums, added new values to OrganizationRelationship, OrganizationStage, and TableIdType.
.../customer-os-api/graph/generated/generated.go Updated enums with new values and removed old ones in OrganizationRelationship, OrganizationStage, and TableIdType.
.../customer-os-api/graph/model/models_gen.go Renamed and redefined constants in OrganizationRelationship, OrganizationStage, and TableIDType.
.../customer-os-api/graph/resolver/organization.resolvers.go Updated OrganizationCreate function logic for setting the Stage field.
.../customer-os-api/graph/resolver/view.resolvers.go Updated TableViewDefs function to handle churn table view definition.
.../customer-os-api/graph/schemas/organization.graphqls Renamed and added new values in OrganizationRelationship and OrganizationStage enums.
.../customer-os-api/graph/schemas/view.graphqls Added CHURN value to TableIdType enum.
.../customer-os-api/mapper/enum/organization_relationship_mapper.go Renamed OrganizationRelationshipStranger to OrganizationRelationshipNotAFit.
.../customer-os-api/mapper/enum/organization_stage_mapper.go Updated mappings for new organization stages.
.../customer-os-neo4j-repository/enum/organization_relationship.go Replaced Stranger with NotAFit in OrganizationRelationship enum.
.../customer-os-neo4j-repository/enum/organization_stage.go Added new stages and removed old ones in OrganizationStage enum.

🐇
In the land of code, enums now align,
Relationships refined, stages redefined.
From strangers to fits, and churns to be seen,
Organizations mapped in a world so keen.
With logic renewed, and stages so bright,
Our codebase evolves, in the springtime light.
🌸

Tip

New Features and Improvements

Review Settings

Introduced new personality profiles for code reviews. Users can now select between "Chill" and "Assertive" review tones to tailor feedback styles according to their preferences. The "Assertive" profile posts more comments and nitpicks the code more aggressively, while the "Chill" profile is more relaxed and posts fewer comments.

AST-based Instructions

CodeRabbit offers customizing reviews based on the Abstract Syntax Tree (AST) pattern matching. Read more about AST-based instructions in the documentation.

Community-driven AST-based Rules

We are kicking off a community-driven initiative to create and share AST-based rules. Users can now contribute their AST-based rules to detect security vulnerabilities, code smells, and anti-patterns. Please see the ast-grep-essentials repository for more information.

New Static Analysis Tools

We are continually expanding our support for static analysis tools. We have added support for biome, hadolint, and ast-grep. Update the settings in your .coderabbit.yaml file or head over to the settings page to enable or disable the tools you want to use.

Tone Settings

Users can now customize CodeRabbit to review code in the style of their favorite characters or personalities. Here are some of our favorite examples:

  • Mr. T: "You must talk like Mr. T in all your code reviews. I pity the fool who doesn't!"
  • Pirate: "Arr, matey! Ye must talk like a pirate in all yer code reviews. Yarrr!"
  • Snarky: "You must be snarky in all your code reviews. Snark, snark, snark!"

Revamped Settings Page

We have redesigned the settings page for a more intuitive layout, enabling users to find and adjust settings quickly. This change was long overdue; it not only improves the user experience but also allows our development team to add more settings in the future with ease. Going forward, the changes to .coderabbit.yaml will be reflected in the settings page, and vice versa.

Miscellaneous

  • Turn off free summarization: You can switch off free summarization of PRs opened by users not on a paid plan using the enable_free_tier setting.
  • Knowledge-base scope: You can now set the scope of the knowledge base to either the repository (local) or the organization (global) level using the knowledge_base setting. In addition, you can specify Jira project keys and Linear team keys to limit the knowledge base scope for those integrations.
  • High-level summary placement: You can now customize the location of the high-level summary in the PR description using the high_level_summary_placeholder setting (default @coderabbitai summary).
  • Revamped request changes workflow: You can now configure CodeRabbit to auto-approve or request changes on PRs based on the review feedback using the request_changes_workflow setting.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 6368c28 and 24507b2.
Files selected for processing (13)
  • packages/server/customer-os-api-sdk/graph/generated/generated.go (2 hunks)
  • packages/server/customer-os-api-sdk/graph/model/models_gen.go (5 hunks)
  • packages/server/customer-os-api/graph/generated/generated.go (2 hunks)
  • packages/server/customer-os-api/graph/model/models_gen.go (5 hunks)
  • packages/server/customer-os-api/graph/resolver/organization.resolvers.go (1 hunks)
  • packages/server/customer-os-api/graph/resolver/view.resolvers.go (3 hunks)
  • packages/server/customer-os-api/graph/resolver/view_helper.go (3 hunks)
  • packages/server/customer-os-api/graph/schemas/organization.graphqls (1 hunks)
  • packages/server/customer-os-api/graph/schemas/view.graphqls (1 hunks)
  • packages/server/customer-os-api/mapper/enum/organization_relationship_mapper.go (1 hunks)
  • packages/server/customer-os-api/mapper/enum/organization_stage_mapper.go (1 hunks)
  • packages/server/customer-os-neo4j-repository/enum/organization_relationship.go (3 hunks)
  • packages/server/customer-os-neo4j-repository/enum/organization_stage.go (2 hunks)
Additional comments not posted (15)
packages/server/customer-os-neo4j-repository/enum/organization_relationship.go (3)

9-9: Added NotAFit to OrganizationRelationship enum.

This change aligns with the PR's objective to adjust organization relationship statuses.


33-33: Validated the inclusion of NotAFit in the IsValid method.

This ensures that NotAFit is recognized as a valid organization relationship.


22-23: Ensure NotAFit.String() correctly returns the string representation.

packages/server/customer-os-api/mapper/enum/organization_relationship_mapper.go (1)

12-12: Updated mapping for OrganizationRelationshipNotAFit.

Correctly maps the new enum value from the model to the Neo4j repository.

packages/server/customer-os-api/mapper/enum/organization_stage_mapper.go (1)

10-19: Updated mapping for new OrganizationStage enums.

The mappings are correctly updated to reflect the new stages introduced in the enums.

packages/server/customer-os-neo4j-repository/enum/organization_stage.go (3)

6-15: Added new OrganizationStage enums.

These additions are consistent with the PR's objectives to redefine organization stages.


51-51: Validated the inclusion of new stages in the IsValid method.

This ensures that all new stages are recognized as valid organization stages.


32-43: Ensure correct string representations for new OrganizationStage values.

packages/server/customer-os-api/graph/schemas/view.graphqls (1)

43-43: The addition of the CHURN enum value aligns with the PR's objectives to handle organization stages related to churn.

packages/server/customer-os-api/graph/resolver/view.resolvers.go (1)

Line range hint 168-237: The updated logic to check for the presence of various table view definitions, including churn, and to create them if they are not found, enhances the robustness of the system.

packages/server/customer-os-api/graph/schemas/organization.graphqls (1)

377-391: The updates to the OrganizationRelationship and OrganizationStage enums align with the PR's objectives to handle new stages and relationships of organizations.

packages/server/customer-os-api/graph/resolver/view_helper.go (1)

419-447: The addition of the DefaultTableViewDefinitionChurn function supports the handling of the new churn stage and is consistent with changes in other files.

packages/server/customer-os-api/graph/resolver/organization.resolvers.go (1)

116-131: Ensure correct default values for Relationship and Stage.

Verification successful

The extracted implementation of the OrganizationCreate function provides a comprehensive view of how default values for Relationship and Stage are set. The logic appears to be correctly implemented, ensuring that default values are assigned based on specific conditions.

Key Points:

  • Relationship Default Value: If input.Relationship is not provided and input.IsCustomer is true, it defaults to OrganizationRelationshipCustomer. If neither is provided, it defaults to OrganizationRelationshipProspect.
  • Stage Default Value: If input.Stage is not provided, the Stage is set based on the Relationship value:
    • OrganizationRelationshipCustomer -> OrganizationStageOnboarding
    • OrganizationRelationshipProspect -> OrganizationStageLead
    • OrganizationRelationshipNotAFit -> OrganizationStageUnqualified
    • OrganizationRelationshipFormerCustomer -> OrganizationStageTarget

Conclusion:

The logic for setting default values for Relationship and Stage in the OrganizationCreate function is correctly implemented and aligns with the intended behavior.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the logic for setting default values in `OrganizationCreate` function.

# Test: Search for the function usage and ensure the default values are correctly applied.
rg --type go $'OrganizationCreate'

Length of output: 10908



Script:

#!/bin/bash
# Description: Extract the implementation of the OrganizationCreate function from organization.resolvers.go for detailed review.

# Search for the OrganizationCreate function implementation in organization.resolvers.go
ast-grep --lang go --pattern $'func (r *mutationResolver) OrganizationCreate(ctx context.Context, input model.OrganizationInput) (*model.Organization, error) {
  $$$
}' packages/server/customer-os-api/graph/resolver/organization.resolvers.go

Length of output: 25501

packages/server/customer-os-api-sdk/graph/model/models_gen.go (2)

4864-4864: Update to OrganizationRelationship enum to reflect new business logic.

The removal of STRANGER and addition of NOT_A_FIT aligns with the new business strategy to categorize organizations more effectively.

Also applies to: 4871-4871


4907-4916: Update to OrganizationStage enum to accommodate new stages in organization lifecycle.

The addition of stages such as READY_TO_BUY, ONBOARDING, INITIAL_VALUE, RECURRING_VALUE, MAX_VALUE, and PENDING_CHURN provides a more granular and realistic tracking of organization progression and lifecycle.

Comment on lines 4862 to 4869
OrganizationRelationshipNotAFit OrganizationRelationship = "NOT_A_FIT"
OrganizationRelationshipFormerCustomer OrganizationRelationship = "FORMER_CUSTOMER"
)

var AllOrganizationRelationship = []OrganizationRelationship{
OrganizationRelationshipCustomer,
OrganizationRelationshipProspect,
OrganizationRelationshipStranger,
OrganizationRelationshipNotAFit,
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The old enum value OrganizationRelationshipStranger is still present in packages/server/user-admin-api/model/cos_input.go and is not referenced elsewhere in the codebase. Please remove this outdated enum value to ensure consistency with the updated business logic.

  • packages/server/user-admin-api/model/cos_input.go
Analysis chain

The enum OrganizationRelationship has been updated to reflect new business logic. The removal of STRANGER and addition of NOT_A_FIT and FORMER_CUSTOMER should be cross-checked to ensure they align with the business requirements and that all references in the codebase have been updated accordingly.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all references to the old `STRANGER` enum value have been updated or removed.

# Test: Search for the old enum value. Expect: No occurrences.
rg --type go 'STRANGER'

Length of output: 151



Script:

#!/bin/bash
# Description: Verify if `OrganizationRelationshipStranger` is still being used in the codebase.

# Test: Search for references to `OrganizationRelationshipStranger`. Expect: No occurrences.
rg --type go 'OrganizationRelationshipStranger'

Length of output: 175

Comment on lines 4905 to 4927
OrganizationStageLead OrganizationStage = "LEAD"
OrganizationStageTarget OrganizationStage = "TARGET"
OrganizationStageEngaged OrganizationStage = "ENGAGED"
OrganizationStageUnqualified OrganizationStage = "UNQUALIFIED"
OrganizationStageReadyToBuy OrganizationStage = "READY_TO_BUY"
OrganizationStageOnboarding OrganizationStage = "ONBOARDING"
OrganizationStageInitialValue OrganizationStage = "INITIAL_VALUE"
OrganizationStageRecurringValue OrganizationStage = "RECURRING_VALUE"
OrganizationStageMaxValue OrganizationStage = "MAX_VALUE"
OrganizationStagePendingChurn OrganizationStage = "PENDING_CHURN"
)

var AllOrganizationStage = []OrganizationStage{
OrganizationStageLead,
OrganizationStageTarget,
OrganizationStageInterested,
OrganizationStageEngaged,
OrganizationStageClosedWon,
OrganizationStageClosedLost,
OrganizationStageUnqualified,
OrganizationStageNurture,
OrganizationStageReadyToBuy,
OrganizationStageOnboarding,
OrganizationStageInitialValue,
OrganizationStageRecurringValue,
OrganizationStageMaxValue,
OrganizationStagePendingChurn,
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The absence of output from the verification scripts indicates that the new stages (READY_TO_BUY, INITIAL_VALUE, RECURRING_VALUE, MAX_VALUE, PENDING_CHURN) are not explicitly handled in the business logic (organization.resolvers.go) and are not covered in the tests (organization.resolvers_it_test.go).

Action Required

  1. Update Business Logic:

    • Ensure that all new stages are explicitly handled in organization.resolvers.go.
  2. Add Tests:

    • Add tests to cover the new stages in organization.resolvers_it_test.go.

Locations Needing Attention

  • packages/server/customer-os-api/graph/resolver/organization.resolvers.go
  • packages/server/customer-os-api/graph/resolver/organization.resolvers_it_test.go

Please update the business logic and tests to handle the new stages appropriately.

Analysis chain

The enum OrganizationStage has been significantly updated with new stages such as READY_TO_BUY, ONBOARDING, INITIAL_VALUE, RECURRING_VALUE, MAX_VALUE, and PENDING_CHURN. This change likely impacts various business processes. Ensure that all parts of the application that depend on this enum are updated to handle these new stages.


The rg command output indicates that the OrganizationStage enum is used in various files across the codebase. To ensure that the new stages are handled correctly, we need to verify the following:

  1. Enum Definition and Mapping: Ensure that the new stages are defined and mapped correctly in the relevant files.
  2. Business Logic: Verify that the business logic handling OrganizationStage includes the new stages.
  3. Tests: Check if there are tests covering the new stages.

Enum Definition and Mapping

The enum definition and mapping appear in several files, such as:

  • packages/server/customer-os-api/graph/model/models_gen.go
  • packages/server/customer-os-api/mapper/enum/organization_stage_mapper.go
  • packages/server/customer-os-neo4j-repository/enum/organization_stage.go

Business Logic

The business logic handling OrganizationStage is found in:

  • packages/server/customer-os-api/graph/resolver/organization.resolvers.go
  • packages/server/events-processing-platform-subscribers/subscriptions/graph/organization_event_handlers.go
  • packages/server/customer-os-neo4j-repository/mapper/node_to_entity_mapper.go

Tests

Tests related to OrganizationStage are found in:

  • packages/server/customer-os-api/graph/resolver/organization.resolvers_it_test.go

To ensure comprehensive verification, we need to check the handling of the new stages in these files. Let's start by examining the enum definition and mapping files to confirm the inclusion of the new stages.

Once we confirm the inclusion of the new stages in the enum definition and mapping, we can proceed to verify the business logic and tests.


The rg command output indicates that the OrganizationStage enum is used in various files across the codebase. To ensure that the new stages are handled correctly, we need to verify the following:

  1. Enum Definition and Mapping: Ensure that the new stages are defined and mapped correctly in the relevant files.
  2. Business Logic: Verify that the business logic handling OrganizationStage includes the new stages.
  3. Tests: Check if there are tests covering the new stages.

Enum Definition and Mapping

The enum definition and mapping appear in several files, such as:

  • packages/server/customer-os-api/graph/model/models_gen.go
  • packages/server/customer-os-api/mapper/enum/organization_stage_mapper.go
  • packages/server/customer-os-neo4j-repository/enum/organization_stage.go

Business Logic

The business logic handling OrganizationStage is found in:

  • packages/server/customer-os-api/graph/resolver/organization.resolvers.go
  • packages/server/events-processing-platform-subscribers/subscriptions/graph/organization_event_handlers.go
  • packages/server/customer-os-neo4j-repository/mapper/node_to_entity_mapper.go

Tests

Tests related to OrganizationStage are found in:

  • packages/server/customer-os-api/graph/resolver/organization.resolvers_it_test.go

To ensure comprehensive verification, we need to check the handling of the new stages in these files. Let's start by examining the enum definition and mapping files to confirm the inclusion of the new stages.

Once we confirm the inclusion of the new stages in the enum definition and mapping, we can proceed to verify the business logic and tests.


The output confirms that the new stages (READY_TO_BUY, ONBOARDING, INITIAL_VALUE, RECURRING_VALUE, MAX_VALUE, PENDING_CHURN) have been correctly defined and mapped in the relevant files:

  • packages/server/customer-os-api/graph/model/models_gen.go
  • packages/server/customer-os-api/mapper/enum/organization_stage_mapper.go
  • packages/server/customer-os-neo4j-repository/enum/organization_stage.go

Next, we need to verify that the business logic and tests handling OrganizationStage include these new stages. This involves checking the following files:

  1. Business Logic:

    • packages/server/customer-os-api/graph/resolver/organization.resolvers.go
    • packages/server/events-processing-platform-subscribers/subscriptions/graph/organization_event_handlers.go
    • packages/server/customer-os-neo4j-repository/mapper/node_to_entity_mapper.go
  2. Tests:

    • packages/server/customer-os-api/graph/resolver/organization.resolvers_it_test.go

Let's proceed by examining these files to ensure the new stages are handled appropriately.


The output confirms that the new stages are included in the enum definition and mapping files. However, the business logic and tests do not seem to fully account for the new stages. Specifically:

  1. Business Logic:

    • packages/server/customer-os-api/graph/resolver/organization.resolvers.go only shows handling for OrganizationStageOnboarding, OrganizationStageLead, OrganizationStageUnqualified, and OrganizationStageTarget. The new stages READY_TO_BUY, INITIAL_VALUE, RECURRING_VALUE, MAX_VALUE, and PENDING_CHURN are not explicitly handled.
    • packages/server/events-processing-platform-subscribers/subscriptions/graph/organization_event_handlers.go and packages/server/customer-os-neo4j-repository/mapper/node_to_entity_mapper.go use a generic decoding function, which might handle all stages, but this needs to be confirmed.
  2. Tests:

    • packages/server/customer-os-api/graph/resolver/organization.resolvers_it_test.go only tests for OrganizationStageLead. There are no tests for the new stages.

Actionable Follow-Up

To ensure comprehensive handling of the new stages, the following steps should be taken:

  1. Update Business Logic:

    • Ensure that all new stages (READY_TO_BUY, INITIAL_VALUE, RECURRING_VALUE, MAX_VALUE, PENDING_CHURN) are explicitly handled in the business logic files.
  2. Add Tests:

    • Add tests to cover the new stages in organization.resolvers_it_test.go.

Verification Scripts

To verify the updates, we need to check for explicit handling of the new stages in the business logic and ensure that tests for these stages are added.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all parts of the application handling `OrganizationStage` have been updated to accommodate new stages.

# Test: Search for the usage of the enum. Expect: Updated logic to handle new stages.
rg --type go 'OrganizationStage'

Length of output: 18177



Script:

#!/bin/bash
# Verify the inclusion of new stages in the enum definition and mapping files

# Check the enum definition in models_gen.go
echo "Checking enum definition in models_gen.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-api/graph/model/models_gen.go

# Check the enum mapping in organization_stage_mapper.go
echo "Checking enum mapping in organization_stage_mapper.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-api/mapper/enum/organization_stage_mapper.go

# Check the enum definition in organization_stage.go
echo "Checking enum definition in organization_stage.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-neo4j-repository/enum/organization_stage.go

Length of output: 4008



Script:

#!/bin/bash
# Verify the inclusion of new stages in the enum definition and mapping files

# Check the enum definition in models_gen.go
echo "Checking enum definition in models_gen.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-api/graph/model/models_gen.go

# Check the enum mapping in organization_stage_mapper.go
echo "Checking enum mapping in organization_stage_mapper.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-api/mapper/enum/organization_stage_mapper.go

# Check the enum definition in organization_stage.go
echo "Checking enum definition in organization_stage.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-neo4j-repository/enum/organization_stage.go

Length of output: 4008



Script:

#!/bin/bash
# Verify the handling of new stages in business logic and tests

# Check business logic in organization.resolvers.go
echo "Checking business logic in organization.resolvers.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-api/graph/resolver/organization.resolvers.go

# Check business logic in organization_event_handlers.go
echo "Checking business logic in organization_event_handlers.go..."
rg --type go 'OrganizationStage' packages/server/events-processing-platform-subscribers/subscriptions/graph/organization_event_handlers.go

# Check business logic in node_to_entity_mapper.go
echo "Checking business logic in node_to_entity_mapper.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-neo4j-repository/mapper/node_to_entity_mapper.go

# Check tests in organization.resolvers_it_test.go
echo "Checking tests in organization.resolvers_it_test.go..."
rg --type go 'OrganizationStage' packages/server/customer-os-api/graph/resolver/organization.resolvers_it_test.go

Length of output: 1727



Script:

#!/bin/bash
# Verify explicit handling of new stages in business logic and ensure tests are added

# Check for explicit handling of new stages in organization.resolvers.go
echo "Checking for explicit handling of new stages in organization.resolvers.go..."
rg --type go 'OrganizationStage(ReadyToBuy|InitialValue|RecurringValue|MaxValue|PendingChurn)' packages/server/customer-os-api/graph/resolver/organization.resolvers.go

# Check for tests covering new stages in organization.resolvers_it_test.go
echo "Checking for tests covering new stages in organization.resolvers_it_test.go..."
rg --type go 'OrganizationStage(ReadyToBuy|InitialValue|RecurringValue|MaxValue|PendingChurn)' packages/server/customer-os-api/graph/resolver/organization.resolvers_it_test.go

Length of output: 677

@alexopenline alexopenline force-pushed the alex/cos-3309-set-new-orgs-as-prospect-leads-by-default branch from 24507b2 to 1ef9dcf Compare May 24, 2024 17:35
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 24507b2 and 1ef9dcf.
Files selected for processing (1)
  • packages/server/customer-os-api/graph/resolver/organization.resolvers.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/server/customer-os-api/graph/resolver/organization.resolvers.go

@alexopenline alexopenline merged commit 60447c6 into otter May 24, 2024
5 checks passed
@alexopenline alexopenline deleted the alex/cos-3309-set-new-orgs-as-prospect-leads-by-default branch May 24, 2024 19:36
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.

None yet

2 participants