feat(preferences): added display options to preferences table

This commit is contained in:
Matthieu Haineault 2025-10-14 09:33:29 -04:00
parent 2f0982c952
commit 5292f1af11
4 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,4 @@
-- AlterTable
ALTER TABLE "preferences" ADD COLUMN "employee_list_display" INTEGER NOT NULL DEFAULT 0,
ADD COLUMN "timesheet_display" INTEGER NOT NULL DEFAULT 0,
ADD COLUMN "validation_display" INTEGER NOT NULL DEFAULT 0;

View File

@ -381,6 +381,10 @@ model Preferences {
lang_switch Int @default(0)
lefty_mode Int @default(0)
employee_list_display Int @default(0)
validation_display Int @default(0)
timesheet_display Int @default(0)
@@map("preferences")
}

View File

@ -13,4 +13,13 @@ export class PreferencesDto {
@IsInt()
lefty_mode: number;
@IsInt()
employee_list_display: number;
@IsInt()
validation_display: number;
@IsInt()
timesheet_display: number;
}

View File

@ -1,4 +1,4 @@
import { Injectable, NotFoundException } from "@nestjs/common";
import { Injectable } from "@nestjs/common";
import { Preferences } from "@prisma/client";
import { PrismaService } from "src/prisma/prisma.service";
import { PreferencesDto } from "../dtos/preferences.dto";
@ -20,6 +20,9 @@ export class PreferencesService {
dark_mode: dto.dark_mode,
lang_switch: dto.lang_switch,
lefty_mode: dto.lefty_mode,
employee_list_display: dto.employee_list_display,
validation_display: dto.validation_display,
timesheet_display: dto.timesheet_display,
},
include: { user: true },
});