Skip to content

Commit

Permalink
Release 1.24.0 - SuperFluid Release (#1387)
Browse files Browse the repository at this point in the history
* add null to verificationStatus in projectsWithoutUpdateAfterTimeFrame

* update draftDonationMatchWorker.test.ts and draftDonationService.test.ts

* Add new fields to the ProjectActualMatchingView

* Fix qfRound test cases

* Fix qfRound test cases

* Change logger.info to logger.debug

* add project actual matching address and network

* add network addresses to entity

* inner join project_address

* fix project Latest Updated date calculation

* do not query if user exists

* rebuild

* add isRecipient condition to actualMatching

* Implement updateRecurringDonationParams webservice (#1371)

* Implement updateRecurringDonationParams webservice

related to #1362

* Fix update recurring donation test case

* Fix update recurring donation test case

* Modify update recurring donation web service

* Fix build error

* Add currency to updateRecurringDonationParams web service input

* F superfluid validate transactions (WIP, not ready for review) (#1352)

* add superfluid adapter

* add super fluid services for recurring donation

* add superfluid columns to donations

* add logic to notify user of super token balancer

* create donations from virtual periods

* fix conflicts

* fix conflicts

* add email interface for superfluid and new attributes

* update recurringdonation totals

* fix mock notification adapter for supertokens

* fix recurring donation migration

* add email job and test for recurring donation service

* Remove amount and interval from recurringDonation entity

---------

Co-authored-by: Mohammad Ranjbar Z <[email protected]>

* Change error message when recurring donation not found in udatedonation webservice

* Just a change for rerun the github action job

* change project verificationStatus to null when a new update is added

* Set default value for finished field in recurring_donation table

* remove Ortto tag only if user has no other projects in the round

* add project update test case

* do not change verificationStatus on project update when status is revoked

* return proper error message when user not found

* add test case for not changing verificationStatus on project update when a new update is added

* Add token filters to recurringDonationsByUserId webservice (#1404)

* Add token filters to recurringDonationsByUserId webservice

related to #1398

* Add finished filters to recurringDonationsByUserId and recurringDonationsByProjectId webservice

related to #1398

* update eslint and prettier config

* fix migrations eslint errors

* fix migrations eslint errors

* fix /test eslint errors

* fix /src root files eslint errors

* fix /entities eslint errors

* fix /src eslint errors part 1

* fix /server eslint errors

* fix /routers and /scripts eslint errors

* fix /types and /user eslint errors

* fix /utils eslint errors

* fix /views eslint errors

* fix /adapters eslint errors

* fix /repositories eslint errors

* fix /resolvers eslint errors

* fix /services eslint errors

* add eslint packages

* fix workflows eslint packages

* fix /migration eslint packages

* fix /src eslint packages

* remove old tslint file

* fix type-graphql eslint errors

* fix getResolvers type error

* revert stripe.ts to original state

* Fix actual matching view and add test cases for it (#1410)

related to Giveth/giveth-dapps-v2#3840

* add eslint-plugin-import and sort imports

* Add log

* add update recurring donation status (#1412)

* Improve Error Logging for adding duplicate token

* Join project's anchor contracts in recurringDonationsByUserId web service

* fix eslint errors

* add uniqueness for slug

* remove duplicate slug on tests

* fix duplicate slug in featureProjectsTestCases

* add migration for unique slug index

* fix the recurring donation Id not saved properly (#1420)

* write duplicate slug test case

* add Queries to fetch stats about new donors

* Prevent valueUsd to be null for donations related to recurring_donations

* Add logs to getListOfTransactionsByAddress function

* Fix eslint errors

* add newDonorsDonationTotalUsdPerDate query

* fix eslint error

* add fetchNewDonorsCount and fetchNewDonorsDonationTotalUsd queries

* add newDonorsCountPerDate and newDonorsDonationTotalUsdPerDate test cases

* prevent creating duplicate slugs with empty input

* Skip draftDonationService test cases

* Remove RegisterResolver and ConfirmUserResolver resolvers

* Remove REGISTER_USERNAME_PASSWORD usage

* Bring draftDonationServices test cases back

related to #1425 (comment)

* improve queries and conditions for superfluid donation validation (#1423)

* improve queries and conditions for superfluid donation validation

* fix superfluid api calls

* fix usd amount fetch

* remove REGISTER_USERNAME_PASSWORD env var

* remove LoginResolver.ts

* remove LoginResolver.ts

* remove IsEmailAlreadyExist and RegisterWalletInput

* remove unused packages

* move types to dev dependencies

* move types to dev dependencies

* Verify recurring donation with network data (#1424)

* WIP Add test funciton for verify recurring donations

* Update recurring donation status with blockchain network data

related to #1426

* Validate anchor contract addresses blockchain data

related to #1427

* Fix error handling of updateRecurringDonationStatusWithNetwork

* Copy abi files to build folder after each build

* Read projectId from different field for anchor contract transactions

* add SuperFluid balance critical notification

* fix fetching the correct recurringDonation data

* Change finish status filter in recurring donation web services

* Fix recurringDonationsByUserId when sending status filter

* add usd value to recurring donation related donations

* fix valueUsd of recurring donation

* update recurring donation totals with mini donations

* Allow qf round to edit some fields even when round has ended

related to Giveth/giveth-dapps-v2#3864

* Make finished:true for ended and failed donations

* Add isArchived field to recurring donation

related to #1439

* Use includeArchived toggle in webservice instead of isArchived

* Allow to filter Donation data by verified project donations

* revert package.json changes

* Add new "sort" to QF round page "by Estimated Matching amount"

* test commit

* Revert "test commit"

This reverts commit da14d42.

* remove test logs

* add activeQfRoundId for sorting by EstimatedMatching

* add donation received email service for recurring donations

* update MockNotificationAdapter for donationReceived

* Dont override isActive for ended qf rounds in admin bro edit page

Giveth/giveth-dapps-v2#3864 (comment)

* Add cronjob to verify recurring donations with blockchain network

#1445

* Call runCheckPendingRecurringDonationsCronJob in bootstrap

* Add cronjob to verify recurring donations with blockchain network (#1446)

* Add cronjob to verify recurring donations with blockchain network

#1445

* Call runCheckPendingRecurringDonationsCronJob in bootstrap

* rename variable for expiration hours

---------

Co-authored-by: Carlos <[email protected]>

* Write test case for getPendingRecurringDonationsIds

* fix symbol parsing in recurringDonationService

* fix async function for updating recurring donation prices

* add recurring donation balance warning check

* fix typo in recurringDonation var name

* skip sending redundant emails for recurringDonation

* separate the price service component

* send donation email for more than 20 USD only

* remove updateDonationPricesAndValues unused inputs

* Change status of recurring donation to pending when updating flowRate and txHash (#1450)

* WIP change status o recurring donation to pending when updating flowRate

* Change status to pending and finished to false when user updates txHash and flowRate

Giveth/giveth-dapps-v2#3930

* add AddBalanceWarningToRecurringDonation migration

* fix adminUserId for recurringDonation project

* fix missing email address in recurringDonation emails

* fix amount in recurringDonation emails

* add logs to donationReceived

* add token to logs

* Verify batch superfluid createFlow transactions (#1448)

* WIP decoded batch transactions with ABI

* Add migration file

* Verify batch call of createFlow smart contract calls work

#1447

* Verify batch call of createFlow smart contract calls work

#1447

* Fix build error

* fix recurring donation amount

* fix email address in sendProjectRelatedNotification

* fix walletAddress in sendProjectRelatedNotification

* add trigger and event names for superfluid emails (#1457)

* Add readme for qf code (#1444)

* Add readme for qf code

* Update qf round matching fund calculation document

* Add some logs for create streamed donations

* Add column type to recurring donation fields

* Remove Goerli tx from tests

* Add some logs for qfRound upload data

* add logs for Super Token Balance

* add more logs for Super Token Balance

* fix superFluidGraphqlUrl for Sepolia

* rebuild

* Fix admin panel export data

* Show user's totalDonated and donationsCount correctly even with recurring donations (#1458)

#1453 , Giveth/giveth-dapps-v2#3886

* fix returning when user is found

* return active recurring donations count in donationsByProjectId query (#1460)

* return active recurring donations count in donationsByProjectId query

Giveth/giveth-dapps-v2#3968 (comment)

* Refresh project donation summery after updating totalDonation

Giveth/giveth-dapps-v2#3968

* fix accountBalance issues

* fix super tokens symbol problem

* fix walletAddress problem in userSuperTokensCritical

* fix payload for userSuperTokensCritical

* fix Super Tokens Critical event names

* fix depleted balance

* remove trackId #1416

* fix metadata for userSuperTokensCritical

* don't check all user streams

* Count uniqueDonors correctly regarding recurringDonations and one time donations

Giveth/giveth-dapps-v2#3968 (comment)

* Fix eslint errors

* Fix total donated in donation summery

* Fix total donated in donation summery

* add virtual field for comma separated project_ids (#1469)

* add project owner email to qfdata export (#1452)

Co-authored-by: Mohammad Ranjbar Z <[email protected]>

* add networkName and recurringDonationTab to userSuperTokensCritical

* WIP Write the document template and two sample test cases (#1461)

* WIP Write the document template and two sample test cases

1459

* Fix eslint errors

* Fix eslint errors

* Added test cases for permissions and documentation (table of permissions) updates

---------

Co-authored-by: mac <[email protected]>

* fix calculating timestamp for negative numbers

* 1459 document admin panel role permissions (#1473)

* WIP Write the document template and two sample test cases

1459

* Fix eslint errors

* Fix eslint errors

* Added test cases for permissions and documentation (table of permissions) updates

* add returnAllDonationData action for qfRound to all permissions

---------

Co-authored-by: Mohammad Ranjbar Z <[email protected]>
Co-authored-by: mac <[email protected]>

* add new admin role for QF stuff (#1475)

* feat: add new role qfManager
- add list permission (to restrict qfManger from listing specific resources

* fix: add list test cases & set compain manger project listing to true

* Modify permissions and readme for qfManager role

related to #1471

* Fix eslint errors

---------

Co-authored-by: mac <[email protected]>
Co-authored-by: Mohammad Ranjbar Z <[email protected]>

* Update adminPermissions.md

* Remove returnAllDonationData from user permissions in test file

* Remove Goerli test case

* 1471 qf stuff role bugs (#1480)

* feat: add new role qfManager
- add list permission (to restrict qfManger from listing specific resources

* fix: add list test cases & set compain manger project listing to true

* fix: postTesting permissions bugs

* fix: add add/remove fromqf round actions to admin permissions

* fix: rename migration clasee name

* fix: merge staging into this branch

---------

Co-authored-by: mac <[email protected]>

* add streamBalanceWarning to user

* add recurringDonationId to updateDonationService (#1484)

* add qfround title and description (#1485)

* Implement webservice for creating draft recurring donations (#1474)

* Implement webservice for creating draft recurring donations

related to #1463

* WIP add draftDonationService

* feat: draft recurring donation for normal tx works on create endpoint

related to #1463

* feat: draft recurring donation for update donations work now

related to #1463

* Fix eslint errors

* Add cronjob for running draft recurring donations

* add recurringDonationId to updateDonationService (#1484)

* improvement: Rewrite all the things about recurring donation verification with superfluid subgraph

related to #1463

* Fix eslint errors

* Fix eslint errors

* Fix build error

* Add log if flow is undefined

---------

Co-authored-by: CarlosQ96 <[email protected]>

* add updateRecurringDonationById service (#1490)

* fix: QF manger role bugs (#1489)

- impliment roles based on the table that was approved

* fix Ortto GIVbacksRound tag (#1486)

* add recurringDonationId to updateDonationService (#1484)

* fix ortto GIVbacksRound tag

---------

Co-authored-by: CarlosQ96 <[email protected]>
Co-authored-by: Mohammad Ranjbar Z <[email protected]>

* skip verify some failed tests related to superfluid subgraph

* Fix eslint errors

* uncomment superfluid test cases

* Fix: The Project Status History Tab should not be displayed for users with the QF Manger role. (#1493)

* fix: QF manger role bugs
- impliment roles based on the table that was approved

* fix: Project Status History Tab shouldn't be shown for QF stuff role
- add list, show actions so it can be applied

* change streamBalanceWarning from string to json

* Fix updateRecurringDonationParams endpoint

* Consider ended recurring donations when counting unique donors

related to Giveth/giveth-dapps-v2#3093 (comment)

* Can create draft donation when updating recurring donation and recurringDonationId has not sent

related to #1463 (comment)

* Mark draft recurring donation as done when updating recurring donation

* Dont relate qfRounds to donations

* Fix eslint errors

* Fix eslint errors

---------

Co-authored-by: Ramin <[email protected]>
Co-authored-by: Mohammad Ranjbar Z <[email protected]>
Co-authored-by: Carlos <[email protected]>
Co-authored-by: CarlosQ96 <[email protected]>
Co-authored-by: Cherik <[email protected]>
Co-authored-by: mac <[email protected]>
Co-authored-by: Meriem Barhoumi <[email protected]>
  • Loading branch information
8 people authored Apr 21, 2024
1 parent 5e4bef6 commit cd39a98
Show file tree
Hide file tree
Showing 453 changed files with 14,680 additions and 5,315 deletions.
Binary file modified .DS_Store
Binary file not shown.
42 changes: 42 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["import", "unused-imports"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"no-console": "error",
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/no-unused-vars": [
"error", { "argsIgnorePattern": "^_" }],
"prettier/prettier": [
"error",
{
"arrowParens": "avoid",
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "all",
"jsdoc-format": false,
"endOfLine": "auto"
}
],
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
["internal", "parent", "sibling"],
"index",
"object",
"type"
]
}
]
}
}
4 changes: 2 additions & 2 deletions .github/workflows/develop-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
node-version: 20.11.0
- name: Install dependencies
run: npm ci
- name: Run tslint
run: npm run tslint
- name: Run eslint
run: npm run eslint
- name: Run build
run: npm run build
- name: Run migrations
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run tslint
run: npm run tslint
- name: Run eslint
run: npm run eslint

- name: Run build
run: npm run build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests-on-pr.yml.bck
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
node-version: 16.14.2
- name: Install dependencies
run: npm ci
- name: Run tslint
run: npm run tslint
- name: Run eslint
run: npm run eslint
- name: Run build
run: npm run build
- name: Run migrations
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/staging-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run tslint
run: npm run tslint
- name: Run eslint
run: npm run eslint

- name: Run build
run: npm run build
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ src/scripts/*.json

*.log
*.log.*
*.DS_Store

.adminbro
.adminjs
./src/adminjs
./src/server/adminjs
./src/server/adminJs/adminjs

.DS_Store
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"semi": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "all"
"trailingComma": "all",
"endOfLine": "auto"
}
17 changes: 14 additions & 3 deletions config/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ TYPEORM_DATABASE_PORT=
TYPEORM_LOGGING=
DROP_DATABASE=
APOLLO_KEY=
REGISTER_USERNAME_PASSWORD=
STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=
Expand Down Expand Up @@ -188,7 +187,7 @@ DONATION_VERIFICAITON_EXPIRATION_HOURS=24
# Default: unnamed
SERVICE_NAME=example
OPTIMISM_NODE_HTTP_URL=https://optimism-mainnet.public.blastapi.io/
OPTIMISM_GOERLI_NODE_HTTP_URL=
OPTIMISM_SEPOLIA_NODE_HTTP_URL=

####################################### INSTANT BOOSTING #################################
# OPTIONAL - default: false
Expand Down Expand Up @@ -278,6 +277,9 @@ NUMBER_OF_UPDATE_RECURRING_DONATION_CONCURRENT_JOB=1
# Default value is 0 0 * * * that means one day at 00:00
UPDATE_RECURRING_DONATIONS_STREAM=0 0 * * *

# Default value is 0.4
PROJECT_SEARCH_SIMILARITY_THRESHOLD=0.4

MPETH_GRAPHQL_PRICES_URL=

# Draft donation match expiration hours, they will be deleted after to lessen dabase size
Expand All @@ -294,4 +296,13 @@ INSERT_USER_PASSPORT_SCORE_FOR_QF_ROUND_CRONJOB_TIME=0 0 * * *
QfRound_PASSPORT_SCORE_CHECK_START_TIMESTAMP_IN_SECONDS=

ORTTO_API_KEY=FAKE_API_KEY
ORTTO_PERSON_API=https://api.ap3api.com/v1/person/merge
ORTTO_PERSON_API=https://api.ap3api.com/v1/person/merge


RECURRING_DONATION_VERIFICATION_EXPIRATION_HOURS=24
VERIFY_RECURRING_DONATION_CRONJOB_EXPRESSION=0 * * * * *
NUMBER_OF_VERIFY_RECURRING_DONATION_CONCURRENT_JOB=1
ENABLE_DRAFT_RECURRING_DONATION=true
DRAFT_RECURRING_DONATION_MATCH_EXPIRATION_HOURS=24

OPTIMISTIC_SEPOLIA_SCAN_API_KEY=
15 changes: 12 additions & 3 deletions config/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ TYPEORM_DATABASE_PORT=5443
TYPEORM_LOGGING=all
DROP_DATABASE=true
APOLLO_KEY=service:0000000000000000000000000000000000
REGISTER_USERNAME_PASSWORD=false
STRIPE_KEY=pk_test_000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
STRIPE_SECRET=sk_test_000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
STRIPE_WEBHOOK_SECRET=whsec_00000000000000000000000000000000
Expand Down Expand Up @@ -41,6 +40,7 @@ ETHERSCAN_ROPSTEN_API_URL=https://api-ropsten.etherscan.io/api
ETHERSCAN_GOERLI_API_URL=https://api-goerli.etherscan.io/api
POLYGON_SCAN_API_URL=https://api.polygonscan.com/api
OPTIMISTIC_SCAN_API_URL=https://api-optimistic.etherscan.io/api
OPTIMISTIC_SEPOLIA_SCAN_API_URL=https://api-sepolia-optimistic.etherscan.io/api
CELO_SCAN_API_URL=https://api.celoscan.io/api
CELO_ALFAJORES_SCAN_API_URL=https://api-alfajores.celoscan.io/api
ARBITRUM_SCAN_API_URL=https://api.arbiscan.io/api
Expand Down Expand Up @@ -139,11 +139,11 @@ NOTIFICATION_CENTER_USERNAME=
NOTIFICATION_CENTER_PASSWORD=

PROJECT_UPDATES_VERIFIED_REMINDER_DAYS=30
PROJECT_UPDATES_VERIFIED_WARNING_DAYS=60
PROJECT_UPDATES_VERIFIED_WARNING_DAYS=45
PROJECT_UPDATES_VERIFIED_LAST_WARNING_DAYS=90
PROJECT_UPDATES_VERIFIED_REVOKED_DAYS=104
PROJECT_UPDATES_FIRST_REVOKE_BATCH_DATE=2021-01-22
PROJECT_REVOKE_SERVICE_ACTIVE=false
PROJECT_REVOKE_SERVICE_ACTIVE=true

UPDATE_POWER_ROUND_CRONJOB_EXPRESSION=0 0 * * *
UPDATE_POWER_SNAPSHOT_SERVICE_ACTIVE=false
Expand All @@ -167,6 +167,7 @@ CHAINVINE_ADAPTER=mock
CHAINVINE_API_ENABLE_TEST_MODE=true
# We should not try to verify donaitons after some hours, because checking old donations would make lots of requests to web3 providers
DONATION_VERIFICAITON_EXPIRATION_HOURS=24
RECURRING_DONATION_VERIFICAITON_EXPIRATION_HOURS=24

# We need it for monoswap
POLYGON_MAINNET_NODE_HTTP_URL=https://polygon-rpc.com
Expand Down Expand Up @@ -227,3 +228,11 @@ ENABLE_INSERT_USER_PASSPORT_SCORES=true
INSERT_USER_PASSPORT_SCORE_FOR_QF_ROUND_CRONJOB_TIME=0 0 * * *
# Optional
QfRound_PASSPORT_SCORE_CHECK_START_TIMESTAMP_IN_SECONDS=

ENABLE_DRAFT_RECURRING_DONATION=true
DRAFT_RECURRING_DONATION_MATCH_EXPIRATION_HOURS=24


OPTIMISTIC_SEPOLIA_SCAN_API_KEY=

SUPER_FLUID_ADAPTER=superfluid
Loading

0 comments on commit cd39a98

Please sign in to comment.