Skip to content

Bulk import view lacks CSV schema validation before upload #266

Description

@usmanimamu17-create

The bulk import view (src/components/bulk-import/bulk-import-view.tsx) allows users to upload CSV or JSON files for bulk outage creation. The current implementation sends the file directly to the backend's dry-run endpoint for validation. If the CSV has incorrect columns or missing required fields, the user only receives an error after the upload completes, wasting upload time for large files.

Why this is architecturally hard

  1. Expected CSV schema is defined in backend's OpenAPI spec, not exposed to frontend
  2. Parsing CSV in browser requires library like papaparse or custom parsing
  3. Type coercion must match backend expectations exactly

Acceptance criteria

  • Uploading CSV with missing required columns shows immediate error
  • Uploading CSV with unrecognized columns shows warning but allows proceeding
  • Validation completes within 500ms for files up to 1000 rows

Getting started

Files: src/components/bulk-import/bulk-import-view.tsx, src/services/bulkImportService.ts

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or requestuxtracking label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions