This document outlines the complete implementation plan for creating a new page called "Cintas Install Calendar Summary" with a workflow-based interface for processing Cintas install calendar data.
Import model with LayoutConfiguration for data mappingexceljs with streaming for large filescintas_install_calendar - stores raw calendar datacintas_intall_calendar_summary - stores calculated summariescintas_calculate_summary for summary calculationscintas_calculate_summary stored procedure definitioncintas_install_calendarapp/cintas-install-calendar-summary/page.tsxapp/dashboard/page.tsx to include new tilecintas-blue.svg icon with circular motifStep 1: File Upload
Step 2: Import Creation
Step 3: Data Processing
cintas_install_calendar tableStep 4: Summary Calculation
cintas_calculate_summary stored procedure-- Add stored procedure (will be added via migration)
CREATE PROCEDURE cintas_calculate_summary(IN provided_import_id bigint)
LANGUAGE plpgsql
AS $$
-- [Stored procedure definition from task]
$$;
{
"name": "Cintas Install Calendar",
"sections": [
{
"name": "Install Calendar Data",
"type": "excel_import",
"sheetName": "Sheet1",
"tableName": "cintas_install_calendar",
"fields": [
{"name": "opportunity_status", "cellPosition": "A", "dataType": "string"},
{"name": "week", "cellPosition": "B", "dataType": "string"},
{"name": "qtr", "cellPosition": "C", "dataType": "string"},
{"name": "install_date", "cellPosition": "D", "dataType": "string"},
{"name": "account_name", "cellPosition": "E", "dataType": "string"},
{"name": "zip_code", "cellPosition": "F", "dataType": "string"},
{"name": "sold_to_number", "cellPosition": "G", "dataType": "string"},
{"name": "sort_number", "cellPosition": "H", "dataType": "string"},
{"name": "type", "cellPosition": "I", "dataType": "string"},
{"name": "route", "cellPosition": "J", "dataType": "string"},
{"name": "day", "cellPosition": "K", "dataType": "string"},
{"name": "trr", "cellPosition": "L", "dataType": "decimal"},
{"name": "paper_chem_wk1", "cellPosition": "M", "dataType": "decimal"},
{"name": "paper_chem_wk2", "cellPosition": "N", "dataType": "decimal"},
{"name": "paper_chem_wk3", "cellPosition": "O", "dataType": "decimal"},
{"name": "paper_chem_wk4", "cellPosition": "P", "dataType": "decimal"},
{"name": "sanis", "cellPosition": "Q", "dataType": "decimal"},
{"name": "power_add", "cellPosition": "R", "dataType": "decimal"}
]
}
]
}
app/
├── cintas-install-calendar-summary/
│ ├── page.tsx # Main page component
│ ├── components/
│ │ ├── FileUploadStep.tsx # Step 1: File upload
│ │ ├── ImportCreationStep.tsx # Step 2: Import creation
│ │ ├── ProcessingStep.tsx # Step 3: Data processing
│ │ ├── ResultsStep.tsx # Step 4: Results display
│ │ └── WorkflowProgress.tsx # Progress indicator
│ └── actions/
│ └── cintas-actions.ts # Server actions
POST /api/cintas/upload - File uploadPOST /api/cintas/create-import - Create import recordPOST /api/cintas/process-import - Process dataGET /api/cintas/summary/:importId - Get summary resultsenum WorkflowStep {
UPLOAD = 1,
CREATE_IMPORT = 2,
PROCESS = 3,
RESULTS = 4
}
interface WorkflowState {
currentStep: WorkflowStep;
fileId?: string;
importId?: number;
processingStatus?: 'idle' | 'processing' | 'completed' | 'error';
results?: CintasSummary[];
}
exceljs - Excel file processing@prisma/client - Database accesslucide-react - Iconsreact-hook-form - Form handlingreact-dropzone - File upload