Repository: Expensify/App
Pull request #57678: [No QA] Bootstrap secondary actions getter
Author: login: jnowakow
Created: 2025-03-03T15:00:45Z | Merged: 2025-03-07T17:49:34Z

<!-- If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit. -->

### Explanation of Change
<!-- Explain what your change does and how it addresses the linked issue -->
Adds logic for determining what secondary actions should be available for report.

### Fixed Issues
<!---
1. Please postfix `$` with a URL link to the GitHub issue this Pull Request is fixing. For example, `$ https://github.com/Expensify/App/issues/<issueID>`.
2. Please postfix  `PROPOSAL:` with a URL link to your GitHub comment, which contains the approved proposal (i.e. the proposal that was approved by Expensify).  For example, `PROPOSAL: https://github.com/Expensify/App/issues/<issueID>#issuecomment-1369752925`

Do NOT add the special GH keywords like `fixed` etc, we have our own process of managing the flow.
It MUST be an entire link to the github issue and your comment proposal ; otherwise, the linking and its automation will not work as expected.

Make sure this section looks similar to this (you can link multiple issues using the same formatting, just add a new line):

$ https://github.com/Expensify/App/issues/<issueID>
$ https://github.com/Expensify/App/issues/<issueID(comment)>

Do NOT only link the issue number like this: $ #<issueID>
--->
$ https://github.com/Expensify/App/issues/57438
PROPOSAL: N/A


<!--- 
If you want to trigger adhoc build of hybrid app from specific Mobile-Expensify PR please link it like this:

MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/<PR-number>

--->

### Tests
<!---
Add a numbered list of manual tests you performed that validates your changes work on all platforms, and that there are no regressions present.
Add any additional test steps if test steps are unique to a particular platform.
Manual test steps should be written so that your reviewer can repeat and verify one or more expected outcomes in the development environment.

For example:
1. Click on the text input to bring it into focus
2. Upload an image via copy paste
3. Verify a modal appears displaying a preview of that image
--->

Verify that `npm run test` passes

- [x] Verify that no errors appear in the JS console

### Offline tests
<!---
Add any relevant steps that validate your changes work as expected in a variety of network states e.g. "offline", "spotty connection", "slow internet", etc. Manual test steps should be written so that your reviewer and QA testers can repeat and verify one or more expected outcomes. If you are unsure how the behavior should work ask for advice in the `#expensify-open-source` Slack channel.
--->

N/A

### QA Steps
<!---
Add a numbered list of manual tests that can be performed by our QA engineers on the staging environment to validate that your changes work on all platforms, and that there are no regressions present.
Add any additional QA steps if test steps are unique to a particular platform.
Manual test steps should be written so that the QA engineer can repeat and verify one or more expected outcomes in the staging environment.

For example:
1. Click on the text input to bring it into focus
2. Upload an image via copy paste
3. Verify a modal appears displaying a preview of that image

It's acceptable to write "Same as tests" if the QA team is able to run the tests in the above "Tests" section.
--->

N/A

- [x] Verify that no errors appear in the JS console

### PR Author Checklist
<!--
This is a checklist for PR authors. Please make sure to complete all tasks and check them off once you do, or else your PR will not be merged!
-->

- [x] I linked the correct issue in the `### Fixed Issues` section above
- [x] I wrote clear testing steps that cover the changes made in this PR
    - [x] I added steps for local testing in the `Tests` section
    - [x] I added steps for the expected offline behavior in the `Offline steps` section
    - [x] I added steps for Staging and/or Production testing in the `QA steps` section
    - [x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    - [x] 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)
    - [x] I tested this PR with a [High Traffic account](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#high-traffic-accounts) against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
- [x] I included screenshots or videos for tests on [all platforms](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [x] I ran the tests on **all platforms** & verified they passed on:
    - [x] Android: Native
    - [x] Android: mWeb Chrome
    - [x] iOS: Native
    - [x] iOS: mWeb Safari
    - [x] MacOS: Chrome / Safari
    - [x] MacOS: Desktop
- [x] 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)
- [x] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
    - [x] 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`)
    - [x] I verified that comments were added to code that is not self explanatory
    - [x] 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.
    - [x] I verified any copy / text shown in the product is localized by adding it to `src/languages/*` files and using the [translation method](https://github.com/Expensify/App/blob/4bd99402cebdf4d7394e0d1f260879ea238197eb/src/components/withLocalize.js#L60)
      - [x] If any non-english text was added/modified, I used [JaimeGPT](https://chatgpt.com/g/g-2dgOQl5VM-english-to-spanish-translator-aka-jaimegpt) to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    - [x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the [localization methods](https://github.com/Expensify/App/blob/4bd99402cebdf4d7394e0d1f260879ea238197eb/src/components/withLocalize.js#L60-L68)
    - [x] 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)
    - [x] 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.
    - [x] I verified the JSDocs style guidelines (in [`STYLE.md`](https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#jsdocs)) were followed
- [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- [x] I followed the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md)
- [x] 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)
- [x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- [x] I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
- [x] I verified that if a function's arguments changed that all usages have also been updated correctly
- [x] If any new file was added I verified that:
    - [x] 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
- [x] If a new CSS style is added I verified that:
    - [x] A similar style doesn't already exist
    - [x] The style can't be created with an existing [StyleUtils](https://github.com/Expensify/App/blob/main/src/styles/utils/index.ts) function (i.e. `StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)`)
- [x] 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.
- [x] 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)
- [x] 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.
- [x] 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.
- [x] 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:
    - [x] I verified that all the inputs inside a form are aligned with each other.
    - [x] I added `Design` label and/or tagged `@Expensify/design` so the design team can review the changes.
- [x] 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.
- [x] I added [unit tests](https://github.com/Expensify/App/blob/main/tests/README.md) for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
- [x] 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
<details>
<summary>Android: Native</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>Android: mWeb Chrome</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>iOS: Native</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>iOS: mWeb Safari</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>MacOS: Chrome / Safari</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>MacOS: Desktop</summary>

<!-- add screenshots or videos here -->

</details>



Diff:
diff --git a/src/CONST.ts b/src/CONST.ts
index 5c89dd506447..b26f097a0d92 100755
--- a/src/CONST.ts
+++ b/src/CONST.ts
@@ -1116,6 +1116,19 @@ const CONST = {
         MIN_INITIAL_REPORT_ACTION_COUNT: 15,
         UNREPORTED_REPORTID: '0',
         SPLIT_REPORTID: '-2',
+        SECONDARY_ACTIONS: {
+            SUBMIT: 'submit',
+            APPROVE: 'approve',
+            UNAPPROVE: 'unapprove',
+            CANCEL_PAYMENT: 'cancelPayment',
+            EXPORT_TO_ACCOUNTING: 'exportToAccounting',
+            MARK_AS_EXPORTED: 'markAsExported',
+            HOLD: 'hold',
+            DOWNLOAD: 'download',
+            CHANGE_WORKSPACE: 'changeWorkspace',
+            VIEW_DETAILS: 'viewDetails',
+            DELETE: 'delete',
+        },
         PRIMARY_ACTIONS: {
             SUBMIT: 'submit',
             APPROVE: 'approve',
diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts
index 6bcd4afc9246..7744e1fe470a 100644
--- a/src/libs/ReportActionsUtils.ts
+++ b/src/libs/ReportActionsUtils.ts
@@ -2182,6 +2182,10 @@ function getReportActionsLength() {
     return Object.keys(allReportActions ?? {}).length;
 }
 
+function getReportActions(report: Report) {
+    return allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`];
+}
+
 function wasActionCreatedWhileOffline(action: ReportAction, isOffline: boolean, lastOfflineAt: Date | undefined, lastOnlineAt: Date | undefined, locale: Locale): boolean {
     // The user has never gone offline or never come back online
     if (!lastOfflineAt || !lastOnlineAt) {
@@ -2333,6 +2337,7 @@ export {
     getWorkspaceTagUpdateMessage,
     getWorkspaceReportFieldUpdateMessage,
     getWorkspaceReportFieldDeleteMessage,
+    getReportActions,
 };
 
 export type {LastVisibleMessage};
diff --git a/src/libs/ReportPrimaryActionUtils.ts b/src/libs/ReportPrimaryActionUtils.ts
index fb42a1b1689f..16a755427a3e 100644
--- a/src/libs/ReportPrimaryActionUtils.ts
+++ b/src/libs/ReportPrimaryActionUtils.ts
@@ -2,49 +2,49 @@ import type {OnyxCollection} from 'react-native-onyx';
 import type {ValueOf} from 'type-fest';
 import CONST from '@src/CONST';
 import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
-import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {isApprover as isApproverUtils} from './actions/Policy/Member';
 import {getCurrentUserAccountID} from './actions/Report';
-import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {arePaymentsEnabled as arePaymentsEnabledUtils, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
 import {
-    isClosedReport,
+    isClosedReport as isClosedReportUtils,
     isCurrentUserSubmitter,
-    isExpenseReport,
+    isExpenseReport as isExpenseReportUtils,
     isHoldCreator,
-    isInvoiceReport,
-    isIOUReport,
-    isOpenReport,
+    isInvoiceReport as isInvoiceReportUtils,
+    isIOUReport as isIOUReportUtils,
+    isOpenReport as isOpenReportUtils,
     isPayer,
-    isProcessingReport,
-    isReportApproved,
+    isProcessingReport as isProcessingReportUtils,
+    isReportApproved as isReportApprovedUtils,
     isSettled,
 } from './ReportUtils';
 import {getSession} from './SessionUtils';
 import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
 
 function isSubmitAction(report: Report, policy: Policy) {
-    const isExpense = isExpenseReport(report);
-    const isSubmitter = isCurrentUserSubmitter(report.reportID);
-    const isOpen = isOpenReport(report);
+    const isExpenseReport = isExpenseReportUtils(report);
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isOpenReport = isOpenReportUtils(report);
     const isManualSubmitEnabled = getCorrectedAutoReportingFrequency(policy) === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
 
-    return isExpense && isSubmitter && isOpen && isManualSubmitEnabled;
+    return isExpenseReport && isReportSubmitter && isOpenReport && isManualSubmitEnabled;
 }
 
 function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[]) {
-    const isExpense = isExpenseReport(report);
-    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isExpenseReport = isExpenseReportUtils(report);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
     const isApprovalEnabled = policy.approvalMode && policy.approvalMode !== CONST.POLICY.APPROVAL_MODE.OPTIONAL;
 
-    if (!isExpense || !isApprover || !isApprovalEnabled) {
+    if (!isExpenseReport || !isReportApprover || !isApprovalEnabled) {
         return false;
     }
 
-    const isOneExpenseReport = isExpense && reportTransactions.length === 1;
-    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
-    const isProcessing = isProcessingReport(report);
-    const isOneExpenseReportOnHold = isOneExpenseReport && isOnHold;
+    const isOneExpenseReport = isExpenseReport && reportTransactions.length === 1;
+    const isReportOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    const isProcessingReport = isProcessingReportUtils(report);
+    const isOneExpenseReportOnHold = isOneExpenseReport && isReportOnHold;
 
-    if (isProcessing || isOneExpenseReportOnHold) {
+    if (isProcessingReport || isOneExpenseReportOnHold) {
         return true;
     }
 
@@ -52,22 +52,22 @@ function isApproveAction(report: Report, policy: Policy, reportTransactions: Tra
 }
 
 function isPayAction(report: Report, policy: Policy) {
-    const isExpense = isExpenseReport(report);
+    const isExpenseReport = isExpenseReportUtils(report);
     const isReportPayer = isPayer(getSession(), report, false, policy);
-    const isPaymentsEnabled = arePaymentsEnabled(policy);
-    const isApproved = isReportApproved({report});
-    const isClosed = isClosedReport(report);
-    const isFinished = isApproved || isClosed;
+    const arePaymentsEnabled = arePaymentsEnabledUtils(policy);
+    const isReportApproved = isReportApprovedUtils({report});
+    const isReportClosed = isClosedReportUtils(report);
+    const isReportFinished = isReportApproved || isReportClosed;
 
-    if (isReportPayer && isExpense && isPaymentsEnabled && isFinished) {
+    if (isReportPayer && isExpenseReport && arePaymentsEnabled && isReportFinished) {
         return true;
     }
 
-    const isProcessing = isProcessingReport(report);
-    const isInvoice = isInvoiceReport(report);
-    const isIOU = isIOUReport(report);
+    const isProcessingReport = isProcessingReportUtils(report);
+    const isInvoiceReport = isInvoiceReportUtils(report);
+    const isIOUReport = isIOUReportUtils(report);
 
-    if ((isInvoice || isIOU) && isProcessing) {
+    if ((isInvoiceReport || isIOUReport) && isProcessingReport) {
         return true;
     }
 
@@ -80,8 +80,8 @@ function isExportAction(report: Report, policy: Policy) {
         return false;
     }
 
-    const isExporter = isPrefferedExporter(policy);
-    if (!isExporter) {
+    const isReportExporter = isPrefferedExporter(policy);
+    if (!isReportExporter) {
         return false;
     }
 
@@ -90,11 +90,11 @@ function isExportAction(report: Report, policy: Policy) {
         return false;
     }
 
-    const isReimbursed = isSettled(report);
-    const isApproved = isReportApproved({report});
-    const isClosed = isClosedReport(report);
+    const isReportReimbursed = isSettled(report);
+    const isReportApproved = isReportApprovedUtils({report});
+    const isReportClosed = isClosedReportUtils(report);
 
-    if (isApproved || isReimbursed || isClosed) {
+    if (isReportApproved || isReportReimbursed || isReportClosed) {
         return true;
     }
 
@@ -102,10 +102,10 @@ function isExportAction(report: Report, policy: Policy) {
 }
 
 function isRemoveHoldAction(report: Report, reportTransactions: Transaction[]) {
-    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    const isReportOnHold = reportTransactions.some(isOnHoldTransactionUtils);
     const isHolder = reportTransactions.some((transaction) => isHoldCreator(transaction, report.reportID));
 
-    return isOnHold && isHolder;
+    return isReportOnHold && isHolder;
 }
 
 function isReviewDuplicatesAction(report: Report, policy: Policy, reportTransactions: Transaction[]) {
@@ -115,15 +115,15 @@ function isReviewDuplicatesAction(report: Report, policy: Policy, reportTransact
         return false;
     }
 
-    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
-    const isSubmitter = isCurrentUserSubmitter(report.reportID);
-    const isProcessing = isProcessingReport(report);
-    const isOpen = isOpenReport(report);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isProcessingReport = isProcessingReportUtils(report);
+    const isReportOpen = isOpenReportUtils(report);
 
-    const isSubmitterOrApprover = isSubmitter || isApprover;
-    const isActive = isOpen || isProcessing;
+    const isSubmitterOrApprover = isReportSubmitter || isReportApprover;
+    const isReportActive = isReportOpen || isProcessingReport;
 
-    if (isSubmitterOrApprover && isActive) {
+    if (isSubmitterOrApprover && isReportActive) {
         return true;
     }
 
@@ -138,13 +138,13 @@ function isMarkAsCashAction(report: Report, policy: Policy, reportTransactions:
         return true;
     }
 
-    const isSubmitter = isCurrentUserSubmitter(report.reportID);
-    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
     const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
 
     const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
 
-    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const userControlsReport = isReportSubmitter || isReportApprover || isAdmin;
     return userControlsReport && shouldShowBrokenConnectionViolation;
 }
 
diff --git a/src/libs/ReportSecondaryActionUtils.ts b/src/libs/ReportSecondaryActionUtils.ts
new file mode 100644
index 000000000000..80545b4404e6
--- /dev/null
+++ b/src/libs/ReportSecondaryActionUtils.ts
@@ -0,0 +1,350 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApproverUtils} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {
+    arePaymentsEnabled as arePaymentsEnabledUtils,
+    getCorrectedAutoReportingFrequency,
+    hasAccountingConnections,
+    hasNoPolicyOtherThanPersonalType,
+    isAutoSyncEnabled,
+    isPrefferedExporter,
+} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport as isClosedReportUtils,
+    isCurrentUserSubmitter,
+    isExpenseReport as isExpenseReportUtils,
+    isExported as isExportedUtils,
+    isInvoiceReport as isInvoiceReportUtils,
+    isIOUReport as isIOUReportUtils,
+    isOpenReport as isOpenReportUtils,
+    isPayer as isPayerUtils,
+    isProcessingReport as isProcessingReportUtils,
+    isReportApproved as isReportApprovedUtils,
+    isReportManager as isReportManagerUtils,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+
+    if (!isReportSubmitter && !isReportApprover) {
+        return false;
+    }
+
+    const isOpenReport = isOpenReportUtils(report);
+
+    if (!isOpenReport) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+    const isProcessingReport = isProcessingReportUtils(report);
+    const reportHasDuplicatedTransactions = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpenseReport && isReportApprover && isProcessingReport && reportHasDuplicatedTransactions) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isReportApprover || isAdmin;
+    return userControlsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+    const isReportApproved = isReportApprovedUtils({report});
+
+    return isExpenseReport && isReportApprover && isReportApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isReportPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const now = new Date();
+        const paymentDatetime = new Date(action.created);
+        const nowUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()));
+        const cutoffTimeUTC = new Date(Date.UTC(paymentDatetime.getUTCFullYear(), paymentDatetime.getUTCMonth(), paymentDatetime.getUTCDate(), 23, 45, 0));
+        return nowUTC.getTime() < cutoffTimeUTC.getTime();
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoiceReport = isInvoiceReportUtils(report);
+    const isReportSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoiceReport && isReportSender) {
+        return true;
+    }
+
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpenseReport || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isReportApproved = isReportApprovedUtils({report});
+    const isReportPayer = isPayerUtils(getSession(), report, false, policy);
+    const arePaymentsEnabled = arePaymentsEnabledUtils(policy);
+    const isReportClosed = isClosedReportUtils(report);
+
+    if (isReportPayer && arePaymentsEnabled && (isReportApproved || isReportClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReportReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExportedUtils(getReportActions(report));
+    const isReportFinished = isReportApproved || isReportReimbursed || isReportClosed;
+
+    return isAdmin && isReportFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoiceReport = isInvoiceReportUtils(report);
+    const isReportSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoiceReport && isReportSender) {
+        return true;
+    }
+
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportPayer = isPayerUtils(getSession(), report, false, policy);
+    const arePaymentsEnabled = arePaymentsEnabledUtils(policy);
+    const isReportApproved = isReportApprovedUtils({report});
+    const isReportClosed = isClosedReportUtils(report);
+    const isReportClosedOrApproved = isReportClosed || isReportApproved;
+
+    if (isReportPayer && arePaymentsEnabled && isReportClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReportReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportFinished = isReportClosedOrApproved || isReportReimbursed;
+
+    if (isAdmin && isReportFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isReportFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+
+    if (isReportOnHold) {
+        return false;
+    }
+
+    const isOpenReport = isOpenReportUtils(report);
+    const isProcessingReport = isProcessingReportUtils(report);
+    const isReportApproved = isReportApprovedUtils({report});
+
+    return isOpenReport || isProcessingReport || isReportApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosedReport = isClosedReportUtils(report);
+
+    if (isExpenseReport && isReportSubmitter && !areWorkflowsEnabled && isClosedReport) {
+        return true;
+    }
+
+    const isOpenReport = isOpenReportUtils(report);
+    const isProcessingReport = isProcessingReportUtils(report);
+
+    if (isReportSubmitter && (isOpenReport || isProcessingReport)) {
+        return true;
+    }
+
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+
+    if (isReportApprover && isProcessingReport) {
+        return true;
+    }
+
+    const isReportPayer = isPayerUtils(getSession(), report, false, policy);
+    const isReportApproved = isReportApprovedUtils({report});
+
+    if (isReportPayer && (isReportApproved || isClosedReport)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReportReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isReportSubmitter || isReportApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+    const isReportExported = isExportedUtils(getReportActions(report));
+    const isReportFinished = isReportApproved || isReportReimbursed || isClosedReport;
+
+    if (isAdmin && ((!isReportExported && isReportFinished) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOUReport = isIOUReportUtils(report);
+    const hasOnlyPersonalWorkspace = hasNoPolicyOtherThanPersonalType();
+    const isReportReceiver = isReportManagerUtils(report);
+
+    if (isIOUReport && !hasOnlyPersonalWorkspace && isReportReceiver && isReportReimbursed) {
+        return true;
+    }
+
+    return false;
+}
+
+function isDeleteAction(report: Report): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+
+    if (!isReportSubmitter) {
+        return false;
+    }
+
+    const isReportOpen = isOpenReportUtils(report);
+    const isProcessingReport = isProcessingReportUtils(report);
+    const isReportApproved = isReportApprovedUtils({report});
+
+    return isReportOpen || isProcessingReport || isReportApproved;
+}
+
+function getSecondaryAction(
+    report: Report,
+    policy: Policy,
+    reportTransactions: Transaction[],
+    violations: OnyxCollection<TransactionViolation[]>,
+): Array<ValueOf<typeof CONST.REPORT.SECONDARY_ACTIONS>> {
+    const options: Array<ValueOf<typeof CONST.REPORT.SECONDARY_ACTIONS>> = [];
+    options.push(CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD);
+    options.push(CONST.REPORT.SECONDARY_ACTIONS.VIEW_DETAILS);
+
+    if (isSubmitAction(report, policy)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.SUBMIT);
+    }
+
+    if (isApproveAction(report, policy, reportTransactions, violations)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.APPROVE);
+    }
+
+    if (isUnapproveAction(report, policy)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.UNAPPROVE);
+    }
+
+    if (isCancelPaymentAction(report, reportTransactions)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.CANCEL_PAYMENT);
+    }
+
+    if (isExportAction(report, policy)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.EXPORT_TO_ACCOUNTING);
+    }
+
+    if (isMarkAsExportedAction(report, policy)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.MARK_AS_EXPORTED);
+    }
+
+    if (isHoldAction(report, reportTransactions)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.HOLD);
+    }
+
+    if (isChangeWorkspaceAction(report, policy, reportTransactions, violations)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE);
+    }
+
+    if (isDeleteAction(report)) {
+        options.push(CONST.REPORT.SECONDARY_ACTIONS.DELETE);
+    }
+
+    return options;
+}
+
+export default getSecondaryAction;
diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
index 55d1c3efc30c..49150469ed29 100644
--- a/src/libs/ReportUtils.ts
+++ b/src/libs/ReportUtils.ts
@@ -1266,7 +1266,7 @@ function isSettled(reportOrID: OnyxInputOrEntry<Report> | SearchReport | string
         return false;
     }
 
-    if (isEmptyObject(report) || report.isWaitingOnBankAccount) {
+    if (isEmptyObject(report)) {
         return false;
     }
 
diff --git a/tests/unit/ReportSecondaryActionUtilsTest.ts b/tests/unit/ReportSecondaryActionUtilsTest.ts
new file mode 100644
index 000000000000..560a6003e6b7
--- /dev/null
+++ b/tests/unit/ReportSecondaryActionUtilsTest.ts
@@ -0,0 +1,445 @@
+import Onyx from 'react-native-onyx';
+import getSecondaryAction from '@libs/ReportSecondaryActionUtils';
+import CONST from '@src/CONST';
+import ONYXKEYS from '@src/ONYXKEYS';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+
+const CURRENT_USER_ACCOUNT_ID = 1;
+const CURRENT_USER_EMAIL = 'tester@mail.com';
+
+const SESSION = {
+    email: CURRENT_USER_EMAIL,
+    accountID: CURRENT_USER_ACCOUNT_ID,
+};
+
+const PERSONAL_DETAILS = {
+    accountID: CURRENT_USER_ACCOUNT_ID,
+    login: CURRENT_USER_EMAIL,
+};
+
+const REPORT_ID = 1;
+
+describe('getSecondaryAction', () => {
+    beforeAll(() => {
+        Onyx.init({
+            keys: ONYXKEYS,
+        });
+    });
+
+    beforeEach(async () => {
+        jest.clearAllMocks();
+        Onyx.clear();
+        await Onyx.merge(ONYXKEYS.SESSION, SESSION);
+        await Onyx.set(ONYXKEYS.PERSONAL_DETAILS_LIST, {[CURRENT_USER_ACCOUNT_ID]: PERSONAL_DETAILS});
+    });
+
+    it('should always return default options', () => {
+        const report = {} as unknown as Report;
+        const policy = {} as unknown as Policy;
+        // await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const result = [CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD, CONST.REPORT.SECONDARY_ACTIONS.VIEW_DETAILS];
+        expect(getSecondaryAction(report, policy, [], {})).toEqual(result);
+    });
+
+    it('includes SUBMIT option', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.OPEN,
+            statusNum: CONST.REPORT.STATUS_NUM.OPEN,
+        } as unknown as Report;
+        const policy = {
+            autoReportingFrequency: CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT,
+            harvesting: {
+                enabled: true,
+            },
+        } as unknown as Policy;
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.SUBMIT)).toBe(true);
+    });
+
+    it('includes APPROVE option for approver and report with duplicates', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
+            statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
+        } as unknown as Report;
+        const policy = {
+            approver: CURRENT_USER_EMAIL,
+        } as unknown as Policy;
+        const TRANSACTION_ID = 'TRANSACTION_ID';
+        const transaction = {
+            transactionID: TRANSACTION_ID,
+        } as unknown as Transaction;
+
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION}${TRANSACTION_ID}`, transaction);
+
+        await Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${TRANSACTION_ID}`, [
+            {
+                name: CONST.VIOLATIONS.DUPLICATED_TRANSACTION,
+            } as TransactionViolation,
+        ]);
+
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const result = getSecondaryAction(report, policy, [transaction], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.APPROVE)).toBe(true);
+    });
+
+    it('includes APPROVE option for report with RTER violations for all transactions', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+        } as unknown as Report;
+        const policy = {} as unknown as Policy;
+        const TRANSACTION_ID = 'TRANSACTION_ID';
+
+        const transaction = {
+            transactionID: TRANSACTION_ID,
+        } as unknown as Transaction;
+
+        const violation = {
+            name: CONST.VIOLATIONS.RTER,
+            data: {
+                pendingPattern: true,
+                rterType: CONST.RTER_VIOLATION_TYPES.SEVEN_DAY_HOLD,
+            },
+        } as unknown as TransactionViolation;
+
+        const result = getSecondaryAction(report, policy, [transaction], {[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${TRANSACTION_ID}`]: [violation]});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.APPROVE)).toBe(true);
+    });
+
+    it('includes APPROVE option for admin and report with broken connection', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.OPEN,
+            statusNum: CONST.REPORT.STATUS_NUM.OPEN,
+        } as unknown as Report;
+        const policy = {role: CONST.POLICY.ROLE.ADMIN} as unknown as Policy;
+        const TRANSACTION_ID = 'TRANSACTION_ID';
+
+        const transaction = {
+            transactionID: TRANSACTION_ID,
+        } as unknown as Transaction;
+
+        const violation = {
+            name: CONST.VIOLATIONS.RTER,
+            data: {
+                rterType: CONST.RTER_VIOLATION_TYPES.BROKEN_CARD_CONNECTION,
+            },
+        } as unknown as TransactionViolation;
+
+        const result = getSecondaryAction(report, policy, [transaction], {[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${TRANSACTION_ID}`]: [violation]});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.APPROVE)).toBe(true);
+    });
+
+    it('includes UNAPPROVE option', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+            statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
+        } as unknown as Report;
+        const policy = {approver: CURRENT_USER_EMAIL} as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.UNAPPROVE)).toBe(true);
+    });
+
+    it('includes CANCEL_PAYMENT option for report paid elsewhere', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+            statusNum: CONST.REPORT.STATUS_NUM.REIMBURSED,
+        } as unknown as Report;
+        const policy = {} as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CANCEL_PAYMENT)).toBe(true);
+    });
+
+    it('includes CANCEL_PAYMENT option for report before nacha cutoff', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            statusNum: CONST.REPORT.STATUS_NUM.REIMBURSED,
+        } as unknown as Report;
+        const policy = {} as unknown as Policy;
+        const TRANSACTION_ID = 'transaction_id';
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const ACTION_ID = 'action_id';
+        const reportAction = {
+            actionID: ACTION_ID,
+            actionName: CONST.REPORT.ACTIONS.TYPE.IOU,
+            message: {
+                IOUTransactionID: TRANSACTION_ID,
+                type: CONST.IOU.REPORT_ACTION_TYPE.PAY,
+            },
+            created: '2025-03-06 18:00:00.000',
+        } as unknown as ReportAction;
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, {[ACTION_ID]: reportAction});
+
+        const result = getSecondaryAction(
+            report,
+            policy,
+            [
+                {
+                    transactionID: TRANSACTION_ID,
+                } as unknown as Transaction,
+            ],
+            {},
+        );
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CANCEL_PAYMENT)).toBe(true);
+    });
+
+    it('includes EXPORT option for invoice submitter', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.INVOICE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+        } as unknown as Report;
+        const policy = {} as unknown as Policy;
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.EXPORT_TO_ACCOUNTING)).toBe(true);
+    });
+
+    it('includes EXPORT option for expense report with payments enabled', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+            statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
+        } as unknown as Report;
+        const policy = {
+            role: CONST.POLICY.ROLE.ADMIN,
+            reimbursementChoice: CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES,
+            connections: {[CONST.POLICY.CONNECTIONS.NAME.QBD]: {}},
+        } as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.EXPORT_TO_ACCOUNTING)).toBe(true);
+    });
+
+    it('includes EXPORT option for expense report with payments disabled', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+            statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
+        } as unknown as Report;
+        const policy = {
+            role: CONST.POLICY.ROLE.ADMIN,
+            connections: {[CONST.POLICY.CONNECTIONS.NAME.QBD]: {config: {autosync: {enabled: true}}}},
+        } as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.EXPORT_TO_ACCOUNTING)).toBe(true);
+    });
+
+    it('includes MARK_AS_EXPORTED option for invoice report sender', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.INVOICE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+        } as unknown as Report;
+        const policy = {} as unknown as Policy;
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.MARK_AS_EXPORTED)).toBe(true);
+    });
+
+    it('includes MARK_AS_EXPORTED option for expense report with payments enabled', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+            statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
+        } as unknown as Report;
+        const policy = {
+            role: CONST.POLICY.ROLE.ADMIN,
+            reimbursementChoice: CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES,
+        } as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.MARK_AS_EXPORTED)).toBe(true);
+    });
+
+    it('includes MARK_AS_EXPORTED option for expense report with payments disabled', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+            statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
+        } as unknown as Report;
+        const policy = {
+            role: CONST.POLICY.ROLE.ADMIN,
+            connections: {[CONST.POLICY.CONNECTIONS.NAME.QBD]: {config: {autosync: {enabled: true}}}},
+        } as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.MARK_AS_EXPORTED)).toBe(true);
+    });
+
+    it('includes MARK_AS_EXPORTED option for expense report preffered exporter', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+            statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
+        } as unknown as Report;
+        const policy = {
+            connections: {[CONST.POLICY.CONNECTIONS.NAME.QBD]: {config: {export: {exporter: CURRENT_USER_EMAIL}}}},
+        } as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.MARK_AS_EXPORTED)).toBe(true);
+    });
+
+    it('includes HOLD option ', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+            statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
+        } as unknown as Report;
+        const policy = {} as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.HOLD)).toBe(true);
+    });
+
+    it('includes CHANGE_WORKSPACE option for closed expense report submitter', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            statusNum: CONST.REPORT.STATUS_NUM.CLOSED,
+        } as unknown as Report;
+        const policy = {
+            areWorkflowsEnabled: false,
+        } as unknown as Policy;
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
+    });
+
+    it('includes CHANGE_WORKSPACE option for opened expense report submitter', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            statusNum: CONST.REPORT.STATUS_NUM.OPEN,
+            stateNum: CONST.REPORT.STATE_NUM.OPEN,
+        } as unknown as Report;
+        const policy = {} as unknown as Policy;
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
+    });
+
+    it('includes CHANGE_WORKSPACE option for opened expense report submitter', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
+            stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
+        } as unknown as Report;
+        const policy = {
+            approver: CURRENT_USER_EMAIL,
+        } as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
+    });
+
+    it('includes CHANGE_WORKSPACE option for approved expense report payer', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
+            stateNum: CONST.REPORT.STATE_NUM.APPROVED,
+        } as unknown as Report;
+        const policy = {
+            role: CONST.POLICY.ROLE.ADMIN,
+        } as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
+    });
+
+    it('includes CHANGE_WORKSPACE option for not exported expense report admin', () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            statusNum: CONST.REPORT.STATUS_NUM.REIMBURSED,
+        } as unknown as Report;
+        const policy = {
+            role: CONST.POLICY.ROLE.ADMIN,
+        } as unknown as Policy;
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
+    });
+
+    it('includes CHANGE_WORKSPACE option for IOU report receiver', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.IOU,
+            managerID: CURRENT_USER_ACCOUNT_ID,
+            statusNum: CONST.REPORT.STATUS_NUM.REIMBURSED,
+        } as unknown as Report;
+        const POLICY_ID = 'policyID';
+        const policy = {
+            policyID: POLICY_ID,
+            type: CONST.POLICY.TYPE.TEAM,
+        } as unknown as Policy;
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${POLICY_ID}`, policy);
+
+        const result = getSecondaryAction(report, {} as Policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE)).toBe(true);
+    });
+
+    it('includes DELETE option for expense report submitter', async () => {
+        const report = {
+            reportID: REPORT_ID,
+            type: CONST.REPORT.TYPE.EXPENSE,
+            ownerAccountID: CURRENT_USER_ACCOUNT_ID,
+            statusNum: CONST.REPORT.STATUS_NUM.OPEN,
+            stateNum: CONST.REPORT.STATE_NUM.OPEN,
+        } as unknown as Report;
+        const policy = {} as unknown as Policy;
+        await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
+
+        const result = getSecondaryAction(report, policy, [], {});
+        expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.DELETE)).toBe(true);
+    });
+});


Reviews:
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T14:36:48Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T14:38:09Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T17:06:47Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T17:07:47Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T17:09:45Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T17:18:20Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T17:34:06Z
user: login: allgandalf
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T08:58:44Z
user: login: allgandalf
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T09:03:20Z
user: login: allgandalf
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T09:04:00Z
user: login: allgandalf
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T09:05:20Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T09:16:57Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T09:19:21Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T09:24:11Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T09:28:53Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T10:38:14Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T12:59:36Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T13:22:58Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T13:23:55Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T13:39:17Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T13:39:47Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T13:40:26Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T13:41:23Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T14:54:29Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T15:43:25Z
user: login: allgandalf
body: @jnowakow please update the `ReportSecondaryActionUtils`, it doesn't follow the style we follow in our codebase, i didn't comment on some functions but the same applies to all the functions, do let reach out to me if you need any extra help here, thanks ! 
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T18:24:35Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T18:28:50Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T18:29:29Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T18:34:27Z
user: login: luacmartins
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T18:40:10Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T08:29:26Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T09:17:32Z
user: login: allgandalf
body: okay, code LGTM! just one comment, but that won't block me from testing out this PR. 

Completing checklist now
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T17:32:24Z
user: login: allgandalf
body: Lets ship this and clear out the commented code in a followup 🚀 
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T17:48:11Z
user: login: luacmartins
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T17:49:04Z
user: login: jnowakow
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-10T15:28:08Z
user: login: c3024
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-06-17T11:31:51Z
user: login: ahmedGaber93
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-07-11T12:33:41Z
user: login: jayeshmangwani
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-07-21T09:18:44Z
user: login: suneox
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-12-30T17:38:53Z

Review comments:
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @luacmartins I'm not sure how to determine this value
created_at: 2025-03-04T14:36:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @luacmartins I'm not sure how to determine this value
created_at: 2025-03-04T14:36:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @luacmartins I'm not sure how to determine this value
created_at: 2025-03-04T14:37:00Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @luacmartins I'm not sure how to determine this value
created_at: 2025-03-04T14:37:17Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
+    const isReceiver = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @luacmartins I'm not sure how to determine this value
created_at: 2025-03-04T14:37:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: The cutoff is 23:45 PM UTC the day the payment was made
created_at: 2025-03-04T17:06:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: Yes, sender (invoice) and submitter (expense reports) are the same.
created_at: 2025-03-04T17:07:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: We can verify this by:

1. Getting all `policy_` keys
2. Checking if any of them has `policy.type !== CONST.POLICY.TYPE.PERSONAL` (this means they have a business policy)
created_at: 2025-03-04T17:09:45Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
+    const isReceiver = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: This is the `report.managerID` in the case of invoices
created_at: 2025-03-04T17:18:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: We can check if `isSettled === true` here. 
created_at: 2025-03-04T17:34:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: @luacmartins but the payment is processing and not settled ? do we assume processing payments as settled ?
created_at: 2025-03-05T08:58:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: alternatively you can use the following util:
https://github.com/Expensify/App/blob/ad7462d095158adab111ff34e86f39b00d7222b1/src/libs/PolicyUtils.ts#L1139
created_at: 2025-03-05T09:03:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1265,7 +1265,7 @@ function isSettled(reportOrID: OnyxInputOrEntry<Report> | SearchReport | string
         return false;
     }
 
-    if (isEmptyObject(report) || report.isWaitingOnBankAccount) {
+    if (isEmptyObject(report)) {
path: src/libs/ReportUtils.ts
user: login: allgandalf
body: @jnowakow i don't understand the change here? why do we need to remove this change? 
created_at: 2025-03-05T09:04:00Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
+    const isReceiver = true; // TODO
+    if (isIOU && hasWorkspaces && isReceiver && isReimbursed) {
+        return true;
+    }
+
+    const isSender = true; // TODO
+
+    if (isSender && isProcessing) {
+        return true;
+    }
+
+    return false;
+}
+
+function isDeleteAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+
+    if (!isSubmitter) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function getSecondaryAction(
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: @jnowakow shouldn't we just return if one of the conditions below are true? will there be a case where report will have many actions ? checking for each action isn't optimal right, unless i'm missing something 
created_at: 2025-03-05T09:05:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: Thanks!
created_at: 2025-03-05T09:16:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1265,7 +1265,7 @@ function isSettled(reportOrID: OnyxInputOrEntry<Report> | SearchReport | string
         return false;
     }
 
-    if (isEmptyObject(report) || report.isWaitingOnBankAccount) {
+    if (isEmptyObject(report)) {
path: src/libs/ReportUtils.ts
user: login: jnowakow
body: There is contradiction in this function. Discussion is [here](https://github.com/Expensify/App/pull/57475#discussion_r1978778219)
created_at: 2025-03-05T09:19:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
+    const isReceiver = true; // TODO
+    if (isIOU && hasWorkspaces && isReceiver && isReimbursed) {
+        return true;
+    }
+
+    const isSender = true; // TODO
+
+    if (isSender && isProcessing) {
+        return true;
+    }
+
+    return false;
+}
+
+function isDeleteAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+
+    if (!isSubmitter) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function getSecondaryAction(
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @allgandalf assumption is that there will be only one primary action and it was already implemented [here](https://github.com/Expensify/App/pull/57475). There can be many secondary actions so we're creating array of them as stated in [design doc](https://docs.google.com/document/d/1JZLr_5gX348cMZXNr6HUwi4QscOcDg3IY368FMAu3H4/edit?tab=t.0#bookmark=id.4lnlf133ay8). 
It will look like this: 
<img width="627" alt="image" src="https://github.com/user-attachments/assets/8ea4b4ee-28bc-4ba9-82e4-634afaabf693" />

created_at: 2025-03-05T09:24:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
+    const isReceiver = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: Here we're in context in IOU report but looking at onyx type I think it still will be `mangerID` 🤔 
created_at: 2025-03-05T09:28:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: Hmm so here I have to find payment transaction and get it's creation date and check if it's after 23:45 on that day? 
created_at: 2025-03-05T10:38:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @luacmartins current condition for showing cancel payment button is this: https://github.com/Expensify/App/blob/237759df908f426871dc4874e3ec88a3717cb35b/src/pages/ReportDetailsPage.tsx#L367

And `canCancelPayment` implementation looks like this: https://github.com/Expensify/App/blob/237759df908f426871dc4874e3ec88a3717cb35b/src/libs/actions/IOU.ts#L8287-L8289
created_at: 2025-03-05T12:59:35Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: >@luacmartins but the payment is processing and not settled ? do we assume processing payments as settled ?

Well, in this case the processing state is given by the combination of `isSettled` and is past the NACHA cutoff (at which point we can't cancel it anymore. If we paid the report and we're within the nacha cutoff window, we can still cancel it.
created_at: 2025-03-05T13:22:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: @jnowakow yes, we use `isSettled` in the current condition. I think the `isWaitingOnBankAccount` condition is redundant since `isSettled` also takes that into account. The new change here is adding the nacha cutoff.
created_at: 2025-03-05T13:23:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: Yes, you can probably use [getIOUActionForReportID](https://github.com/Expensify/App/blob/c406beed64b4a5f4b7959d0b63b163d9d0dea5fc/src/libs/ReportActionsUtils.ts#L1631) to get the IOU action and check if it's a [pay action](https://github.com/Expensify/App/blob/c406beed64b4a5f4b7959d0b63b163d9d0dea5fc/src/libs/ReportActionsUtils.ts#L1072) and then use the reportAction date
created_at: 2025-03-05T13:39:17Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: Ah nice! Didn't know we had that already. Let's reuse that
created_at: 2025-03-05T13:39:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
+    const isReceiver = true; // TODO
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: Yea, that's still the same. 
created_at: 2025-03-05T13:40:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,330 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO is sender the same as submitter?
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = true; // TODO
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+    
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+    
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+
+    if (isAdmin && ((!isExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasWorkspaces = true; // TODO
+    const isReceiver = true; // TODO
+    if (isIOU && hasWorkspaces && isReceiver && isReimbursed) {
+        return true;
+    }
+
+    const isSender = true; // TODO
+
+    if (isSender && isProcessing) {
+        return true;
+    }
+
+    return false;
+}
+
+function isDeleteAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+
+    if (!isSubmitter) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function getSecondaryAction(
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: Correct. We can have many secondary actions, which is what we're implementing in this PR.
created_at: 2025-03-05T13:41:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,332 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+    const isReportExported = isExported(getReportActions(report));
+
+    if (isAdmin && ((!isReportExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasOnlyPersonalWorkspace = hasNoPolicyOtherThanPersonalType();
+    const isReceiver = isReportManager(report);
+    if (isIOU && !hasOnlyPersonalWorkspace && isReceiver && isReimbursed) {
+        return true;
+    }
+
+    const isSender = isCurrentUserSubmitter(report.reportID);
+    // it's already satisified in line 215
+    if (isSender && isProcessing) {
+        return true;
+    }
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @luacmartins This condition is already satisfied in line 215: https://github.com/Expensify/App/blob/e45b47197b223a4a06ed200228f00aef777911c3/src/libs/ReportSecondaryActionUtils.ts#L212-L217

Aren't we missing in `isInvoice` in this condition? In other places `isSender` references Invoice report
created_at: 2025-03-05T14:54:24Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,332 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getReportActions} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = true; // TODO
+    const hasDailyNachaCutoffPassed = false; // TODO
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
+
+    return isAdmin && isFinished && syncEnabled && !isReportExported;
+}
+
+function isMarkAsExportedAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isApproved = isReportApproved({report});
+    const isClosed = isClosedReport(report);
+    const isClosedOrApproved = isClosed || isApproved;
+
+    if (isReportPayer && isPaymentsEnabled && isClosedOrApproved) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const hasAccountingConnection = hasAccountingConnections(policy);
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isFinished = isClosedOrApproved || isReimbursed;
+
+    if (isAdmin && isFinished && hasAccountingConnection && syncEnabled) {
+        return true;
+    }
+
+    const isExporter = isPrefferedExporter(policy);
+
+    if (isExporter && isFinished && hasAccountingConnection && !syncEnabled) {
+        return true;
+    }
+
+    return false;
+}
+
+function isHoldAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isOnHold = reportTransactions.some(isOnHoldTransactionUtils);
+
+    if (isOnHold) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+    const isApproved = isReportApproved({report});
+
+    return isOpen || isProcessing || isApproved;
+}
+
+function isChangeWorkspaceAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const areWorkflowsEnabled = policy.areWorkflowsEnabled;
+    const isClosed = isClosedReport(report);
+
+    if (isExpense && isSubmitter && !areWorkflowsEnabled && isClosed) {
+        return true;
+    }
+
+    const isOpen = isOpenReport(report);
+    const isProcessing = isProcessingReport(report);
+
+    if (isSubmitter && (isOpen || isProcessing)) {
+        return true;
+    }
+
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (isApprover && isProcessing) {
+        return true;
+    }
+
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isApproved = isReportApproved({report});
+
+    if (isReportPayer && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = isSettled(report);
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isSubmitter || isApprover || isAdmin;
+    const hasReceiptMatchViolation = hasAllPendingRTERViolations || (userControlsReport && shouldShowBrokenConnectionViolation);
+    const isReportExported = isExported(getReportActions(report));
+
+    if (isAdmin && ((!isReportExported && (isApproved || isReimbursed || isClosed)) || hasReceiptMatchViolation)) {
+        return true;
+    }
+
+    const isIOU = isIOUReport(report);
+    const hasOnlyPersonalWorkspace = hasNoPolicyOtherThanPersonalType();
+    const isReceiver = isReportManager(report);
+    if (isIOU && !hasOnlyPersonalWorkspace && isReceiver && isReimbursed) {
+        return true;
+    }
+
+    const isSender = isCurrentUserSubmitter(report.reportID);
+    // it's already satisified in line 215
+    if (isSender && isProcessing) {
+        return true;
+    }
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: Hmm you're right. I think we can just get rid of this one, since the logic is the same for expense/invoice reports and AFAIK invoices can't be in Open state
created_at: 2025-03-05T15:43:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: ```suggestion
    const isExpenseReport = isExpenseReportReportUtils(report);
```

Please have a look at [this](https://expensify.slack.com/archives/C01GTK53T8Q/p1733492380567339) slack post for details about when variable and util names are the same
created_at: 2025-03-06T18:14:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as ^
created_at: 2025-03-06T18:14:35Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: Shouldn't we use existing isApprover util here? 
created_at: 2025-03-06T18:15:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as  ^, please name the report as isOpenReport and adjust the util accordingly 
created_at: 2025-03-06T18:15:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as ^
created_at: 2025-03-06T18:16:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: this should be compared against the current user right? , @luacmartins is this correct? i'm not sure
created_at: 2025-03-06T18:17:30Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: `userControllsReport` can you think of any better name for this? c.c. @luacmartins 
created_at: 2025-03-06T18:17:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as ^
created_at: 2025-03-06T18:18:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: please name this as isReportApproved, and rename util accordingly 
created_at: 2025-03-06T18:18:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as ^
created_at: 2025-03-06T18:19:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: please rename this as isReportPaidElsewhere
created_at: 2025-03-06T18:19:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: @jnowakow can you check the codebase once if we do something similar in a util?
created_at: 2025-03-06T18:20:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as ^
created_at: 2025-03-06T18:20:38Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as ^
created_at: 2025-03-06T18:20:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as ^
created_at: 2025-03-06T18:20:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: same as ^
created_at: 2025-03-06T18:21:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: this should be names as isReportClosed
created_at: 2025-03-06T18:21:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: not sure if this check is correct, same @luacmartins we should check this with the current user right?
created_at: 2025-03-06T18:22:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: isReportReimbursed please
created_at: 2025-03-06T18:22:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+    const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+    const syncEnabled = isAutoSyncEnabled(policy);
+    const isReportExported = isExported(getReportActions(report));
+    const isFinished = isApproved || isReimbursed || isClosed;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: allgandalf
body: `isFinished` doesn't really explain what this is used for, maybe something more meaningful?
created_at: 2025-03-06T18:23:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: `policy.role` is specific to the current user, so this is comparing against the current user
created_at: 2025-03-06T18:28:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: I think this name is fine and we're already using it in the primary actions. Let's just fix the typo `userControlsReport`
created_at: 2025-03-06T18:29:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: I don't think we have anything like this yet, but we can simplify this by something like this:

```
const now = new Date();
const paymentDatetime = new Date(actionCreated);
const nowUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()));
const cutoffTimeUTC = new Date(Date.UTC(paymentDatetime.getUTCFullYear(), paymentDatetime.getUTCMonth(), paymentDatetime.getUTCDate(), 23, 45, 0));
return nowUTC < cutoffTimeUTC;
```
created_at: 2025-03-06T18:34:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
+
+        return actionCreatedTime > cutoffTime;
+    });
+    return isPaymentProcessing && !hasDailyNachaCutoffPassed;
+}
+
+function isExportAction(report: Report, policy: Policy): boolean {
+    const isInvoice = isInvoiceReport(report);
+    const isSender = isCurrentUserSubmitter(report.reportID);
+
+    if (isInvoice && isSender) {
+        return true;
+    }
+
+    const isExpense = isExpenseReport(report);
+
+    const hasAccountingConnection = hasAccountingConnections(policy);
+
+    if (!isExpense || !hasAccountingConnection) {
+        return false;
+    }
+
+    const isApproved = isReportApproved({report});
+    const isReportPayer = isPayer(getSession(), report, false, policy);
+    const isPaymentsEnabled = arePaymentsEnabled(policy);
+    const isClosed = isClosedReport(report);
+
+    if (isReportPayer && isPaymentsEnabled && (isApproved || isClosed)) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: luacmartins
body: policy.role is specific to the current user, so this is comparing against the current user
created_at: 2025-03-06T18:40:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: I'm using existing `isApprover` from `libs/actions/Policy/Member`
created_at: 2025-03-07T08:29:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,346 @@
+import {fromZonedTime, toZonedTime} from 'date-fns-tz';
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApprovedMember} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {arePaymentsEnabled, getCorrectedAutoReportingFrequency, hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport,
+    isCurrentUserSubmitter,
+    isExpenseReport,
+    isExported,
+    isInvoiceReport,
+    isIOUReport,
+    isOpenReport,
+    isPayer,
+    isProcessingReport,
+    isReportApproved,
+    isReportManager,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+
+    if (!isSubmitter && !isApprover) {
+        return false;
+    }
+
+    const isOpen = isOpenReport(report);
+
+    if (!isOpen) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isProcessing = isProcessingReport(report);
+    const hasDuplicates = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpense && isApprover && isProcessing && hasDuplicates) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControllsReport = isApprover || isAdmin;
+    return userControllsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpense = isExpenseReport(report);
+    const isApprover = isApprovedMember(policy, getCurrentUserAccountID());
+    const isApproved = isReportApproved({report});
+
+    return isExpense && isApprover && isApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpense = isExpenseReport(report);
+
+    if (!isExpense) {
+        return false;
+    }
+
+    const isPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const actionCreated = fromZonedTime(action.created, 'UTC');
+        const actionCreatedTime = actionCreated.getTime();
+        const day = actionCreated.getDate();
+        const month = actionCreated.getMonth() + 1; // getMonth return 0-11
+        const year = actionCreated.getFullYear();
+        const cutoff = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day} 23:45:00`;
+        const cutoffTime = toZonedTime(cutoff, 'UTC').getTime();
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jnowakow
body: @luacmartins shouldn't it be `return nowUTC.getTime() > cutoffTimeUTC.getTime()`? Because `hasDailyNachaCutoffPassed` should be `true` if it's later than cutoff time, right? 
created_at: 2025-03-07T09:17:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,445 @@
+import Onyx from 'react-native-onyx';
+import getSecondaryAction from '@libs/ReportSecondaryActionUtils';
+import CONST from '@src/CONST';
+import ONYXKEYS from '@src/ONYXKEYS';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+
+const CURRENT_USER_ACCOUNT_ID = 1;
+const CURRENT_USER_EMAIL = 'tester@mail.com';
+
+const SESSION = {
+    email: CURRENT_USER_EMAIL,
+    accountID: CURRENT_USER_ACCOUNT_ID,
+};
+
+const PERSONAL_DETAILS = {
+    accountID: CURRENT_USER_ACCOUNT_ID,
+    login: CURRENT_USER_EMAIL,
+};
+
+const REPORT_ID = 1;
+
+describe('getSecondaryAction', () => {
+    beforeAll(() => {
+        Onyx.init({
+            keys: ONYXKEYS,
+        });
+    });
+
+    beforeEach(async () => {
+        jest.clearAllMocks();
+        Onyx.clear();
+        await Onyx.merge(ONYXKEYS.SESSION, SESSION);
+        await Onyx.set(ONYXKEYS.PERSONAL_DETAILS_LIST, {[CURRENT_USER_ACCOUNT_ID]: PERSONAL_DETAILS});
+    });
+
+    it('should always return default options', () => {
+        const report = {} as unknown as Report;
+        const policy = {} as unknown as Policy;
+        // await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
path: tests/unit/ReportSecondaryActionUtilsTest.ts
user: login: allgandalf
body: NAB: but lets remove this if we are not using it
```suggestion
```
created_at: 2025-03-07T17:31:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,445 @@
+import Onyx from 'react-native-onyx';
+import getSecondaryAction from '@libs/ReportSecondaryActionUtils';
+import CONST from '@src/CONST';
+import ONYXKEYS from '@src/ONYXKEYS';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+
+const CURRENT_USER_ACCOUNT_ID = 1;
+const CURRENT_USER_EMAIL = 'tester@mail.com';
+
+const SESSION = {
+    email: CURRENT_USER_EMAIL,
+    accountID: CURRENT_USER_ACCOUNT_ID,
+};
+
+const PERSONAL_DETAILS = {
+    accountID: CURRENT_USER_ACCOUNT_ID,
+    login: CURRENT_USER_EMAIL,
+};
+
+const REPORT_ID = 1;
+
+describe('getSecondaryAction', () => {
+    beforeAll(() => {
+        Onyx.init({
+            keys: ONYXKEYS,
+        });
+    });
+
+    beforeEach(async () => {
+        jest.clearAllMocks();
+        Onyx.clear();
+        await Onyx.merge(ONYXKEYS.SESSION, SESSION);
+        await Onyx.set(ONYXKEYS.PERSONAL_DETAILS_LIST, {[CURRENT_USER_ACCOUNT_ID]: PERSONAL_DETAILS});
+    });
+
+    it('should always return default options', () => {
+        const report = {} as unknown as Report;
+        const policy = {} as unknown as Policy;
+        // await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
path: tests/unit/ReportSecondaryActionUtilsTest.ts
user: login: jnowakow
body: Good catch!
created_at: 2025-03-10T15:28:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,350 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApproverUtils} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {
+    arePaymentsEnabled as arePaymentsEnabledUtils,
+    getCorrectedAutoReportingFrequency,
+    hasAccountingConnections,
+    hasNoPolicyOtherThanPersonalType,
+    isAutoSyncEnabled,
+    isPrefferedExporter,
+} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport as isClosedReportUtils,
+    isCurrentUserSubmitter,
+    isExpenseReport as isExpenseReportUtils,
+    isExported as isExportedUtils,
+    isInvoiceReport as isInvoiceReportUtils,
+    isIOUReport as isIOUReportUtils,
+    isOpenReport as isOpenReportUtils,
+    isPayer as isPayerUtils,
+    isProcessingReport as isProcessingReportUtils,
+    isReportApproved as isReportApprovedUtils,
+    isReportManager as isReportManagerUtils,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+
+    if (!isReportSubmitter && !isReportApprover) {
path: src/libs/ReportSecondaryActionUtils.ts
user: login: c3024
body: This check should include to ensure that the current user is neither the admin nor the manager before returning false to match the behaviour shown on report preview. Fixed here 

https://github.com/Expensify/App/pull/63538
created_at: 2025-06-17T11:31:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,350 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApproverUtils} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {
+    arePaymentsEnabled as arePaymentsEnabledUtils,
+    getCorrectedAutoReportingFrequency,
+    hasAccountingConnections,
+    hasNoPolicyOtherThanPersonalType,
+    isAutoSyncEnabled,
+    isPrefferedExporter,
+} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport as isClosedReportUtils,
+    isCurrentUserSubmitter,
+    isExpenseReport as isExpenseReportUtils,
+    isExported as isExportedUtils,
+    isInvoiceReport as isInvoiceReportUtils,
+    isIOUReport as isIOUReportUtils,
+    isOpenReport as isOpenReportUtils,
+    isPayer as isPayerUtils,
+    isProcessingReport as isProcessingReportUtils,
+    isReportApproved as isReportApprovedUtils,
+    isReportManager as isReportManagerUtils,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+
+    if (!isReportSubmitter && !isReportApprover) {
+        return false;
+    }
+
+    const isOpenReport = isOpenReportUtils(report);
+
+    if (!isOpenReport) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+    const isProcessingReport = isProcessingReportUtils(report);
+    const reportHasDuplicatedTransactions = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpenseReport && isReportApprover && isProcessingReport && reportHasDuplicatedTransactions) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
path: src/libs/ReportSecondaryActionUtils.ts
user: login: ahmedGaber93
body: Coming from https://github.com/Expensify/App/issues/63137, we need to check `isProcessingReport` here to prevent displaying approve button if expense is not submitted and `hasAllPendingRTERViolations` is true.
created_at: 2025-07-11T12:33:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,350 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApproverUtils} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {
+    arePaymentsEnabled as arePaymentsEnabledUtils,
+    getCorrectedAutoReportingFrequency,
+    hasAccountingConnections,
+    hasNoPolicyOtherThanPersonalType,
+    isAutoSyncEnabled,
+    isPrefferedExporter,
+} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport as isClosedReportUtils,
+    isCurrentUserSubmitter,
+    isExpenseReport as isExpenseReportUtils,
+    isExported as isExportedUtils,
+    isInvoiceReport as isInvoiceReportUtils,
+    isIOUReport as isIOUReportUtils,
+    isOpenReport as isOpenReportUtils,
+    isPayer as isPayerUtils,
+    isProcessingReport as isProcessingReportUtils,
+    isReportApproved as isReportApprovedUtils,
+    isReportManager as isReportManagerUtils,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+
+    if (!isReportSubmitter && !isReportApprover) {
+        return false;
+    }
+
+    const isOpenReport = isOpenReportUtils(report);
+
+    if (!isOpenReport) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
path: src/libs/ReportSecondaryActionUtils.ts
user: login: jayeshmangwani
body: Coming from this issue https://github.com/Expensify/App/issues/62266 , here on `isSubmitAction` we are checking that when Scheduled Submit is enabled for the workspace, the Submit button appears as a secondary action. This behavior caused an issue if the workspace has Manual Submit enabled then Submit button does not appear for duplicate expenses. context: https://github.com/Expensify/App/issues/62266#issuecomment-2889860125


created_at: 2025-07-21T09:18:44Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,350 @@
+import type {OnyxCollection} from 'react-native-onyx';
+import type {ValueOf} from 'type-fest';
+import CONST from '@src/CONST';
+import type {Policy, Report, ReportAction, Transaction, TransactionViolation} from '@src/types/onyx';
+import {isApprover as isApproverUtils} from './actions/Policy/Member';
+import {getCurrentUserAccountID} from './actions/Report';
+import {
+    arePaymentsEnabled as arePaymentsEnabledUtils,
+    getCorrectedAutoReportingFrequency,
+    hasAccountingConnections,
+    hasNoPolicyOtherThanPersonalType,
+    isAutoSyncEnabled,
+    isPrefferedExporter,
+} from './PolicyUtils';
+import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils';
+import {
+    isClosedReport as isClosedReportUtils,
+    isCurrentUserSubmitter,
+    isExpenseReport as isExpenseReportUtils,
+    isExported as isExportedUtils,
+    isInvoiceReport as isInvoiceReportUtils,
+    isIOUReport as isIOUReportUtils,
+    isOpenReport as isOpenReportUtils,
+    isPayer as isPayerUtils,
+    isProcessingReport as isProcessingReportUtils,
+    isReportApproved as isReportApprovedUtils,
+    isReportManager as isReportManagerUtils,
+    isSettled,
+} from './ReportUtils';
+import {getSession} from './SessionUtils';
+import {allHavePendingRTERViolation, isDuplicate, isOnHold as isOnHoldTransactionUtils, shouldShowBrokenConnectionViolationForMultipleTransactions} from './TransactionUtils';
+
+function isSubmitAction(report: Report, policy: Policy): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportSubmitter = isCurrentUserSubmitter(report.reportID);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+
+    if (!isReportSubmitter && !isReportApprover) {
+        return false;
+    }
+
+    const isOpenReport = isOpenReportUtils(report);
+
+    if (!isOpenReport) {
+        return false;
+    }
+
+    const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy);
+
+    const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;
+
+    return !!isScheduledSubmitEnabled;
+}
+
+function isApproveAction(report: Report, policy: Policy, reportTransactions: Transaction[], violations: OnyxCollection<TransactionViolation[]>): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+    const isProcessingReport = isProcessingReportUtils(report);
+    const reportHasDuplicatedTransactions = reportTransactions.some((transaction) => isDuplicate(transaction.transactionID));
+
+    if (isExpenseReport && isReportApprover && isProcessingReport && reportHasDuplicatedTransactions) {
+        return true;
+    }
+
+    const transactionIDs = reportTransactions.map((t) => t.transactionID);
+
+    const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs, violations);
+
+    if (hasAllPendingRTERViolations) {
+        return true;
+    }
+
+    const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
+
+    const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);
+
+    const userControlsReport = isReportApprover || isAdmin;
+    return userControlsReport && shouldShowBrokenConnectionViolation;
+}
+
+function isUnapproveAction(report: Report, policy: Policy): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
+    const isReportApproved = isReportApprovedUtils({report});
+
+    return isExpenseReport && isReportApprover && isReportApproved;
+}
+
+function isCancelPaymentAction(report: Report, reportTransactions: Transaction[]): boolean {
+    const isExpenseReport = isExpenseReportUtils(report);
+
+    if (!isExpenseReport) {
+        return false;
+    }
+
+    const isReportPaidElsewhere = report.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED;
+
+    if (isReportPaidElsewhere) {
+        return true;
+    }
+
+    const isPaymentProcessing = isSettled(report);
+
+    const payActions = reportTransactions.reduce((acc, transaction) => {
+        const action = getIOUActionForReportID(report.reportID, transaction.transactionID);
+        if (action && isPayAction(action)) {
+            acc.push(action);
+        }
+        return acc;
+    }, [] as ReportAction[]);
+
+    const hasDailyNachaCutoffPassed = payActions.some((action) => {
+        const now = new Date();
+        const paymentDatetime = new Date(action.created);
+        const nowUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()));
+        const cutoffTimeUTC = new Date(Date.UTC(paymentDatetime.getUTCFullYear(), paymentDatetime.getUTCMonth(), paymentDatetime.getUTCDate(), 23, 45, 0));
+        return nowUTC.getTime() < cutoffTimeUTC.getTime();
path: src/libs/ReportSecondaryActionUtils.ts
user: login: suneox
body: Coming from #66225 BugZero checklist:

the implementation of the `hasDailyNachaCutoffPassed` condition is described in https://github.com/Expensify/App/pull/57678#discussion_r1981138296 `check if it's after 23:45 on that day` so that mean the current time must be > cut off time

created_at: 2025-12-30T17:38:54Z
author_association: CONTRIBUTOR

PR comments:
user: login: melvin-bot[bot]
created_at: 2025-03-03T15:00:51Z
body: @allgandalf Please copy/paste the Reviewer Checklist from [here](https://raw.githubusercontent.com/Expensify/App/main/contributingGuides/REVIEWER_CHECKLIST.md) into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]
author_association: NONE
user: login: allgandalf
created_at: 2025-03-05T05:45:53Z
body: @jnowakow please also fix the failing test
author_association: CONTRIBUTOR
user: login: allgandalf
created_at: 2025-03-05T18:26:29Z
body: @jnowakow when do you think you can get this PR out of draft
author_association: CONTRIBUTOR
user: login: jnowakow
created_at: 2025-03-06T07:59:37Z
body: > @jnowakow when do you think you can get this PR out of draft

I think I will mark it as ready to review today
author_association: CONTRIBUTOR
user: login: luacmartins
created_at: 2025-03-06T11:27:30Z
body: Nice! Let's push to get this one reviewed today then!
author_association: CONTRIBUTOR
user: login: jnowakow
created_at: 2025-03-06T12:26:03Z
body: @luacmartins @allgandalf it's ready (I hope 🤞) 
author_association: CONTRIBUTOR
user: login: allgandalf
created_at: 2025-03-06T18:08:25Z
body: @jnowakow quoting from the design doc:
> We can then clean up all the [duplicate buttons](https://github.com/Expensify/App/blob/27d6da72361af3629fbdbc118dd7686d83767e99/src/components/MoneyReportHeader.tsx#L364-L486) in MoneyReportHeader.tsx

Are we not doing it in this PR?
author_association: CONTRIBUTOR
user: login: luacmartins
created_at: 2025-03-06T18:40:41Z
body: >@jnowakow quoting from the design doc:
>
>We can then clean up all the [duplicate buttons](https://github.com/Expensify/App/blob/27d6da72361af3629fbdbc118dd7686d83767e99/src/components/MoneyReportHeader.tsx#L364-L486) in MoneyReportHeader.tsx
>
>Are we not doing it in this PR?

@allgandalf we're gonna handle UI changes in a separate PR
author_association: CONTRIBUTOR
user: login: allgandalf
created_at: 2025-03-06T20:40:32Z
body: > @allgandalf we're gonna handle UI changes in a separate PR

ohh, it confused me as it was written in the design doc  section of `Secondary actions`.

author_association: CONTRIBUTOR
user: login: jnowakow
created_at: 2025-03-07T09:17:54Z
body: @allgandalf I renamed all variables according to your suggestion
author_association: CONTRIBUTOR
user: login: luacmartins
created_at: 2025-03-07T11:48:08Z
body: Ready for another review from @allgandalf 
author_association: CONTRIBUTOR
user: login: allgandalf
created_at: 2025-03-07T17:34:10Z
body: This PR has nothing to test in particular but i will try building each platform and verify that we are able to build successfully 
author_association: CONTRIBUTOR
user: login: allgandalf
created_at: 2025-03-07T17:38:04Z
body: ## Reviewer Checklist

- [x] I have verified the author checklist is complete (all boxes are checked off).
- [x] I verified the correct issue is linked in the `### Fixed Issues` section above
- [x] I verified testing steps are clear and they cover the changes made in this PR
    - [x] I verified the steps for local testing are in the `Tests` section
    - [x] I verified the steps for Staging and/or Production testing are in the `QA steps` section
    - [x] 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)
    - [x] 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)
- [x] I checked that screenshots or videos are included for tests on [all platforms](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [x] I included screenshots or videos for tests on [all platforms](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [x] I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
- [x] I verified tests pass on **all platforms** & I tested again on:
    - [x] Android: Native
    - [x] Android: mWeb Chrome
    - [x] iOS: Native
    - [x] iOS: mWeb Safari
    - [x] MacOS: Chrome / Safari
    - [x] MacOS: Desktop
- [x] 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
- [x] I verified proper code patterns were followed (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
    - [x] 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`).
    - [x] I verified that comments were added to code that is not self explanatory
    - [x] 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.
    - [x] I verified any copy / text shown in the product is localized by adding it to `src/languages/*` files and using the [translation method](https://github.com/Expensify/App/blob/4bd99402cebdf4d7394e0d1f260879ea238197eb/src/components/withLocalize.js#L60)
    - [x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the [localization methods](https://github.com/Expensify/App/blob/4bd99402cebdf4d7394e0d1f260879ea238197eb/src/components/withLocalize.js#L60-L68)
    - [x] 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)
    - [x] 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.
    - [x] I verified the JSDocs style guidelines (in [`STYLE.md`](https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#jsdocs)) were followed
- [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- [x] I verified that this PR follows the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md)
- [x] 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)
- [x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- [x] I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
- [x] If a new component is created I verified that:
    - [x] A similar component doesn't exist in the codebase
    - [x] All props are defined accurately and each prop has a `/** comment above it */`
    - [x] The file is named correctly
    - [x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    - [x] The only data being stored in the state is data necessary for rendering and nothing else
    - [x] 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)
    - [x] 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`)
    - [x] All JSX used for rendering exists in the render method
    - [x] 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
