-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34092 from VickyStash/ts-migration/iou
[TS migration] Migrate 'IOU.js' lib to TypeScript
- Loading branch information
Showing
42 changed files
with
1,678 additions
and
1,456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type ApproveMoneyRequestParams = { | ||
reportID: string; | ||
approvedReportActionID: string; | ||
}; | ||
|
||
export default ApproveMoneyRequestParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type CompleteSplitBillParams = { | ||
transactionID: string; | ||
amount?: number; | ||
currency?: string; | ||
created?: string; | ||
merchant?: string; | ||
comment?: string; | ||
category?: string; | ||
tag?: string; | ||
splits: string; | ||
}; | ||
|
||
export default CompleteSplitBillParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
type CreateDistanceRequestParams = { | ||
comment: string; | ||
iouReportID: string; | ||
chatReportID: string; | ||
transactionID: string; | ||
reportActionID: string; | ||
createdChatReportActionID: string; | ||
createdIOUReportActionID: string; | ||
reportPreviewReportActionID: string; | ||
waypoints: string; | ||
created: string; | ||
category?: string; | ||
tag?: string; | ||
billable?: boolean; | ||
}; | ||
|
||
export default CreateDistanceRequestParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type DeleteMoneyRequestParams = { | ||
transactionID: string; | ||
reportActionID: string; | ||
}; | ||
|
||
export default DeleteMoneyRequestParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type DetachReceiptParams = { | ||
transactionID: string; | ||
}; | ||
|
||
export default DetachReceiptParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
type EditMoneyRequestParams = { | ||
transactionID: string; | ||
reportActionID: string; | ||
created?: string; | ||
amount?: number; | ||
currency?: string; | ||
comment?: string; | ||
merchant?: string; | ||
category?: string; | ||
billable?: boolean; | ||
tag?: string; | ||
}; | ||
|
||
export default EditMoneyRequestParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type CONST from '@src/CONST'; | ||
import type DeepValueOf from '@src/types/utils/DeepValueOf'; | ||
|
||
type PayMoneyRequestParams = { | ||
iouReportID: string; | ||
chatReportID: string; | ||
reportActionID: string; | ||
paymentMethodType: DeepValueOf<typeof CONST.IOU.PAYMENT_TYPE>; | ||
}; | ||
|
||
export default PayMoneyRequestParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type ReplaceReceiptParams = { | ||
transactionID: string; | ||
receipt: File; | ||
}; | ||
|
||
export default ReplaceReceiptParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type {ValueOf} from 'type-fest'; | ||
import type CONST from '@src/CONST'; | ||
import type {Receipt} from '@src/types/onyx/Transaction'; | ||
|
||
type RequestMoneyParams = { | ||
debtorEmail: string; | ||
debtorAccountID: number; | ||
amount: number; | ||
currency: string; | ||
comment: string; | ||
created: string; | ||
merchant: string; | ||
iouReportID: string; | ||
chatReportID: string; | ||
transactionID: string; | ||
reportActionID: string; | ||
createdChatReportActionID: string; | ||
createdIOUReportActionID: string; | ||
reportPreviewReportActionID: string; | ||
receipt: Receipt; | ||
receiptState?: ValueOf<typeof CONST.IOU.RECEIPT_STATE>; | ||
category?: string; | ||
tag?: string; | ||
taxCode: string; | ||
taxAmount: number; | ||
billable?: boolean; | ||
}; | ||
|
||
export default RequestMoneyParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type CONST from '@src/CONST'; | ||
import type DeepValueOf from '@src/types/utils/DeepValueOf'; | ||
|
||
type SendMoneyParams = { | ||
iouReportID: string; | ||
chatReportID: string; | ||
reportActionID: string; | ||
paymentMethodType: DeepValueOf<typeof CONST.IOU.PAYMENT_TYPE>; | ||
transactionID: string; | ||
newIOUReportDetails: string; | ||
createdReportActionID: string; | ||
reportPreviewReportActionID: string; | ||
}; | ||
|
||
export default SendMoneyParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
type SplitBillParams = { | ||
reportID: string; | ||
amount: number; | ||
splits: string; | ||
comment: string; | ||
currency: string; | ||
merchant: string; | ||
category: string; | ||
tag: string; | ||
billable: boolean; | ||
transactionID: string; | ||
reportActionID: string; | ||
createdReportActionID?: string; | ||
policyID?: string; | ||
}; | ||
|
||
export default SplitBillParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type {Receipt} from '@src/types/onyx/Transaction'; | ||
|
||
type StartSplitBillParams = { | ||
chatReportID: string; | ||
reportActionID: string; | ||
transactionID: string; | ||
splits: string; | ||
receipt: Receipt; | ||
comment: string; | ||
category: string; | ||
tag: string; | ||
isFromGroupDM: boolean; | ||
createdReportActionID?: string; | ||
billable: boolean; | ||
}; | ||
|
||
export default StartSplitBillParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type SubmitReportParams = { | ||
reportID: string; | ||
managerAccountID?: number; | ||
reportActionID: string; | ||
}; | ||
|
||
export default SubmitReportParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type {TransactionDetails} from '@libs/ReportUtils'; | ||
|
||
type UpdateMoneyRequestParams = Partial<TransactionDetails> & { | ||
reportID?: string; | ||
transactionID: string; | ||
reportActionID?: string; | ||
}; | ||
|
||
export default UpdateMoneyRequestParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.