-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added overtimecarry model and api request
- Loading branch information
Showing
5 changed files
with
47 additions
and
0 deletions.
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
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,16 @@ | ||
import { faker } from "@faker-js/faker"; | ||
import { OvertimecarryRow } from "./overtimecarry.js"; | ||
|
||
export const createOvertimecarryMocks = ({ | ||
count = 1, | ||
usersId = 0, | ||
}: { count?: number; usersId?: number } = {}) => { | ||
return Array.from({ length: count }, (): OvertimecarryRow => { | ||
return { | ||
usersId, | ||
year: faker.datatype.number({ min: 1900, max: 2024 }), | ||
note: faker.datatype.boolean() ? faker.lorem.sentences(2) : null, | ||
hours: faker.datatype.number({ min: 0, max: 100 }), | ||
}; | ||
}); | ||
}; |
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,12 @@ | ||
export type OvertimecarryRow = { | ||
/** The related employee's ID */ | ||
usersId: number; | ||
/** | ||
* Year for which the overtime carryover applies | ||
* Format YYYY | ||
*/ | ||
year: number; | ||
/** Number of hours */ | ||
hours: number; | ||
note: string | null; | ||
}; |