Skip to content

Commit

Permalink
Vouched projects and superfluid Base improvements (#1897)
Browse files Browse the repository at this point in the history
* throw error on un-vouching the givbackseligible projects

* update message

* optimize the approveMultipleProjects

* make projects verified if they become givbacksEligible

* prevent approve or reject draft projects

* fix records

* fix conditions

* use redirectUrl

* fix tests

* add unverifyProjectsTestCases

* add test:projectVerificationTab

* temporary comment

* fix typo

* send email when project verification status changed

* Feat/Generating public user data

* added tests for querying user basic data

* add includeUnlisted to FilterProjectQueryInputParams

* return proper projects

* add recipient address to streams when nonexistent (#1890)

* started endaoment update feature

* Superfluid Base Support (#1893)

* finish project endpoint for superfluid to read

* add filters for network and tokens for recurringdonations

* fix verification logic and emails for base network streams

* Update src/resolvers/recurringDonationResolver.ts

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

* comment network test and add cbBTC to seeds

---------

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

* remove project validation from anchor contract

* Add networkId logic to superfluid subgraphs (#1896)

* add networkId logic to superfluid subgraphs

* remove networkId from api call to superfluid

* fix eslint

* fix linkedin scope

* fix user info link to user info

* cron job for sitemap generating

* adding additional projects to Endaoment list

* started cronjob

* finished cron job

* Feature cluster matching (#1862)

* add cluster matching entity

* add cluster matching adapters

* finish cocm adapter

* improve error handling for cluster matching

* comment broken contract tests by missing eth_getCode Method

* add feedback to handle qf cases

* add cluster matching job to bootstrap file

* fix coderabbit feedback PR

* termine worker if an exception is raised

* fix updateUser condition to handle email undefined case

* fixed one variable; added cronjob env suggested by Carlos

* removed redundant code

* check config value

* fix calling env variable

* fix/removing endaomentId from update

* add qfStrategy to qfRounds (#1903)

* update bootstrap.js adding check endaoment

* adding sitemap cronjob to bootstrap

* additional logger data

* fine tuninnig log

* improve logger

* fixing endaoment id

* Set default zero for power balance snapshot on no return from balance aggregator (#1732)

Ref #1655

* Fix/Sitemap env variables

* fix missing prefix for url

* fix matching cap calculation

* fix data insertion for cluster matching

* add user passport score null case to clustermatching queries

* fix error handling in cocm adapter

* add cluster matching sync timestamp and logs (#1913)

* add cluster matching sync timestamp and logs

* add nullability to clustermathicng syncAT

* fix db call in worker for cluster matching

* add uniquness constraint to estimatedclustedMatching

* handle undefined case for instant power boosting services

* better error handling in worker job

* fixing prettier problem

* Disable cluster matching

---------

Co-authored-by: Cherik <[email protected]>
Co-authored-by: kkatusic <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Mitch <[email protected]>
Co-authored-by: Lovel George <[email protected]>
Co-authored-by: Amin Latifi <[email protected]>
  • Loading branch information
7 people authored Jan 27, 2025
1 parent f63c346 commit 2f014ec
Show file tree
Hide file tree
Showing 41 changed files with 46,808 additions and 111 deletions.
34 changes: 34 additions & 0 deletions migration/1728554628004-AddEstimatedClusterMatching.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddEstimatedClusterMatching1728554628004
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TABLE estimated_cluster_matching (
id SERIAL PRIMARY KEY,
"projectId" INT NOT NULL,
"qfRoundId" INT NOT NULL,
matching DOUBLE PRECISION NOT NULL
);
`);

// Create indexes on the new table
await queryRunner.query(`
CREATE INDEX estimated_cluster_matching_project_id_qfround_id
ON estimated_cluster_matching ("projectId", "qfRoundId");
`);

await queryRunner.query(`
CREATE INDEX estimated_cluster_matching_matching
ON estimated_cluster_matching (matching);
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
// Revert changes if necessary by dropping the table and restoring the view
await queryRunner.query(`
DROP TABLE IF EXISTS estimated_cluster_matching;
`);
}
}
56 changes: 56 additions & 0 deletions migration/1735909243926-insertEndaomentProjectsIds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* This migration script is used to insert the endaomentId values for the projects in the endaomentProjects array.
* The endaomentId values are used to link the projects in the database with the projects in the Endaoment platform.
*
* The script will add a new column to the project table called "endaomentId".
*/

import { MigrationInterface, QueryRunner } from 'typeorm';
import { endaomentProjects } from './data/updatedEndaomentProjects';

export class InsertEndaomentProjectsIds1735909243926
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
// Add endaomentId column to the project table
queryRunner.query(`
ALTER TABLE "project"
ADD COLUMN IF NOT EXISTS "endaomentId" UUID;
`);

// Get the organization ID for Endaoment
const endaomentOrgIdResult = await queryRunner.query(`
SELECT "id" FROM "organization" WHERE "label" = 'endaoment';
`);
const endaomentOrgId = endaomentOrgIdResult[0].id;

// Go through each project in the endaomentProjects array and update the endaomentId value in the database
for (const project of endaomentProjects) {
const singleProject = await queryRunner.query(
`SELECT "id" FROM "project" WHERE "title" = $1 AND "organizationId" = $2`,
[project.name, endaomentOrgId],
);

// Update project endaomentId value
if (
singleProject &&
singleProject.length > 0 &&
singleProject[0].id > 0
) {
await queryRunner.query(
`UPDATE "project"
SET "endaomentId" = $1
WHERE "id" = $2;`,
[project.endaomentID, singleProject[0].id],
);
}
}
}

public async down(queryRunner: QueryRunner): Promise<void> {
queryRunner.query(`
ALTER TABLE "project"
DROP COLUMN IF EXISTS "endaomentId";
`);
}
}
24 changes: 24 additions & 0 deletions migration/1736719823637-MarkRoundsStrategy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class MarkRoundsStrategy1736719823637 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TYPE "qf_strategy_enum" AS ENUM ('cocm', 'regular');
`);

await queryRunner.query(`
ALTER TABLE "qf_round"
ADD COLUMN "qfStrategy" "qf_strategy_enum" DEFAULT 'regular';
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE "qf_round"
DROP COLUMN "qfStrategy";
`);
await queryRunner.query(`
DROP TYPE "qf_strategy_enum";
`);
}
}
25 changes: 25 additions & 0 deletions migration/1737544105947-addClusterMatchingSyncAtTimestamp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';

export class addClusterMatchingSyncAtTimestamp1737544105947
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
const table = await queryRunner.getTable('qf_round');
const columnExists = table?.findColumnByName('clusterMatchingSyncAt');

if (!columnExists) {
await queryRunner.addColumn(
'qf_round',
new TableColumn({
name: 'clusterMatchingSyncAt',
type: 'timestamp',
isNullable: true,
}),
);
}
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropColumn('qf_round', 'clusterMatchingSyncAt');
}
}
22 changes: 22 additions & 0 deletions migration/1737553475189-addUniquenessToEstimatedClusterMatching.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { MigrationInterface, QueryRunner, TableUnique } from 'typeorm';

export class addUniquenessToEstimatedClusterMatching1737553475189
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createUniqueConstraint(
'estimated_cluster_matching',
new TableUnique({
name: 'unique_projectId_qfRoundId',
columnNames: ['projectId', 'qfRoundId'],
}),
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropUniqueConstraint(
'estimated_cluster_matching',
'unique_projectId_qfRoundId',
);
}
}
Loading

0 comments on commit 2f014ec

Please sign in to comment.