diff --git a/package.json b/package.json index e7682ec6..07f9b98c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@timetac/js-client-library", - "version": "2.102.0", + "version": "2.98.0-paid-breaks-beta-3", "description": "TimeTac API JS client library", "homepage": "https://github.com/TimeTac/js-client-library#readme", "repository": { diff --git a/src/index.ts b/src/index.ts index e994eb54..f227fa5c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -79,6 +79,7 @@ import { WorkingTimeCyclesEndpoint } from './workingTimeCycles'; import { TimeTrackingChangelogsEndPoint } from './timeTrackingChangelogs'; import { UserPreferencesEndpoint } from './userPreferences'; import { CalculationStatesEndpoint } from './calculationStates'; +import { PaidBreaksHistoryEndpoint } from './paidBreaksHistory'; import { OtherPaidLeaveLimitationsEndpoint } from './otherPaidLeaveLimitations'; export { AbsenceBan } from './absenceBans/types'; @@ -217,8 +218,8 @@ export { UserEvent, UserEventCreate } from './userEvents/types'; export { CalculationStates } from './calculationStates/types'; export * from './workingTimeBalanceRules/types'; export * from './workingTimeCycles/types'; - export * from './timeTrackingChangelogs/types'; +export * from './paidBreaksHistory/types'; const DEFAULT_HOST = 'api.timetac.com'; @@ -318,6 +319,7 @@ export default class Api { public workingTimeCycles: WorkingTimeCyclesEndpoint; public userPreferences: UserPreferencesEndpoint; public calculationStates: CalculationStatesEndpoint; + public paidBreaksHistory: PaidBreaksHistoryEndpoint; public otherPaidLeaveLimitations: OtherPaidLeaveLimitationsEndpoint; constructor(config: ApiConfig) { @@ -413,6 +415,8 @@ export default class Api { this.holidayAdjustment = new HolidayAdjustmentEndpoint(this.config); this.hourTypes = new HourTypesEndpoint(this.config); + this.paidBreaksHistory = new PaidBreaksHistoryEndpoint(this.config); + useInterceptors({ state: this.state, config: this.config, authentication: this.authentication }); } diff --git a/src/paidBreaksHistory/index.ts b/src/paidBreaksHistory/index.ts new file mode 100644 index 00000000..7918c261 --- /dev/null +++ b/src/paidBreaksHistory/index.ts @@ -0,0 +1,8 @@ +import BaseApi from '../baseApi'; + +const resourceName = 'paidBreaksHistory'; +type ResourceName = typeof resourceName; + +export class PaidBreaksHistoryEndpoint extends BaseApi { + public readonly resourceName = resourceName; +} diff --git a/src/paidBreaksHistory/types.ts b/src/paidBreaksHistory/types.ts new file mode 100644 index 00000000..fc5de361 --- /dev/null +++ b/src/paidBreaksHistory/types.ts @@ -0,0 +1,7 @@ +export type PaidBreaksHistory = { + id: number; + user_id: number; + quota_value: number; + valid_from: string; + created_at: string; +}; diff --git a/src/timesheetAccountings/types.ts b/src/timesheetAccountings/types.ts index a4bd8c95..9c2f7042 100644 --- a/src/timesheetAccountings/types.ts +++ b/src/timesheetAccountings/types.ts @@ -125,6 +125,10 @@ export type TimesheetAccounting = { rest_period_violation: boolean; rest_period_weekly_violation: boolean; plausibility_conflict_violation: boolean; + paid_break?: number; + unpaid_break?: number; + paid_break_details?: string; + unpaid_break_details?: string; }; export type TimesheetAccountingApproveRequest = { diff --git a/src/users/types.ts b/src/users/types.ts index 477125ae..dcb77425 100644 --- a/src/users/types.ts +++ b/src/users/types.ts @@ -99,6 +99,8 @@ export type UserReadFull = UserReadObscured & { overtime__all_inc_ov_hours_per_cycle_valid_starting_from: string; overtime_allowance_clear_working_time_saldo_valid_starting_from: string; working_time_balance_rule_cycle_id?: number; + paid_break_day_quota_in_minutes?: number; + paid_break_day_quota_valid_from?: string; }; export type UserRead = UserReadFull | UserReadObscured; diff --git a/src/utils/response/apiResponse.ts b/src/utils/response/apiResponse.ts index b9fa3816..e465a8f4 100644 --- a/src/utils/response/apiResponse.ts +++ b/src/utils/response/apiResponse.ts @@ -71,6 +71,7 @@ import { WorkingTimeCycle } from '../../workingTimeCycles/types'; import { TimeTrackingChangelogs } from '../../timeTrackingChangelogs/types'; import { UserPreferenceRead } from '../../userPreferences/types'; import { CalculationStates } from '../../calculationStates/types'; +import { PaidBreaksHistory } from '../../paidBreaksHistory/types'; import { OtherPaidLeaveLimitation } from '../../otherPaidLeaveLimitations/types'; // Because types cannot be iterated at runtime, we add the keys of Resources here as a value @@ -123,6 +124,7 @@ export const resourceNameArray = [ 'workSchedules', 'workScheduleDays', 'workScheduleDayDefinitions', + 'paidBreaksHistory', 'publicHolidayTemplates', 'publicHolidays', 'userRoles', @@ -246,6 +248,7 @@ export interface Resources { workingTimeCycles: WorkingTimeCycle; userPreferences: UserPreferenceRead; calculationStates: CalculationStates; + paidBreaksHistory: PaidBreaksHistory; otherPaidLeaveLimitations: OtherPaidLeaveLimitation; }