Closed RamRamez closed 2 weeks ago
The recent changes pivot around the enhancement of project and donation statistics functionalities. A notable addition is the qfRoundStats
function in donationRepository.ts
for retrieving unique donor counts and total donation values for specific projects and rounds. The caching in sumDonationValueUsdForQfRound
has been removed. Consequently, projectService.ts
has been refactored to consolidate these statistics retrievals using the new qfRoundStats
function, simplifying and improving the code.
File | Change Summary |
---|---|
src/repositories/donationRepository.ts |
Added qfRoundStats function; removed caching in sumDonationValueUsdForQfRound . |
src/services/projectService.ts |
Replaced sumDonationValueUsdForQfRound and countUniqueDonorsForRound with centralized qfRoundStats . |
sequenceDiagram
participant Client
participant ProjectService
participant DonationRepository
Client->>ProjectService: request qfRoundStats
ProjectService->>DonationRepository: call qfRoundStats with projectId, qfRoundId
DonationRepository-->>ProjectService: return uniqueDonorsCount, sumValueUsd
ProjectService-->>Client: return statistics
In the realm of code so grand,
Stats and donors hand in hand,
With a tweak and shift, align the plan,
Caching’s gone, a cleaner span.
qfRoundStats
now leads the band,
Projects shine, donations stand.
Efficient data, just as planned!
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?
Summary by CodeRabbit
New Features
Refactor