Fix seed: inline defaultRoundConfig to eliminate src/ dependency
The Docker production image only has compiled .next/ output — src/ TypeScript files don't exist. The seed was importing from ../src/types/competition-configs which fails in Docker regardless of file extension. Inlined the default config map directly in the seed so it has zero external dependencies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ac970fc6a0
commit
fbb194067d
|
|
@ -18,7 +18,49 @@ import {
|
||||||
AdvancementRuleType,
|
AdvancementRuleType,
|
||||||
} from '@prisma/client'
|
} from '@prisma/client'
|
||||||
import bcrypt from 'bcryptjs'
|
import bcrypt from 'bcryptjs'
|
||||||
import { defaultRoundConfig } from '../src/types/competition-configs'
|
// Inline default configs so seed has ZERO dependency on src/ (not available in Docker prod image)
|
||||||
|
function defaultRoundConfig(roundType: RoundType): Record<string, unknown> {
|
||||||
|
const defaults: Record<RoundType, () => Record<string, unknown>> = {
|
||||||
|
INTAKE: () => ({
|
||||||
|
allowDrafts: true, draftExpiryDays: 30,
|
||||||
|
acceptedCategories: ['STARTUP', 'BUSINESS_CONCEPT'],
|
||||||
|
maxFileSizeMB: 50, maxFilesPerSlot: 1, allowedMimeTypes: ['application/pdf'],
|
||||||
|
lateSubmissionNotification: true, publicFormEnabled: false, customFields: [],
|
||||||
|
}),
|
||||||
|
FILTERING: () => ({
|
||||||
|
rules: [], aiScreeningEnabled: true, manualReviewEnabled: true,
|
||||||
|
aiConfidenceThresholds: { high: 0.85, medium: 0.6, low: 0.4 },
|
||||||
|
autoAdvanceEligible: false, duplicateDetectionEnabled: true, batchSize: 20,
|
||||||
|
}),
|
||||||
|
EVALUATION: () => ({
|
||||||
|
requiredReviewsPerProject: 3, scoringMode: 'criteria', requireFeedback: true,
|
||||||
|
feedbackMinLength: 0, requireAllCriteriaScored: true, coiRequired: true,
|
||||||
|
peerReviewEnabled: false, anonymizationLevel: 'fully_anonymous',
|
||||||
|
aiSummaryEnabled: false, generateAiShortlist: false, advancementMode: 'admin_selection',
|
||||||
|
}),
|
||||||
|
SUBMISSION: () => ({
|
||||||
|
eligibleStatuses: ['PASSED'], notifyEligibleTeams: true, lockPreviousWindows: true,
|
||||||
|
}),
|
||||||
|
MENTORING: () => ({
|
||||||
|
eligibility: 'requested_only', chatEnabled: true, fileUploadEnabled: true,
|
||||||
|
fileCommentsEnabled: true, filePromotionEnabled: true, autoAssignMentors: false,
|
||||||
|
}),
|
||||||
|
LIVE_FINAL: () => ({
|
||||||
|
juryVotingEnabled: true, votingMode: 'simple', audienceVotingEnabled: false,
|
||||||
|
audienceVoteWeight: 0, audienceVotingMode: 'per_project', audienceMaxFavorites: 3,
|
||||||
|
audienceRequireIdentification: false, audienceRevealTiming: 'at_deliberation',
|
||||||
|
deliberationEnabled: false, deliberationDurationMinutes: 30, showAudienceVotesToJury: false,
|
||||||
|
presentationOrderMode: 'manual', presentationDurationMinutes: 15, qaDurationMinutes: 5,
|
||||||
|
revealPolicy: 'ceremony',
|
||||||
|
}),
|
||||||
|
DELIBERATION: () => ({
|
||||||
|
juryGroupId: 'PLACEHOLDER', mode: 'SINGLE_WINNER_VOTE',
|
||||||
|
showCollectiveRankings: false, showPriorJuryData: false,
|
||||||
|
tieBreakMethod: 'ADMIN_DECIDES', votingDuration: 60, topN: 3, allowAdminOverride: true,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
return defaults[roundType]()
|
||||||
|
}
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import { parse } from 'csv-parse/sync'
|
import { parse } from 'csv-parse/sync'
|
||||||
import { join, dirname } from 'path'
|
import { join, dirname } from 'path'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue