mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-11-30 22:45:46 +01:00
removed notes as user attribute
This commit is contained in:
@@ -73,7 +73,6 @@ export const createEmployee = async (req: AuthRequest, res: Response): Promise<v
|
||||
role,
|
||||
employeeType,
|
||||
isSufficientlyIndependent,
|
||||
notes
|
||||
} = req.body as CreateEmployeeRequest;
|
||||
|
||||
// Validierung
|
||||
@@ -107,8 +106,8 @@ export const createEmployee = async (req: AuthRequest, res: Response): Promise<v
|
||||
await db.run(
|
||||
`INSERT INTO users (
|
||||
id, email, password, name, role, employee_type, is_sufficiently_independent,
|
||||
notes, is_active
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
is_active
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
[
|
||||
employeeId,
|
||||
email,
|
||||
@@ -117,7 +116,6 @@ export const createEmployee = async (req: AuthRequest, res: Response): Promise<v
|
||||
role,
|
||||
employeeType,
|
||||
isSufficientlyIndependent ? 1 : 0,
|
||||
notes || null,
|
||||
1
|
||||
]
|
||||
);
|
||||
@@ -128,7 +126,7 @@ export const createEmployee = async (req: AuthRequest, res: Response): Promise<v
|
||||
id, email, name, role, is_active as isActive,
|
||||
employee_type as employeeType,
|
||||
is_sufficiently_independent as isSufficientlyIndependent,
|
||||
notes, created_at as createdAt,
|
||||
created_at as createdAt,
|
||||
last_login as lastLogin
|
||||
FROM users
|
||||
WHERE id = ?
|
||||
|
||||
@@ -8,7 +8,8 @@ CREATE TABLE IF NOT EXISTS users (
|
||||
employee_type TEXT CHECK(employee_type IN ('chef', 'neuling', 'erfahren')),
|
||||
is_sufficiently_independent BOOLEAN DEFAULT FALSE,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
last_login DATETIME
|
||||
);
|
||||
|
||||
-- Tabelle für Schichtvorlagen
|
||||
|
||||
@@ -7,7 +7,6 @@ export interface Employee {
|
||||
employeeType: 'chef' | 'neuling' | 'erfahren';
|
||||
isSufficientlyIndependent: boolean;
|
||||
isActive: boolean;
|
||||
notes?: string;
|
||||
createdAt: string;
|
||||
lastLogin?: string | null;
|
||||
}
|
||||
@@ -19,7 +18,6 @@ export interface CreateEmployeeRequest {
|
||||
role: 'admin' | 'instandhalter' | 'user';
|
||||
employeeType: 'chef' | 'neuling' | 'erfahren';
|
||||
isSufficientlyIndependent: boolean;
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export interface UpdateEmployeeRequest {
|
||||
@@ -28,7 +26,6 @@ export interface UpdateEmployeeRequest {
|
||||
employeeType?: 'chef' | 'neuling' | 'erfahren';
|
||||
isSufficientlyIndependent?: boolean;
|
||||
isActive?: boolean;
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export interface EmployeeWithPassword extends Employee {
|
||||
|
||||
Reference in New Issue
Block a user