From e2c70cc047ea14cae3aca6424e338bed2f7aeffa Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 12 Dec 2025 12:04:26 +0000 Subject: [PATCH 1/4] Update transaction shape to include existing time data --- src/CONST/index.ts | 7 ++++++- src/types/onyx/Transaction.ts | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 975cbd0052a77..e3ec7b72d5a51 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1759,6 +1759,7 @@ const CONST = { PARTIAL_TRANSACTION_MERCHANT: '(none)', TYPE: { CUSTOM_UNIT: 'customUnit', + TIME: 'time', }, STATUS: { PENDING: 'Pending', @@ -1774,7 +1775,11 @@ const CONST = { ALLOW: 'personal', }, }, - + TIME_TRACKING: { + UNIT: { + HOUR: 'h', + }, + }, MCC_GROUPS: { AIRLINES: 'Airlines', COMMUTER: 'Commuter', diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index c844f47f60b36..99b3fbc798770 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -75,6 +75,18 @@ type Comment = { /** Type of the transaction */ type?: ValueOf; + /** Contains information pertaining to time tracking */ + units?: { + /** Count of the unit */ + count: number; + + /** Rate of the unit in cents */ + rate: number; + + /** Unit of the unit (e.g. 'h' for hours) */ + unit: ValueOf; + }; + /** In custom unit transactions this holds the information of the custom unit */ customUnit?: TransactionCustomUnit; From 680e2e331937b4f6c03bfcd91835c72280c699da Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 12 Dec 2025 12:52:49 +0000 Subject: [PATCH 2/4] optional --- src/types/onyx/Transaction.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index 99b3fbc798770..cea438c2283fa 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -78,13 +78,13 @@ type Comment = { /** Contains information pertaining to time tracking */ units?: { /** Count of the unit */ - count: number; + count?: number; /** Rate of the unit in cents */ - rate: number; + rate?: number; /** Unit of the unit (e.g. 'h' for hours) */ - unit: ValueOf; + unit?: ValueOf; }; /** In custom unit transactions this holds the information of the custom unit */ From 1f3665394c636cc90b640a85fa928391050f0655 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 12 Dec 2025 13:37:48 +0000 Subject: [PATCH 3/4] add units to pending action test --- src/libs/DebugUtils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/DebugUtils.ts b/src/libs/DebugUtils.ts index 38d1364ff9517..d7a81df132f37 100644 --- a/src/libs/DebugUtils.ts +++ b/src/libs/DebugUtils.ts @@ -1033,6 +1033,7 @@ function validateTransactionDraftProperty(key: keyof Transaction, value: string) isLoading: CONST.RED_BRICK_ROAD_PENDING_ACTION, type: CONST.RED_BRICK_ROAD_PENDING_ACTION, customUnit: CONST.RED_BRICK_ROAD_PENDING_ACTION, + units: CONST.RED_BRICK_ROAD_PENDING_ACTION, source: CONST.RED_BRICK_ROAD_PENDING_ACTION, originalTransactionID: CONST.RED_BRICK_ROAD_PENDING_ACTION, splits: CONST.RED_BRICK_ROAD_PENDING_ACTION, From 474030b2b2367bbae85382014fce308577628bf8 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Mon, 15 Dec 2025 13:07:09 +0000 Subject: [PATCH 4/4] debugutils typing --- src/libs/DebugUtils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/DebugUtils.ts b/src/libs/DebugUtils.ts index d7a81df132f37..96feaad6b9c27 100644 --- a/src/libs/DebugUtils.ts +++ b/src/libs/DebugUtils.ts @@ -1140,6 +1140,7 @@ function validateTransactionDraftProperty(key: keyof Transaction, value: string) splitExpenses: 'array', isDemoTransaction: 'boolean', splitExpensesTotal: 'number', + units: 'object', }); case 'accountant': return validateObject>(value, {