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

onlyEndaement option added to donationResolvers to get only endaoment… #1796

Conversation

HrithikSampson
Copy link
Collaborator

@HrithikSampson HrithikSampson commented Sep 4, 2024

relates to Giveth/analytics-dashboard#13

I have added only Endaoment option to get Donations only from endaoment projects to fetch endaoment project donations when only enldaoment is clicked in analytics dashboard

Summary by CodeRabbit

  • New Features

    • Introduced a new filtering option for donation queries to focus on organizations labeled as "Endaoment."
    • Enhanced several donation-related queries and GraphQL endpoints to support the new filtering parameter, allowing for more targeted data retrieval.
    • Added new test cases to validate the functionality of donation queries specifically for "Endaoment" projects.
  • Bug Fixes

    • Updated caching mechanisms to accurately reflect the new filtering capabilities, ensuring data consistency.

Copy link
Contributor

coderabbitai bot commented Sep 4, 2024

Walkthrough

The changes introduce a new optional parameter, onlyEndaoment, to several donation-related functions within the donationRepository.ts and donationResolver.ts files. This parameter allows for filtering donations based on their association with organizations labeled as "Endaoment." Modifications include enhancements to query logic, adjustments to caching mechanisms, and the addition of new test cases to ensure accurate functionality across the system.

Changes

Files Change Summary
src/repositories/donationRepository.ts, src/resolvers/donationResolver.ts, src/repositories/donationRepository.test.ts, src/resolvers/donationResolver.test.ts Added an optional onlyEndaoment parameter to multiple functions and methods to filter donations by organization label. Updated query logic to include joins for filtering, modified caching keys, and added new test cases to validate the functionality.
test/graphqlQueries.ts Introduced a new optional parameter, $onlyEndaoment, to several GraphQL queries for enhanced filtering capabilities.

Possibly related PRs

  • Endaoment integration #1663: The changes in this PR involve the integration of the Endaoment organization, which includes modifications to donation-related functionalities that are directly relevant to the main PR's focus on filtering donations based on the "Endaoment" label.
  • remove updateTotalDonationsOfProject and sumDonationValueUsd #1648: This PR removes the updateTotalDonationsOfProject function, which is related to donation processing and could impact the logic in the main PR that enhances donation queries.
  • get donation to giveth with donation box analytics #1661: This PR introduces enhancements to donation metrics, which may relate to the new filtering capabilities added in the main PR for donations associated with specific organizations.
  • Feat/issue 743 #1756: This PR adds test cases to ensure that users cannot donate to their own projects, which aligns with the main PR's focus on enhancing donation functionalities and could be relevant in testing the new filtering logic.
  • Implement allocatedGivbacks function #1808: This PR implements a function for calculating eligible donations for Givback, which is relevant to the main PR's focus on enhancing donation queries and metrics.

Suggested labels

Code Review

Poem

🐰 In the meadow where donations flow,
A new filter helps us know,
"Endaoment" shines so bright,
Guiding gifts both day and night.
With every hop, we cheer and play,
For clearer paths in giving's way! 🌼


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>, please review it.
    -- 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 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.
    -- @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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: 0

Outside diff range, codebase verification and nitpick comments (1)
src/resolvers/donationResolver.ts (1)

339-343: LGTM with a suggestion!

The if block correctly filters donations based on the onlyEndaoment parameter.

Suggestion: Consider defining a constant for the string literal 'endaoment' to improve readability and maintainability.

Copy link
Contributor

@ae2079 ae2079 left a comment

Choose a reason for hiding this comment

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

Thanks @HrithikSampson
LGTM

…ytics_track_donation_statistics_for_endaoment_projects

pull staging branch
…ytics_track_donation_statistics_for_endaoment_projects

Update Branch
@ae2079
Copy link
Contributor

ae2079 commented Sep 9, 2024

@HrithikSampson
please fix the failed test case, it seems there are some limitations in the used method of the mocha library for checking the difference between objects

@HrithikSampson
Copy link
Collaborator Author

Hi @ae2079 ,

The test cases have passed, the Second User from the SEED Data was being used to donate to a project and the last donation made was the fifth donation of the SEED Data. Since I used the second user in my code to make donations it was failing, but now after changing it to a new user to make the donations it is passing.

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1311d39 and 1d33d40.

Files selected for processing (5)
  • src/repositories/donationRepository.test.ts (3 hunks)
  • src/repositories/donationRepository.ts (13 hunks)
  • src/resolvers/donationResolver.test.ts (4 hunks)
  • src/resolvers/donationResolver.ts (8 hunks)
  • test/graphqlQueries.ts (4 hunks)
Additional comments not posted (36)
src/repositories/donationRepository.ts (6)

Line range hint 181-214: LGTM!

The changes introduce a new onlyEndaoment filter, enabling the function to retrieve donations specific to Endaoment organizations. The query logic is updated to conditionally join the project and organization tables based on the filter combination, ensuring optimal performance. The cache key is also correctly updated to maintain the integrity of cached results.


Line range hint 233-269: LGTM!

The changes introduce a new onlyEndaoment filter, enabling the function to retrieve donations per month specific to Endaoment organizations. The query logic is updated to conditionally join the project and organization tables based on the filter combination, ensuring optimal performance. The cache key is also correctly updated to maintain the integrity of cached results.


Line range hint 290-323: LGTM!

The changes introduce a new onlyEndaoment filter, enabling the function to retrieve the total number of donations specific to Endaoment organizations. The query logic is updated to conditionally join the project and organization tables based on the filter combination, ensuring optimal performance. The cache key is also correctly updated to maintain the integrity of cached results.


Line range hint 342-377: LGTM!

The changes introduce a new onlyEndaoment filter, enabling the function to retrieve the total number of donations per month specific to Endaoment organizations. The query logic is updated to conditionally join the project and organization tables based on the filter combination, ensuring optimal performance. The cache key is also correctly updated to maintain the integrity of cached results.


Line range hint 397-423: LGTM!

The changes introduce a new onlyEndaoment filter, enabling the function to retrieve the count of unique donors specific to Endaoment organizations. The query logic is updated to join the project and organization tables when onlyEndaoment is true, allowing for filtering based on the organization label. The cache key is also correctly updated to maintain the integrity of cached results.


Line range hint 473-499: LGTM!

The changes introduce a new onlyEndaoment filter, enabling the function to retrieve the count of unique donors per month and year specific to Endaoment organizations. The query logic is updated to join the project and organization tables when onlyEndaoment is true, allowing for filtering based on the organization label. The cache key is also correctly updated to maintain the integrity of cached results.

src/resolvers/donationResolver.ts (5)

75-75: LGTM!

The import statement for ORGANIZATION_LABELS is syntactically correct and likely used in the subsequent code changes.


360-366: LGTM!

The query modification within the if block correctly filters the donations based on the "Endaoment" organization label when the onlyEndaoment parameter is true. The usage of the ORGANIZATION_LABELS.ENDAOMENT constant ensures the correct label is matched.


319-319: Verify the usage of the new onlyEndaoment parameter.

The addition of the optional onlyEndaoment parameter to the totalDonationsPerCategory method is syntactically correct. Ensure that this parameter is properly handled within the method implementation and any relevant code paths.

Run the following script to verify the parameter usage:


381-381: Verify the usage of the new onlyEndaoment parameter.

The addition of the optional onlyEndaoment parameter to the donationsTotalUsdPerDate method is syntactically correct. Ensure that this parameter is properly passed to the relevant repository methods (donationsTotalAmountPerDateRange and donationsTotalAmountPerDateRangeByMonth) and handled correctly within those methods.

Run the following script to verify the parameter usage:

Verification successful

Verification successful: onlyEndaoment parameter is correctly implemented and used.

The onlyEndaoment parameter has been properly added to the donationsTotalUsdPerDate method in src/resolvers/donationResolver.ts. It is correctly used within the method body and passed to relevant repository methods. The parameter is also handled in the repository layer (src/repositories/donationRepository.ts) in multiple methods, indicating proper implementation throughout the codebase. Additionally, test files have been updated to include the new parameter, suggesting that the change has been thoroughly tested.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `onlyEndaoment` parameter in `donationsTotalUsdPerDate`.

# Test: Search for the parameter usage. Expect: Occurrences within the method implementation and relevant repository methods.
rg --type typescript -A 5 $'onlyEndaoment\?\: boolean'

Length of output: 159


Script:

#!/bin/bash
# Description: Verify the usage of the `onlyEndaoment` parameter in `donationsTotalUsdPerDate`.

# Find the method declaration and its body
echo "Method declaration and body:"
ast-grep --lang typescript --pattern 'async donationsTotalUsdPerDate($$$) {
  $$$
}'

# Search for potential usages of the parameter
echo -e "\nPotential usages of onlyEndaoment:"
rg --type typescript -i 'onlyendaoment'

Length of output: 781


Script:

#!/bin/bash
# Description: Verify the existence and usage of the `onlyEndaoment` parameter in `donationsTotalUsdPerDate`.

# Find the method signature
echo "Method signature:"
ast-grep --lang typescript --pattern 'donationsTotalUsdPerDate($_)'

# Search for the method name
echo -e "\nMethod name occurrences:"
rg --type ts 'donationsTotalUsdPerDate'

# Search for potential usages of the parameter
echo -e "\nPotential usages of onlyEndaoment:"
rg --type ts -i 'onlyendaoment'

Length of output: 4390


513-513: Verify the usage of the new onlyEndaoment parameter.

The addition of the optional onlyEndaoment parameter to the totalDonorsCountPerDate method is syntactically correct. Ensure that this parameter is properly passed to the relevant repository methods (donorsCountPerDate and donorsCountPerDateByMonthAndYear) and handled correctly within those methods.

Run the following script to verify the parameter usage:

Verification successful

Verification of onlyEndaoment parameter usage successful.

The onlyEndaoment parameter has been properly implemented and is being used correctly in the codebase. It is present in multiple functions including donorsCountPerDate, donorsCountPerDateByMonthAndYear, and totalDonorsCountPerDate. The parameter is consistently used as an optional boolean to filter donations for Endaoment projects when set to true. The implementation appears to be correct and aligns with the intended functionality.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `onlyEndaoment` parameter in `totalDonorsCountPerDate`.

# Test: Search for the parameter usage. Expect: Occurrences within the method implementation and relevant repository methods.
rg --type typescript -A 5 $'onlyEndaoment\?\: boolean'

Length of output: 159


Script:

#!/bin/bash
# Description: Verify the usage of the `onlyEndaoment` parameter in `totalDonorsCountPerDate`.

# Search for the parameter declaration (both correct and misspelled versions)
echo "Searching for parameter declaration:"
rg --type typescript -A 5 'only(Endaoment|Endowment)\?\s*:\s*boolean'

# Find the method implementation and check for parameter usage
echo "Searching for method implementation:"
ast-grep --lang typescript --pattern $'@Query(() => [DonorCountPerDateType])
async totalDonorsCountPerDate(
  $$$
  only(Endaoment|Endowment)\?: boolean,
  $$$
) {
  $$$
}'

# Search for usage in related repository methods
echo "Searching for usage in repository methods:"
rg --type typescript -A 10 'donorsCountPerDate|donorsCountPerDateByMonthAndYear'

Length of output: 1212


Script:

#!/bin/bash
# Description: Verify the usage of the `onlyEndaoment` parameter in `totalDonorsCountPerDate`.

# Search for the parameter declaration
echo "Searching for parameter declaration:"
fd -e ts -x rg -A 5 'only(Endaoment|Endowment)\?:\s*boolean'

# Find the method implementation
echo "Searching for method implementation:"
ast-grep --lang typescript --pattern 'async totalDonorsCountPerDate($$$) {'

# Search for parameter usage in the method body
echo "Searching for parameter usage in method body:"
fd -e ts -x rg -A 10 'totalDonorsCountPerDate.*\{' -p1 | rg 'only(Endaoment|Endowment)'

# Search for usage in related repository methods
echo "Searching for usage in repository methods:"
fd -e ts -x rg -A 10 'donorsCountPerDate|donorsCountPerDateByMonthAndYear'

Length of output: 270893

test/graphqlQueries.ts (4)

573-580: LGTM!

The new optional parameter $onlyEndaoment is correctly added to the fetchTotalDonationsPerCategoryPerDate query and passed to the totalDonationsPerCategory function. This allows filtering donations from only Endaoment organizations, enhancing the query functionality without introducing breaking changes.


616-622: Looks good!

The $onlyEndaoment parameter is properly added to the fetchTotalDonors query and passed to the totalDonorsCountPerDate function. This allows filtering total donors from only Endaoment organizations, enhancing the query functionality without causing any breaking changes.


639-646: Approved!

The $onlyEndaoment parameter is correctly added to the fetchTotalDonationsUsdAmount query and passed to the donationsTotalUsdPerDate function. This allows filtering total donations USD amount from only Endaoment organizations, enhancing the query functionality without introducing any breaking changes.


659-678: Changes look great!

The $onlyEndaoment parameter is properly added to the fetchTotalDonationsNumberPerDateRange query and passed to the totalDonationsNumberPerDate function. This allows filtering total donations number per date range from only Endaoment organizations, enhancing the query functionality without causing any breaking changes.

The reformatting of the query and function arguments with line breaks and indentation improves readability without altering the functionality.

src/repositories/donationRepository.test.ts (11)

99-190: LGTM!

The test case looks good. It correctly sets up the test data and makes the appropriate assertions to verify the donorsCountPerDateByMonthAndYear function behavior for all projects vs endaoment projects over a 3 month period.


192-237: LGTM!

The test case looks good. It correctly sets up the test data and makes the appropriate assertions to verify the donationsNumberPerDateRange function behavior for all projects vs endaoment projects on a specific date.


239-334: LGTM!

The test case looks good. It correctly sets up the test data and makes the appropriate assertions to verify the donationsTotalNumberPerDateRangeByMonth function behavior for all projects vs endaoment projects over a 3 month period.


336-381: LGTM!

The test case looks good. It correctly sets up the test data and makes the appropriate assertions to verify the donationsNumberPerDateRange function behavior for all projects vs endaoment projects on a specific date.


383-490: LGTM!

The test case looks good. It correctly sets up the test data and makes the appropriate assertions to verify the donationsTotalAmountPerDateRangeByMonth function behavior for all projects vs endaoment projects over a 3 month period.


492-544: LGTM!

The test case looks good. It correctly sets up the test data and makes the appropriate assertions to verify the donationsTotalAmountPerDateRange function behavior for all projects vs endaoment projects on a specific date.


Line range hint 545-583: LGTM!

The test case looks good. It correctly sets up the test data, triggers the fillQfRoundDonationsUserScores function by setting the QF round to inactive, and makes the appropriate assertions to verify that qfRoundUserScore is populated correctly based on the donation status.


Line range hint 585-686: LGTM!

The test cases look good. They correctly set up the test data, refresh the estimated matching view, and make the appropriate assertions to verify the expected matching distribution behavior based on the number and size of donations to each project.


Line range hint 688-724: LGTM!

The test cases look good. They correctly set up the test data and make the appropriate assertions to verify the expected behavior of the findDonationsByTransactionId function, including case-insensitivity and handling of non-existent transaction IDs.


Line range hint 726-772: LGTM!

The test cases look good. They correctly set up the test data and make the appropriate assertions to verify the expected behavior of the findDonationById function, including checking for associated project and QF round, and handling of non-existent donation IDs.


Line range hint 774-800: LGTM!

The test case looks good. It correctly sets up the test data, calls the createDonation function with the necessary data, and makes the appropriate assertion to verify that the created donation is associated with the correct project.

src/resolvers/donationResolver.test.ts (10)

171-276: Approved: The new test case for endaoment projects looks good!

The added test case thoroughly verifies the donation count per category for endaoment projects over a specified time range. It checks the counts before and after adding donations, and also filters for only endaoment projects within the time frame. The implementation looks correct and comprehensive.


330-431: Approved: The new test case for endaoment projects looks good!

The added test case thoroughly verifies the total donation count for endaoment projects over a specified time range. It checks the total count, the count for only verified donations, and the count for verified endaoment donations. The implementation looks correct and comprehensive.


519-639: Approved: The new test case for endaoment projects looks good!

The added test case thoroughly verifies the unique donor count for endaoment projects over a specified time range. It checks the total unique count for all projects and for only endaoment projects, handling anonymous donations separately. The implementation looks correct and comprehensive.


Line range hint 641-679: LGTM!

The test case correctly verifies the new donor count and their total donation over a specified time range. It sets up the test data appropriately and makes the right assertions.


Line range hint 681-806: Approved: The test cases for doesDonatedToProjectInQfRound query look good!

The test cases cover various scenarios thoroughly:

  • When there is a verified donation in the specified QF round
  • When the donation is non-verified
  • When the projectId, qfRoundId, or userId is invalid

The test case implementations look correct and make the right assertions.


960-1031: Approved: The new test case for endaoment projects looks good!

The added test case thoroughly verifies the total USD amount for donations to endaoment projects over a specified time range. It creates donations to endaoment and non-endaoment projects and checks the total amount and the amount for only endaoment projects. The implementation looks correct and comprehensive.


Line range hint 1033-1222: LGTM: The test cases for donations query look good!

The test cases cover various scenarios thoroughly:

  • Error handling for invalid fromDate and toDate formats
  • Returning results without any time filters
  • Returning results with recurring donations joined
  • Filtering results by fromDate, toDate, and both
  • Including project categories in the returned donations

The test case implementations look correct and make the right assertions.


Line range hint 1224-2591: Excellent test coverage for createDonation mutation!

