Function: resolveTimeEntryOverlaps()
function resolveTimeEntryOverlaps(existingTimeEntries, newTimeEntry): { adjustedTimeEntries: | { active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; }[] | null; overlappingTimeEntries: { active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; }[];};Defined in: shared/src/helper/workHelper/resolveTimeEntryOverlaps.ts:11
Filters out existing time entries that overlap with the new time entry. If there are no collisions, returns the new session as is. If there are collisions, adjusts the session to fit the collisions.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
existingTimeEntries | { active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; }[] | Existing time entries |
newTimeEntry | { active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; } | New time entry |
newTimeEntry.active_seconds | number | - |
newTimeEntry.created_at | string | - |
newTimeEntry.currency | | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF" | - |
newTimeEntry.end_time | string | - |
newTimeEntry.hourly_payment | boolean | - |
newTimeEntry.id | string | - |
newTimeEntry.memo | string | null | - |
newTimeEntry.paid | boolean | - |
newTimeEntry.payout_id | string | null | - |
newTimeEntry.salary | number | - |
newTimeEntry.start_time | string | - |
newTimeEntry.time_fragments_interval | number | null | - |
newTimeEntry.user_id | string | - |
newTimeEntry.work_project_id | string | - |
Returns
Section titled “Returns”{ adjustedTimeEntries: | { active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; }[] | null; overlappingTimeEntries: { active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; }[];}Adjusted session Array and overlapping sessions
| Name | Type | Defined in |
|---|---|---|
adjustedTimeEntries | | { active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; }[] | null | shared/src/helper/workHelper/resolveTimeEntryOverlaps.ts:15 |
overlappingTimeEntries | { active_seconds: number; created_at: string; currency: | "USD" | "EUR" | "GBP" | "CAD" | "AUD" | "JPY" | "CHF" | "CNY" | "INR" | "BRL" | "VEF"; end_time: string; hourly_payment: boolean; id: string; memo: string | null; paid: boolean; payout_id: string | null; salary: number; start_time: string; time_fragments_interval: number | null; user_id: string; work_project_id: string; }[] | shared/src/helper/workHelper/resolveTimeEntryOverlaps.ts:16 |