Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
df63b0a
backend setup
superhvarn Oct 15, 2025
3acd65f
hooks
superhvarn Oct 16, 2025
437803a
#3629 frontend changes for CAR
superhvarn Dec 6, 2025
936b908
#3629 tests pass
superhvarn Dec 7, 2025
c098546
#3811 fixing frontend tests
superhvarn Dec 7, 2025
d2c8cff
#3629 fixing sidebar
superhvarn Dec 7, 2025
404f6fe
Merge branch 'develop' into 3629-maintenance---global-finance-filtering
superhvarn Dec 7, 2025
9da7ea5
#3629 fixing finance dashboard
superhvarn Dec 7, 2025
7b68b50
3629 fixing dropdown sidebar UI
superhvarn Dec 7, 2025
41af049
#3629 linting
superhvarn Dec 7, 2025
564fdd8
#3629 linting
superhvarn Dec 7, 2025
5d677ed
filtering for other data
superhvarn Dec 7, 2025
6489d20
Merging main into branch
Steph375 Feb 4, 2026
8b007f8
#3950 getAllProjects
Feb 12, 2026
4c24a7a
#3950 fixed api function
Feb 12, 2026
356617a
#3948 update work-packages.services.ts
patriots1 Feb 13, 2026
05959a9
#3950 modified endpoints to include optional car id
Feb 16, 2026
14d52b6
#3950 docs for car filtering
Feb 16, 2026
5d21f7c
#3950 udpated endpoint to use middleware to get car info
Feb 25, 2026
00255a9
#3948 update work-packages.controllers.ts
patriots1 Feb 28, 2026
931b46e
#3948 refactor work-packages-services.ts
patriots1 Mar 1, 2026
6cbafec
#3948 refactor work-packages.controllers.ts
patriots1 Mar 1, 2026
1e21595
#3948 update work-packages.routes.ts
patriots1 Mar 1, 2026
a1c1ed0
Merge pull request #3975 from Northeastern-Electric-Racing/#3950-getA…
chpy04 Mar 4, 2026
14754fb
connecting carId with frontend
Steph375 Mar 6, 2026
739a001
Merge pull request #4012 from Northeastern-Electric-Racing/4011-carid
Steph375 Mar 6, 2026
1d1530c
Merge branch 'feature/global-car-filtering' into #3948-update-getWork…
patriots1 Mar 7, 2026
db22b43
#3948 update controller and service
patriots1 Mar 7, 2026
5052439
Merge branch 'develop' into feature/global-car-filtering
cielbellerose Mar 10, 2026
fc0bf21
merge with feature branch
chpy04 Mar 11, 2026
18b63f4
remove carid from route validation
chpy04 Mar 11, 2026
025d867
added back status query route validation
chpy04 Mar 11, 2026
8e28487
Merge pull request #4005 from Northeastern-Electric-Racing/#3948-upda…
chpy04 Mar 11, 2026
0f2c0ee
Merge branch 'develop' into feature/global-car-filtering
chpy04 Mar 14, 2026
9ea3dd9
refactor: modify queries to include selectedCar key, remove redundant…
rbessin Mar 19, 2026
85de9c1
test: fix wrapper to include global car filter
rbessin Mar 19, 2026
5c24507
feat: add car filtering to change requests endpoints and overview
rbessin Mar 21, 2026
1956725
fix: correct first load car filtering and simplify initialization logic
rbessin Mar 21, 2026
1dfd631
fix: resolve failing tests and type errors from global car filter
rbessin Mar 21, 2026
21577b3
fix: resolve failing tests for projects + work packages
rbessin Mar 21, 2026
33b1f13
fix: set Fergus car filter in cy.login for e2e tests
rbessin Mar 21, 2026
5ad72df
fix: update Fergus car filter in e2e login to use backend cars endpoint
rbessin Mar 21, 2026
1d9b9ae
fix: move seed data to NER-25 and fix change request car filtering fo…
rbessin Mar 21, 2026
941ddd6
style: fix styling issue
rbessin Mar 21, 2026
b1894f9
fix: default new project car to globally selected car
rbessin Mar 21, 2026
54d2f95
Merge remote-tracking branch 'origin/develop' into feature/global-car…
rbessin Mar 21, 2026
b5b5b83
refactor: autopopulate project forms with global car filter
rbessin Mar 21, 2026
8ace462
feat: fix stale car filter and add all cars selection option
rbessin Mar 22, 2026
1faa056
feat: show car selector in project form when global filter is 'all cars'
rbessin Mar 22, 2026
99837c4
fix: mock car filter in unit tests and restore it in e2e login
rbessin Mar 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/backend/custom.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Organization } from '@prisma/client';
import { Car, Organization } from '@prisma/client';
import { User as SharedUser } from 'shared';

