diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 66273a3408f72..fe9b1151a7a6c 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1749,6 +1749,7 @@ const CONST = { PARTIAL_TRANSACTION_MERCHANT: '(none)', TYPE: { CUSTOM_UNIT: 'customUnit', + TIME: 'time', }, STATUS: { PENDING: 'Pending', @@ -1764,7 +1765,11 @@ const CONST = { ALLOW: 'personal', }, }, - + TIME_TRACKING: { + UNIT: { + HOUR: 'h', + }, + }, MCC_GROUPS: { AIRLINES: 'Airlines', COMMUTER: 'Commuter', diff --git a/src/libs/DebugUtils.ts b/src/libs/DebugUtils.ts index 0469e4a43d4e2..bd4cbe7606b77 100644 --- a/src/libs/DebugUtils.ts +++ b/src/libs/DebugUtils.ts @@ -1042,6 +1042,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, @@ -1151,6 +1152,7 @@ function validateTransactionDraftProperty(key: keyof Transaction, value: string) splitExpenses: 'array', isDemoTransaction: 'boolean', splitExpensesTotal: 'number', + units: 'object', splitsStartDate: 'string', splitsEndDate: 'string', }); diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index 3ff93f59613b1..6dce2a6beafa5 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;