SANC-86: fix updating survey and add passenger info#59
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis pull request extends the post-trip survey feature to capture, persist, and update passenger information. Changes span the database schema (adding passengerInfo column), API layer (supporting passengerInfo in create/update operations), and UI components (refactoring to support survey updates with proper form state management). Changes
Sequence DiagramsequenceDiagram
actor User as Driver
participant UI as SurveyNotification
participant Form as Form State
participant API as Survey API
participant DB as Database
User->>UI: Click "Update Survey" button
UI->>Form: Populate form with mapSurveyToFormValues(survey)
UI->>UI: Open modal with form values
User->>UI: Fill form (passenger info, readings, etc.)
User->>UI: Click "Update Survey"
UI->>Form: Validate form inputs
Form-->>UI: Validation complete
UI->>API: Call updateSurveyMutation({id, ...payload})
API->>DB: Update survey record with new passengerInfo & fields
DB-->>API: Confirmation
API->>UI: onSuccess callback
UI->>Form: Update cached form values
UI->>UI: Close modal & show success
UI-->>User: Survey updated
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
Release Notes
New Features
Improvements