-
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.
Merge branch 'main' into add-surcharge-model
- Loading branch information
Showing
12 changed files
with
256 additions
and
121 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,21 @@ | ||
import { faker } from "@faker-js/faker"; | ||
import { HolidayscarryRow } from "./holidayscarry.js"; | ||
|
||
type Options = { | ||
count?: number; | ||
yearMinMax?: [number, number]; | ||
}; | ||
|
||
export const createHolidayscarryMocks = ({ | ||
count = 1, | ||
yearMinMax = [1900, 2024], | ||
}: Options = {}) => { | ||
return Array.from({ length: count }, (): HolidayscarryRow => { | ||
return { | ||
usersId: 0, | ||
year: faker.datatype.number({ min: yearMinMax[0], max: yearMinMax[1] }), | ||
note: faker.datatype.boolean() ? faker.lorem.sentences(2) : null, | ||
count: 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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
export type HolidayscarryRow = { | ||
/** The related employee's ID */ | ||
usersId: number; | ||
/** | ||
* Year for which the holiday carryover applies | ||
*/ | ||
year: number; | ||
/** Day count */ | ||
count: number; | ||
note: string | null; | ||
}; |
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,35 @@ | ||
import { faker } from "@faker-js/faker"; | ||
import { HolidaysquotaRow } from "./holidaysquota.js"; | ||
|
||
type Options = { | ||
count?: number; | ||
yearSinceMinMax?: [number, number]; | ||
yearUntilMinMax?: [number, number]; | ||
}; | ||
|
||
export const createHolidaysquotaMocks = ({ | ||
count = 1, | ||
yearSinceMinMax = [2020, 2021], | ||
yearUntilMinMax = [2021, 2022], | ||
}: Options = {}) => { | ||
return Array.from({ length: count }, (_, index): HolidaysquotaRow => { | ||
const id = index; | ||
|
||
return { | ||
id, | ||
usersId: 0, | ||
yearSince: faker.datatype.number({ | ||
min: yearSinceMinMax[0], | ||
max: yearSinceMinMax[1], | ||
}), | ||
yearUntil: faker.datatype.boolean() | ||
? faker.datatype.number({ | ||
min: yearUntilMinMax[0], | ||
max: yearUntilMinMax[1], | ||
}) | ||
: null, | ||
note: faker.datatype.boolean() ? faker.lorem.sentences(2) : null, | ||
count: 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
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,10 @@ | ||
import { faker } from "@faker-js/faker"; | ||
import { Team } from "./team.js"; | ||
|
||
export const createTeamMocks = ({ count = 1 }: { count?: number }) => | ||
Array.from({ length: count }, (_, index): Team => { | ||
return { | ||
id: index, | ||
name: faker.name.jobArea() + " Team", | ||
}; | ||
}); |
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