11/**
2- * This scrpt allows you to import a list of people into the database under one specific items and variant.
2+ * This script allows you to import a list of people into the database under one specific items and variant.
33 *
44 * Auto imports into current academic year.
5+ *
6+ *
7+ * TODO: Put somewhere more obvious and document
58 */
69import { AcademicYear } from "@docsoc/eactivities" ;
710import { createLogger } from "@docsoc/util" ;
@@ -20,10 +23,10 @@ dotenv.config();
2023 */
2124
2225/** Used for the name of the {@link RootItem} */
23- const ROOT_ITEM_NAME = "Freshers Merch" ;
26+ const ROOT_ITEM_NAME = "Freshers Merch 2025 " ;
2427
2528/** Used for the name of the {@link Variant} */
26- const VARIANT_NAME = "Freshers Merch 2024 " ;
29+ const VARIANT_NAME = "Freshers Merch 2025 " ;
2730
2831/** Used for the quantity of the {@link Variant} */
2932const VARIANT_QUANTITY = 1 ;
@@ -49,12 +52,18 @@ interface DataSource {
4952}
5053
5154/** Path to the data source */
52- const DATA_SOURCE_PATH = "./data/freshers-2024 .json" ;
55+ const DATA_SOURCE_PATH = "./data/freshers-2025 .json" ;
5356
5457// Start the script
5558
5659// 0: init db
57- const prisma = new PrismaClient ( ) ;
60+ const prisma = new PrismaClient ( {
61+ datasources : {
62+ db : {
63+ url : process . env . COLLECTION_DATABASE_URL , // used to specify production URL
64+ } ,
65+ } ,
66+ } ) ;
5867
5968// 0.1: Find the current academic year
6069// from collection/lib/config.ts
@@ -72,7 +81,7 @@ export async function getAcademicYear(): Promise<AcademicYear> {
7281}
7382
7483async function main ( ) {
75- const currentAcademicYear = await getAcademicYear ( ) ;
84+ const currentAcademicYear = "25-26" ;
7685
7786 if ( ! currentAcademicYear ) {
7887 throw new Error ( "No academic year found to import into" ) ;
0 commit comments