Add 'new' status as default, in_transit becomes branch state

New tickets start as 'new' (just created, not yet examined). In Transit
is now a branch status off New for school pickups and shipped instruments.
Intake means the instrument has been physically received and documented.
Status progress bar, labels, filters, and default status all updated.
Removed debug logging from file upload endpoint.
This commit is contained in:
Ryan Moon
2026-03-29 11:45:41 -05:00
parent ba94adb8d7
commit b0379052d6
10 changed files with 28 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ import { Label } from '@/components/ui/label'
import { Filter, X } from 'lucide-react'
const ALL_STATUSES = [
{ value: 'new', label: 'New' },
{ value: 'in_transit', label: 'In Transit' },
{ value: 'intake', label: 'Intake' },
{ value: 'diagnosing', label: 'Diagnosing' },
@@ -19,7 +20,7 @@ const ALL_STATUSES = [
{ value: 'cancelled', label: 'Cancelled' },
]
const ACTIVE_STATUSES = ['in_transit', 'intake', 'diagnosing', 'pending_approval', 'approved', 'in_progress', 'pending_parts', 'ready']
const ACTIVE_STATUSES = ['new', 'in_transit', 'intake', 'diagnosing', 'pending_approval', 'approved', 'in_progress', 'pending_parts', 'ready']
const CONDITIONS = [
{ value: 'excellent', label: 'Excellent' },

View File

@@ -1,7 +1,7 @@
import { Check, Truck, ClipboardList, Search, Clock, ThumbsUp, Wrench, Package, HandMetal, Ban } from 'lucide-react'
import { Check, Truck, ClipboardList, Search, Clock, ThumbsUp, Wrench, Package, HandMetal, Ban, FilePlus } from 'lucide-react'
const STEPS = [
{ key: 'in_transit', label: 'In Transit', icon: Truck },
{ key: 'new', label: 'New', icon: FilePlus },
{ key: 'intake', label: 'Intake', icon: ClipboardList },
{ key: 'diagnosing', label: 'Diagnosing', icon: Search },
{ key: 'pending_approval', label: 'Pending Approval', icon: Clock },
@@ -12,6 +12,7 @@ const STEPS = [
] as const
const BRANCH_STATUSES: Record<string, { label: string; parentStep: string }> = {
in_transit: { label: 'In Transit', parentStep: 'new' },
pending_parts: { label: 'Pending Parts', parentStep: 'in_progress' },
delivered: { label: 'Delivered', parentStep: 'picked_up' },
}

View File

@@ -112,10 +112,10 @@ export function TicketNotes({ ticketId }: TicketNotesProps) {
// Upload attached photos to the note
for (const photo of photos) {
const formData = new FormData()
formData.append('file', photo)
formData.append('entityType', 'repair_note')
formData.append('entityId', note.id)
formData.append('category', 'attachment')
formData.append('file', photo)
const uploadRes = await fetch('/v1/files', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },