diff --git a/migration/1714566501335-addTokenAndChainToQFRound.ts b/migration/1714566501335-addTokenAndChainToQFRound.ts new file mode 100644 index 000000000..e460662fe --- /dev/null +++ b/migration/1714566501335-addTokenAndChainToQFRound.ts @@ -0,0 +1,21 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class AddTokenAndChainToQFRound1714566501335 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + ALTER TABLE IF EXISTS "qf_round" + ADD COLUMN IF NOT EXISTS "allocatedTokenSymbol" text, + ADD COLUMN IF NOT EXISTS "allocatedTokenChainId" integer; + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + ALTER TABLE IF EXISTS "qf_round" + DROP COLUMN "allocatedTokenSymbol", + DROP COLUMN "allocatedTokenChainId"; + `); + } +} diff --git a/src/entities/qfRound.ts b/src/entities/qfRound.ts index 0d5d8c139..2cff59559 100644 --- a/src/entities/qfRound.ts +++ b/src/entities/qfRound.ts @@ -45,6 +45,14 @@ export class QfRound extends BaseEntity { @Column() allocatedFund: number; + @Field(_type => String, { nullable: true }) + @Column({ nullable: true }) + allocatedTokenSymbol: string; + + @Field(_type => Number, { nullable: true }) + @Column({ nullable: true }) + allocatedTokenChainId: number; + @Field(_type => Number) @Column('real', { default: 0.2 }) maximumReward: number; diff --git a/src/server/adminJs/tabs/qfRoundTab.ts b/src/server/adminJs/tabs/qfRoundTab.ts index 3778b7b6d..b719a1135 100644 --- a/src/server/adminJs/tabs/qfRoundTab.ts +++ b/src/server/adminJs/tabs/qfRoundTab.ts @@ -92,6 +92,29 @@ const returnAllQfRoundDonationAnalysis = async ( }; }; +const availableNetworkValues = [ + { value: NETWORK_IDS.MAIN_NET, label: 'MAINNET' }, + { value: NETWORK_IDS.ROPSTEN, label: 'ROPSTEN' }, + { value: NETWORK_IDS.GOERLI, label: 'GOERLI' }, + { value: NETWORK_IDS.POLYGON, label: 'POLYGON' }, + { value: NETWORK_IDS.OPTIMISTIC, label: 'OPTIMISTIC' }, + { value: NETWORK_IDS.ETC, label: 'ETC' }, + { + value: NETWORK_IDS.MORDOR_ETC_TESTNET, + label: 'MORDOR ETC TESTNET', + }, + { value: NETWORK_IDS.OPTIMISM_SEPOLIA, label: 'OPTIMISM SEPOLIA' }, + { value: NETWORK_IDS.CELO, label: 'CELO' }, + { + value: NETWORK_IDS.CELO_ALFAJORES, + label: 'ALFAJORES (Test CELO)', + }, + { value: NETWORK_IDS.ARBITRUM_MAINNET, label: 'ARBITRUM MAINNET' }, + { value: NETWORK_IDS.ARBITRUM_SEPOLIA, label: 'ARBITRUM SEPOLIA' }, + { value: NETWORK_IDS.XDAI, label: 'XDAI' }, + { value: NETWORK_IDS.BSC, label: 'BSC' }, +]; + export const qfRoundTab = { resource: QfRound, options: { @@ -134,6 +157,14 @@ export const qfRoundTab = { allocatedFund: { isVisible: true, }, + allocatedTokenSymbol: { + isVisible: true, + }, + allocatedTokenChainId: { + isVisible: true, + type: 'number', + availableValues: availableNetworkValues, + }, minimumPassportScore: { isVisible: true, }, @@ -143,28 +174,7 @@ export const qfRoundTab = { eligibleNetworks: { isVisible: true, type: 'array', - availableValues: [ - { value: NETWORK_IDS.MAIN_NET, label: 'MAINNET' }, - { value: NETWORK_IDS.ROPSTEN, label: 'ROPSTEN' }, - { value: NETWORK_IDS.GOERLI, label: 'GOERLI' }, - { value: NETWORK_IDS.POLYGON, label: 'POLYGON' }, - { value: NETWORK_IDS.OPTIMISTIC, label: 'OPTIMISTIC' }, - { value: NETWORK_IDS.ETC, label: 'ETC' }, - { - value: NETWORK_IDS.MORDOR_ETC_TESTNET, - label: 'MORDOR ETC TESTNET', - }, - { value: NETWORK_IDS.OPTIMISM_SEPOLIA, label: 'OPTIMISM SEPOLIA' }, - { value: NETWORK_IDS.CELO, label: 'CELO' }, - { - value: NETWORK_IDS.CELO_ALFAJORES, - label: 'ALFAJORES (Test CELO)', - }, - { value: NETWORK_IDS.ARBITRUM_MAINNET, label: 'ARBITRUM MAINNET' }, - { value: NETWORK_IDS.ARBITRUM_SEPOLIA, label: 'ARBITRUM SEPOLIA' }, - { value: NETWORK_IDS.XDAI, label: 'XDAI' }, - { value: NETWORK_IDS.BSC, label: 'BSC' }, - ], + availableValues: availableNetworkValues, }, projects: { type: 'mixed',