declare global {
namespace Express {
export interface Request {
currentUser: SharedUser;
organization: Organization;
currentCar?: Car;
}
}
}
4 changes: 4 additions & 0 deletions src/backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cors from 'cors';
import cookieParser from 'cookie-parser';
import { getUserAndOrganization, prodHeaders, requireJwtDev, requireJwtProd } from './src/utils/auth.utils.js';
import { errorHandler } from './src/utils/errors.utils.js';
import { getCurrentCar } from './src/utils/car.utils.js';
import userRouter from './src/routes/users.routes.js';
import projectRouter from './src/routes/projects.routes.js';
import teamsRouter from './src/routes/teams.routes.js';
Expand Down Expand Up @@ -90,6 +91,9 @@ app.use(isProd ? requireJwtProd : requireJwtDev);
// get user and organization
app.use(getUserAndOrganization);

// get current car
app.use(getCurrentCar);

// routes
app.use('/users', userRouter);
app.use('/projects', projectRouter);
Expand Down
10 changes: 10 additions & 0 deletions src/backend/src/controllers/cars.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@ export default class CarsController {
next(error);
}
}

static async getCurrentCar(req: Request, res: Response, next: NextFunction) {
try {
const car = await CarsService.getCurrentCar(req.organization);

res.status(200).json(car);
} catch (error: unknown) {
next(error);
}
}
}
14 changes: 10 additions & 4 deletions src/backend/src/controllers/change-requests.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class ChangeRequestsController {

static async getAllChangeRequests(req: Request, res: Response, next: NextFunction) {
try {
const changeRequests = await ChangeRequestsService.getAllChangeRequests(req.organization);
const changeRequests = await ChangeRequestsService.getAllChangeRequests(req.organization, req.currentCar?.carId);
res.status(200).json(changeRequests);
} catch (error: unknown) {
next(error);
Expand All @@ -25,7 +25,11 @@ export default class ChangeRequestsController {

static async getToReviewChangeRequests(req: Request, res: Response, next: NextFunction) {
try {
const changeRequests = await ChangeRequestsService.getToReviewChangeRequests(req.currentUser, req.organization);
const changeRequests = await ChangeRequestsService.getToReviewChangeRequests(
req.currentUser,
req.organization,
req.currentCar?.carId
);
res.status(200).json(changeRequests);
} catch (error: unknown) {
next(error);
Expand All @@ -41,7 +45,8 @@ export default class ChangeRequestsController {
const changeRequests = await ChangeRequestsService.getUnreviewedChangeRequests(
req.currentUser,
validatedWbs,
req.organization
req.organization,
req.currentCar?.carId
);
res.status(200).json(changeRequests);
} catch (error: unknown) {
Expand All @@ -58,7 +63,8 @@ export default class ChangeRequestsController {
const changeRequests = await ChangeRequestsService.getApprovedChangeRequests(
req.currentUser,
validatedWbs,
req.organization
req.organization,
req.currentCar?.carId
);
res.status(200).json(changeRequests);
} catch (error: unknown) {
Expand Down
18 changes: 13 additions & 5 deletions src/backend/src/controllers/projects.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import BillOfMaterialsService from '../services/boms.services.js';
export default class ProjectsController {
static async getAllProjectsGantt(req: Request, res: Response, next: NextFunction) {
try {
const projects: ProjectGantt[] = await ProjectsService.getAllProjectsGantt(req.organization);
const projects: ProjectGantt[] = await ProjectsService.getAllProjectsGantt(req.organization, req.currentCar?.carId);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand All @@ -25,7 +25,7 @@ export default class ProjectsController {

static async getAllProjects(req: Request, res: Response, next: NextFunction) {
try {
const projects: ProjectPreview[] = await ProjectsService.getAllProjects(req.organization);
const projects: ProjectPreview[] = await ProjectsService.getAllProjects(req.organization, req.currentCar?.carId);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand All @@ -34,7 +34,11 @@ export default class ProjectsController {

static async getUsersTeamsProjects(req: Request, res: Response, next: NextFunction) {
try {
const projects: ProjectOverview[] = await ProjectsService.getUsersTeamsProjects(req.currentUser, req.organization);
const projects: ProjectOverview[] = await ProjectsService.getUsersTeamsProjects(
req.currentUser,
req.organization,
req.currentCar?.carId
);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand All @@ -43,7 +47,11 @@ export default class ProjectsController {

static async getUsersLeadingProjects(req: Request, res: Response, next: NextFunction) {
try {
const projects: ProjectOverview[] = await ProjectsService.getUsersLeadingProjects(req.currentUser, req.organization);
const projects: ProjectOverview[] = await ProjectsService.getUsersLeadingProjects(
req.currentUser,
req.organization,
req.currentCar?.carId
);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand All @@ -53,7 +61,7 @@ export default class ProjectsController {
static async getTeamsProjects(req: Request, res: Response, next: NextFunction) {
try {
const { teamId } = req.params as Record<string, string>;
const projects: Project[] = await ProjectsService.getTeamsProjects(req.organization, teamId);
const projects: Project[] = await ProjectsService.getTeamsProjects(req.organization, teamId, req.currentCar?.carId);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand Down
24 changes: 19 additions & 5 deletions src/backend/src/controllers/work-packages.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ export default class WorkPackagesController {
static async getAllWorkPackages(req: Request, res: Response, next: NextFunction) {
try {
const { query } = req;
const queryWithCarId = {
...query,
carId: req.currentCar?.carId
};

const outputWorkPackages: WorkPackage[] = await WorkPackagesService.getAllWorkPackages(query, req.organization);
const outputWorkPackages: WorkPackage[] = await WorkPackagesService.getAllWorkPackages(
queryWithCarId,
req.organization
);

res.status(200).json(outputWorkPackages);
} catch (error: unknown) {
Expand All @@ -24,7 +31,8 @@ export default class WorkPackagesController {

const outputWorkPackages: WorkPackagePreview[] = await WorkPackagesService.getAllWorkPackagesPreview(
status,
req.organization
req.organization,
req.currentCar?.carId
);

res.status(200).json(outputWorkPackages);
Expand All @@ -50,7 +58,11 @@ export default class WorkPackagesController {
try {
const { wbsNums } = req.body;

const workPackages: WorkPackage[] = await WorkPackagesService.getManyWorkPackages(wbsNums, req.organization);
const workPackages: WorkPackage[] = await WorkPackagesService.getManyWorkPackages(
wbsNums,
req.organization,
req.currentCar?.carId
);
res.status(200).json(workPackages);
} catch (error: unknown) {
next(error);
Expand Down Expand Up @@ -131,7 +143,8 @@ export default class WorkPackagesController {

const blockingWorkPackages: WorkPackage[] = await WorkPackagesService.getBlockingWorkPackages(
wbsNum,
req.organization
req.organization,
req.currentCar?.carId
);

res.status(200).json(blockingWorkPackages);
Expand All @@ -158,7 +171,8 @@ export default class WorkPackagesController {
const workPackages: WorkPackagePreview[] = await WorkPackagesService.getHomePageWorkPackages(
req.currentUser,
req.organization,
selection as WorkPackageSelection
selection as WorkPackageSelection,
req.currentCar?.carId
);

res.status(200).json(workPackages);
Expand Down
Loading
Loading