- [x] If any new file was added I verified that:
    - [x] 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
- [x] If a new CSS style is added I verified that:
    - [x] A similar style doesn't already exist
    - [x] The style can't be created with an existing [StyleUtils](https://github.com/Expensify/App/blob/main/src/utils/index.ts) function (i.e. `StyleUtils.getBackgroundAndBorderStyle(theme.componentBG`)
- [x] 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.
- [x] 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)
- [x] 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.
- [x] 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.
- [x] 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:
    - [x] I verified that all the inputs inside a form are aligned with each other.
    - [x] I added `Design` label and/or tagged `@Expensify/design` so the design team can review the changes.
- [x] 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.
- [x] For any bug fix or new feature in this PR, I verified that sufficient [unit tests](https://github.com/Expensify/App/blob/main/tests/README.md) are included to prevent regressions in this flow.
- [x] 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.
- [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

### Screenshots/Videos
<details>
<summary>Android: Native</summary>

<img width="1284" alt="Screenshot 2025-03-07 at 11 15 53 PM" src="https://github.com/user-attachments/assets/a2c81300-814e-4a73-80c3-965110f0a4cd" />

<!-- add screenshots or videos here -->

</details>

<details>
<summary>Android: mWeb Chrome</summary>

<img width="550" alt="Screenshot 2025-03-07 at 11 17 28 PM" src="https://github.com/user-attachments/assets/356716e0-ce49-4633-88f3-7c8cef26a4b0" />

<!-- add screenshots or videos here -->

</details>

<details>
<summary>iOS: Native</summary>

<img width="1284" alt="Screenshot 2025-03-07 at 11 12 39 PM" src="https://github.com/user-attachments/assets/427c9d1e-4d9d-490c-b899-27dce431c931" />

<!-- add screenshots or videos here -->

</details>

<details>
<summary>iOS: mWeb Safari</summary>

<img width="448" alt="Screenshot 2025-03-07 at 11 13 30 PM" src="https://github.com/user-attachments/assets/e442bd2b-34b5-440f-b624-15591b240536" />

<!-- add screenshots or videos here -->

</details>

<details>
<summary>MacOS: Chrome / Safari</summary>

<img width="1512" alt="Screenshot 2025-03-07 at 11 07 38 PM" src="https://github.com/user-attachments/assets/ac0606a5-d53f-414c-a475-2fe29303e2f2" />

<!-- add screenshots or videos here -->

</details>

<details>
<summary>MacOS: Desktop</summary>

<img width="1225" alt="Screenshot 2025-03-07 at 11 11 09 PM" src="https://github.com/user-attachments/assets/78b99594-42e8-491a-8e0f-419e6230c0e3" />

<!-- add screenshots or videos here -->

</details>

author_association: CONTRIBUTOR
user: login: OSBotify
created_at: 2025-03-07T17:57:40Z
body: :hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-03-10T21:35:55Z
body: 🚀 [Deployed](https://github.com/Expensify/App/actions/runs/13774664219) to staging by https://github.com/luacmartins in version: 9.1.11-1 🚀

platform | result
---|---
🤖 android 🤖|success ✅
🖥 desktop 🖥|success ✅
🍎 iOS 🍎|success ✅
🕸 web 🕸|success ✅
🤖🔄 android HybridApp 🤖🔄|success ✅
🍎🔄 iOS HybridApp 🍎🔄|success ✅
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-03-14T01:07:14Z
body: 🚀 [Deployed](https://github.com/Expensify/App/actions/runs/13847526651) to production by https://github.com/mountiny in version: 9.1.12-7 🚀

platform | result
---|---
🤖 android 🤖|true ❌
🖥 desktop 🖥|success ✅
🍎 iOS 🍎|success ✅
🕸 web 🕸|success ✅
🤖🔄 android HybridApp 🤖🔄|failure ❌
🍎🔄 iOS HybridApp 🍎🔄|failure ❌
author_association: CONTRIBUTOR