Skip to content

Dis 142 bug fixing create new bookings#194

Merged
sguming merged 6 commits intomainfrom
DIS-142-Bug-Fixing-Create-New-Bookings
Aug 25, 2025
Merged

Dis 142 bug fixing create new bookings#194
sguming merged 6 commits intomainfrom
DIS-142-Bug-Fixing-Create-New-Bookings

Conversation

@Whiskey-Taste
Copy link
Copy Markdown
Contributor

🚀 Add Custom Form Fields Support for Service Bookings

📋 Summary

This PR adds comprehensive support for custom form fields in service bookings, allowing users to create and view custom form data when booking services. It also improves the time validation logic to allow past time selection for cancelled bookings.

✨ Features Added

1. Custom Form Fields in Booking Creation

  • Dynamic Form Generation: Automatically displays custom form fields based on service configuration
  • Multiple Field Types: Supports short answer, paragraph, dropdown, single choice, multiple choice, date, and time fields
  • Required Field Validation: Enforces required field validation before allowing booking creation
  • Real-time Data Binding: Form values are captured and stored with the booking

2. Custom Form Fields in Booking View

  • Enhanced View Form Modal: Displays custom form fields with their labels and user-provided values
  • Data Persistence: Custom form field values are properly stored and retrieved from the backend
  • User Experience: Clear separation between field labels and values for better readability

3. Improved Time Validation

  • Flexible Past Time Selection: Allows past time selection for both "Done" and "Cancelled" booking statuses
  • Better User Guidance: Updated helper text and validation messages for clearer user instructions
  • Status-based Validation: Different validation rules based on booking status

🔧 Technical Changes

Frontend Components Modified

  • BookingModal.tsx: Added custom form field rendering and validation
  • ViewFormModal.tsx: Enhanced to display custom form fields with values
  • BookingManager.tsx: Updated data transformation to include custom form values
  • serviceApi.ts: Extended Service interface with custom form fields support

Key Implementation Details

  • State Management: Added customFormValues state for managing custom form field inputs
  • API Integration: Integrated with useGetServiceFormFieldsQuery to fetch field definitions
  • Data Flow: Custom form values are properly mapped and sent to backend during booking creation
  • Validation Logic: Enhanced form validation to include required custom form fields

Backend Integration

  • Data Structure: Custom form values are stored in serviceFormValues array
  • Field Mapping: Proper mapping between field IDs and user responses
  • Data Persistence: Custom form data is successfully saved and retrieved

🎯 User Experience Improvements

Before

  • ❌ No custom form fields support in bookings
  • ❌ Limited time validation options
  • ❌ Missing custom form data in booking views

After

  • ✅ Full custom form fields support with multiple input types
  • ✅ Flexible time selection for different booking statuses
  • ✅ Complete custom form data visibility in booking views
  • ✅ Improved form validation and user guidance

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugbot free trial expires on August 29, 2025
Learn more in the Cursor dashboard.

@sguming sguming merged commit 71842fe into main Aug 25, 2025
1 check passed
@sguming sguming deleted the DIS-142-Bug-Fixing-Create-New-Bookings branch August 25, 2025 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants