Skip to content

Commit

Permalink
rename OvertimeCarry to OvertimeCarryover
Browse files Browse the repository at this point in the history
  • Loading branch information
dsumer committed Nov 10, 2023
1 parent 50157e9 commit ca04f9d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/clockodo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,13 @@ describe("Clockodo (instance)", () => {
});
});

describe("getOvertimecarry()", () => {
it("correctly builds getOvertimecarry() request", async () => {
describe("getOvertimeCarryovers()", () => {
it("correctly builds getOvertimeCarryovers() request", async () => {
const nockScope = nock(CLOCKODO_API)
.get("/overtimecarry?users_id=17&year=2028")
.reply(200, {});

await clockodo.getOvertimeCarry({ usersId: 17, year: 2028 });
await clockodo.getOvertimeCarryovers({ usersId: 17, year: 2028 });

nockScope.done();
});
Expand Down
14 changes: 7 additions & 7 deletions src/clockodo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
WorkTimeChangeRequestStatus,
WorkTimeDay,
} from "./models/workTimes.js";
import { OvertimeCarry } from "./models/overtimeCarry.js";
import { OvertimeCarryover } from "./models/overtimeCarryover.js";
import { HolidaysquotaRow } from "./models/holidaysquota.js";
import { HolidayscarryRow } from "./models/holidayscarry.js";
import { OvertimeReduction } from "./models/overtimeReduction.js";
Expand Down Expand Up @@ -841,9 +841,9 @@ export class Clockodo {
);
}

async getOvertimeCarry(
params?: Params<OvertimeCarryParams>
): Promise<OvertimeCarryReturnType> {
async getOvertimeCarryovers(
params?: Params<OvertimeCarryoversParams>
): Promise<OvertimeCarryoverReturnType> {
return this.api.get("/overtimecarry", params);
}

Expand Down Expand Up @@ -1170,10 +1170,10 @@ export type AddWorkTimesChangeRequestReturnType =
replacedChangeRequest: null;
};

export type OvertimeCarryReturnType = {
overtimecarry: Array<OvertimeCarry>;
export type OvertimeCarryoverReturnType = {
overtimecarry: Array<OvertimeCarryover>;
};
export type OvertimeCarryParams = {
export type OvertimeCarryoversParams = {
/** The user ID by which the overtime carry rows should be filtered */
usersId?: number;
/** The year to which the data should be restricted to */
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export * from "./models/holidaysquota.js";
export * from "./models/lumpsumService.js";
export * from "./models/nonbusinessDay.js";
export * from "./models/nonbusinessGroup.js";
export * from "./models/overtimeCarry.js";
export * from "./models/overtimeCarryover.js";
export * from "./models/overtimeReduction.js";
export * from "./models/project.js";
export * from "./models/service.js";
Expand Down
2 changes: 1 addition & 1 deletion src/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export * from "./models/holidaysquota.mocks.js";
export * from "./models/lumpsumService.mocks.js";
export * from "./models/service.mocks.js";
export * from "./models/nonbusinessDay.mocks.js";
export * from "./models/overtimeCarry.mocks.js";
export * from "./models/overtimeCarryover.mocks.js";
export * from "./models/overtimeReduction.mocks.js";
export * from "./models/project.mocks.js";
// export * from "./models/service.mocks.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { faker } from "@faker-js/faker";
import { OvertimeCarry } from "./overtimeCarry.js";
import { OvertimeCarryover } from "./overtimeCarryover.js";

type Options = {
count?: number;
hoursMinMax?: [number, number];
yearMinMax?: [number, number];
};

export const createOvertimeCarryMocks = ({
export const createOvertimeCarryoverMocks = ({
count = 1,
hoursMinMax = [0, 100],
yearMinMax = [1900, 2024],
}: Options = {}) => {
return Array.from({ length: count }, (): OvertimeCarry => {
return Array.from({ length: count }, (): OvertimeCarryover => {
return {
usersId: 0,
year: faker.datatype.number({ min: yearMinMax[0], max: yearMinMax[1] }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type OvertimeCarry = {
export type OvertimeCarryover = {
/** The related employee's ID */
usersId: number;
/**
Expand Down

0 comments on commit ca04f9d

Please sign in to comment.