Skip to content

Commit

Permalink
feat: expand change request return type
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclickbits committed Mar 22, 2023
1 parent 3ea445f commit d337cc3
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions src/clockodo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -986,11 +986,26 @@ export type WorkTimesChangeRequestsParams = ParamsWithPage & {
export type WorkTimesChangeRequestsReturnType = ResponseWithPaging & {
changeRequests: Array<WorkTimeChangeRequest>;
};
export type AddWorkTimesChangeRequestReturnType = {
changeRequest: WorkTimeChangeRequest;
/**
* Will be set in case the given work time change request replaced a previous one.
* This is because on a certain day there can only be one change request per user.
**/
replacedChangeRequest: null | WorkTimeChangeRequest;
};
export type AddWorkTimesChangeRequestReturnType =
| {
changeRequest: WorkTimeChangeRequest;
/**
* Will be set in case the given work time change request replaced a previous one.
* This is because on a certain day there can only be one change request per user.
**/
replacedChangeRequest: null | WorkTimeChangeRequest;
}
| {
/**
* Is null if the change request was immediately approved (because the rights imply no need for approval)
**/
changeRequest: null;
/**
* Is true if the change request was immediately approved (because the rights imply no need for approval)
**/
approvedImmediately: true;
/**
* Is null if the change request was immediately approved (because the rights imply no need for approval)
**/
replacedChangeRequest: null;
};

0 comments on commit d337cc3

Please sign in to comment.