-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: add tacking recurring donations queries #1704
Conversation
WalkthroughThe update significantly enhances the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Resolver
participant Service
participant Database
Client->>Resolver: request recurringDonationsCountPerDate
Resolver->>Service: call recurringDonationsCountPerDateRange
Service->>Database: query data
Database-->>Service: return counts
Service-->>Resolver: return counts
Resolver-->>Client: return data
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review as they are similar to previous changes (1)
Additional comments not posted (2)
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Outside diff range, codebase verification and nitpick comments (2)
src/resolvers/recurringDonationResolver.ts (2)
685-718
: Ensure date format validation.The
resourcePerDateReportValidator
currently validatesfromDate
andtoDate
usingresourcePerDateRegex
, which matches the formatYYYY-MM-DD
. However, the expected format isYYYYMMDD HH:mm:ss
. Please update the regex to match the expected date format.
src/utils/validators/graphqlQueryValidators.ts
: Update theresourcePerDateRegex
to validateYYYYMMDD HH:mm:ss
.Analysis chain
Ensure date format validation.
Ensure that
fromDate
andtoDate
are validated to match the expected formatYYYYMMDD HH:mm:ss
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `fromDate` and `toDate` are validated to match the expected format. # Test: Search for usage of `resourcePerDateReportValidator`. Expect: Matches in the query file. rg --type js --type ts 'resourcePerDateReportValidator'Length of output: 1056
Script:
#!/bin/bash # Description: Extract the definition of `resourcePerDateReportValidator` to verify date format validation. # Extract the definition of `resourcePerDateReportValidator` from the validators file. rg --type js --type ts --context 10 'resourcePerDateReportValidator' src/utils/validators/graphqlQueryValidators.tsLength of output: 791
Script:
#!/bin/bash # Description: Extract the definition of `resourcePerDateRegex` to verify date format validation. # Extract the definition of `resourcePerDateRegex` from the validators file. rg --type js --type ts --context 10 'resourcePerDateRegex' src/utils/validators/graphqlQueryValidators.tsLength of output: 2060
648-683
: Ensure date format validation.The
resourcePerDateReportValidator
uses a regex pattern that does not match the expected formatYYYYMMDD HH:mm:ss
. The current regex matches dates in the formatYYYY-MM-DD
. Please update the regex to match the expected format.
- File:
src/utils/validators/graphqlQueryValidators.ts
- Lines: 1-5
Analysis chain
Ensure date format validation.
Ensure that
fromDate
andtoDate
are validated to match the expected formatYYYYMMDD HH:mm:ss
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `fromDate` and `toDate` are validated to match the expected format. # Test: Search for usage of `resourcePerDateReportValidator`. Expect: Matches in the query file. rg --type js --type ts 'resourcePerDateReportValidator'Length of output: 1056
Script:
#!/bin/bash # Description: Verify that `resourcePerDateReportValidator` validates `fromDate` and `toDate` to match the expected format. # Test: Extract the definition of `resourcePerDateReportValidator` to check the validation rules. rg --type js --type ts 'resourcePerDateReportValidator' -A 10Length of output: 9873
Script:
#!/bin/bash # Description: Verify that `resourcePerDateRegex` matches the expected date format `YYYYMMDD HH:mm:ss`. # Test: Extract the definition of `resourcePerDateRegex` to check the regex pattern. rg --type js --type ts 'resourcePerDateRegex'Length of output: 342
Script:
#!/bin/bash # Description: Extract the full definition of `resourcePerDateRegex` to verify the regex pattern. # Test: Extract the definition of `resourcePerDateRegex` from `src/utils/validators/graphqlQueryValidators.ts`. rg --type js --type ts 'const resourcePerDateRegex' -A 5Length of output: 566
Related to Giveth/analytics-dashboard#22 (comment)
Summary by CodeRabbit
New Features
recurringDonationsCountPerDate
andrecurringDonationsTotalStreamedUsdPerDate
, allowing for detailed data retrieval based on date ranges and verification status.Bug Fixes
Chores