Skip to content
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

sync all donations totals #1594

Merged
merged 2 commits into from
May 29, 2024
Merged

sync all donations totals #1594

merged 2 commits into from
May 29, 2024

Conversation

CarlosQ96
Copy link
Collaborator

@CarlosQ96 CarlosQ96 commented May 29, 2024

Summary by CodeRabbit

  • Improvements
    • Enhanced the accuracy of total donation calculations by including matching funds in the sum.
    • Simplified the calculation of project donation values for better performance and reliability.

Copy link
Contributor

coderabbitai bot commented May 29, 2024

Walkthrough

The recent updates focus on enhancing the donation tracking and project statistics functionalities. Specifically, the donationService now includes a condition to sum matchingFundPriceUsd from the qfRoundHistory table when calculating totalDonations for a project. Simultaneously, projectService has been streamlined to directly assign the result of sumDonationValueUsd to project.sumDonationValueUsd, removing redundant calculations.

Changes

Files Change Summary
src/services/donationService.ts Updated updateTotalDonationsOfProject to include matchingFundPriceUsd from qfRoundHistory table.
src/services/projectService.ts Simplified updateProjectStatistics by directly using sumDonationValueUsd for project.sumDonationValueUsd.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant Project
    participant DonationService
    participant QfRoundHistory

    Note over DonationService: Old Flow
    Project->>DonationService: updateTotalDonationsOfProject(projectId)
    DonationService->>QfRoundHistory: getMatchingFundPriceUsd(projectId)
    QfRoundHistory-->>DonationService: matchingFundPriceUsd
    DonationService-->>Project: totalDonations

    Note over DonationService: New Flow
    Project->>DonationService: updateTotalDonationsOfProject(projectId)
    DonationService->>QfRoundHistory: getMatchingFundPriceUsd(projectId)
    QfRoundHistory-->>DonationService: matchingFundPriceUsd
    DonationService-->>Project: totalDonations (includes matchingFundPriceUsd)
Loading
sequenceDiagram
    participant Project
    participant ProjectService
    participant DonationService

    Note over ProjectService: Old Flow
    Project->>ProjectService: updateProjectStatistics(projectId)
    ProjectService->>DonationService: getQfRoundHistoryMatchingValueUsd(projectId)
    DonationService-->>ProjectService: matchingValueUsd
    ProjectService->>Project: project.sumDonationValueUsd = matchingValueUsd

    Note over ProjectService: New Flow
    Project->>ProjectService: updateProjectStatistics(projectId)
    ProjectService->>DonationService: sumDonationValueUsd(projectId)
    DonationService-->>ProjectService: sumDonationValueUsd
    ProjectService->>Project: project.sumDonationValueUsd = sumDonationValueUsd
Loading

Poem

In code's bright dance, a change so grand,
Donations tallied across the land.
With matching funds now in the mix,
Projects thrive, no need for tricks.
Statistics streamlined, clear and bright,
Our code now shines, a guiding light.
🐇✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Outside diff range and nitpick comments (3)
src/services/projectService.ts (1)

Line range hint 27-27: Consider using template literals for string concatenation to improve readability and maintainability.

- slug = slug + '-' + (projectCount - 1);
+ slug = `${slug}-${projectCount - 1}`;
src/services/donationService.ts (2)

Line range hint 4-5: Consider removing unused imports to clean up the codebase and improve clarity.

- import { getTokenPrices } from '@giveth/monoswap';
- import { Token } from '../entities/token';
- import { getChainvineAdapter, getNotificationAdapter } from '../adapters/adaptersFactory';

Also applies to: 45-46


Line range hint 372-372: Avoid using non-null assertions as they can lead to runtime errors if assumptions about non-nullability prove incorrect.

- const powerRound = (await getPowerRound())!.round || 1;
+ const powerRoundResult = await getPowerRound();
+ const powerRound = powerRoundResult ? powerRoundResult.round : 1;
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 7554f78 and 8950178.
Files selected for processing (2)
  • src/services/donationService.ts (1 hunks)
  • src/services/projectService.ts (2 hunks)
Additional Context Used
Biome (4)
src/services/donationService.ts (3)

372-372: Forbidden non-null assertion.


4-5: All these imports are only used as types.


45-46: Some named imports are only used as types.

