Describe the solution you'd like
Currently, the "Person" model does not have a postal code field or validation. To improve the model, we should:
- Add a new postalCode field to the "Person" model.
- Implement regex validation to ensure the postal code is in the correct format.
- Update the user interface to handle postal code input and validation when adding or updating a person.
Additional context
Add a postalCode attribute to the "Person" class with the necessary getter and setter methods.
Use a regex pattern to validate the postal code format. For example, for a typical US postal code format:
String postalCodeRegex = "^(\d{5})(?:[-\s]?\d{4})?$";
This will handle both 5-digit postal codes and extended 9-digit formats (ZIP+4).
Update the form or input pane in the app or menu to include the postalCode field.
When adding or editing a person, validate the postal code using the regex. If the postal code is invalid, show an error message like "Invalid postal code format."
- Error Handling in the App:
If the postal code fails validation, prevent the user from saving or updating the record and display a message asking them to enter a valid postal code.
Expected sample

Describe the solution you'd like
Currently, the "Person" model does not have a postal code field or validation. To improve the model, we should:
Additional context
Add a postalCode attribute to the "Person" class with the necessary getter and setter methods.
Use a regex pattern to validate the postal code format. For example, for a typical US postal code format:
String postalCodeRegex = "^(\d{5})(?:[-\s]?\d{4})?$";
This will handle both 5-digit postal codes and extended 9-digit formats (ZIP+4).
Update the form or input pane in the app or menu to include the postalCode field.
When adding or editing a person, validate the postal code using the regex. If the postal code is invalid, show an error message like "Invalid postal code format."
If the postal code fails validation, prevent the user from saving or updating the record and display a message asking them to enter a valid postal code.
Expected sample