File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -283,6 +283,35 @@ categoryGroupRoutes.route("/:id/selfAssign").post(
283283 } )
284284) ;
285285
286+ // HackGT 13 specific: maps a room and table number to the table codes used on the venue layout.
287+ // Rooms not listed here fall back to the raw table number.
288+ const getTableCode = ( room : string | undefined , table : number | null ) => {
289+ if ( table === null ) {
290+ return null ;
291+ }
292+ if ( room === undefined ) {
293+ return table ;
294+ }
295+ if ( room === "Klaus Atrium" ) {
296+ return `A${ table } ` ;
297+ }
298+ if ( room . includes ( "1116" ) ) {
299+ return `B${ table } ` ;
300+ }
301+ // Klaus Atrium 2 continues code A after Klaus Atrium's 86 tables
302+ if ( room === "Klaus Atrium 2" ) {
303+ return `A${ table + 86 } ` ;
304+ }
305+ if ( room . includes ( "1456" ) ) {
306+ return `C${ table } ` ;
307+ }
308+ // 1447 shares code C with 1456, continuing after 1456's 25 tables
309+ if ( room . includes ( "1447" ) ) {
310+ return `C${ table + 25 } ` ;
311+ }
312+ return table ;
313+ } ;
314+
286315categoryGroupRoutes . route ( "/:id/generate-csv" ) . get (
287316 checkAbility ( "read" , "CategoryGroup" ) ,
288317 asyncHandler ( async ( req , res ) => {
@@ -330,7 +359,7 @@ categoryGroupRoutes.route("/:id/generate-csv").get(
330359 project . githubUrl ,
331360 project . expo ,
332361 project . tableGroup ?. name ,
333- project . table ,
362+ getTableCode ( project . tableGroup ?. name , project . table ) ,
334363 ]
335364 . map ( escapeCsv )
336365 . join ( "," )
You can’t perform that action at this time.
0 commit comments