Conversation
Update from Dev Fork to official Dev Branch
- Multiple dynamic updates - Every A.Y. there will be a renewal which can be triggered by super_admin - Uploadable QR code for payments - Updatable FB group links and can be triggered to show up or not. - Better emails - Changed template to be more clean - SVGs are not hardcoded anymore and reusable via /public/icons/* - Fixes on the admin side - Changed some aspects on scheduling interview especially the dates
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR is a broad refactor and feature expansion for the CSSApply Next.js app, centered on normalizing recruitment/application data around RecruitmentCycle in Prisma, renaming the Executive Assistant flow to Executive Associate, and adding new admin/config + performance improvements (SWR hooks, new endpoints, and localized/static assets).
Changes:
- Refactors Prisma schema to support multiple applications per cycle and introduces
Membership/MembershipCounterfor member ID generation. - Renames/updates the “Executive Assistant” application flow to “Executive Associate” across UI, API routes, session typing, and admin tooling.
- Adds new API endpoints + SWR hooks for recruitment cycle, EB roles, community link, payment QR/template; replaces several inline SVGs/remote assets with local static assets; introduces standardized loading components.
Reviewed changes
Copilot reviewed 106 out of 201 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Adds .next-dev types + reformats config for new dev distDir. |
| src/types/next-auth.d.ts | Renames EA session flags/types to Executive Associate. |
| src/test/ApplicationGuard.test.tsx | Updates test usage to new applicationType value. |
| src/personality-test/ResultsPage.tsx | Adds attempt-scoped idempotency for quiz submissions. |
| src/personality-test/QuizApp.tsx | Introduces per-attempt ID persisted in sessionStorage. |
| src/personality-test/quiz-styles.module.css | Updates background icon styling to support CSS mask-based icons. |
| src/personality-test/HomePage.tsx | Switches remote image to local static asset. |
| src/personality-test/data/quizData.ts | Switches committee images to local static assets. |
| src/personality-test/BackgroundIcons.tsx | Replaces inline SVG list with mask-based icon assets. |
| src/personality-test/AppHeader.tsx | Switches logo source to local static asset + updates alt text. |
| src/lib/usePaymentReceiptTemplate.ts | Adds SWR hook for receipt template URL. |
| src/lib/usePaymentQr.ts | Adds SWR hook for payment QR URL. |
| src/lib/useEbRoles.ts | Adds SWR hook for EB roles + active cycle data. |
| src/lib/useCommunityLink.ts | Adds SWR hook for community link config. |
| src/lib/useApplicationStatus.ts | Renames EA flag to Executive Associate for status aggregation. |
| src/lib/useApplicationsOpen.ts | Adds stateful hook and date-only comparisons using active cycle endpoint. |
| src/lib/schemas.ts | Expands/normalizes zod schemas (profile fields, schedule, payment proof, enums). |
| src/lib/prisma.ts | Caches Prisma client and pg pool globally to reduce dev connection churn. |
| src/lib/payment-config.ts | Adds optional fallback for public payment QR URL env var. |
| src/lib/member-id.ts | Adds member ID generation + cycle-scoped membership helper. |
| src/lib/auth.ts | Adds allowed-domain sign-in restriction + cycle-scoped application/session logic. |
| src/data/ebRoles.ts | Updates copy to “Executive Associate”. |
| src/components/Modal.tsx | Uses next/image + new LoadingSpinner and local warning icon. |
| src/components/LoadingSpinner.tsx | Adds reusable accessible spinner component. |
| src/components/LoadingScreen.tsx | Simplifies loading screen to use spinner + message prop. |
| src/components/Header.tsx | Switches header logo to local static asset. |
| src/components/Footer.tsx | Replaces inline social SVGs with local icon assets + updates logo asset. |
| src/components/ErrorPage.tsx | Switches background and illustration to local static assets. |
| src/components/ApplicationGuard.tsx | Updates supported applicationType union and checks Executive Associate status. |
| src/components/AdminMobileSB.tsx | Replaces hamburger SVG with CSS mask icon. |
| src/app/user/apply/member/success/content.tsx | Switches to local static background/illustrations. |
| src/app/user/apply/executive-associate/page.tsx | Uses useEbRoles + updates routing/copy/assets for Executive Associate. |
| src/app/user/apply/executive-associate/[eb-role]/success/page.tsx | Updates ApplicationGuard applicationType value. |
| src/app/user/apply/executive-associate/[eb-role]/success/content.tsx | Uses useEbRoles + updates routing/copy/assets for Executive Associate. |
| src/app/user/apply/executive-associate/[eb-role]/schedule/page.tsx | Updates ApplicationGuard applicationType value. |
| src/app/user/apply/executive-associate/[eb-role]/schedule/content.tsx | Migrates API paths to Executive Associate + active cycle endpoint + local assets. |
| src/app/user/apply/executive-associate/[eb-role]/progress/page.tsx | Updates ApplicationGuard applicationType value. |
| src/app/user/apply/committee-staff/page.tsx | Updates redirects + switches images/backgrounds to local assets. |
| src/app/user/apply/committee-staff/[committee]/success/content.tsx | Switches backgrounds/illustrations to local assets. |
| src/app/user/apply/committee-staff/[committee]/schedule/content.tsx | Uses active cycle endpoint + local background assets. |
| src/app/loading.tsx | Adds global app-router loading UI using LoadingScreen. |
| src/app/layout.tsx | Updates metadata copy and OpenGraph/Twitter image/icon asset URLs. |
| src/app/globals.css | Updates branding text (“CSSApply”). |
| src/app/auth/error/page.tsx | Improves Suspense fallback with LoadingScreen. |
| src/app/api/recruitment-cycle/active/route.ts | Adds public API for active recruitment cycle data. |
| src/app/api/quiz-submissions/route.ts | Adds server-side short TTL idempotency cache and payload validation. |
| src/app/api/payment-receipt-template/route.ts | Adds endpoint to resolve receipt template URL from system config. |
| src/app/api/payment-receipt-template/file/route.ts | Adds endpoint to stream receipt template PDF from Supabase storage. |
| src/app/api/payment-qr/route.ts | Adds endpoint for payment QR URL with env fallback. |
| src/app/api/payment-qr/image/route.ts | Adds endpoint to stream payment QR image from Supabase storage. |
| src/app/api/files/upload/route.ts | Updates allowed applicationType values for uploads. |
| src/app/api/files/access/route.ts | Updates allowed applicationType values + queries for file access. |
| src/app/api/eb-roles/route.ts | Adds endpoint to serve EB roles with cycle-aware profile data + availability config. |
| src/app/api/community-link/route.ts | Adds public endpoint for community link config. |
| src/app/api/applications/payment-proof/route.ts | Adds payment proof submission + member ID issuance + email notification. |
| src/app/api/applications/member/route.ts | Refactors member application submission to use cycle rules + schemas + transactions. |
| src/app/api/applications/executive-associate/schedule/route.ts | Adds Executive Associate schedule API with validations + notifications. |
| src/app/api/applications/executive-assistant/schedule/route.ts | Removes legacy Executive Assistant schedule endpoint. |
| src/app/api/applications/executive-assistant/route.ts | Removes legacy Executive Assistant application endpoint. |
| src/app/api/applications/committee-staff/eb/[committee]/route.ts | Updates EB lookup to be cycle-aware and uses committee id directly. |
| src/app/api/applications/check-existing/route.ts | Updates existing-application checks to be cycle-scoped and Executive Associate aware. |
| src/app/api/admin/users/search/route.ts | Forces dynamic rendering + updates relations/counts for Executive Associate model. |
| src/app/api/admin/users/all/route.ts | Forces dynamic rendering + includes user image and cycle member IDs. |
| src/app/api/admin/unavailable-slots/[id]/route.ts | Tightens auth check + minor mapping refactor. |
| src/app/api/admin/test-email/route.ts | Renames EA test template keys + adds new templates (member id/payment/community). |
| src/app/api/admin/resolve-conflict/route.ts | Updates applicationType values + switches to updateMany for non-unique studentNumber. |
| src/app/api/admin/recruitment-cycle/route.ts | Adds auth gating, date validation, and advisory-lock guarded activation changes. |
| src/app/api/admin/payment-receipt-template/route.ts | Adds super-admin endpoint to upload/configure receipt template PDF. |
| src/app/api/admin/payment-qr/route.ts | Adds super-admin endpoint to upload/configure payment QR image. |
| src/app/api/admin/interview-slots/[position]/route.ts | Updates slot queries to be cycle-scoped and Executive Associate aware. |
| src/app/api/admin/files/cleanup-staged/route.ts | Updates bucket names + model name for staged file cleanup. |
| src/app/api/admin/export/csv/route.ts | Makes exports cycle-scoped and adds member ID + profile fields to CSV output. |
| src/app/api/admin/eb-profiles/route.ts | Adds committee normalization + associates EB profiles to active cycle. |
| src/app/api/admin/download-pdf/route.ts | Updates applicationType values + storage bucket name for downloads. |
| src/app/api/admin/cv-download/route.ts | Updates applicationType values + storage bucket name for downloads. |
| src/app/api/admin/community-link/route.ts | Adds super-admin endpoint to manage community link config. |
| src/app/api/admin/check-conflicts/route.ts | Makes conflict checks cycle-scoped and Executive Associate aware. |
| src/app/api/admin/available-executive-associate-roles/route.ts | Adds super-admin endpoint to configure available Executive Associate roles. |
| src/app/api/admin/applications/counts/route.ts | Adds admin endpoint for application counts with committee access filtering. |
| src/app/admin/staffs/page.tsx | Switches background asset + updates copy/labels to Executive Associate naming. |
| src/app/admin/members/page.tsx | Uses cycle membership memberId in UI + updates branding copy/assets. |
| src/app/admin/executive-associates/page.tsx | Renames EA admin page to Executive Associates + updates API params and copy. |
| README.md | Consolidates documentation and updates commands, env vars, admin + performance sections. |
| public/window.svg | Removes unused legacy asset. |
| public/vercel.svg | Removes unused legacy asset. |
| public/next.svg | Removes unused legacy asset. |
| public/globe.svg | Removes unused legacy asset. |
| public/file.svg | Removes unused legacy asset. |
| public/icons/warning.svg | Adds local warning icon asset. |
| public/icons/users.svg | Adds local icon asset. |
| public/icons/trash.svg | Adds local icon asset. |
| public/icons/star.svg | Adds local icon asset. |
| public/icons/send.svg | Adds local icon asset. |
| public/icons/search.svg | Adds local icon asset. |
| public/icons/refresh.svg | Adds local icon asset. |
| public/icons/menu.svg | Adds local icon asset. |
| public/icons/mail.svg | Adds local icon asset. |
| public/icons/logout.svg | Adds local icon asset. |
| public/icons/instagram.svg | Adds local icon asset. |
| public/icons/file-text.svg | Adds local icon asset. |
| public/icons/facebook.svg | Adds local icon asset. |
| public/icons/email.svg | Adds local icon asset. |
| public/icons/edit.svg | Adds local icon asset. |
| public/icons/chevron-down.svg | Adds local icon asset. |
| public/icons/chevron-down-dropdown.svg | Adds local icon asset. |
| public/icons/check.svg | Adds local icon asset. |
| public/icons/calendar.svg | Adds local icon asset. |
| public/icons/briefcase.svg | Adds local icon asset. |
| public/icons/bg-icon-9.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-8.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-7.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-6.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-5.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-4.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-3.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-2.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-11.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-10.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-1.svg | Adds background icon asset for personality test page. |
| public/icons/bg-icon-0.svg | Adds background icon asset for personality test page. |
| prisma/schema.prisma | Normalizes schema around recruitment cycles + memberships + renames EA model mapping. |
| package.json | Upgrades Next.js/Prisma and related dependencies. |
| next.config.ts | Uses .next-dev distDir in development. |
| eslint.config.mjs | Ignores .next-dev output. |
| docs/CSS_REMINDER_README.md | Updates branding text. |
| docs/BREVO_SETUP.md | Updates branding text. |
| AGENTS.md | Removes separate agent guidelines file (moved into README). |
| .gitignore | Adds .next-dev and backup folder. |
Suppressed comments (5)
src/app/user/apply/executive-associate/[eb-role]/success/content.tsx:56
sm:w-50-[200px]is not a valid Tailwind class (it looks like a malformed attempt at an arbitrary value). This will prevent the illustration from being sized correctly.
src/personality-test/ResultsPage.tsx:83submissionStorageKeyis set to "pending" before verifyingsortedResultsis valid. IfsortedResultsis missing/too short, the function returns without clearing the sessionStorage flag, permanently blocking submission for that attempt.
This issue also appears on line 115 of the same file.
src/personality-test/ResultsPage.tsx:118
- On submission errors you remove the sessionStorage key, but
didSubmitRef.currentstaystrue, so the effect won’t retry even though you explicitly cleared the idempotency guard. This makes transient network failures unrecoverable without a full remount.
src/app/api/files/access/route.ts:66 - With the schema change allowing multiple applications per studentNumber,
findFirst({ where: { studentNumber } })can return an arbitrary cycle’s record (and currently has noorderBy). This can generate signed URLs for an older/incorrect CV/portfolio.
src/app/user/apply/committee-staff/[committee]/success/content.tsx:53 sm:w-50 sm:h-50are not valid Tailwind utilities by default, so the success illustration likely won’t scale as intended onsmscreens.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const DEFAULT_REDIRECTS: Record<string, string> = { | ||
| member: "/user/apply/member", | ||
| committee: "/user/apply/committee-staff", | ||
| ea: "/user/apply/executive-assistant", | ||
| ea: "/user/apply/executive-associate", | ||
| }; |
| <Image | ||
| src="https://odjmlznlgvuslhceobtz.supabase.co/storage/v1/object/public/css-apply-static-images/assets/logos/Logo_CSS Apply.svg" | ||
| alt="CSS Apply logo" | ||
| src="/assets/css-apply-static-images/assets/logos/Logo_CSS%20Apply.svg" | ||
| alt="CSSApply logo" | ||
| width={110} | ||
| height={190} | ||
| sizes="(max-width: 640px) 64px, 110px" | ||
| className="w-20 h-auto sm:w-[110px] cursor-pointer" | ||
| className="w-20 h-auto sm:w-27.5 cursor-pointer" | ||
| /> |
| <Image | ||
| src="https://odjmlznlgvuslhceobtz.supabase.co/storage/v1/object/public/css-apply-static-images/assets/pictures/CSAR_Sad.png" | ||
| src="/assets/css-apply-static-images/assets/pictures/CSAR_Sad.webp" | ||
| alt="Error" | ||
| width={150} | ||
| height={150} | ||
| className="object-contain drop-shadow-lg sm:w-[200px] sm:h-[200px] mx-auto" | ||
| className="object-contain drop-shadow-lg sm:w-50 sm:h-50 mx-auto" | ||
| /> |
| // Determine the bucket and application type | ||
| const bucketName = | ||
| applicationType === "ea" ? "ea-applications" : "committee-applications"; | ||
| applicationType === "executive-associate" | ||
| ? "ea-applications" | ||
| : "committee-applications"; | ||
|
|
| const userRole = session.user.role; | ||
| const hasAdminAccess = userRole === "admin" || userRole === "super_admin"; | ||
|
|
||
| if (!hasAdminAccess) { | ||
| return NextResponse.json( | ||
| { error: "Forbidden - Admin access required" }, | ||
| { status: 403 }, | ||
| ); | ||
| } | ||
| const hasAdminAccess = | ||
| userRole === "admin" || | ||
| userRole === "super_admin" || | ||
| userRole === "super-admin"; | ||
|
|
| // Check if user has admin access | ||
| const userRole = session.user.role; | ||
| const hasAdminAccess = userRole === "admin" || userRole === "super_admin"; | ||
|
|
||
| if (!hasAdminAccess) { | ||
| return NextResponse.json( | ||
| { error: "Forbidden - Admin access required" }, | ||
| { status: 403 }, | ||
| ); | ||
| } | ||
|
|
||
| const isSuperAdmin = userRole === "super_admin"; |
This pull request introduces several major updates across the codebase, including a significant database schema migration, dependency upgrades, new admin features, improved documentation, and build system enhancements. The most impactful changes are the normalization of application data in the Prisma schema, the addition of performance optimizations, and enhancements to the admin dashboard and email system.
Database Schema Refactor and Enhancements:
prisma/schema.prisma:MembershipandMembershipCountermodels to track member IDs and sequences per recruitment cycle.MemberApplication,ExecutiveAssociateApplication,CommitteeApplication) now referenceRecruitmentCycle, allowing multiple applications per user per cycle and enforcing appropriate uniqueness constraints.User(e.g.,image,age,dateOfBirth,isOldCssMember) and new relationships for improved data modeling.EBProfileto associate withRecruitmentCycle.Dependency and Build System Updates:
next,next-auth,@prisma/client,@prisma/adapter-pg,tailwindcss,postcss,uuid, and related dev dependencies, ensuring compatibility with Prisma 7.9 and Next.js 15.5. [1] [2].next-devin development to avoid conflicts with production builds, and updated ESLint ignore patterns accordingly. [1] [2]Admin and Application Features:
memberIdin the admin applications page, using the newmembershipsrelationship. [1] [2]Performance and Email System Improvements:
Documentation and Project Structure:
AGENTS.mdfile, consolidating all project guidelines, structure, and code style documentation intoREADME.md, which now includes build, lint, and Prisma command references. [1] [2]These changes collectively improve the system's scalability, maintainability, and user experience, while ensuring the codebase is ready for future feature expansion and higher data integrity.