Commit c2e3773
committed
refactor: extract MoneyRequestBuilder.ts from IOU/index.ts
Extracts the money-request data-builder cluster (13 functions plus 9 supporting
types) from IOU/index.ts into a new dedicated MoneyRequestBuilder.ts module.
Functions moved:
- buildMinimalTransactionForFormula
- getReportPreviewAction
- getReceiptError
- buildOnyxDataForTestDriveIOU
- getTransactionWithPreservedLocalReceiptSource
- buildOnyxDataForMoneyRequest (~687 lines)
- recalculateOptimisticReportName
- maybeUpdateReportNameForFormulaTitle
- getMoneyRequestInformation (~422 lines)
- calculateDiffAmount
- getUpdatedMoneyRequestReportData
- mergePolicyRecentlyUsedCategories
- mergePolicyRecentlyUsedCurrencies
Function bodies are byte-identical to their pre-move state on main, with the
documented translations of direct module-private state reads
(allReports, allPersonalDetails, allReportActions, allReportNameValuePairs,
deprecatedCurrentUserPersonalDetails, deprecatedUserAccountID) to the
corresponding getters on index.ts (the established pattern from PRs B-D).
Namespace imports (Localize.translateLocal, NumberUtils.rand64) are converted
to named imports (translateLocal, rand64) per lint rules for new files.
A new getCurrentUserPersonalDetails getter is added to index.ts to expose
deprecatedCurrentUserPersonalDetails for the moved functions.
Consumers re-pointed to import from ./MoneyRequestBuilder:
- Split.ts, SplitTransactionUpdate.ts, TrackExpense.ts, PerDiem.ts,
SendInvoice.ts, Duplicate.ts, BulkEdit.ts, Receipt.ts, PayMoneyRequest.ts,
DeleteMoneyRequest.ts, UpdateMoneyRequest.ts
- src/pages/inbox/report/ReportActionsView.tsx
- tests/actions/IOU/GetMoneyRequestInformationTest.ts
- tests/actions/IOUTest.ts, IOUTest/SplitTest.ts,
IOUTest/DeleteMoneyRequestTest.ts, IOUTest/DuplicateTest.ts
- tests/actions/MergeTransactionTest.ts
Final size: index.ts drops from 2,805 to ~1,160 lines.
Part of Issue #72804 (break up src/libs/actions/IOU/).1 parent cab0b7b commit c2e3773
22 files changed
Lines changed: 1687 additions & 1707 deletions
File tree
- src
- libs
- ReceiptUploadRetryHandler
- actions/IOU
- pages/inbox/report
- types/onyx
- tests/actions
- IOUTest
- IOU
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | 48 | | |
50 | 49 | | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
0 commit comments