-
-
Notifications
You must be signed in to change notification settings - Fork 34
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/Adding matching property #4930
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request introduces a new Changes
Sequence DiagramsequenceDiagram
participant Client
participant GraphQL
participant QFCalculator
Client->>GraphQL: Request Project Data
GraphQL-->>Client: Return Project with estimatedMatching
Client->>QFCalculator: Calculate Total Estimated Matching
QFCalculator->>QFCalculator: Check QF Strategy
alt Strategy is COCM
QFCalculator-->>Client: Return Matching Value
else Strategy is Regular
QFCalculator->>QFCalculator: Perform Standard Calculation
QFCalculator-->>Client: Return Calculated Matching
end
Possibly Related PRs
Poem
Finishing Touches
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 using PR comments)
Other keywords and placeholders
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: 0
🧹 Nitpick comments (1)
src/apollo/types/types.ts (1)
492-495
: Add documentation for the QF strategy enum values.Consider adding JSDoc comments to explain what each QF strategy represents and when they should be used.
Apply this diff to add documentation:
export enum QfStrategyEnum { + /** Constrained Optimal Capital Matching strategy */ Cocm = 'Cocm', + /** Regular Quadratic Funding matching strategy */ Regular = 'Regular', }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/apollo/gql/gqlDonations.ts
(1 hunks)src/apollo/gql/gqlProjects.ts
(6 hunks)src/apollo/types/types.ts
(3 hunks)src/components/project-card/ProjectCard.tsx
(3 hunks)src/components/views/donate/DonatePageProjectDescription.tsx
(3 hunks)src/components/views/project/projectDonations/ProjectTotalFundCard.tsx
(4 hunks)src/helpers/qf.ts
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (15)
src/helpers/qf.ts (2)
35-36
: LGTM! Parameters are well-defined.The new parameters
matching
andqfStrategy
are properly typed and initialized. The default value of 0 formatching
prevents potential null/undefined issues.
46-49
: LGTM! Clean implementation of COCM strategy.The early return pattern for the COCM strategy is clean and maintainable. The condition is clear and the logic is straightforward.
src/apollo/gql/gqlDonations.ts (1)
173-173
: LGTM! GraphQL query updated correctly.The
matching
field is properly added to theestimatedMatching
object in theFETCH_QF_ROUND_HISTORY
query.src/components/views/donate/DonatePageProjectDescription.tsx (2)
52-57
: LGTM! Clean destructuring of new properties.The
matching
field is properly destructured fromestimatedMatching
along with other existing fields.
155-156
: LGTM! Function parameters updated correctly.The
calculateTotalEstimatedMatching
call is properly updated with the newmatching
andqfStrategy
parameters.src/components/views/project/projectDonations/ProjectTotalFundCard.tsx (2)
123-124
: LGTM! Function calls updated consistently.Both instances of
calculateTotalEstimatedMatching
are properly updated with the newmatching
andqfStrategy
parameters.Also applies to: 135-136
225-225
: LGTM! Good defensive programming.The null check
matchFund || 0
prevents potential runtime errors when formatting the donation amount.src/apollo/types/types.ts (1)
30-30
: LGTM!The
matching
property is correctly typed as a required number, consistent with other properties in the interface.src/apollo/gql/gqlProjects.ts (4)
23-23
: LGTM!The
qfStrategy
field is correctly added to thePROJECT_CORE_FIELDS
fragment, ensuring consistent data fetching across all queries that use this fragment.
55-55
: LGTM!The
matching
field is correctly added to thePROJECT_CARD_FIELDS
fragment, ensuring consistent data fetching across all queries that use this fragment.
185-185
: LGTM!The
matching
andqfStrategy
fields are correctly added to theFETCH_PROJECT_BY_SLUG_DONATION
query.Also applies to: 199-199
283-283
: LGTM!The
matching
andqfStrategy
fields are correctly added to theFETCH_PROJECT_BY_SLUG_SINGLE_PROJECT
query.Also applies to: 296-296
src/components/project-card/ProjectCard.tsx (3)
94-99
: LGTM!The
matching
property is correctly destructured fromestimatedMatching
with proper null checking.
108-108
: LGTM!The
qfStrategy
property is correctly destructured fromactiveQFRound
with proper null checking.
308-309
: LGTM!The
matching
andqfStrategy
parameters are correctly passed to thecalculateTotalEstimatedMatching
function.
Summary by CodeRabbit
Release Notes
New Features
Improvements
Technical Updates