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

feat: add new api for masked contact number in phone number module [ATLAS-197] #142

Merged
merged 17 commits into from
May 20, 2024

Conversation

RgnDunes
Copy link
Collaborator

@RgnDunes RgnDunes commented May 8, 2024

Description

This module adds a new API that returns us a masked contact number as shown below:

// Example: 

// Masking a U.S. phone number completely
console.log(
  getMaskedPhoneNumber({
    countryCode: 'US',
    phoneNumber: '2025550125',
    withDialCode: true,
  }),
);
// Output: +1 xxx-xxx-xxxx

// Partially masking an Indian phone number, hiding the last 6 digits
console.log(
  getMaskedPhoneNumber({
    countryCode: 'IN',
    phoneNumber: '9876543210',
    maskingOptions: {
      maskingStyle: 'suffix',
      maskedDigitsCount: 6,
      maskingChar: '*',
    },
    withDialCode: true,
  }),
);
// Output: +91 9876**-****

// Formatting and completely masking a phone number for Brazil without specifying a phone number
console.log(
  getMaskedPhoneNumber({
    countryCode: 'BR',
  }),
);
// Output: xx xxxx-xxxx

Changes Made

List the main changes made in this pull request.

Title ---
JIRA link https://razorpay.atlassian.net/browse/ATLAS-197
Slack thread (if any) NA
Product spec NA
Tech spec/One-pager NA
Bundle Size Difference NA
Fixes Issue NA

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change is a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Is your change backward compatible ?
  • Tested on major browsers (Chrome, Firefox, Safari, IE) ?
  • Tested in a consumer application(s) ?

Additional Notes

Any additional information that would be helpful for the reviewer.

Checklist:

  • Add Jira ID(s) in PR title and in the description?
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My code is written in TypeScript and follows the coding standards of the project.
  • I have added relevant documentation and updated the README if necessary.
  • My commit messages are clear and follow the project's commit message conventions.
  • Is any external library added?
  • My changes do not introduce any new runtime errors or warnings.
  • All relevant unit tests have been added/updated in my PR for the change.
  • [NA] Any Screenshots (mobile & desktop) required for PR? If yes, have you added the respective screenshots ?
  • Any manual dev testing done by you on beta/func environment?
  • Reviewer added (SLA 2 days)

Reviewer Checklist

  • Sufficient QA/Dev-Testing is done with proof (test cases list)
  • Ensure that the change in bundle size falls within the acceptable range.

PR Title Format

Format: <type>: <subject>

Types can be as follows:

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Copy link

changeset-bot bot commented May 8, 2024

🦋 Changeset detected

Latest commit: e4b328b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@razorpay/i18nify-js Minor
@razorpay/i18nify-react Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@RgnDunes RgnDunes marked this pull request as draft May 8, 2024 07:39

This comment has been minimized.

@rzpcibot
Copy link
Contributor

rzpcibot commented May 8, 2024

Warnings
⚠️ Your PR has over 600 lines of code additions 😱 . Try to breakup into separate PRs 👍

Bundle Size Report

Files

click to expand/collapse
🟢 No Change 🗑 File Deleted 🆕 New File 📈 Size Increased 👍 Size Reduced
Parsed (kb)
🚦 File Name Base PR Diff %
📈 cjs/index.js 138.9 146.13 $\textcolor{red}{7.23}$ 5.21
📈 esm/index.min.js 51.45 52.74 $\textcolor{red}{1.29}$ 2.51
📈 umd/index.js 158.85 166.67 $\textcolor{red}{7.82}$ 4.92

Generated by 🚫 dangerJS against e4b328b

This comment has been minimized.

This comment has been minimized.

@RgnDunes RgnDunes marked this pull request as ready for review May 8, 2024 07:50
@RgnDunes RgnDunes requested a review from tarun-khanna May 8, 2024 07:51
@RgnDunes RgnDunes changed the title feat: add new api for masked contact number in phone number module feat: add new api for masked contact number in phone number module [ATLAS-197] May 8, 2024

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

Unit Test Results

0 files  0 suites   0s ⏱️
0 tests 0 ✔️ 0 💤 0 ❌

Results for commit 84ef659.

@RgnDunes RgnDunes merged commit 08342e6 into master May 20, 2024
16 checks passed
@RgnDunes RgnDunes deleted the masked-contact-number branch May 20, 2024 07:44
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.

3 participants