diff --git a/package.json b/package.json index e7682ec6..43f40154 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@timetac/js-client-library", - "version": "2.102.0", + "version": "0.0.1-beta-work-schedules-featurebranch", "description": "TimeTac API JS client library", "homepage": "https://github.com/TimeTac/js-client-library#readme", "repository": { diff --git a/src/userTemplateHistory/index.ts b/src/userTemplateHistory/index.ts index ab8211bd..f93f1055 100644 --- a/src/userTemplateHistory/index.ts +++ b/src/userTemplateHistory/index.ts @@ -13,4 +13,9 @@ export class UserTemplateHistoryEndpoint extends BaseApi { const response = this._get('view', { params }); return list(response); } + + public readHistory(params?: RequestParams>): Promise[]>> { + const response = this._get('read', { params }); + return list(response); + } } diff --git a/src/users/types.ts b/src/users/types.ts index 477125ae..629e7af2 100644 --- a/src/users/types.ts +++ b/src/users/types.ts @@ -123,6 +123,7 @@ export interface UserReadMe extends UserReadFull { export interface UserUpdate extends Partial { id: number; department_id?: number; + timesheet_template_id?: number; } export interface UserResetPassword { diff --git a/src/workSchedules/index.ts b/src/workSchedules/index.ts index 79e8c91b..2d74ca53 100644 --- a/src/workSchedules/index.ts +++ b/src/workSchedules/index.ts @@ -19,4 +19,9 @@ export class WorkSchedulesEndpoint extends BaseApi { const response = this._put('update', data, params); return required(response); } + + public copy(data: { id: number }, params?: RequestParams>): Required[]> { + const response = this._post('copy', data, params); + return required(response); + } } diff --git a/src/workSchedules/types.ts b/src/workSchedules/types.ts index 457ad925..07397d21 100644 --- a/src/workSchedules/types.ts +++ b/src/workSchedules/types.ts @@ -21,6 +21,7 @@ export type WorkSchedule = { minijobber_absence_credit?: number; active: boolean; overtime_allowance_always_deduct?: number; + assigned_users?: string; }; export type WorkScheduleCreate = Omit< @@ -38,7 +39,7 @@ export type WorkScheduleCreate = Omit< | 'active' >; -export type WorkScheduleUpdate = Pick & +export type WorkScheduleUpdate = Pick & Omit< Partial, | 'archived' @@ -51,5 +52,4 @@ export type WorkScheduleUpdate = Pick & | 'law_rest_period_minimum_hours' | 'law_rest_period_minimum_weekly_hours' | 'is_default' - | 'active' >;