src/services/projectService.ts (1)

27-27: Template literals are preferred over string concatenation.

Additional comments not posted (2)
src/services/projectService.ts (1)

56-56: The refactoring of updateProjectStatistics simplifies the donation value aggregation. Good job on enhancing readability and potentially improving performance.

src/services/donationService.ts (1)

194-204: The updated SQL query in updateTotalDonationsOfProject now correctly includes matching funds in the total donations calculation. This should provide a more accurate financial overview for projects.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Outside diff range and nitpick comments (2)
src/services/donationService.ts (2)

Line range hint 4-5: Optimize imports by removing unused ones.

- import { Project } from '../entities/project';
- import { Token } from '../entities/token';
- import { Donation, DONATION_STATUS } from '../entities/donation';
- import { TransakOrder } from './transak/order';
- import { logger } from '../utils/logger';
- import {
-   findUserById,
-   findUserByWalletAddress,
- } from '../repositories/userRepository';
- import {
-   errorMessages,
-   i18n,
-   translationErrorMessagesKeys,
- } from '../utils/errorMessages';
- import { findProjectById } from '../repositories/projectRepository';
- import { convertExponentialNumber } from '../utils/utils';
- import { fetchGivHistoricPrice } from './givPriceService';
- import {
-   findDonationById,
-   findStableCoinDonationsWithoutPrice,
- } from '../repositories/donationRepository';
- import {
-   getChainvineAdapter,
-   getNotificationAdapter,
- } from '../adapters/adaptersFactory';
- import { calculateGivbackFactor } from './givbackService';
- import SentryLogger from '../sentryLogger';
- import {
-   getUserDonationStats,
-   updateUserTotalDonated,
-   updateUserTotalReceived,
- } from './userService';
- import {
-   refreshProjectDonationSummaryView,
-   refreshProjectEstimatedMatchingView,
- } from './projectViewsService';
- import { AppDataSource } from '../orm';
- import { getQfRoundHistoriesThatDontHaveRelatedDonations } from '../repositories/qfRoundHistoryRepository';
- import { getPowerRound } from '../repositories/powerRoundRepository';
- import { fetchSafeTransactionHash } from './safeServices';
- import { NETWORKS_IDS_TO_NAME } from '../provider';
- import { getTransactionInfoFromNetwork } from './chains';
- import { getEvmTransactionTimestamp } from './chains/evm/transactionService';
- import { getOrttoPersonAttributes } from '../adapters/notifications/NotificationCenterAdapter';
- import { CustomToken, getTokenPrice } from './priceService';
- import { updateProjectStatistics } from './projectService';

Also applies to: 45-46


Line range hint 366-366: Avoid using non-null assertions without checking for nullity.

- const powerRound = (await getPowerRound())?.round || 1;
+ const powerRoundResult = await getPowerRound();
+ const powerRound = powerRoundResult ? powerRoundResult.round : 1;
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8950178 and f3eccca.
Files selected for processing (1)
  • src/services/donationService.ts (2 hunks)
Additional Context Used
Biome (3)
src/services/donationService.ts (3)

366-366: Forbidden non-null assertion.


4-5: All these imports are only used as types.


45-46: Some named imports are only used as types.

Additional comments not posted (1)
src/services/donationService.ts (1)

194-198: Ensure the SQL query is safe from SQL injection.

Verification successful

The SQL queries in donationService.ts appear to be parameterized correctly, using placeholders like $1 to prevent SQL injection.

  • The UPDATE query uses $1 for the projectId parameter.
  • The INSERT query also appears to be structured safely.

No immediate issues with SQL injection vulnerabilities were found in the provided snippets.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if the SQL query in `updateTotalDonationsOfProject` is parameterized correctly.

# Test: Search for SQL queries in the file and check for parameter usage.
rg --type typescript $'SELECT|UPDATE|INSERT' src/services/donationService.ts

Length of output: 112



Script:

#!/bin/bash
# Description: Verify if the SQL query in `updateTotalDonationsOfProject` is parameterized correctly.

# Test: Search for SQL queries in the file and check for parameter usage.
rg --type ts $'SELECT|UPDATE|INSERT' src/services/donationService.ts

Length of output: 211



Script:

#!/bin/bash
# Description: Extract SQL queries from `donationService.ts` and verify parameter usage.

# Extract SQL queries
rg --type ts 'SELECT|UPDATE|INSERT' src/services/donationService.ts -A 5 -B 5

Length of output: 1582

@CarlosQ96 CarlosQ96 merged commit 8348342 into staging May 29, 2024
3 checks passed
@CarlosQ96 CarlosQ96 deleted the hotfix_project_total_donated branch May 29, 2024 21:36
CarlosQ96 added a commit that referenced this pull request May 29, 2024
* sync all donations totals

* add update qfroundmatching
mohammadranjbarz added a commit that referenced this pull request Jun 2, 2024
* add activeQfRoundId to sortingBy InstantBoosting

* add orderBy totalDonations and totalReactions

* feat: add getRecurringDonationStats resolver

* fix filtering by QF

* remove qfRounds joins for non qf round filters

* add some temp logs

* remove temp logs

* fix: changes test cases of recuring donations stats
- create recored with createdAt field in past so test result won't be related to other endpoints test cases

* Fix projectActualserviceView

* fix stream balance depleted issue (#1496)

Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* rebuild

* refresh and fetch user address separately (#1499)

* Added pg_trgm extension migration (#1502)

* fix: change recurring donations stats query to single query

* fix recurring donation count

* WIP: projectIds textArea

* fix actual matching cap (#1507)

* fix query error

* fix user donations count

* fix recurring donation count tests

* fix user recurring donation query

* fix user recurring donation test

* add donations relation to qfround

* add findArchivedQfRounds endpoint

* add findArchivedQfRounds endpoint

* feat: add sponsors & banner images upload

* add sortBy to findArchivedQfRounds

* 1.23.3

* add new test graphql query

* add tests for new QfArchivedRounds

* fixes on qfArchivedRounds query

* add new tests for qfArchivedRounds query

* fix findArchivedQfRounds tests

* fix: keep already uploaded sponsors images

* fix skip and limit for findArchivedQfRounds

* Add logs and refactor the bootstrap code to help investigate latency problem

* Add poolSize to orm config

* Fix eslint errors

* remove changing squareRootSumOfProjects when cap is overflown

* Trigger ortto activity when user saves their profile info for the first time (#1520)

* add newUser to updateUser query

* add createOrttoProfile

* add createOrttoProfile to NotificationAdapterInterface

* add createOrttoProfile to MockNotificationAdapter

* add CREATE_ORTTO_PROFILE event

* Allow to set the matching pool token & amount to be something other than usd (#1517)

* Allow to set the matching pool token & amount to be something other than USD in adminjs

* Allow to set the matching pool token & amount to be something other than USD in QFRound table

* add null to allocatedTokenSymbol and allocatedTokenChainId

* add nullable true to allocatedTokenSymbol and allocatedTokenChainId

* add allocatedFundUSDPreferred and allocatedFundUSD to qfRound

* Comment migrations

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* add qfRound to qfRoundStats

* fix qfRoundStatsQuery

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add logs to projectVerificationForm

* Add logs to projectVerificationForm

* fix: add project Ids list textarea for qf round edit

* Master to staging (#1543)

* Hotfix db improvements (#1523) (#1524)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* Fix/db replica production (#1525)

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* Define db read only configs

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* update comment

* Hotfix latency issues for prod (#1529)

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add informative logs for draft donation service job (#1537)

* Fix eslint errors

* Fix/master test (#1541)

* Fixed master test issue

* Returned test to master pipeline

* Comment executing donation summary view

---------

Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* Fix/word similarity - staging (#1546)

* Hotfix db improvements (#1523) (#1524)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* Fix/db replica production (#1525)

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* Define db read only configs

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* update comment

* Hotfix latency issues for prod (#1529)

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add informative logs for draft donation service job (#1537)

* Fix eslint errors

* Fix/master test (#1541)

* Fixed master test issue

* Returned test to master pipeline

* Comment executing donation summary view

---------

Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>

* Fixed word similarity issue

* Removed unused import

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* remove refresh_project_summary_from totals and add user cache (#1539)

* Remove users field from project

* Remove users field from filterProjectsQuery

* Remove projects field from user

* remove added logs

* fix eslint errors

* remove users from Project.create

* remove users from Project.create in testUtils.ts

* remove projectOwnerId

* replace admin with adminUserId

* Add recurring donation join to donations() endpoint (#1554)

related to #1483

* replace admin with adminUserId in SEED data

* replace admin with adminUserId

* replace admin with adminUserId in projectResolver.ts

* replace admin with adminUserId in projectsTab.ts

* replace admin with adminUserId in projectResolver.test.ts

* replace admin with adminUserId in projectResolver.ts

* add allocatedFundUSD and allocatedTokenSymbol to qfArchivedRounds

* fix nullable

* remove admin from project

* replace admin with adminUserId

* replace admin with adminUserId

* add adminUserId field

* drop admin column

* Implementing read-only node replica in local

* fix: add telegram to ProjectSocialMediaType enum to allow adding telegram url

* Add some logs

* Fix eslint errors

* Add maxQueuedJobs for draft donation worker

* Fix eslint errors

* fix unstable test case

* Disable concurrency for draft donation worker

* add indexes to project_summary_view (#1568)

* improve projectBySlug query

* fix: change output types to float

* Ignore small differences of amounts when matching draft donation for erc20

* add graphql-fields

* add getVerificationFormStatusByProjectId

* refactor projectBySlug

* add findProjectIdBySlug

* fix projectBySlug tests with new changes

* fix projectBySlug tests with new changes

* fix projectBySlug tests with new changes

* remove projectVerificationForm assert

* add logs

* fix title in should return projects with indicated slug test

* Add streamed mini donations to qf round (#1557)

* Add streamed mini donations to qf round

related to Giveth/giveth-dapps-v2#3284

* Fix eslint error

* Fix eslint errors

* make verificationFormStatus field public

* Reduce test runnning time (#1574)

* fix: reduce test runnning time

* fix: add permissions test case

* fix: add permissions test case

* fix: refactor (excluding permissions test cases from global beforeEach)

* add migration and columns for totals in project entity (#1571)

* add migration and columns for totals in project entity

* add service to update project totals

* add filling the value for new fields

* WIP add base network

* add word similarity to search

* fix word similarity test case

* add defaultMode to replication

* Continue on integrating with base chain

* Fix migrations

* Fix migrations

* optimize projectById

* add passport score to streams minidonations

* Add methods for adding matching to totals usd received (#1582)

* add methods for adding matching to totals usd received

* Update src/repositories/qfRoundHistoryRepository.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* add coalesce to get 0 always incase null total matching

* Add test cases about filteriing base network

* Add BASE node http urls for rpc

* Add BASE node http urls for rpc

* Add missing things for integrating with base

* merge stage

* Limit characters of each cell to less than 5000 characters

* Fix eslint errors

* Fix creating new token with coingeckoId

related to #1564

* Fill base mainnet tokens

related to #1561

* optimize qfRounds query

* Add base chain (#1579)

* Ignore small differences of amounts when matching draft donation for … (#1573)

* Ignore small differences of amounts when matching draft donation for erc20

* Fix eslint errors

* Release Integrate QF with super fluid streamed donations (#1555)

* add activeQfRoundId to sortingBy InstantBoosting

* add orderBy totalDonations and totalReactions

* feat: add getRecurringDonationStats resolver

* fix filtering by QF

* remove qfRounds joins for non qf round filters

* add some temp logs

* remove temp logs

* fix: changes test cases of recuring donations stats
- create recored with createdAt field in past so test result won't be related to other endpoints test cases

* Fix projectActualserviceView

* fix stream balance depleted issue (#1496)

Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* rebuild

* refresh and fetch user address separately (#1499)

* Added pg_trgm extension migration (#1502)

* fix: change recurring donations stats query to single query

* fix recurring donation count

* WIP: projectIds textArea

* fix actual matching cap (#1507)

* fix query error

* fix user donations count

* fix recurring donation count tests

* fix user recurring donation query

* fix user recurring donation test

* add donations relation to qfround

* add findArchivedQfRounds endpoint

* add findArchivedQfRounds endpoint

* feat: add sponsors & banner images upload

* add sortBy to findArchivedQfRounds

* 1.23.3

* add new test graphql query

* add tests for new QfArchivedRounds

* fixes on qfArchivedRounds query

* add new tests for qfArchivedRounds query

* fix findArchivedQfRounds tests

* fix: keep already uploaded sponsors images

* fix skip and limit for findArchivedQfRounds

* Add logs and refactor the bootstrap code to help investigate latency problem

* Add poolSize to orm config

* Fix eslint errors

* remove changing squareRootSumOfProjects when cap is overflown

* Trigger ortto activity when user saves their profile info for the first time (#1520)

* add newUser to updateUser query

* add createOrttoProfile

* add createOrttoProfile to NotificationAdapterInterface

* add createOrttoProfile to MockNotificationAdapter

* add CREATE_ORTTO_PROFILE event

* Allow to set the matching pool token & amount to be something other than usd (#1517)

* Allow to set the matching pool token & amount to be something other than USD in adminjs

* Allow to set the matching pool token & amount to be something other than USD in QFRound table

* add null to allocatedTokenSymbol and allocatedTokenChainId

* add nullable true to allocatedTokenSymbol and allocatedTokenChainId

* add allocatedFundUSDPreferred and allocatedFundUSD to qfRound

* Comment migrations

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* add qfRound to qfRoundStats

* fix qfRoundStatsQuery

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add logs to projectVerificationForm

* Add logs to projectVerificationForm

* fix: add project Ids list textarea for qf round edit

* Master to staging (#1543)

* Hotfix db improvements (#1523) (#1524)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* Fix/db replica production (#1525)

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* Define db read only configs

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* update comment

* Hotfix latency issues for prod (#1529)

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add informative logs for draft donation service job (#1537)

* Fix eslint errors

* Fix/master test (#1541)

* Fixed master test issue

* Returned test to master pipeline

* Comment executing donation summary view

---------

Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* Fix/word similarity - staging (#1546)

* Hotfix db improvements (#1523) (#1524)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* Fix/db replica production (#1525)

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* Define db read only configs

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* update comment

* Hotfix latency issues for prod (#1529)

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add informative logs for draft donation service job (#1537)

* Fix eslint errors

* Fix/master test (#1541)

* Fixed master test issue

* Returned test to master pipeline

* Comment executing donation summary view

---------

Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>

* Fixed word similarity issue

* Removed unused import

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* remove refresh_project_summary_from totals and add user cache (#1539)

* Remove users field from project

* Remove users field from filterProjectsQuery

* Remove projects field from user

* remove added logs

* fix eslint errors

* remove users from Project.create

* remove users from Project.create in testUtils.ts

* remove projectOwnerId

* replace admin with adminUserId

* Add recurring donation join to donations() endpoint (#1554)

related to #1483

* replace admin with adminUserId in SEED data

* replace admin with adminUserId

* replace admin with adminUserId in projectResolver.ts

* replace admin with adminUserId in projectsTab.ts

* replace admin with adminUserId in projectResolver.test.ts

* replace admin with adminUserId in projectResolver.ts

* add allocatedFundUSD and allocatedTokenSymbol to qfArchivedRounds

* fix nullable

* remove admin from project

* replace admin with adminUserId

* replace admin with adminUserId

* add adminUserId field

* drop admin column

* fix: add telegram to ProjectSocialMediaType enum to allow adding telegram url

* Add some logs

* Fix eslint errors

* Add maxQueuedJobs for draft donation worker

* Fix eslint errors

* fix unstable test case

* Disable concurrency for draft donation worker

* add indexes to project_summary_view (#1568)

* improve projectBySlug query

* fix: change output types to float

* Ignore small differences of amounts when matching draft donation for erc20

* add graphql-fields

* add getVerificationFormStatusByProjectId

* refactor projectBySlug

* add findProjectIdBySlug

* fix projectBySlug tests with new changes

* fix projectBySlug tests with new changes

* fix projectBySlug tests with new changes

* remove projectVerificationForm assert

* add logs

* fix title in should return projects with indicated slug test

* Add streamed mini donations to qf round (#1557)

* Add streamed mini donations to qf round

related to Giveth/giveth-dapps-v2#3284

* Fix eslint error

* Fix eslint errors

* make verificationFormStatus field public

* Reduce test runnning time (#1574)

* fix: reduce test runnning time

* fix: add permissions test case

* fix: add permissions test case

* fix: refactor (excluding permissions test cases from global beforeEach)

---------

Co-authored-by: Ramin <raminramazanpour@gmail.com>
Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com>
Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Amin Latifi <a.latifi.al@gmail.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>

* WIP add base network

* Continue on integrating with base chain

* Fix migrations

* Fix migrations

* Add test cases about filteriing base network

* Add BASE node http urls for rpc

* Add BASE node http urls for rpc

* Add missing things for integrating with base

* Fix creating new token with coingeckoId

related to #1564

* Fill base mainnet tokens

related to #1561

---------

Co-authored-by: Ramin <raminramazanpour@gmail.com>
Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com>
Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Amin Latifi <a.latifi.al@gmail.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>

* Add coingeckoId to BASE_SEPOLIA (#1592)

* Ignore small differences of amounts when matching draft donation for … (#1573)

* Ignore small differences of amounts when matching draft donation for erc20

* Fix eslint errors

* Release Integrate QF with super fluid streamed donations (#1555)

* add activeQfRoundId to sortingBy InstantBoosting

* add orderBy totalDonations and totalReactions

* feat: add getRecurringDonationStats resolver

* fix filtering by QF

* remove qfRounds joins for non qf round filters

* add some temp logs

* remove temp logs

* fix: changes test cases of recuring donations stats
- create recored with createdAt field in past so test result won't be related to other endpoints test cases

* Fix projectActualserviceView

* fix stream balance depleted issue (#1496)

Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* rebuild

* refresh and fetch user address separately (#1499)

* Added pg_trgm extension migration (#1502)

* fix: change recurring donations stats query to single query

* fix recurring donation count

* WIP: projectIds textArea

* fix actual matching cap (#1507)

* fix query error

* fix user donations count

* fix recurring donation count tests

* fix user recurring donation query

* fix user recurring donation test

* add donations relation to qfround

* add findArchivedQfRounds endpoint

* add findArchivedQfRounds endpoint

* feat: add sponsors & banner images upload

* add sortBy to findArchivedQfRounds

* 1.23.3

* add new test graphql query

* add tests for new QfArchivedRounds

* fixes on qfArchivedRounds query

* add new tests for qfArchivedRounds query

* fix findArchivedQfRounds tests

* fix: keep already uploaded sponsors images

* fix skip and limit for findArchivedQfRounds

* Add logs and refactor the bootstrap code to help investigate latency problem

* Add poolSize to orm config

* Fix eslint errors

* remove changing squareRootSumOfProjects when cap is overflown

* Trigger ortto activity when user saves their profile info for the first time (#1520)

* add newUser to updateUser query

* add createOrttoProfile

* add createOrttoProfile to NotificationAdapterInterface

* add createOrttoProfile to MockNotificationAdapter

* add CREATE_ORTTO_PROFILE event

* Allow to set the matching pool token & amount to be something other than usd (#1517)

* Allow to set the matching pool token & amount to be something other than USD in adminjs

* Allow to set the matching pool token & amount to be something other than USD in QFRound table

* add null to allocatedTokenSymbol and allocatedTokenChainId

* add nullable true to allocatedTokenSymbol and allocatedTokenChainId

* add allocatedFundUSDPreferred and allocatedFundUSD to qfRound

* Comment migrations

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* add qfRound to qfRoundStats

* fix qfRoundStatsQuery

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add logs to projectVerificationForm

* Add logs to projectVerificationForm

* fix: add project Ids list textarea for qf round edit

* Master to staging (#1543)

* Hotfix db improvements (#1523) (#1524)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* Fix/db replica production (#1525)

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* Define db read only configs

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* update comment

* Hotfix latency issues for prod (#1529)

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add informative logs for draft donation service job (#1537)

* Fix eslint errors

* Fix/master test (#1541)

* Fixed master test issue

* Returned test to master pipeline

* Comment executing donation summary view

---------

Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* Fix/word similarity - staging (#1546)

* Hotfix db improvements (#1523) (#1524)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* Fix/db replica production (#1525)

* Hotfix db improvements (#1523)

* add extra configurations for postgresql connections

* add master and slave replication strategy for typeorm

* Define db read only configs

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>

* update comment

* Hotfix latency issues for prod (#1529)

* Hotfix staging fix latency (#1528)

* add project donation summary view entity

* convert projectQueries to querybuilder

* add cache to projectDonationSummary queries

* add configurable cache to slow queries

* remove massive recurring donation log

* add await for project queries

* Add informative logs for draft donation service job (#1537)

* Fix eslint errors

* Fix/master test (#1541)

* Fixed master test issue

* Returned test to master pipeline

* Comment executing donation summary view

---------

Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>

* Fixed word similarity issue

* Removed unused import

---------

Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>

* remove refresh_project_summary_from totals and add user cache (#1539)

* Remove users field from project

* Remove users field from filterProjectsQuery

* Remove projects field from user

* remove added logs

* fix eslint errors

* remove users from Project.create

* remove users from Project.create in testUtils.ts

* remove projectOwnerId

* replace admin with adminUserId

* Add recurring donation join to donations() endpoint (#1554)

related to #1483

* replace admin with adminUserId in SEED data

* replace admin with adminUserId

* replace admin with adminUserId in projectResolver.ts

* replace admin with adminUserId in projectsTab.ts

* replace admin with adminUserId in projectResolver.test.ts

* replace admin with adminUserId in projectResolver.ts

* add allocatedFundUSD and allocatedTokenSymbol to qfArchivedRounds

* fix nullable

* remove admin from project

* replace admin with adminUserId

* replace admin with adminUserId

* add adminUserId field

* drop admin column

* fix: add telegram to ProjectSocialMediaType enum to allow adding telegram url

* Add some logs

* Fix eslint errors

* Add maxQueuedJobs for draft donation worker

* Fix eslint errors

* fix unstable test case

* Disable concurrency for draft donation worker

* add indexes to project_summary_view (#1568)

* improve projectBySlug query

* fix: change output types to float

* Ignore small differences of amounts when matching draft donation for erc20

* add graphql-fields

* add getVerificationFormStatusByProjectId

* refactor projectBySlug

* add findProjectIdBySlug

* fix projectBySlug tests with new changes

* fix projectBySlug tests with new changes

* fix projectBySlug tests with new changes

* remove projectVerificationForm assert

* add logs

* fix title in should return projects with indicated slug test

* Add streamed mini donations to qf round (#1557)

* Add streamed mini donations to qf round

related to Giveth/giveth-dapps-v2#3284

* Fix eslint error

* Fix eslint errors

* make verificationFormStatus field public

* Reduce test runnning time (#1574)

* fix: reduce test runnning time

* fix: add permissions test case

* fix: add permissions test case

* fix: refactor (excluding permissions test cases from global beforeEach)

---------

Co-authored-by: Ramin <raminramazanpour@gmail.com>
Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com>
Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Amin Latifi <a.latifi.al@gmail.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>

* WIP add base network

* Continue on integrating with base chain

* Fix migrations

* Fix migrations

* Add test cases about filteriing base network

* Add BASE node http urls for rpc

* Add BASE node http urls for rpc

* Add missing things for integrating with base

* Fix creating new token with coingeckoId

related to #1564

* Fill base mainnet tokens

related to #1561

* add coingeckoId to BASE_SEPOLIA

---------

Co-authored-by: mohammadranjbarz <mranjbar.z2993@gmail.com>
Co-authored-by: Ramin <raminramazanpour@gmail.com>
Co-authored-by: CarlosQ96 <92376054+CarlosQ96@users.noreply.github.com>
Co-authored-by: Amin Latifi <a.latifi.al@gmail.com>
Co-authored-by: Carlos <carlos.quintero096@gmail.com>
Co-authored-by: Meriem-B <135605616+Meriem-B@users.noreply.github.com>

* Deleting redis

* sync all donations totals (#1594)

* sync all donations totals

* add update qfroundmatching

* Add coingeckoId for BASE ETH

* Changee isGivbaclEligble of base chain tokens to false

---------

Co-authored-by: Ramin <raminramazanpour@gmail.com>
Co-authored-by: Meriem-BM <barhoumi.meriem1@gmail.com>
Co-authored-by: Mohammad Ranjbar Z <mranjbar.z2993@gmail.com>
Co-authored-by: Amin Latifi <a.latifi.al@gmail.com>
Co-authored-by: Rolazo <nicobaena96@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Meriem-B <135605616+Meriem-B@users.noreply.github.com>
Co-authored-by: Nicolas <38561963+Rolazo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant