Giveth / impact-graph

MIT License
47 stars 17 forks source link

Track recurring donation statistics #1477

Open divine-comedian opened 3 months ago

divine-comedian commented 3 months ago

We should be able to query and track the following information related to recurring donations feature:

This information should be available through https://stats.giveth.io/

jainkrati commented 3 months ago

@Meriem-BM pls work on this with guidance from @mohammadranjbarz

mohammadranjbarz commented 3 months ago

We should implement a new endpoint in recurringDonationResolver.ts with name of getRecurringDonationStats

Input

Output

PS Please don't forget to write test cases For writing test cases look at https://github.com/Giveth/impact-graph/blob/staging/src/resolvers/donationResolver.test.ts#L105-L146 to know how to pass dates as input

@divine-comedian Please read this spec and correct me if there is something wrong @Meriem-BM Please tell me if something is not clear to you

divine-comedian commented 3 months ago

This looks great Mohammad!

Meriem-BM commented 2 months ago

@maryjaf, this issue is ready for test

maryjaf commented 2 months ago

Please send the api/query or other thing that I can use it for test of this issue @Meriem-BM @mohammadranjbarz

Meriem-BM commented 2 months ago

@maryjaf here is the query

query (
    $beginDate: String!
    $endDate: String!
    $currency: String
    ) {
      getRecurringDonationStats(
        beginDate: $beginDate
        endDate: $endDate
        currency: $currency
      ) {
        totalStreamedUsdValue,
        activeRecurringDonationsCount,
      }
  }

with 2 required variables beginDate & endDate and other optional currency. Date format YYYY-MM-DD.

maryjaf commented 1 month ago

I want to check the response of the query from admin bro->recurring donation tab, but I got below error please take a look @Meriem-BM

image.png

It seems this field isn't correct in response of query "totalStreamedUsdValue": 2630.3987 on stg , but i need to check from admin bro to be sure

Meriem-BM commented 1 month ago

@maryjaf It still under development, right @mohammadranjbarz (Recurring donations tab)?

divine-comedian commented 1 month ago

@Meriem-BM - this shouldn't go to UAT column until it is ready to test or else this creates confusion.. moving this back

Meriem-BM commented 1 month ago

Hey @maryjaf can you check this once again

maryjaf commented 3 weeks ago

Hey @maryjaf can you check this once again

Is it ready for testing ? it is on code review state @Meriem-BM

Meriem-BM commented 3 weeks ago

Hey @maryjaf can you check this once again

Is it ready for testing ? it is on code review state @Meriem-BM

Yes @maryjaf, forgot to move it

maryjaf commented 3 weeks ago
  • total USD value of all recurring donations made in a specific token between two dates
  • count of active recurring donations made with a speicfic token created between two dates

Thanks @Meriem-BM

query ( $beginDate: String! $endDate: String! $currency: String ) { getRecurringDonationStats( beginDate: $beginDate endDate: $endDate currency: $currency ) { totalStreamedUsdValue, activeRecurringDonationsCount, } }


  • total USD value of all recurring donations between two dates
  • count of active recurring donations created between two dates

The tests of these 2 items have been passed

Meriem-BM commented 3 weeks ago

@maryjaf you can pass the token to currency field (DAI, USDT...)

divine-comedian commented 1 week ago

@Meriem-BM is it possible to merge this feature to production?

Meriem-BM commented 1 week ago

@Meriem-BM is it possible to merge this feature to production?

Yes, the important part is on prod, just last PR isn't which fixes problem of recurring donations tab on admin panel not listing data, do you want me to merge it?

Screenshot 2024-07-05 at 13 10 14 (2)