-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: feat: added api call for getting breakrules #141
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { NonbusinessGroup } from "./models/nonbusinessGroup.js"; | ||
import { WorktimeRegulation } from "./models/worktimeRegulation.js"; | ||
import { | ||
WorktimeRegulation, | ||
WorktimeRegulationWithRules, | ||
} from "./models/worktimeRegulation.js"; | ||
import { Absence } from "./models/absence.js"; | ||
import { Customer } from "./models/customer.js"; | ||
import { | ||
|
@@ -44,6 +47,7 @@ import { | |
import { OvertimecarryRow } from "./models/overtimecarry.js"; | ||
import { HolidaysquotaRow } from "./models/holidaysquota.js"; | ||
import { HolidayscarryRow } from "./models/holidayscarry.js"; | ||
import { WorktimeBreakRule } from "./models/worktimeBreakRule.js"; | ||
|
||
export class Clockodo { | ||
api: Api; | ||
|
@@ -857,6 +861,18 @@ export class Clockodo { | |
): Promise<HolidayscarryRowReturnType> { | ||
return this.api.get("/holidayscarry", params); | ||
} | ||
|
||
async getWorktimeRegulations( | ||
params?: Params | ||
): Promise<WorktimeRegulationsReturnType> { | ||
return this.api.get("/v2/worktimeRegulations", params); | ||
} | ||
|
||
async getWorktimeBreakRules( | ||
params?: Params | ||
): Promise<WorktimeBreakRulesReturnType> { | ||
return this.api.get("/v2/worktimeBreakRules", params); | ||
} | ||
} | ||
|
||
export type AbsenceReturnType = { absence: Absence }; | ||
|
@@ -1054,7 +1070,7 @@ export type NonbusinessDaysReturnType = { | |
export type AggregatesUsersMeReturnType = { | ||
user: User; | ||
company: Company; | ||
worktimeRegulation: WorktimeRegulation; | ||
worktimeRegulation: WorktimeRegulationWithRules; | ||
}; | ||
export type ClockReturnType = { | ||
/** The currently running entry */ | ||
|
@@ -1190,3 +1206,12 @@ export type HolidayscarryRowParams = { | |
/** The year to which the data should be restricted to */ | ||
year?: number; | ||
}; | ||
|
||
/** The user ID by which the overtime carry rows should be filtered */ | ||
export type WorktimeRegulationsReturnType = { | ||
worktimeRegulations: Array<WorktimeRegulation>; | ||
}; | ||
|
||
export type WorktimeBreakRulesReturnType = { | ||
worktimeBreakRules: Array<WorktimeBreakRule>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. data |
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export type WorktimeBreakRule = { | ||
/** ID of the break rule */ | ||
id: number; | ||
/** ID of the corresponding worktime regulation */ | ||
worktimeRegulationsId: number; | ||
/** Daily worktime (in hours), above which the rule applies */ | ||
worktime: number; | ||
/** Required total break time */ | ||
breakSum: number; | ||
/** | ||
* Contains the break splitting options as key-value pair. | ||
* The key represents the number of breaks into which the required time may be split, the value contains the minimum length of a single break (in minutes) | ||
**/ | ||
splitting: { | ||
/** Only one break */ | ||
"1"?: number; | ||
/** At least one break */ | ||
"1+"?: number; | ||
/** Two breaks */ | ||
"2"?: number; | ||
/** Three breaks */ | ||
"3"?: number; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workTimeBreakRules