import { type LumpsumService } from "./lumpsumService.js"; import { type Project } from "./project.js"; export declare enum EntryType { Time = 1, LumpsumValue = 2, LumpsumService = 3 } export declare enum Billability { NotBillable = 0, Billable = 1, Billed = 2 } export type TimeEntryBillability = Billability.NotBillable | Billability.Billable | Billability.Billed; export type ClockingTimeEntryBillability = Billability.NotBillable | Billability.Billable; export type LumpsumEntryBillability = Billability.Billable | Billability.Billed; type CommonEntry = { id: number; customersId: number; projectsId: number | null; usersId: number; textsId: number | null; text: string | null; timeSince: string; timeInsert: string; timeLastChange: string; }; export type TimeEntry = CommonEntry & { type: EntryType.Time; servicesId: number; /** Will be null if clocked is false */ timeClockedSince: string | null; timeUntil: string | null; timeLastChangeWorkTime: string; billable: TimeEntryBillability; duration: number | null; /** Only present if the duration is not linked to timeSince and timeUntil */ offset?: number; clocked: boolean; clockedOffline: boolean; /** Only present with sufficient access rights */ hourlyRate?: number; }; export type ClockingTimeEntry = TimeEntry & { timeUntil: null; timeClockedSince: string; clocked: true; }; export type ClockedTimeEntry = TimeEntry & { timeUntil: string; timeClockedSince: string; clocked: true; }; export type ClockTimeEntry = ClockingTimeEntry | ClockedTimeEntry; export type FinishedTimeEntry = ClockedTimeEntry | ManualTimeEntry; export type ManualTimeEntry = TimeEntry & { timeUntil: string; timeClockedSince: null; clocked: false; clockedOffline: false; }; export type LumpsumValueEntry = CommonEntry & { type: EntryType.LumpsumValue; timeUntil: string; billable: LumpsumEntryBillability; servicesId: number; lumpsum: number; }; export type LumpsumServiceEntry = CommonEntry & { type: EntryType.LumpsumService; timeUntil: string; billable: LumpsumEntryBillability; lumpsumServicesId: number; lumpsumServicesAmount: number; }; export type LumpsumEntry = LumpsumValueEntry | LumpsumServiceEntry; export type Entry = TimeEntry | LumpsumEntry; export declare const isClockingTimeEntry: (entry: Entry) => entry is ClockingTimeEntry; export declare const isClockedTimeEntry: (entry: Entry) => entry is ClockedTimeEntry; export declare const isClockTimeEntry: (entry: Entry) => entry is ClockTimeEntry; export declare const isManualTimeEntry: (entry: Entry) => entry is ManualTimeEntry; export declare const isFinishedTimeEntry: (entry: Entry) => entry is FinishedTimeEntry; export declare const isTimeEntry: (entry: Entry) => entry is TimeEntry; export declare const isLumpsumEntry: (entry: Entry) => entry is LumpsumEntry; /** * Returns the entry's timeUntil property as ISO string. If the entry is * currently clocking, timeUntil is new Date().toISOString() without * milliseconds precision. */ export declare const getEntryTimeUntilNow: (entry: Entry) => string; /** * Returns the entry's duration in seconds. In case the entry is currently * clocking, the duration will be from timeSince until now. */ export declare const getEntryDurationUntilNow: (entry: Entry) => number; /** * Calculates the entry's revenue based on the hourly rate and the project's * revenue factor or the amount and lumpsum service price. * * Returns undefined if the entry or project did not contain enough information * to calculate the revenue (because of insufficient access rights). * * Throws an error if the provided project or lumpsum service does not match the * entry. */ export declare const getEntryRevenue: ({ entry, project, lumpsumService, }: { entry: Entry; project?: Project; lumpsumService?: LumpsumService; }) => number | undefined; export {}; //# sourceMappingURL=entry.d.ts.map