Closed Beamanator closed 1 month ago
Keeping internal for now, will make this external soon once all details are added here
Might want to hold on https://github.com/Expensify/Expensify/issues/404203 b/c that's where we'll start sharing the workspace chat w/ new people added to approval chains
@Beamanator Huh... This is 4 days overdue. Who can take care of this?
@Beamanator 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
@Beamanator 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
Gotta get the held issue done, then will open this up!
@Beamanator, @youssef-lr Whoops! This issue is 2 days overdue. Let's get this updated quick!
I think we're off hold! cc @Beamanator yeah?
Hmm yes this is off hold, @youssef-lr I don't think we need you on this one since it can be worked externally (see my messages above) - I'm planning to finish writing up the necessary details & assigning this one out today or tomorrow!
Note: there's still a few things I'm working on to make workspace chat sharing / unsharing perfect (here) but this issue shouldn't hold on those changes! You just mayyy have weird experiences testing if you:
Asked @rushatgabhane for a review of the requirements to make sure it makes sense 🙏
Triggered auto assignment to @trjExpensify (NewFeature
), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.
@Beamanator, @trjExpensify, @rushatgabhane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Okay so I was able to build the approval chain and it tests well for employee, manager, and both owners -
@Beamanator it is okay to always make the reportTotal
a positive number, right?
The expense submitters owed money, so the report total was -X
@Beamanator I finished building the approval chain and optimistic steps in the PR, but I'm facing a backend issue.
When a manger approves the report, im getting a 400 error for ApproveMoneyRequest
.
https://github.com/Expensify/App/assets/29673073/ff581cb8-93f8-4e05-9387-ec29767c6323
@rushatgabhane it looks like that is thrown when our backend thinks you're trying to "Forward" the report, but you SHOULD be trying to "Approve"
This is actually expected for right now, since @marcochavezf is working on adding changes so that mid-level approvers can always "Approve" OR "Forward" a report from NewDot. So you probably can't actually test out the full "Submitter -> submitsTo -> forwardsTo" approval flow YET (with the backend working) but you can test that it optimistically works probably?
@Beamanator yeah optimistic is no problem :)
It works offline
Groovy - but ya probably sadly we can't get your PR merged till the backend stuff is done. sorry for that, thanks for getting this done quick!
working on adding changes so that mid-level approvers can always "Approve" OR "Forward" a report from NewDot
makes sensee, thank you for digging into it : )
Groovy - but ya probably sadly we can't get your PR merged till the backend stuff is done. sorry for that, thanks for getting this done quick!
No worries
Can we state what issue/PR this is on hold for in the title, so that's clear?
^^ bump on the above! :)
Sorry for the delay! We're basically holding on https://github.com/Expensify/Expensify/issues/404206, where @marcochavezf will be enable clicking Approve (no matter if it's approving or forwarding) in NewDot
@Beamanator, @trjExpensify, @rushatgabhane Huh... This is 4 days overdue. Who can take care of this?
Still held.
Still held, but getting close!
@Beamanator, @trjExpensify, @rushatgabhane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Can we remove the hold based on Marco's most recent merged PRs?
https://expensify.slack.com/archives/C06ML6X0W9L/p1722354497413689?thread_ts=1722319732.404769&cid=C06ML6X0W9L - according to @Beamanator not quite, but Marco's Web PR in the linked issue is on staging, so I think we're pretty much there.
Ooh yes even the App PR is on staging! I think it's time to take this off hold!
@rushatgabhane can you pull main
& start testing on staging? 🙏 there may be a few bugs which @marcochavezf and I can work out, but as long as this optimistic stuff can be tested now, that would be amazing 🙏
Boom this is completely off hold as the ApproveMoneyRequest stuff should be on prod!
PR was most likely deployed to prod yesterday
I thinkkkk payment is due here 🚀
Okay, so this is the PR: https://github.com/Expensify/App/pull/44940
What happened here with the review, it was merged before @mananjadhav's C+ review, but completed after, hence no checkmark? 🤔
Yep exactly 👍
Was this considered a regression?
Hmm seems like ifffff it was, we didn't consider it a big deal since it hasn't been worked on yet, so i would say we don't need to consider that a payment slashing regression, what you think?
Alright, so payment summary as follows:
Closing it out!
$250 approved for @rushatgabhane
$250 approved for @mananjadhav
Tracking issue: https://github.com/Expensify/Expensify/issues/393839
Design doc section: Make sure optimistic Next Steps & report action are set correctly, for “Approve” (old term “Forward”) in NewDot
Goals:
employeeList
in order to be able to figure out who should optimistically be the next approvalApproved <total>
report action to workspace chatBackground:
We currently generate optimistic Next Steps when approving a report in NewDot here. The current possible next steps are:
Problem:
There are now more possible cases when a report is getting approved!
When a Control policy has "Advanced Approvals" enabled, there can be multiple "mid-level" approvers. When these members approve the policy, we actually call this "forwarding" - because we "forward" the report to the next person in line. The final approver actually does the "approving".
Solution:
submitsTo
,forwardsTo
, andoverLimitForwardsTo
. Later, we'll add in rule approvers (tag & category)approved <total>
even when forwarding the reportApproval Chain Logic:
When building out the approval chain logic, logic should look like this:
employeeList
employeeList[submitterEmail]
submitsTo
- likesubmitsToEmail = employeeList[submitterEmail]?.submitsTo ?? policyOwnerEmail
submitsToEmployeeData = employeeList[submitsToEmail]
forwardsTo
,overLimitForwardsTo
, andapprovalLimit
submitsToEmployeeData
has anapprovalLimit
andoverLimitForwardsTo
, do this:approvalLimit
, then the next approver in line is the email address insubmitsToEmployeeData?.overLimitForwardsTo
approvalLimit
, then the next approver in line issubmitsToEmployeeData?.forwardsTo
submitsToEmployeeData
doesn't have eitherapprovalLimit
or doesn't haveoverLimitForwardsTo
, the next approver in line issubmitsToEmployeeData?.forwardsTo
submitsToEmployeeData
doesn't have aforwardsTo
), we're done!forwardsTo
oroverLimitForwardsTo
's policy data withforwardsEmployeeData = employeeList[forwardsToEmail]
forwardsTo
This looks something like this:
Where
$policy->getForwardsTo
looks like this:Examples:
Say, for example, we have this Control
employeeList
policy setup (with advanced approvals enabled):submitsTo
forwardsTo
overLimitForwardsTo
approvalLimit
Each member's approval chain looks like this: