Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,7 @@ const CONST = {
PARTIAL_TRANSACTION_MERCHANT: '(none)',
TYPE: {
CUSTOM_UNIT: 'customUnit',
TIME: 'time',
},
STATUS: {
PENDING: 'Pending',
Expand All @@ -1764,7 +1765,11 @@ const CONST = {
ALLOW: 'personal',
},
},

TIME_TRACKING: {
UNIT: {
HOUR: 'h',
},
},
MCC_GROUPS: {
AIRLINES: 'Airlines',
COMMUTER: 'Commuter',
Expand Down
2 changes: 2 additions & 0 deletions src/libs/DebugUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1151,6 +1152,7 @@ function validateTransactionDraftProperty(key: keyof Transaction, value: string)
splitExpenses: 'array',
isDemoTransaction: 'boolean',
splitExpensesTotal: 'number',
units: 'object',
splitsStartDate: 'string',
splitsEndDate: 'string',
});
Expand Down
12 changes: 12 additions & 0 deletions src/types/onyx/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ type Comment = {
/** Type of the transaction */
type?: ValueOf<typeof CONST.TRANSACTION.TYPE>;

/** 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<typeof CONST.TIME_TRACKING.UNIT>;
};

/** In custom unit transactions this holds the information of the custom unit */
customUnit?: TransactionCustomUnit;

Expand Down
Loading