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

[HOLD for payment 2024-07-24] Filter out payroll and bill reports from the client #45104

Closed
puneetlath opened this issue Jul 9, 2024 · 58 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Jul 9, 2024

If a report has the report type type: paycheck or type: bill we should filter it out in the NewDot inbox. It shouldn't show up in the LHN even if it has unread messages or error messages. It just shouldn't ever show up there.

You won't be able to test this with real data as reports of type:paycheck isn't currently a publicly accessible feature.

Issue OwnerCurrent Issue Owner: @puneetlath
@puneetlath puneetlath added External Added to denote the issue can be worked on by a contributor Daily KSv2 NewFeature Something to build that is a new item. labels Jul 9, 2024
@puneetlath puneetlath self-assigned this Jul 9, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 9, 2024
Copy link

melvin-bot bot commented Jul 9, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

Copy link

melvin-bot bot commented Jul 9, 2024

Current assignee @puneetlath is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jul 9, 2024
Copy link

melvin-bot bot commented Jul 9, 2024

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Jul 9, 2024

Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (NewFeature)

@cretadn22
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Filter out payroll reports

What is the root cause of that problem?

New feature

What changes do you think we should make in order to solve the problem?

In the shouldReportBeInOptionList function, we need to include a condition to filter reports that has type: paycheck

 if (report.type === "paycheck") {
        return false;
    }

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 9, 2024
@ShridharGoel
Copy link
Contributor

ShridharGoel commented Jul 9, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Filter out payroll reports from the client.

What is the root cause of that problem?

New change.

What changes do you think we should make in order to solve the problem?

We need to update getOrderedReportIDs in SidebarUtils to include the below check after this:

if (ReportUtils.isPaycheck(report) || ReportUtils.isBill(report)) {
    return;
}

We'll add the isPaycheck method in ReportUtils:

function isPaycheck(report: OnyxEntry<Report>): boolean {
    return report?.type === 'paycheck';
}

We'll add the isBill method in ReportUtils:

function isBill(report: OnyxEntry<Report>): boolean {
    return report?.type === 'bill';
}

@nkdengineer
Copy link
Contributor

nkdengineer commented Jul 10, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Filter out payroll reports from the client

What is the root cause of that problem?

This is a new feature

What changes do you think we should make in order to solve the problem?

  1. Create a util to check the type of report
function isPayCheckReport(report: OnyxInputOrEntry<Report>): boolean {
    return report?.type === 'paycheck';
}
function isBillReport(report: OnyxInputOrEntry<Report>): boolean {
    return report?.type === 'bill';
}
  1. To not show the report in LHN and display the not found page if we access this report via deeplink, we can update the canAccessReport function to return false if the report is paycheck report. This function is used in shouldReportBeInOptionList‎ function here to not show the report in LHN and used in the ReportScreen here to show the not found page.
if (isPayCheckReport(report) || isBillReport(report)) {
    return false;
}

function canAccessReport(report: OnyxEntry<Report>, policies: OnyxCollection<Policy>, betas: OnyxEntry<Beta[]>): boolean {

OPTIONAL: We can also create a beta for the paycheck report or bill report as we do for the default room

App/src/libs/ReportUtils.ts

Lines 5309 to 5311 in c973e62

if (isDefaultRoom(report) && !canSeeDefaultRoom(report, policies, betas)) {
return false;
}

What alternative solutions did you explore? (Optional)

NA

@puneetlath puneetlath changed the title Filter out payroll reports from the client Filter out payroll and bill reports from the client Jul 10, 2024
@puneetlath
Copy link
Contributor Author

FYI, I updated the OP to include reports of type: bill but I think the solution should be the same.

@ShridharGoel
Copy link
Contributor

Proposal

Updated to include bill check.

@nkdengineer
Copy link
Contributor

Updated proposal #45104 (comment)

@rayane-djouah
Copy link
Contributor

rayane-djouah commented Jul 10, 2024

Taking over as C+ (https://expensify.slack.com/archives/C02NK2DQWUX/p1720624712448849)

@sobitneupane sobitneupane removed their assignment Jul 10, 2024
@rayane-djouah
Copy link
Contributor

rayane-djouah commented Jul 10, 2024

@cretadn22's proposal looks good to me. we can address refactors on the PR stage (include reports of type: bill and create isPaycheck and isBillReport utility functions), I don't think we need a beta for this though.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jul 10, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 17, 2024
@melvin-bot melvin-bot bot changed the title Filter out payroll and bill reports from the client [HOLD for payment 2024-07-24] Filter out payroll and bill reports from the client Jul 17, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jul 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-24. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jul 17, 2024

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@rayane-djouah] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@puneetlath
Copy link
Contributor Author

@cretadn22 bump. Any thoughts on this?

@cretadn22
Copy link
Contributor

In your case

if (hasErrorsOtherThanFailedReceipt) {
reportsToDisplay.push({
...report,
hasErrorsOtherThanFailedReceipt: true,
});
return;

I think hasErrorsOtherThanFailedReceipt is true, the report is included in reportsToDisplay. And, we also skip ReportUtils.shouldReportBeInOptionList checking

@cretadn22
Copy link
Contributor

The PR will be up soon

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Daily KSv2 and removed Weekly KSv2 labels Jul 18, 2024
Copy link

melvin-bot bot commented Jul 24, 2024

Payment Summary

Upwork Job

BugZero Checklist (@puneetlath)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@puneetlath
Copy link
Contributor Author

@rayane-djouah @cretadn22 can you link me your Upwork profiles so that I can send you an offer?

@rayane-djouah
Copy link
Contributor

@rayane-djouah
Copy link
Contributor

  • Please propose regression test steps to ensure the new feature will work correctly on production in further releases.

No regression tests are needed as we included automated tests

@puneetlath
Copy link
Contributor Author

@rayane-djouah offer: https://www.upwork.com/nx/wm/offer/103254979

Please ping me when you've accepted.

@rayane-djouah
Copy link
Contributor

@puneetlath - Accepted, Thanks!

@puneetlath
Copy link
Contributor Author

Ok @rayane-djouah has been paid.

Just waiting on the Upwork profile for @cretadn22 now.

@cretadn22
Copy link
Contributor

@puneetlath
Copy link
Contributor Author

@cretadn22 sent you an offer here: https://www.upwork.com/nx/wm/offer/103263505

Please ping me on this issue when you've accepted.

@cretadn22
Copy link
Contributor

@puneetlath I accepted your offer

@puneetlath
Copy link
Contributor Author

Ok all paid now. Thanks everyone!

@github-project-automation github-project-automation bot moved this from CRITICAL to Done in [#whatsnext] #quality Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review
Projects
Development

No branches or pull requests

7 participants