Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone country code unique #9035

Merged
merged 25 commits into from
Dec 19, 2024
Merged

Phone country code unique #9035

merged 25 commits into from
Dec 19, 2024

Conversation

guillim
Copy link
Contributor

@guillim guillim commented Dec 12, 2024

fix #8775

@guillim guillim self-assigned this Dec 12, 2024
@guillim guillim linked an issue Dec 12, 2024 that may be closed by this pull request
@guillim guillim changed the title Phone country code unique Phone country code unique #backend Dec 17, 2024
@guillim guillim marked this pull request as ready for review December 17, 2024 13:04
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds functionality to handle phone country codes and calling codes separately, addressing the issue where multiple countries can share the same calling code (e.g., +1 for US and Canada).

  • Added new primaryPhoneCallingCode field across the system to store international dialing codes (e.g., '+33'), while primaryPhoneCountryCode now stores ISO country codes (e.g., 'FR')
  • Created migration command PhoneCallingCodeCommand that converts existing calling codes to proper country codes and backfills the new calling code field
  • Added validation and default value handling for the new calling code field in metadata definitions and DTOs
  • Updated GraphQL queries, OpenAPI specs, and mock data to support the new phone number structure
  • Ensured migration runs before metadata sync to maintain data consistency during upgrade

13 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

Left a few comments! Also I think it would be nice to implement dryRun in your commands so we can safely test them 👍

@guillim guillim changed the title Phone country code unique #backend Phone country code unique Dec 19, 2024
@charlesBochet charlesBochet merged commit 360c34f into main Dec 19, 2024
19 of 20 checks passed
@charlesBochet charlesBochet deleted the phone-country-code-unique branch December 19, 2024 15:42
Copy link

Thanks @guillim for your contribution!
This marks your 25th PR on the repo. You're top 2% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

mdrazak2001 pushed a commit to mdrazak2001/twenty that referenced this pull request Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phone country codes not unique
3 participants