feat: add phone validation option to Job Applicant contact number field#6025
feat: add phone validation option to Job Applicant contact number field#6025pjamsheer wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Improves phone number handling for Job Applicants and Employees by enforcing phone validation on the Job Applicant contact number field and sanitizing stored phone numbers to remove problematic Unicode characters.
Changes:
- Adds
options: "Phone"to the Job Applicantone_fm_contact_numbercustom field (fixture + patch). - Introduces a data patch to sanitize existing Job Applicant contact numbers by stripping Unicode bidirectional markers.
- Sanitizes Employee phone fields during onboarding before saving the new Employee record.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| one_fm/patches/v15_0/sanitize_job_applicant_contact_numbers.py | New patch to sanitize stored Job Applicant phone numbers. |
| one_fm/patches/v15_0/add_phone_option_to_job_applicant_contact_number.py | New patch to apply Phone validation option to the Job Applicant contact number field. |
| one_fm/patches.txt | Registers the two new v15 patches for migration execution. |
| one_fm/hiring/doctype/onboard_employee/onboard_employee.py | Sanitizes employee phone fields during Employee creation. |
| one_fm/custom/custom_field/job_applicant.py | Updates Job Applicant contact number field to use options: "Phone". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR improves phone-number handling for Job Applicants and newly created Employees by enforcing Frappe’s “Phone” field validation and sanitizing stored phone strings to remove problematic Unicode formatting characters.
Changes:
- Add
"options": "Phone"to the Job Applicant contact number custom field (via customization + patch). - Introduce a migration patch to sanitize existing Job Applicant phone fields by removing bidi markers and trimming whitespace.
- Sanitize Employee phone fields during onboarding employee creation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| one_fm/patches/v15_0/sanitize_job_applicant_contact_numbers.py | New patch to sanitize existing Job Applicant contact numbers in DB. |
| one_fm/patches/v15_0/add_phone_option_to_job_applicant_contact_number.py | New patch to enforce “Phone” validation on an existing custom field. |
| one_fm/patches.txt | Registers the two new v15 patches for migration execution. |
| one_fm/hiring/utils.py | Adds shared sanitization utilities (translation table + sanitization helper). |
| one_fm/hiring/doctype/onboard_employee/onboard_employee.py | Sanitizes Employee phone fields before saving newly created Employee records. |
| one_fm/custom/custom_field/job_applicant.py | Updates Job Applicant custom field definition to use “Phone” validation option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Improves phone number handling for hiring/onboarding by enforcing phone validation for Job Applicant contact numbers, sanitizing problematic Unicode characters in existing data, and sanitizing phone fields during employee creation.
Changes:
- Add
"options": "Phone"to the Job Applicantone_fm_contact_numbercustom field (and include a patch to apply it). - Introduce a migration patch to sanitize Job Applicant contact numbers using a shared
sanitize_phone_numberutility. - Sanitize Employee phone fields during onboarding to prevent invalid/unexpected Unicode markers in newly created Employee records.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| one_fm/patches/v15_0/sanitize_job_applicant_contact_numbers.py | Adds a batched data migration to sanitize Job Applicant phone fields. |
| one_fm/patches/v15_0/add_phone_option_to_job_applicant_contact_number.py | Adds/updates custom field metadata to enforce Phone validation on contact number. |
| one_fm/patches.txt | Registers the new patches for execution during migrations. |
| one_fm/hiring/utils.py | Adds reusable phone sanitization helper(s) and a cached translation table. |
| one_fm/hiring/doctype/onboard_employee/onboard_employee.py | Sanitizes phone fields before saving newly created Employee records. |
| one_fm/custom/custom_field/job_applicant.py | Updates the Job Applicant custom field definition to include options = "Phone". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR improves phone number handling across the hiring/onboarding flow by enforcing phone validation on the Job Applicant contact number field and sanitizing phone strings to remove invisible Unicode formatting characters that can break validation.
Changes:
- Added
"options": "Phone"to the Job Applicantone_fm_contact_numbercustom field and introduced a patch to apply this to existing sites. - Added a sanitization utility (
sanitize_phone_number) and applied it during employee creation in onboarding. - Added a database patch to sanitize existing Job Applicant contact numbers, and registered the new patches in
patches.txt.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| one_fm/patches/v15_0/sanitize_job_applicant_contact_numbers.py | New patch to batch-sanitize Job Applicant phone fields in the DB. |
| one_fm/patches/v15_0/add_phone_option_to_job_applicant_contact_number.py | New patch to enforce Phone validation option on the Job Applicant contact number field. |
| one_fm/patches.txt | Registers the two new patches (including post-model-sync execution for sanitization). |
| one_fm/hiring/utils.py | Adds cached translation table + sanitize_phone_number() helper. |
| one_fm/hiring/doctype/onboard_employee/onboard_employee.py | Sanitizes employee phone fields during onboarding employee creation. |
| one_fm/custom/custom_field/job_applicant.py | Adds "options": "Phone" to the Job Applicant contact number field definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Improves phone-number handling for hiring/onboarding by enforcing phone validation on Job Applicant contact numbers and normalizing stored phone values to remove problematic Unicode formatting markers.
Changes:
- Adds
"options": "Phone"to the Job Applicantone_fm_contact_numbercustom field (and introduces a migration patch to apply it). - Introduces a post-migration patch to sanitize existing Job Applicant phone numbers in batches.
- Adds shared phone sanitization utilities and applies them during employee creation in onboarding.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
one_fm/patches/v15_0/sanitize_job_applicant_contact_numbers.py |
New post-model-sync patch to sanitize existing Job Applicant phone fields in batches. |
one_fm/patches/v15_0/add_phone_option_to_job_applicant_contact_number.py |
New patch to enforce Phone validation option on Job Applicant contact number field. |
one_fm/patches.txt |
Registers the new patches (including post-model-sync sanitization). |
one_fm/hiring/utils.py |
Adds reusable sanitization helpers (cached translate table + sanitizer). |
one_fm/hiring/doctype/onboard_employee/onboard_employee.py |
Sanitizes employee phone fields before saving the created Employee document. |
one_fm/custom/custom_field/job_applicant.py |
Updates the Job Applicant custom field definition to include Phone validation option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2987ce9 to
3e07096
Compare
There was a problem hiding this comment.
Pull request overview
Adds phone-number validation configuration to the Job Applicant “Contact Number” custom field and ensures existing sites receive the update via a migration patch.
Changes:
- Set
options = "Phone"on theone_fm_contact_numbercustom field definition for Job Applicant. - Added a v15 patch to apply the phone validation option to existing databases.
- Registered the new patch in
one_fm/patches.txt.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
one_fm/patches/v15_0/add_phone_option_to_job_applicant_contact_number.py |
Adds a migration patch that updates the Job Applicant contact number custom field to use options="Phone". |
one_fm/patches.txt |
Registers the new patch for execution during migrations. |
one_fm/custom/custom_field/job_applicant.py |
Updates the Job Applicant custom field spec to include options="Phone" for the contact number field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3e07096 to
48156d1
Compare
This pull request adds a validation option to the "Contact Number" field for job applicants, ensuring that phone numbers are properly validated. The main changes include updating the field definition, adding a database patch to apply this change, and registering the patch for execution.
Job Applicant "Contact Number" field improvements:
"options": "Phone"property to theone_fm_contact_numberfield inget_job_applicant_custom_fields()to enable phone number validation.Database migration:
add_phone_option_to_job_applicant_contact_number.pythat updates theone_fm_contact_numberfield to include the "Phone" option, ensuring the change is applied to existing fields.patches.txtso it will run during the next migration.