The test cases are very comprehensive and cover a wide range of scenarios, including:

  • Creating donations for different organizations on different networks
  • Handling different tokens based on the organization and network
  • Extensive error handling for invalid scenarios
  • Verifying donation status and segmentNotified after creation
  • Saving referrer wallet and handling anonymous donations
  • Marking draft donations as matched
  • Filling USD value and givback calculations
  • Creating donations for active QF rounds
  • Creating Solana donations

The test case implementations look thorough, correct, and make the right assertions. Great job with the test coverage!


Line range hint 2593-2686: LGTM: The test cases for donationsFromWallets query look good!

The test cases cover the important scenarios:

  • Finding donations from the specified wallet address successfully
  • Finding donations from the specified wallet address in uppercase successfully
  • Finding donations from only the specified wallet address when there are donations from other addresses too
  • Returning no donations when there are no donations from the specified wallet address

The test case implementations look correct and make the right assertions.


Line range hint 2688-3021: Comprehensive test coverage for donationsByProjectId query!

The test cases cover a range of scenarios, including:

  • Filtering donations by QF round
  • Sorting donations by different fields in ascending and descending order
  • Searching donations by various criteria (user name, amount, currency, toWalletAddress)
  • Filtering donations by status and returning all donations when no status filter is provided
  • Returning recurringDonationsCount and totalCount correctly

The test case implementations look thorough, correct, and make the right assertions. The test coverage for this query is comprehensive and covers the important scenarios and edge cases. Well done!

@@ -406,6 +418,7 @@ export class DonationResolver {
@Arg('toDate', { nullable: true }) toDate?: string,
@Arg('networkId', { nullable: true }) networkId?: number,
@Arg('onlyVerified', { nullable: true }) onlyVerified?: boolean,
@Arg('onlyEndaoment', { nullable: true }) onlyEndaoment?: boolean,
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

Incorrect parameter usage and naming issue detected

The onlyEndaoment parameter has been added to the totalDonationsNumberPerDate method, but there are some issues:

  1. The parameter is not being used in the method implementation or passed to the repository methods (donationsNumberPerDateRange and donationsTotalNumberPerDateRangeByMonth).
  2. There's a typo in the parameter name: onlyEndaoment should be onlyEndowment.

To resolve these issues:

  • Correct the parameter name to onlyEndowment.
  • Implement the parameter usage in the totalDonationsNumberPerDate method.
  • Pass the parameter to the relevant repository methods if needed.
Analysis chain

Verify the usage of the new onlyEndaoment parameter.

The addition of the optional onlyEndaoment parameter to the totalDonationsNumberPerDate method is syntactically correct. Ensure that this parameter is properly passed to the relevant repository methods (donationsNumberPerDateRange and donationsTotalNumberPerDateRangeByMonth) and handled correctly within those methods.

Run the following script to verify the parameter usage:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `onlyEndaoment` parameter in `totalDonationsNumberPerDate`.

# Test: Search for the parameter usage. Expect: Occurrences within the method implementation and relevant repository methods.
rg --type typescript -A 5 $'onlyEndaoment\?\: boolean'

Length of output: 159


Script:

#!/bin/bash
# Description: Verify the usage of the `onlyEndaoment` parameter in `totalDonationsNumberPerDate`.

# Search for the method implementation and parameter usage
ast-grep --lang typescript --pattern $'@Arg("onlyEndaoment", { nullable: true }) onlyEndaoment\?: boolean,
  $$$
  async totalDonationsNumberPerDate($$$) {
    $$$
  }'

# Search for both correct and misspelled parameter usage in the entire codebase
rg --type typescript -i '(onlyendao?wment)'

# Search for related repository method calls
rg --type typescript 'donationsNumberPerDateRange|donationsTotalNumberPerDateRangeByMonth'

Length of output: 927


Script:

#!/bin/bash
# Description: Verify the usage of the `onlyEndaoment` parameter in `totalDonationsNumberPerDate`.

# Search for the parameter declaration
ast-grep --lang typescript --pattern '@Arg("onlyEndaoment", { nullable: true }) onlyEndaoment?: boolean,'

# Search for the method implementation and parameter usage
rg 'async totalDonationsNumberPerDate' -A 10

# Search for both correct and misspelled parameter usage in the entire codebase
rg -i '(onlyendao?wment)'

# Search for related repository method calls
rg 'donationsNumberPerDateRange|donationsTotalNumberPerDateRangeByMonth'

Length of output: 3540

@HrithikSampson HrithikSampson merged commit 5c61a99 into staging Sep 18, 2024
5 checks passed
@HrithikSampson HrithikSampson deleted the 13_analytics_track_donation_statistics_for_endaoment_projects branch September 18, 2024 10:14
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