From 8e888808385fc49aea50d3f096142ada87699887 Mon Sep 17 00:00:00 2001 From: kyle Date: Wed, 4 Feb 2026 17:33:57 +0100 Subject: [PATCH] chore: remove unused packages, imports, and stale type definitions - Remove @casl/prisma (unused) from backend - Remove @heroicons/react (unused, using lucide-react) from frontend - Remove unused InferSubjects import from ability.factory.ts - Remove unused Calendar import from Dashboard.tsx - Delete stale frontend/src/lib/types.ts (duplicate of src/types/index.ts) Co-Authored-By: Claude Opus 4.5 --- backend/package-lock.json | 15 --- backend/package.json | 1 - backend/src/auth/abilities/ability.factory.ts | 2 +- frontend/package-lock.json | 10 -- frontend/package.json | 1 - frontend/src/lib/types.ts | 126 ------------------ frontend/src/pages/Dashboard.tsx | 2 +- 7 files changed, 2 insertions(+), 155 deletions(-) delete mode 100644 frontend/src/lib/types.ts diff --git a/backend/package-lock.json b/backend/package-lock.json index dcd0d4f..5be725a 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -11,7 +11,6 @@ "dependencies": { "@anthropic-ai/sdk": "^0.72.1", "@casl/ability": "^6.8.0", - "@casl/prisma": "^1.6.1", "@nestjs/axios": "^4.0.1", "@nestjs/common": "^10.3.0", "@nestjs/config": "^3.1.1", @@ -791,20 +790,6 @@ "url": "https://github.com/stalniy/casl/blob/master/BACKERS.md" } }, - "node_modules/@casl/prisma": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@casl/prisma/-/prisma-1.6.1.tgz", - "integrity": "sha512-VSAzfTMOZvP3Atj3F0qwJItOm1ixIiumjbBz21PL/gLUIDwoktyAx2dB7dPwjH9AQvzZPE629ee7fVU5K2hpzg==", - "license": "MIT", - "dependencies": { - "@ucast/core": "^1.10.0", - "@ucast/js": "^3.0.1" - }, - "peerDependencies": { - "@casl/ability": "^5.3.0 || ^6.0.0", - "@prisma/client": "^2.14.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" - } - }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", diff --git a/backend/package.json b/backend/package.json index 3bd8dc2..d3b1106 100644 --- a/backend/package.json +++ b/backend/package.json @@ -26,7 +26,6 @@ "dependencies": { "@anthropic-ai/sdk": "^0.72.1", "@casl/ability": "^6.8.0", - "@casl/prisma": "^1.6.1", "@nestjs/axios": "^4.0.1", "@nestjs/common": "^10.3.0", "@nestjs/config": "^3.1.1", diff --git a/backend/src/auth/abilities/ability.factory.ts b/backend/src/auth/abilities/ability.factory.ts index 421d8ed..4b510cd 100644 --- a/backend/src/auth/abilities/ability.factory.ts +++ b/backend/src/auth/abilities/ability.factory.ts @@ -1,4 +1,4 @@ -import { AbilityBuilder, PureAbility, AbilityClass, ExtractSubjectType, InferSubjects } from '@casl/ability'; +import { AbilityBuilder, PureAbility, AbilityClass, ExtractSubjectType } from '@casl/ability'; import { Injectable } from '@nestjs/common'; import { Role, User, VIP, Driver, ScheduleEvent, Flight, Vehicle } from '@prisma/client'; diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 3f860db..fab06d4 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -11,7 +11,6 @@ "@auth0/auth0-react": "^2.2.4", "@casl/ability": "^6.8.0", "@casl/react": "^5.0.1", - "@heroicons/react": "^2.2.0", "@react-pdf/renderer": "^4.3.2", "@tanstack/react-query": "^5.17.19", "axios": "^1.6.5", @@ -912,15 +911,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@heroicons/react": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@heroicons/react/-/react-2.2.0.tgz", - "integrity": "sha512-LMcepvRaS9LYHJGsF0zzmgKCUim/X3N/DQKc4jepAXJ7l8QxJ1PmxJzqplF2Z3FE4PqBAIGyJAQ/w4B5dsqbtQ==", - "license": "MIT", - "peerDependencies": { - "react": ">= 16 || ^19.0.0-rc" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index e9b8560..e75e16d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,7 +18,6 @@ "@auth0/auth0-react": "^2.2.4", "@casl/ability": "^6.8.0", "@casl/react": "^5.0.1", - "@heroicons/react": "^2.2.0", "@react-pdf/renderer": "^4.3.2", "@tanstack/react-query": "^5.17.19", "axios": "^1.6.5", diff --git a/frontend/src/lib/types.ts b/frontend/src/lib/types.ts deleted file mode 100644 index e01ffb0..0000000 --- a/frontend/src/lib/types.ts +++ /dev/null @@ -1,126 +0,0 @@ -/** - * TypeScript interfaces for VIP Coordinator - */ - -export interface VIP { - id: string; - name: string; - organization?: string; - department: 'OFFICE_OF_DEVELOPMENT' | 'ADMIN'; - arrivalMode: 'FLIGHT' | 'SELF_DRIVING'; - expectedArrival?: string; - airportPickup: boolean; - venueTransport: boolean; - notes?: string; - createdAt: string; - updatedAt: string; - deletedAt?: string; -} - -export interface Driver { - id: string; - name: string; - phone: string; - department?: 'OFFICE_OF_DEVELOPMENT' | 'ADMIN'; - userId?: string; - shiftStartTime?: string; - shiftEndTime?: string; - isAvailable: boolean; - createdAt: string; - updatedAt: string; - deletedAt?: string; -} - -export interface ScheduleEvent { - id: string; - vipId: string; - vip?: VIP; - title: string; - pickupLocation?: string; - dropoffLocation?: string; - location?: string; - startTime: string; - endTime: string; - actualStartTime?: string; - actualEndTime?: string; - description?: string; - type: 'TRANSPORT' | 'MEETING' | 'EVENT' | 'MEAL' | 'ACCOMMODATION'; - status: 'SCHEDULED' | 'IN_PROGRESS' | 'COMPLETED' | 'CANCELLED'; - driverId?: string; - driver?: Driver; - vehicleId?: string; - eventId?: string; - event?: Event; - notes?: string; - createdAt: string; - updatedAt: string; - deletedAt?: string; -} - -export interface EventTemplate { - id: string; - name: string; - description?: string; - defaultDuration: number; // in minutes - location?: string; - type: 'TRANSPORT' | 'MEETING' | 'EVENT' | 'MEAL' | 'ACCOMMODATION'; - createdAt: string; - updatedAt: string; - deletedAt?: string; - _count?: { - events: number; - }; -} - -export interface Event { - id: string; - name: string; - description?: string; - startTime: string; - endTime: string; - location: string; - type: 'TRANSPORT' | 'MEETING' | 'EVENT' | 'MEAL' | 'ACCOMMODATION'; - templateId?: string; - template?: EventTemplate; - attendees: EventAttendance[]; - scheduleTasks?: ScheduleEvent[]; - createdAt: string; - updatedAt: string; - deletedAt?: string; - _count?: { - attendees: number; - scheduleTasks: number; - }; -} - -export interface EventAttendance { - id: string; - eventId: string; - vipId: string; - vip: VIP; - addedAt: string; -} - -export interface CreateEventTemplateDto { - name: string; - description?: string; - defaultDuration: number; - location?: string; - type: 'TRANSPORT' | 'MEETING' | 'EVENT' | 'MEAL' | 'ACCOMMODATION'; -} - -export interface CreateEventDto { - name: string; - description?: string; - startTime: string; - endTime: string; - location: string; - type: 'TRANSPORT' | 'MEETING' | 'EVENT' | 'MEAL' | 'ACCOMMODATION'; - templateId?: string; -} - -export interface AddVipsToEventDto { - vipIds: string[]; - pickupMinutesBeforeEvent?: number; - pickupLocationOverride?: string; -} diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index ca9dcec..0d6d885 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -1,6 +1,6 @@ import { useQuery } from '@tanstack/react-query'; import { api } from '@/lib/api'; -import { Users, Car, Calendar, Plane, Clock } from 'lucide-react'; +import { Users, Car, Plane, Clock } from 'lucide-react'; import { VIP, Driver, ScheduleEvent } from '@/types'; import { formatDateTime } from '@/lib/utils';