Hi,
Im with a doubt about how to model the context below.
There is a entity "Conference" that can have 1 or more registration types(ex: general, vip). For each registration type there is a form that have always 2 mandatory fields: name and email. But then for each registration type the user that creates a conference can add more fields to the form. This fields can be of type: checkbox, input, select, textarea, date and upload file. And the conference creator can select each extra field as mandatory or not.
Example: A user create a conference and define 2 registration types. For one registration type its only necessary the default name and email of the participant. But for the other registration type the user add two extra fields to that specific registration type form. For this the user selects the type of field(checkbox, input, select, textarea, date and upload file), introduces the label for the field and selects if the field is mandatory or not. And do the same for the other extra field.
Do you know how this can be properly modeled? For now I have just the schema below:
Entities identified: Conference, RegistrationType, Form, FormField, FieldValue
Relationships:
1 to many relationship from Conference To Registration type (non-identifying)
1 to many relationship from RegistrationType to Form (non-identifying)
1 to many relationship from Form to Field (non-identifying)
1 to many relationship Field Form to FieldValue (non-identifying)
Schema:
- Conference: ConferenceID, Name, etc
- RegistrationType: RegistrationTypeID, Name, Description, etc, ConferenceConferenceID
- Form: idForm, RegistrationTypeRegistrationTypeID
- Field: idField, FormFormID, label, mandatory
- FieldValue: idFieldValue, value, FieldFieldiD