From 5286dd34566dc9ec73cebd49fe816e9b15ac8223 Mon Sep 17 00:00:00 2001 From: jedtan Date: Sun, 3 Sep 2023 18:21:30 -0700 Subject: [PATCH] Integrating GroupImpactHistory --- .../GroupImpactContainer.js | 8 ++++ src/schema/schema.graphql | 42 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/components/groupImpactComponents/GroupImpactContainer.js b/src/components/groupImpactComponents/GroupImpactContainer.js index a3df758b..cfc4bd3a 100644 --- a/src/components/groupImpactComponents/GroupImpactContainer.js +++ b/src/components/groupImpactComponents/GroupImpactContainer.js @@ -35,6 +35,14 @@ export default createFragmentContainer(GroupImpact, { referralDollarContribution } } + groupImpactHistory { + dollarContribution + tabDollarContribution + searchDollarContribution + shopDollarContribution + referralDollarContribution + dateStarted + } } `, }) diff --git a/src/schema/schema.graphql b/src/schema/schema.graphql index 3281a143..e6f2853e 100644 --- a/src/schema/schema.graphql +++ b/src/schema/schema.graphql @@ -986,6 +986,9 @@ type User implements Node { """Current UserGroupImpactMetrics leaderboard""" leaderboard: [leaderboardEntry] + + """User historical data related to group impacts""" + groupImpactHistory: [UserGroupImpactMetricLog] } """a user's charity specific impact""" @@ -1331,6 +1334,45 @@ type leaderboardEntry { user: User } +""" +A historical view of a specific users contribution to a GroupImpactMetric +""" +type UserGroupImpactMetricLog implements Node { + """The ID of an object""" + id: ID! + + """The ID of the user which the UserGroupImpactMetric belongs to""" + userId: String! + + """ + The micro USD amount raised for this instance of GroupImpactMetric so far by this user + """ + dollarContribution: Int! + + """ + The micro USD amount raised for this instance of GroupImpactMetric so far by this user from tabs + """ + tabDollarContribution: Int! + + """ + The micro USD amount raised for this instance of GroupImpactMetric so far by this user from search + """ + searchDollarContribution: Int! + + """ + The micro USD amount raised for this instance of GroupImpactMetric so far by this user from shopping + """ + shopDollarContribution: Int! + + """ + The micro USD amount raised for this instance of GroupImpactMetric so far by this user from referrals + """ + referralDollarContribution: Int! + + """Date the group impact metric started""" + dateStarted: Int! +} + """The Wildfire object""" type Wildfire { causeName: String