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

change: [M3-7847] - Add Akamai's Japanese QI System ID to Japanese Invoices. #10356

Merged
merged 4 commits into from
Apr 10, 2024

Conversation

cpathipa
Copy link
Contributor

@cpathipa cpathipa commented Apr 5, 2024

Description 📝

Add Akamai's Japanese QI System ID to Japanese Invoices.

Changes 🔄

List any change relevant to the reviewer.

  • Conditionally render Japanese QI System ID in pdfGenerator function.
  • Add's new field to the taxes object in LD (Note this filed is not yet added. Will be added once it is merged into Prod.)
    Example:
 {
  "country_tax": {
    "tax_id": "******",
    "tax_name": "Japan JCT",
    **"qi_registration": "**********"**
  },
  "provincial_tax_ids": {}
}

Preview 📷

image

How to test 🧪

Prerequisites

(How to setup test environment)

  • Turn on MSW
  • Change account country to "JP" in MSW

Verification steps

(How to verify changes)

  • Navigate to http://localhost:3000/account/billing
  • Click on Download invoice and verify the IQ registration appears under Tax Id's (top left side in invoice).
  • Validate the changes reflect AC in the ticket.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@cpathipa cpathipa requested a review from a team as a code owner April 5, 2024 13:48
@cpathipa cpathipa requested review from bnussman-akamai and jaalah-akamai and removed request for a team April 5, 2024 13:48
@cpathipa cpathipa marked this pull request as draft April 5, 2024 13:48
@cpathipa cpathipa self-assigned this Apr 5, 2024
@@ -5,6 +5,7 @@ import type { NoticeVariant } from 'src/components/Notice/Notice';
// These flags should correspond with active features flags in LD

export interface TaxDetail {
qi_registration?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any thoughts or suggestions regarding the addition or maintenance of IQ registration numbers in LD? Since it's related to the country, I was thinking of adding an optional new field to accommodate this for JP.

 {
  "country_tax": {
    "tax_id": "******",
    "tax_name": "Japan JCT",
    "qi_registration": "**********"
  },
  "provincial_tax_ids": {}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Im fine with that unless someone can convince me otherwise :P

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup! good adjustment and workaround 👍

@cpathipa cpathipa marked this pull request as ready for review April 5, 2024 14:08
Copy link

github-actions bot commented Apr 5, 2024

Coverage Report:
Base Coverage: 81.78%
Current Coverage: 81.78%

addLine(`${countryTax.tax_name}: ${countryTax.tax_id}`);
const line =
country === 'JP'
? `QI Registration # ${countryTax.qi_registration}`
Copy link
Contributor

Choose a reason for hiding this comment

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

considering qi_registration could be undefined, how about:

country === 'JP' && countryTax.qi_registration 
  ? ...
  : ...

?

or provide a fallback for countryTax.qi_registration? (what we want to display as a fallback may be a product decision)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could do that. We could display the default tax ID in case of undefined, which shouldn't be a problem once it is added in LD. f9e5891

Copy link
Member

Choose a reason for hiding this comment

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

Do we need to have the country === 'JP'? If a qi_registration is in launch darkly, maybe we should render it at all times for any country

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bnussman-akamai First part - Yes, since its specific to 'JP'.
For the second part: - Are you suggesting that qi_registration shouldn't be part of LD?

Copy link
Member

Choose a reason for hiding this comment

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

I'm pretty sure Launch Darkly conditionally serves the Tax data based on the user's country automatically. I think just checking for qi_registration would be sufficient, but I guess keeping country === 'JP' would be okay too.

If we remove country === 'JP', we'd be able to push out qi_registration changes for other countries without any code changes required. I'm not sure if that will ever happen, but maybe it would?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TY @bnussman-akamai Yeah, technically we can rely on qi_registration 34a19d1

country === 'JP'
? `QI Registration # ${countryTax.qi_registration}`
: `${countryTax.tax_name}: ${countryTax.tax_id}`;
addLine(line);
Copy link
Contributor

Choose a reason for hiding this comment

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

Am wondering if we could start a map instead of a one of exception. We may get more exception like this one soon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hoping this 34a19d1 could address need of map.

@cpathipa cpathipa requested a review from abailly-akamai April 9, 2024 16:44
Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

Looks good!

In the internal ticket, it didn't seem super clear to me if we want both the Tax ID and the QI number to show, or only the QI number if one is present.

I just want to make sure we're okay with not showing the Tax ID when a QI number is present in the Launch Darkly data.

@cpathipa
Copy link
Contributor Author

cpathipa commented Apr 9, 2024

@bnussman-akamai Based on the screenshot attached to the ticket my understanding is only QI. But, I will double check on that.

@@ -5,6 +5,7 @@ import type { NoticeVariant } from 'src/components/Notice/Notice';
// These flags should correspond with active features flags in LD

export interface TaxDetail {
qi_registration?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Yup! good adjustment and workaround 👍

@cpathipa cpathipa merged commit 6524ebe into linode:develop Apr 10, 2024
18 checks passed
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.

4 participants