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

fix: add default rates data #38375

Merged
merged 29 commits into from
Mar 22, 2024
Merged

fix: add default rates data #38375

merged 29 commits into from
Mar 22, 2024

Conversation

nkdengineer
Copy link
Contributor

@nkdengineer nkdengineer commented Mar 15, 2024

Details

Fixed Issues

$ #38234
$ #38859
PROPOSAL: #38234 (comment)

Tests

Test Steps:

  1. Create a new Collect workspace (say new_collect)in OD
  2. Enable isPolicyExpenseChatEnabled using the following steps in console:
    p = Policy.getCurrent(); p.policy.isPolicyExpenseChatEnabled = "true"; p.save();
  3. Sign-off and Sign-in in ND using admin account of workspace new_collect
  4. Go Offline
  5. Go to User Settings -> Workspace
  6. Select workspace new_collect-> More features
  7. Enable Taxes
  8. Verify that the Taxes page shows two tax rates Tax exempt and Tax rate 1. Tax exempt is default.
  9. Verify that the tax rates are greyed-out
  10. Go Online
  11. Go to Taxes page
  12. Verify that the tax rates are not greyed-out
  13. Go Offline again.
  14. Go to Taxes page
  15. Verify that the tax rates remain non greyed-out.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Create a new Collect workspace (say new_collect)in OD
  2. Enable isPolicyExpenseChatEnabled using the following steps in console:
    p = Policy.getCurrent(); p.policy.isPolicyExpenseChatEnabled = "true"; p.save();
  3. Sign-off and Sign-in in ND using admin account of workspace new_collect
  4. Go Offline
  5. Go to User Settings -> Workspace
  6. Select workspace new_collect-> More features
  7. Enable Taxes
  8. Verify that the Taxes page shows two tax rates Tax exempt and Tax rate 1. Tax exempt is default.
  9. Verify that the tax rates are greyed-out
  10. Go Online
  11. Go to Taxes page
  12. Verify that the tax rates are not greyed-out
  13. Go Offline again.
  14. Go to Taxes page
  15. Verify that the tax rates remain non greyed-out.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2024-03-15.at.17.35.39.mov
Android: mWeb Chrome
Screen.Recording.2024-03-15.at.16.27.43.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2024-03-16.at.09.58.13.mov
MacOS: Chrome / Safari
output.mp4
MacOS: Desktop
Screen.Recording.2024-03-15.at.16.13.41.mov

@nkdengineer nkdengineer marked this pull request as ready for review March 15, 2024 09:07
@nkdengineer nkdengineer requested a review from a team as a code owner March 15, 2024 09:07
@melvin-bot melvin-bot bot requested review from rojiphil and removed request for a team March 15, 2024 09:07
Copy link

melvin-bot bot commented Mar 15, 2024

@rojiphil Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

src/CONST.ts Outdated
Comment on lines 988 to 1002
TAXES: {
DEFAULT: {
EXTERNAL_ID: 'id_TAX_EXEMPT',
FOREIGN_ID: 'id_TAX_EXEMPT',
VALUE: '0%',
EXEMPT_ID: 'id_TAX_EXEMPT',
NAME: 'Tax',
EXEMPT_NAME: 'Tax exempt',
EXEMPT_VALUE: '0%',
TAX_RATE_1_ID: 'id_TAX_RATE_1',
TAX_RATE_1_NAME: 'Tax Rate 1',
TAX_RATE_1_VALUE: '5%',
},
},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These data are obtained when I try turning on the tax feature in OD

Copy link
Contributor

Choose a reason for hiding this comment

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

@luacmartins @kosmydel @filip-solecki
Please confirm if the following default tax rates as per @nkdengineer proposal would match the BE defaults.
Also, is localization required for name i.e. "Tax", "Tax exempt", "Tax option 1"?

{
        "defaultExternalID": "id_TAX_EXEMPT",
        "defaultValue": "0%",
        "foreignTaxDefault": "id_TAX_EXEMPT",
        "name": "Tax",
        "taxes": {
            "id_TAX_EXEMPT": {
                "name": "Tax exempt",
                "value": "0%"
            },
            "id_TAX_OPTION_1": {
                "name": "Tax option 1",
                "value": "5%"
            }
        }
    }

Copy link
Contributor

Choose a reason for hiding this comment

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

{ "defaultExternalID": "id_TAX_EXEMPT", "defaultValue": "0%", "foreignTaxDefault": "id_TAX_EXEMPT", "name": "Tax", "taxes": { "id_TAX_EXEMPT": { "name": "Tax exempt", "value": "0%" }, "id_TAX_RATE_1": { "name": "Tax rate 1", "value": "5%" } } }

Copy link
Contributor

Choose a reason for hiding this comment

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

I left a comment above, I think the only difference is id_TAX_OPTION_1 should be id_TAX_RATE_1 and same for the name Tax option 1 -> Tax rate 1

Copy link
Contributor

Choose a reason for hiding this comment

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

I left a comment above, I think the only difference is id_TAX_OPTION_1 should be id_TAX_RATE_1 and same for the name Tax option 1 -> Tax rate 1

I think the code has incorporated most of these already. Only one minor change is pending: Tax Rate 1 -> Tax rate 1

@luacmartins luacmartins self-requested a review March 15, 2024 14:42
@rojiphil
Copy link
Contributor

rojiphil commented Mar 15, 2024

@nkdengineer
I have left some review comments.
Also, please share working test videos for all platforms as part of the PR author checklist

@luacmartins
Copy link
Contributor

@rojiphil I don't see any comments

Copy link
Contributor

@rojiphil rojiphil left a comment

Choose a reason for hiding this comment

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

Sorry, didn't submit the review comments. Here they are.

src/libs/actions/Policy.ts Show resolved Hide resolved
src/libs/actions/Policy.ts Show resolved Hide resolved
src/CONST.ts Outdated
Comment on lines 988 to 1002
TAXES: {
DEFAULT: {
EXTERNAL_ID: 'id_TAX_EXEMPT',
FOREIGN_ID: 'id_TAX_EXEMPT',
VALUE: '0%',
EXEMPT_ID: 'id_TAX_EXEMPT',
NAME: 'Tax',
EXEMPT_NAME: 'Tax exempt',
EXEMPT_VALUE: '0%',
TAX_RATE_1_ID: 'id_TAX_RATE_1',
TAX_RATE_1_NAME: 'Tax Rate 1',
TAX_RATE_1_VALUE: '5%',
},
},

Copy link
Contributor

Choose a reason for hiding this comment

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

@luacmartins @kosmydel @filip-solecki
Please confirm if the following default tax rates as per @nkdengineer proposal would match the BE defaults.
Also, is localization required for name i.e. "Tax", "Tax exempt", "Tax option 1"?

{
        "defaultExternalID": "id_TAX_EXEMPT",
        "defaultValue": "0%",
        "foreignTaxDefault": "id_TAX_EXEMPT",
        "name": "Tax",
        "taxes": {
            "id_TAX_EXEMPT": {
                "name": "Tax exempt",
                "value": "0%"
            },
            "id_TAX_OPTION_1": {
                "name": "Tax option 1",
                "value": "5%"
            }
        }
    }

@rojiphil
Copy link
Contributor

@luacmartins
Also, I have another query.
Currently, taxRates is used within policy.
But I also noticed onyx entry generated for tax rates with key policyTaxRates_. But, that is not used anywhere currently.
Why do we have two sources of the taxRates?
Or is it under plan to move to one of them?

@luacmartins
Copy link
Contributor

luacmartins commented Mar 15, 2024

We're deprecating policyTaxRates_, so we should be using policy.taxRates.

src/CONST.ts Outdated
Comment on lines 988 to 1002
TAXES: {
DEFAULT: {
EXTERNAL_ID: 'id_TAX_EXEMPT',
FOREIGN_ID: 'id_TAX_EXEMPT',
VALUE: '0%',
EXEMPT_ID: 'id_TAX_EXEMPT',
NAME: 'Tax',
EXEMPT_NAME: 'Tax exempt',
EXEMPT_VALUE: '0%',
TAX_RATE_1_ID: 'id_TAX_RATE_1',
TAX_RATE_1_NAME: 'Tax Rate 1',
TAX_RATE_1_VALUE: '5%',
},
},

Copy link
Contributor

Choose a reason for hiding this comment

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

