Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ const nextConfig: NextConfig = {
source: '/cdn/coinmarketcap/:path*',
destination: 'https://s2.coinmarketcap.com/:path*',
},
{
source: '/cdn/bnbstatic/:path*',
destination: 'https://bin.bnbstatic.com/:path*',
},
{
source: '/cdn/solscan/:path*',
destination: 'https://statics.solscan.io/:path*',
Expand Down
3 changes: 3 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ model GrantTranche {
eventReceipts Json?
attendeeCount Int?
socialPost String? @db.VarChar(500)
colosseumLink String? @db.VarChar(500)
githubRepo String? @db.VarChar(500)
aiReceipt String? @db.VarChar(500)

@@index([applicationId])
@@index([grantId])
Expand Down
11 changes: 9 additions & 2 deletions src/app/api/grant-application/create/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { queueAgent } from '@/features/agents/utils/queueAgent';
import { getUserSession } from '@/features/auth/utils/getUserSession';
import { queueEmail } from '@/features/emails/utils/queueEmail';
import { grantApplicationSchema } from '@/features/grants/utils/grantApplicationSchema';
import { isUserEligibleForST } from '@/features/grants/utils/stGrant';
import {
getGrantFixedAsk,
isAgenticEngineeringGrant,
isUserEligibleForST,
} from '@/features/grants/utils/stGrant';
import { syncGrantApplicationWithAirtable } from '@/features/grants/utils/syncGrantApplicationWithAirtable';
import { validateGrantRequest } from '@/features/grants/utils/validateGrantRequest';
import { extractSocialUsername } from '@/features/social/utils/extractUsername';
Expand All @@ -29,6 +33,8 @@ async function createGrantApplication(
});

const isST = grant.isST === true;
const isAgenticEngineering = isAgenticEngineeringGrant(grant);
const fixedAsk = getGrantFixedAsk(grant);

const validationResult = grantApplicationSchema(
grant.minReward,
Expand All @@ -37,6 +43,7 @@ async function createGrantApplication(
grant.questions,
user as any,
isST,
isAgenticEngineering,
).safeParse({
...data,
twitter:
Expand Down Expand Up @@ -73,7 +80,7 @@ async function createGrantApplication(
milestones: validatedData.milestones,
kpi: validatedData.kpi || '',
walletAddress: validatedData.walletAddress,
ask: validatedData.ask,
ask: fixedAsk ?? validatedData.ask,
twitter: validatedData.twitter,
github: validatedData.github,
answers: validatedData.answers || [],
Expand Down
6 changes: 6 additions & 0 deletions src/app/api/grant-application/request-tranche/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export async function POST(request: Request) {
eventReceipts,
attendeeCount,
socialPost,
colosseumLink,
githubRepo,
aiReceipt,
} = body;

logger.debug(`Request body: ${safeStringify(body)}`);
Expand Down Expand Up @@ -62,6 +65,9 @@ export async function POST(request: Request) {
eventReceipts,
attendeeCount,
socialPost,
colosseumLink,
githubRepo,
aiReceipt,
});
},
{ ttlSeconds: 300 },
Expand Down
11 changes: 9 additions & 2 deletions src/app/api/grant-application/update/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import { safeStringify } from '@/utils/safeStringify';
import { queueAgent } from '@/features/agents/utils/queueAgent';
import { getUserSession } from '@/features/auth/utils/getUserSession';
import { grantApplicationSchema } from '@/features/grants/utils/grantApplicationSchema';
import { isUserEligibleForST } from '@/features/grants/utils/stGrant';
import {
getGrantFixedAsk,
isAgenticEngineeringGrant,
isUserEligibleForST,
} from '@/features/grants/utils/stGrant';
import { syncGrantApplicationWithAirtable } from '@/features/grants/utils/syncGrantApplicationWithAirtable';
import { validateGrantRequest } from '@/features/grants/utils/validateGrantRequest';
import { extractSocialUsername } from '@/features/social/utils/extractUsername';
Expand All @@ -26,6 +30,8 @@ async function updateGrantApplication(
});

const isST = grant.isST === true;
const isAgenticEngineering = isAgenticEngineeringGrant(grant);
const fixedAsk = getGrantFixedAsk(grant);

const validationResult = grantApplicationSchema(
grant.minReward,
Expand All @@ -34,6 +40,7 @@ async function updateGrantApplication(
grant.questions,
user as any,
isST,
isAgenticEngineering,
).safeParse({
...data,
twitter:
Expand Down Expand Up @@ -87,7 +94,7 @@ async function updateGrantApplication(
milestones: validatedData.milestones,
kpi: validatedData.kpi || '',
walletAddress: validatedData.walletAddress,
ask: validatedData.ask,
ask: fixedAsk ?? validatedData.ask,
twitter: validatedData.twitter,
github: validatedData.github,
answers: validatedData.answers || [],
Expand Down
Loading