Skip to content

Commit

Permalink
feat: Add boss reference to user model
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnns authored Jul 10, 2023
2 parents c68c3ea + dcc7e15 commit aa66df7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/models/user.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { User, UserRole, UserLanguage, WorkTimeEditLock } from "./user.js";
export const createUserMocks = ({
count = 1,
workTimeEditLockDays = 0,
boss,
}: {
count?: number;
workTimeEditLockDays?: WorkTimeEditLock;
boss?: number;
}) =>
Array.from({ length: count }, (_, index): User => {
const userId = index;
Expand Down Expand Up @@ -34,5 +36,6 @@ export const createUserMocks = ({
editLockSync: faker.datatype.boolean(),
nonbusinessgroupsId: null,
workTimeEditLockDays,
boss: boss ?? null,
};
});
4 changes: 4 additions & 0 deletions src/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export type User = {
* The values for "no work time edit lock" and "clock only" are explicitly modelled
*/
workTimeEditLockDays: WorkTimeEditLock;
/**
* The user's team leader's / boss' id
*/
boss: number | null;
};

export enum UserRole {
Expand Down

0 comments on commit aa66df7

Please sign in to comment.