Download src/models/problem-statement.ts from helo-ayush/NewIntentExtractor: direct link, hf CLI and curl.
- Browser
- Download file 2.47 kB
-
https://huggingface.co/spaces/helo-ayush/NewIntentExtractor/resolve/main/src/models/problem-statement.ts
- Command line
-
hf download hf://spaces/helo-ayush/NewIntentExtractor/src/models/problem-statement.ts
-
curl -L -o problem-statement.ts https://huggingface.co/spaces/helo-ayush/NewIntentExtractor/resolve/main/src/models/problem-statement.ts
2.47 kB
| import "server-only"; | |
| /** | |
| * SIHJantaParty — problem statements. | |
| * | |
| * The canonical list used to live in src/components/statements/statements-data.ts | |
| * and was duplicated three more times (teams-mock.ts PS_LIST, teams-create.tsx | |
| * EXTRA_PS_PAGES, and the landing page's PROBLEMS) across two mutually | |
| * incompatible id namespaces — SIH2026-001 named a different statement in two | |
| * of them. This collection is now the single source of truth; the authored | |
| * content from statements-data.ts was imported by scripts/import-statements.ts. | |
| * | |
| * Reference content, not seed data: these are real SIH statements, so the | |
| * import is idempotent (upsert on psId) and safe to re-run when the list | |
| * changes. | |
| */ | |
| import mongoose, { Schema, type Model, type InferSchemaType } from "mongoose"; | |
| const ProblemStatementSchema = new Schema( | |
| { | |
| psId: { type: String, required: true, unique: true }, // "SIH2026-001" | |
| title: { type: String, required: true }, | |
| organization: { type: String, required: true }, | |
| ministry: String, | |
| category: { type: String, enum: ["Software", "Hardware"], required: true }, | |
| theme: { type: String, required: true }, | |
| difficulty: { type: Number, enum: [1, 2, 3], required: true }, | |
| domain: { type: String, required: true }, | |
| description: { type: String, required: true }, | |
| background: { type: String, required: true }, | |
| expectedSolution: { type: String, required: true }, | |
| deliverables: { type: [String], default: [] }, | |
| tags: { type: [String], default: [] }, | |
| tint: { type: String, required: true }, | |
| datasetUrl: String, | |
| youtubeUrl: String, | |
| /** | |
| * NOTE: there is deliberately no `submittedTeams` field. The old hardcoded | |
| * counts (142, 98, 76 …) are replaced by a live aggregate over Team.psIds — | |
| * see countTeamsByPs() in src/lib/teams/dal.ts. Storing it would mean | |
| * keeping a counter in sync with every team create/delete/update. | |
| */ | |
| }, | |
| { timestamps: true, collection: "problem_statements" } | |
| ); | |
| ProblemStatementSchema.index({ title: "text", description: "text", tags: "text" }); | |
| ProblemStatementSchema.index({ theme: 1, difficulty: 1 }); | |
| ProblemStatementSchema.index({ category: 1 }); | |
| export type ProblemStatementDoc = InferSchemaType<typeof ProblemStatementSchema>; | |
| export const ProblemStatement = | |
| (mongoose.models.ProblemStatement as Model<ProblemStatementDoc>) ?? | |
| mongoose.model<ProblemStatementDoc>("ProblemStatement", ProblemStatementSchema); | |