From a43e77faf0d18a0a44c9cb566d9eaa2f368f57a9 Mon Sep 17 00:00:00 2001 From: Rithish-2914 Date: Thu, 13 Aug 2026 17:58:55 +0530 Subject: [PATCH] Add school information to papers --- src/components/Card.tsx | 1 + src/db/papers.ts | 8 ++++++++ src/interface.ts | 26 ++++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/components/Card.tsx b/src/components/Card.tsx index ff0646d6..00511bf8 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -89,6 +89,7 @@ const Card = ({ paper, onSelect, isSelected, isShow=true }: CardProps) => { {paper.slot} {paper.year} {paper.semester} + {paper.school && {paper.school}} diff --git a/src/db/papers.ts b/src/db/papers.ts index c3f8781a..88ae5cf4 100644 --- a/src/db/papers.ts +++ b/src/db/papers.ts @@ -31,6 +31,10 @@ const adminSchema = new Schema({ "Mauritius", ], }, + school: { + type: String || null, + enum: ["SCOPE", "SITE", "SENSE", "SMEC", "SCE", "SELECT", "SAS", "SSL", "VITBS", "SBST","SCORE"], + }, answer_key_included: { type: Boolean || null, default: false }, is_selected: { type: Boolean, default: false }, ambiguous_tags: { type: [String], default: [] }, @@ -69,6 +73,10 @@ const paperSchema = new Schema({ ], required: true, }, + school: { + type: String, + enum: ["SCOPE", "SITE", "SENSE", "SMEC", "SCE", "SELECT", "SAS", "SSL", "VITBS", "SBST"], + }, answer_key_included: { type: Boolean, default: false }, }); diff --git a/src/interface.ts b/src/interface.ts index c64ca357..990618e7 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -2,8 +2,6 @@ import { type mongo } from "mongoose"; export interface IUpcomingSlot { slot: string; - lastSyncedDate?: string; - syncMode?: "CAT" | "FAT"; } export interface IUpcomingSubject { @@ -17,6 +15,7 @@ export interface PaperResponse { year: string; slot: string; exam: string; + school?: string; } export interface IAdminPaper { @@ -40,6 +39,18 @@ export interface IAdminPaper { | "Bangalore" | "Mauritius" | null; + school?: + | "SCOPE" + | "SITE" + | "SENSE" + | "SMEC" + | "SCE" + | "SELECT" + | "SAS" + | "SSL" + | "VITBS" + | "SBST" + | null; answer_key_included?: boolean | null; is_selected?: boolean; ambiguous_tags: string[]; @@ -94,6 +105,17 @@ export interface IPaper { | "Bhopal" | "Bangalore" | "Mauritius"; + school?: + | "SCOPE" + | "SITE" + | "SENSE" + | "SMEC" + | "SCE" + | "SELECT" + | "SAS" + | "SSL" + | "VITBS" + | "SBST"; slot: string; subject: string; year: string;