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
8 changes: 8 additions & 0 deletions src/annualHoursHistory/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import BaseApi from '../baseApi';

const resourceName = 'annualHoursHistory';
type ResourceName = typeof resourceName;

export class AnnualHoursHistoryEndpoint extends BaseApi<ResourceName> {
public readonly resourceName = resourceName;
}
7 changes: 7 additions & 0 deletions src/annualHoursHistory/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export type AnnualHoursHistory = {
id: number;
user_id: number;
quota_value: number;
valid_from: string;
created_at: string;
};
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import { TimeTrackingChangelogsEndPoint } from './timeTrackingChangelogs';
import { UserPreferencesEndpoint } from './userPreferences';
import { CalculationStatesEndpoint } from './calculationStates';
import { PaidBreaksHistoryEndpoint } from './paidBreaksHistory';
import { AnnualHoursHistoryEndpoint } from './annualHoursHistory';
import { OtherPaidLeaveLimitationsEndpoint } from './otherPaidLeaveLimitations';
import { UserHistoryEndpoint } from './userHistory';

Expand Down Expand Up @@ -222,6 +223,7 @@ export * from './workingTimeBalanceRules/types';
export * from './workingTimeCycles/types';
export * from './timeTrackingChangelogs/types';
export * from './paidBreaksHistory/types';
export * from './annualHoursHistory/types';

const DEFAULT_HOST = 'api.timetac.com';

Expand Down Expand Up @@ -323,6 +325,7 @@ export default class Api {
public userPreferences: UserPreferencesEndpoint;
public calculationStates: CalculationStatesEndpoint;
public paidBreaksHistory: PaidBreaksHistoryEndpoint;
public annualHoursHistory: AnnualHoursHistoryEndpoint;
public otherPaidLeaveLimitations: OtherPaidLeaveLimitationsEndpoint;

constructor(config: ApiConfig) {
Expand Down Expand Up @@ -420,6 +423,7 @@ export default class Api {
this.holidayAdjustment = new HolidayAdjustmentEndpoint(this.config);
this.hourTypes = new HourTypesEndpoint(this.config);
this.paidBreaksHistory = new PaidBreaksHistoryEndpoint(this.config);
this.annualHoursHistory = new AnnualHoursHistoryEndpoint(this.config);

useInterceptors({ state: this.state, config: this.config, authentication: this.authentication });
}
Expand Down
2 changes: 2 additions & 0 deletions src/timesheetAccountings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export type TimesheetAccounting = {
unpaid_break?: number;
paid_break_details?: string;
unpaid_break_details?: string;
target_annual_hours?: number;
annual_hours_balance?: number;
};

export type TimesheetAccountingApproveRequest = {
Expand Down
2 changes: 2 additions & 0 deletions src/users/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export type UserReadFull = UserReadObscured & {
working_time_balance_rule_cycle_id?: number;
paid_break_day_quota_in_minutes?: number;
paid_break_day_quota_valid_from?: string;
annual_hours_per_year?: number;
annual_hours_valid_from?: string;
};

export type UserRead = UserReadFull | UserReadObscured;
Expand Down
3 changes: 3 additions & 0 deletions src/utils/response/apiResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import { TimeTrackingChangelogs } from '../../timeTrackingChangelogs/types';
import { UserPreferenceRead } from '../../userPreferences/types';
import { CalculationStates } from '../../calculationStates/types';
import { PaidBreaksHistory } from '../../paidBreaksHistory/types';
import { AnnualHoursHistory } from '../../annualHoursHistory/types';
import { OtherPaidLeaveLimitation } from '../../otherPaidLeaveLimitations/types';
import { UserHistoryEntry } from '../../userHistory/types';

Expand Down Expand Up @@ -127,6 +128,7 @@ export const resourceNameArray = [
'workScheduleDays',
'workScheduleDayDefinitions',
'paidBreaksHistory',
'annualHoursHistory',
'publicHolidayTemplates',
'publicHolidays',
'userRoles',
Expand Down Expand Up @@ -252,6 +254,7 @@ export interface Resources {
userPreferences: UserPreferenceRead;
calculationStates: CalculationStates;
paidBreaksHistory: PaidBreaksHistory;
annualHoursHistory: AnnualHoursHistory;
otherPaidLeaveLimitations: OtherPaidLeaveLimitation;
}

Expand Down
Loading