export enum TimeTrackingEntrySource {
    DAY_CHANGE = 'DAY_CHANGE',
    AUTO_CLOSE = 'AUTO_CLOSE',
    APP = 'APP',
    KIOSK = 'KIOSK',
    MANUAL = 'MANUAL',
    INTEGRATION = 'INTEGRATION',
    WEB = 'WEB',
    /**
     * @deprecated This constant is deprecated. Use other sources if applicable.
     */
    USER = 'USER',
}

export const isUserGeneratedSource = (source: TimeTrackingEntrySource): boolean => {
    const userSources = new Set([
        TimeTrackingEntrySource.APP,
        TimeTrackingEntrySource.KIOSK,
        TimeTrackingEntrySource.MANUAL,
        TimeTrackingEntrySource.INTEGRATION,
        TimeTrackingEntrySource.WEB,
        TimeTrackingEntrySource.USER,
    ]);
    return userSources.has(source);
};

export const isSourceAutoClosed = (source: TimeTrackingEntrySource): boolean => {
    return source === TimeTrackingEntrySource.AUTO_CLOSE;
};

export const isSourceDayChange = (source: TimeTrackingEntrySource): boolean => {
    return source === TimeTrackingEntrySource.DAY_CHANGE;
};