I left a comment above, I think the only difference is id_TAX_OPTION_1 should be id_TAX_RATE_1 and same for the name Tax option 1 -> Tax rate 1

Comment on lines 3425 to 3439
defaultExternalID: CONST.TAXES.DEFAULT.EXTERNAL_ID,
defaultValue: CONST.TAXES.DEFAULT.VALUE,
foreignTaxDefault: CONST.TAXES.DEFAULT.FOREIGN_ID,
name: CONST.TAXES.DEFAULT.NAME,
taxes: {
[CONST.TAXES.DEFAULT.EXEMPT_ID]: {
name: CONST.TAXES.DEFAULT.EXEMPT_NAME,
value: CONST.TAXES.DEFAULT.EXEMPT_VALUE,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
},
[CONST.TAXES.DEFAULT.TAX_RATE_1_ID]: {
name: CONST.TAXES.DEFAULT.TAX_RATE_1_NAME,
value: CONST.TAXES.DEFAULT.TAX_RATE_1_VALUE,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's create a const with these defaults

Copy link
Contributor

Choose a reason for hiding this comment

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

@luacmartins Apologies as it looks like I introduced some confusion here. I was unaware of your earlier review comments about using individual values in CONST to generate taxRates object. But I am ok with that too.
So, I need a clarification here.
Did you mean creating a const object for taxRates in the code itself and set it to value or did you mean creating the entire taxRates object in CONST?
The reason why I ask is that @nkdengineer has reverted the code in the latest commit to create the entire taxRates object in CONST

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

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

Thinking more about this one, I'm not sure that it's this simple. We only want to create these defaults if the policy doesn't have any taxRates yet, so we should check that taxRates is empty before we create the defaults.

For example, in OldDot, if you have tax rates created and then turn off/on the feature, we display the previous tax rates you had.

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

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

I also think we should send this object to the API so that the frontend and backend don't get out of sync in case one changes

The format for the API is:

{"fieldID":"field_id_TAX","type":"tax","defaultValue":"0%","defaultExternalID":null,"value":null,"name":"Tax","target":"expense","values":["5%","0%"],"keys":["Tax Rate 1","Tax exempt"],"orderWeight":0,"deletable":false,"isTax":true,"externalIDs":[],"disabledOptions":[false,false],"externalID":null,"modifiedTaxAmount":null,"origin":null,"foreignTaxDefault":null}

I'll adjust the API to accept the taxFields param as described above. Same thing, we only want to send this param if there's no data in taxRates

@rojiphil
Copy link
Contributor

Thinking more about this one, I'm not sure that it's this simple. We only want to create these defaults if the policy doesn't have any taxRates yet, so we should check that taxRates is empty before we create the defaults.

For example, in OldDot, if you have tax rates created and then turn off/on the feature, we display the previous tax rates you had.

@luacmartins While investigating OD for the existing enable/disable tax feature, I noticed that, during fresh sign-in, the taxRates are not sent in ND within policy if tax is not enabled. This is the only time when taxRates are not available in FE. Further, we already have the check to add default taxRates from FE only when empty. Please note however that taxRates are sent during fresh sign-in in ND if tax is already enabled.
So, I think we can achieve the above objective if BE sends the taxRates when already present in BE irrespective of the enabled/disabled tax status. This way sending the default taxRates from FE is only when BE does not also have taxRates.
Otherwise, I am also not sure if it's simple to do purely from FE.
What do you think?

@rojiphil
Copy link
Contributor

I also think we should send this object to the API so that the frontend and backend don't get out of sync in case one changes

The format for the API is:

{"fieldID":"field_id_TAX","type":"tax","defaultValue":"0%","defaultExternalID":null,"value":null,"name":"Tax","target":"expense","values":["5%","0%"],"keys":["Tax Rate 1","Tax exempt"],"orderWeight":0,"deletable":false,"isTax":true,"externalIDs":[],"disabledOptions":[false,false],"externalID":null,"modifiedTaxAmount":null,"origin":null,"foreignTaxDefault":null}

That sounds cool. I think just a small typo to note here while implementing: Tax Rate 1 -> Tax rate 1

@rojiphil
Copy link
Contributor

rojiphil commented Mar 15, 2024

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native
38234-android-native-01.mp4
Android: mWeb Chrome
38234-mweb-chrome-01.mp4
iOS: Native
38234-ios-native-01.mp4
iOS: mWeb Safari
38234-mweb-safari-01.mp4
MacOS: Chrome / Safari
38234-web-safari-01.mp4
MacOS: Desktop
38234-desktop-01.mp4

@luacmartins
Copy link
Contributor

So, I think we can achieve the above objective if BE sends the taxRates when already present in BE irrespective of the enabled/disabled tax status.

That's a good point. We should send this data when loading the more features page so we have the data if it exists. I can incorporate that in the backend PR I'm working on. Thanks for bringing this up.

@nkdengineer
Copy link
Contributor Author

nkdengineer commented Mar 16, 2024

@rojiphil Why do we need to send this data to BE when calling API?

@nkdengineer
Copy link
Contributor Author

Update: I just resolved all the above comments except this comment because I need to confirm, and add screenshot (except ios native because of a device issue)

@luacmartins
Copy link
Contributor

luacmartins commented Mar 16, 2024

@nkdengineer i think it makes sense to send the data to the backend just like we do for other optimistic data. I think the advantage is that it'll make sure that the FE and BE are in sync and create/show the same data. Otherwise if we ever change the data in one place, we'd have to update the other to match witch might cause inconsistencies when being deployed.

src/CONST.ts Outdated Show resolved Hide resolved
src/libs/actions/Policy.ts Outdated Show resolved Hide resolved
@rojiphil
Copy link
Contributor

@luacmartins Along with the suggested changes here the overall FE code looks super good to go unless you have any further review comments to implement. I have also ticked most of the reviewer checklist.

But I think there are a couple of issues also to be addressed by BE:

  1. When we enable Taxes in OD, it generates Tax Rate 1 instead of Tax rate 1.
    Screenshot 2024-03-21 at 9 14 04 PM
  2. On sending the taxRates as part of setting enablePolicyTaxes to true, the BE does not seem to save it in BE. So, if we signout and signin again in ND, the Taxes are enabled but there are no tax rates.

Do we wait for BE changes too?

@luacmartins
Copy link
Contributor

When we enable Taxes in OD, it generates Tax Rate 1 instead of Tax rate 1.

Let's rename it here to be Tax Rate 1 so it's consistent with olddot

On sending the taxRates as part of setting enablePolicyTaxes to true, the BE does not seem to save it in BE. So, if we signout and signin again in ND, the Taxes are enabled but there are no tax rates.

Yes, I still need to work on the API to save this data.

src/CONST.ts Outdated Show resolved Hide resolved
src/CONST.ts Outdated Show resolved Hide resolved
@nkdengineer
Copy link
Contributor Author

@luacmartins Fixed all your comments

@luacmartins luacmartins merged commit 7dc0cfc into Expensify:main Mar 22, 2024
15 checks passed
@melvin-bot melvin-bot bot added the Emergency label Mar 22, 2024
Copy link

melvin-bot bot commented Mar 22, 2024

@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@luacmartins
Copy link
Contributor

Tests passed
Screenshot 2024-03-22 at 2 58 14 PM

@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@luacmartins
Copy link
Contributor

Added #38859 to the list of fixed issues here.

@MonilBhavsar
Copy link
Contributor

@nkdengineer @rojiphil @luacmartins looks like we have a regression from this PR #39154
Can anyone please take a look?

@rojiphil
Copy link
Contributor

@nkdengineer @rojiphil @luacmartins looks like we have a regression from this PR #39154
Can anyone please take a look?

@MonilBhavsar It doesn't look like this PR was included the build in the first place. So, I doubt if this is the offending PR.

Screenshot 2024-03-28 at 4 57 58 PM

@MonilBhavsar
Copy link
Contributor

The PR being that list indicates that it was included in the build. The unchecked item indicates that this item is yet to be QA'ed by the QA team

@rojiphil
Copy link
Contributor

Ok. Thanks for the clarification. This is a strange issue as we have not touched anything related to navigation.
Anyway, let me try to reproduce this first.

@MonilBhavsar
Copy link
Contributor

Thank you! Sorry if this is not the offending PR. This one stood suspicious from the difference and QA also mentioned they found the issue while QA'ing this PR

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.

5 participants