Skip to content

chore: Update schema for "YDP community sports programme" to use nested values#58

Merged
sajclarke merged 1 commit intodevelopfrom
fix/api/community-sports-programme-schema
Jan 19, 2026
Merged

chore: Update schema for "YDP community sports programme" to use nested values#58
sajclarke merged 1 commit intodevelopfrom
fix/api/community-sports-programme-schema

Conversation

@sajclarke
Copy link
Contributor

Description

This PR restructures the Community Sports Programme form schema to use nested object grouping, improving form organization and data structure clarity. The schema changes consolidate related fields into logical sections such as applicant information, discipline details, employment, contact information, and emergency contact details.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changes Made

  • Restructure form fields into nested objects for better organization:
    • applicant: Group first name, last name, date of birth, and sex
    • discipline: Group area of interest and experience questions
    • experience: Group experience level, other experience, and years of experience
    • employment: Group employment status, institution/company names, and other details
    • contact: Group primary contact address, parish, email, and phone
    • emergency: Group emergency contact information and address
  • Update field names for clarity (e.g., firstNameapplicant.firstName)
  • Rename gender to sex for consistency
  • Rename disciplineOfInterest to discipline.areaOfInterest
  • Rename disciplineExperience to discipline.hasExperience with yes/no validation
  • Rename experienceLevel to experience.levelOfExperience
  • Rename yearsOfExperience to experience.yearsOfExperience
  • Rename employmentStatus to employment.status
  • Rename employerName to employment.companyName
  • Rename otherEmploymentDetails to employment.otherDetails
  • Rename belongsToOrganizations to belongsToOrganisations with yes/no validation
  • Restructure organizationNames array to organizationDetails with organizationName and hasSignificantPosition properties
  • Move all emergency contact fields into emergency object with nested structure
  • Move all contact fields into contact object with nested structure
  • Update email processor template to use nested field paths (e.g., {{formData.applicant.firstName}})
  • Add validation regex patterns for yes/no fields
  • Update label capitalization for consistency (e.g., "First Name" → "First name")

Files Changed

  • schemas/community-sports-programme.json - Complete schema restructuring (255 insertions, 184 deletions)

Notes

This is a breaking change that requires form data to be submitted with the new nested structure. The email processor has been updated to reference fields using the new nested paths. Existing form submissions and stored data may need migration depending on the database schema.

Testing

  • Form schema validation tested with new nested structure
  • Verify all nested fields are properly required/optional
  • Test form submission with complete data using new nested paths
  • Verify email template renders correctly with nested field references
  • Test conditional field logic with updated field names
  • Check all validations work with new field structure
  • Validate yes/no regex patterns on applicable fields
  • Test responsive design across device sizes

Related Github Issue(s)/Trello Ticket(s)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated for schema changes
  • Documentation updated with new field paths
  • Email template expressions updated and tested
  • Database migration plan documented if needed

@amazon-inspector-n-virginia
Copy link

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@amazon-inspector-n-virginia
Copy link

✅ I finished the code review, and didn't find any security or code quality issues.

"required": true
},
{
"name": "telephoneNumber",
Copy link
Contributor

Choose a reason for hiding this comment

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

Will there be validation for telephone number on the backend?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes can you please open a PR to address this?

Copy link
Contributor

@IsaiahSama IsaiahSama left a comment

Choose a reason for hiding this comment

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

See comment about Telephone number validation, otherwise, all good.

@sajclarke sajclarke merged commit 67fdc3e into develop Jan 19, 2026
2 checks passed
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