Initial commit
Dieser Commit ist enthalten in:
120
shared/index.d.ts
vendored
Normale Datei
120
shared/index.d.ts
vendored
Normale Datei
@ -0,0 +1,120 @@
|
||||
// Shared types used by backend and admin-panel
|
||||
|
||||
export type UserRole = 'admin' | 'superuser' | 'user'
|
||||
|
||||
export interface User {
|
||||
id: string
|
||||
username: string
|
||||
email: string
|
||||
role: UserRole
|
||||
employeeId?: string | null
|
||||
lastLogin?: Date | null
|
||||
isActive: boolean
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
|
||||
export interface Skill {
|
||||
id: string
|
||||
name: string
|
||||
category?: string | null
|
||||
level?: string | null
|
||||
verified?: boolean
|
||||
verifiedBy?: string | null
|
||||
verifiedDate?: Date | null
|
||||
}
|
||||
|
||||
export interface LanguageSkill {
|
||||
code: string
|
||||
level: 'basic' | 'fluent' | 'native' | 'business'
|
||||
certified?: boolean
|
||||
certificateType?: string | null
|
||||
isNative?: boolean
|
||||
canInterpret?: boolean
|
||||
}
|
||||
|
||||
export interface Clearance {
|
||||
level: string
|
||||
validUntil: Date
|
||||
issuedDate: Date
|
||||
}
|
||||
|
||||
export interface Employee {
|
||||
id: string
|
||||
firstName: string
|
||||
lastName: string
|
||||
employeeNumber: string
|
||||
photo?: string | null
|
||||
position: string
|
||||
department: string
|
||||
email?: string | null
|
||||
phone?: string | null
|
||||
mobile?: string | null
|
||||
office?: string | null
|
||||
availability: string
|
||||
skills?: Skill[]
|
||||
languages?: LanguageSkill[]
|
||||
clearance?: Clearance
|
||||
specializations?: string[]
|
||||
createdAt: Date | string
|
||||
updatedAt: Date | string
|
||||
createdBy?: string
|
||||
updatedBy?: string | null
|
||||
}
|
||||
|
||||
export interface SkillDefinition {
|
||||
id: string
|
||||
name: string
|
||||
category?: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
username?: string
|
||||
email?: string
|
||||
password: string
|
||||
}
|
||||
|
||||
export interface Token {
|
||||
accessToken: string
|
||||
expiresIn: number
|
||||
tokenType: 'Bearer'
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
user: User
|
||||
token: Token
|
||||
}
|
||||
|
||||
export const ROLE_PERMISSIONS: Record<UserRole, string[]>
|
||||
export const DEFAULT_SKILLS: Record<string, string[]>
|
||||
export const LANGUAGE_LEVELS: string[]
|
||||
export interface SkillLevel { id: string; name: string; level?: string }
|
||||
export interface SubCategory { id: string; name: string; skills: SkillLevel[] }
|
||||
export interface SkillCategory { id: string; name: string; subcategories: SubCategory[] }
|
||||
export const SKILL_HIERARCHY: SkillCategory[]
|
||||
|
||||
// Workspaces
|
||||
export type WorkspaceType = 'desk' | 'meeting_room' | 'phone_booth' | 'parking' | 'locker'
|
||||
|
||||
export interface Workspace {
|
||||
id: string
|
||||
name: string
|
||||
type: WorkspaceType
|
||||
floor: string
|
||||
building?: string | null
|
||||
capacity: number
|
||||
equipment: string[]
|
||||
position_x?: number | null
|
||||
position_y?: number | null
|
||||
is_active: boolean
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface WorkspaceFilter {
|
||||
type?: WorkspaceType
|
||||
floor?: string
|
||||
building?: string
|
||||
min_capacity?: number
|
||||
}
|
||||
65
shared/index.js
Normale Datei
65
shared/index.js
Normale Datei
@ -0,0 +1,65 @@
|
||||
// Runtime constants and helpers shared across projects
|
||||
|
||||
const ROLE_PERMISSIONS = {
|
||||
admin: [
|
||||
'admin:panel:access',
|
||||
'users:create',
|
||||
'users:read',
|
||||
'users:update',
|
||||
'users:delete',
|
||||
'employees:create',
|
||||
'settings:read',
|
||||
'settings:update',
|
||||
'employees:read',
|
||||
'employees:update',
|
||||
'skills:read',
|
||||
'skills:update'
|
||||
],
|
||||
superuser: [
|
||||
'admin:panel:access',
|
||||
'users:read',
|
||||
'employees:create',
|
||||
'employees:read',
|
||||
'employees:update',
|
||||
'skills:read',
|
||||
'skills:update'
|
||||
],
|
||||
user: [
|
||||
'employees:read',
|
||||
'skills:read'
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ROLE_PERMISSIONS,
|
||||
DEFAULT_SKILLS: {
|
||||
general: [
|
||||
'Teamarbeit',
|
||||
'Kommunikation',
|
||||
'Projektmanagement'
|
||||
],
|
||||
it: [
|
||||
'JavaScript',
|
||||
'TypeScript',
|
||||
'Node.js',
|
||||
'SQL'
|
||||
],
|
||||
certificates: [
|
||||
'Erste Hilfe',
|
||||
'Brandschutzhelfer'
|
||||
],
|
||||
weapons: [
|
||||
'WBK A',
|
||||
'WBK B'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// Re-export skill constants
|
||||
try {
|
||||
const { LANGUAGE_LEVELS, SKILL_HIERARCHY } = require('./skills')
|
||||
module.exports.LANGUAGE_LEVELS = LANGUAGE_LEVELS
|
||||
module.exports.SKILL_HIERARCHY = SKILL_HIERARCHY
|
||||
} catch (e) {
|
||||
// no-op if skills.js not present
|
||||
}
|
||||
9
shared/package.json
Normale Datei
9
shared/package.json
Normale Datei
@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "@skillmate/shared",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"license": "UNLICENSED"
|
||||
}
|
||||
|
||||
176
shared/skills.js
Normale Datei
176
shared/skills.js
Normale Datei
@ -0,0 +1,176 @@
|
||||
// Shared skill hierarchy and language levels
|
||||
|
||||
const LANGUAGE_LEVELS = ['A1', 'A2', 'B1', 'B2', 'C1', 'C2', 'Muttersprache']
|
||||
|
||||
const SKILL_HIERARCHY = [
|
||||
{
|
||||
id: 'communication',
|
||||
name: 'Kommunikative Fähigkeiten',
|
||||
subcategories: [
|
||||
{
|
||||
id: 'languages',
|
||||
name: 'Fremdsprachenkenntnisse',
|
||||
skills: [
|
||||
{ id: 'de', name: 'Deutsch' },
|
||||
{ id: 'en', name: 'Englisch' },
|
||||
{ id: 'fr', name: 'Französisch' },
|
||||
{ id: 'es', name: 'Spanisch' },
|
||||
{ id: 'it', name: 'Italienisch' },
|
||||
{ id: 'ru', name: 'Russisch' },
|
||||
{ id: 'ar', name: 'Arabisch' },
|
||||
{ id: 'tr', name: 'Türkisch' },
|
||||
{ id: 'pl', name: 'Polnisch' },
|
||||
{ id: 'zh', name: 'Chinesisch' },
|
||||
{ id: 'fa', name: 'Farsi/Persisch' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'interpersonal',
|
||||
name: 'Zwischenmenschliche Fähigkeiten',
|
||||
skills: [
|
||||
{ id: 'negotiation', name: 'Verhandlungsführung' },
|
||||
{ id: 'presentation', name: 'Präsentationstechnik' },
|
||||
{ id: 'teamwork', name: 'Teamfähigkeit' },
|
||||
{ id: 'leadership', name: 'Führungskompetenz' },
|
||||
{ id: 'conflict', name: 'Konfliktmanagement' }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'technical',
|
||||
name: 'Technische Fähigkeiten',
|
||||
subcategories: [
|
||||
{
|
||||
id: 'it_general',
|
||||
name: 'IT-Grundkenntnisse',
|
||||
skills: [
|
||||
{ id: 'office', name: 'MS Office' },
|
||||
{ id: 'windows', name: 'Windows Administration' },
|
||||
{ id: 'linux', name: 'Linux Administration' },
|
||||
{ id: 'networks', name: 'Netzwerktechnik' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'programming',
|
||||
name: 'Programmierung',
|
||||
skills: [
|
||||
{ id: 'python', name: 'Python' },
|
||||
{ id: 'java', name: 'Java' },
|
||||
{ id: 'javascript', name: 'JavaScript' },
|
||||
{ id: 'sql', name: 'SQL/Datenbanken' },
|
||||
{ id: 'r', name: 'R' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'security',
|
||||
name: 'IT-Sicherheit',
|
||||
skills: [
|
||||
{ id: 'forensics', name: 'Digitale Forensik' },
|
||||
{ id: 'malware', name: 'Malware-Analyse' },
|
||||
{ id: 'crypto', name: 'Kryptographie' },
|
||||
{ id: 'pentest', name: 'Penetrationstests' },
|
||||
{ id: 'siem', name: 'SIEM-Systeme' }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'operational',
|
||||
name: 'Operative Fähigkeiten',
|
||||
subcategories: [
|
||||
{
|
||||
id: 'investigation',
|
||||
name: 'Ermittlungstechniken',
|
||||
skills: [
|
||||
{ id: 'surveillance', name: 'Observationstechnik' },
|
||||
{ id: 'undercover', name: 'Verdeckte Ermittlung' },
|
||||
{ id: 'interrogation', name: 'Vernehmungsführung' },
|
||||
{ id: 'evidence', name: 'Spurensicherung' },
|
||||
{ id: 'scene', name: 'Tatortarbeit' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'tactical',
|
||||
name: 'Taktische Fähigkeiten',
|
||||
skills: [
|
||||
{ id: 'planning', name: 'Einsatzplanung' },
|
||||
{ id: 'access', name: 'Zugriffstechniken' },
|
||||
{ id: 'protection', name: 'Personenschutz' },
|
||||
{ id: 'crisis', name: 'Krisenmanagement' },
|
||||
{ id: 'firstaid', name: 'Erste Hilfe' }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'analytical',
|
||||
name: 'Analytische Fähigkeiten',
|
||||
subcategories: [
|
||||
{
|
||||
id: 'data_analysis',
|
||||
name: 'Datenanalyse',
|
||||
skills: [
|
||||
{ id: 'statistics', name: 'Statistische Analyse' },
|
||||
{ id: 'osint', name: 'OSINT-Techniken' },
|
||||
{ id: 'social_media', name: 'Social Media Analyse' },
|
||||
{ id: 'financial', name: 'Finanzermittlungen' },
|
||||
{ id: 'network_analysis', name: 'Netzwerkanalyse' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'intelligence',
|
||||
name: 'Nachrichtendienstliche Analyse',
|
||||
skills: [
|
||||
{ id: 'threat', name: 'Gefährdungsbewertung' },
|
||||
{ id: 'profiling', name: 'Profiling' },
|
||||
{ id: 'pattern', name: 'Mustererkennung' },
|
||||
{ id: 'risk', name: 'Risikoanalyse' },
|
||||
{ id: 'forecasting', name: 'Prognosemodelle' }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'certifications',
|
||||
name: 'Zertifizierungen & Berechtigungen',
|
||||
subcategories: [
|
||||
{
|
||||
id: 'security_clearance',
|
||||
name: 'Sicherheitsüberprüfungen',
|
||||
skills: [
|
||||
{ id: 'ue2', name: 'Sicherheitsüberprüfung Ü2' },
|
||||
{ id: 'ue3', name: 'Sicherheitsüberprüfung Ü3' },
|
||||
{ id: 'nato', name: 'NATO-Freigabe' },
|
||||
{ id: 'vs', name: 'Verschlusssachen-Ermächtigung' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'weapons',
|
||||
name: 'Waffen & Ausrüstung',
|
||||
skills: [
|
||||
{ id: 'weapons_cert', name: 'Waffensachkunde' },
|
||||
{ id: 'pistol', name: 'Schießausbildung Pistole' },
|
||||
{ id: 'rifle', name: 'Schießausbildung Gewehr' },
|
||||
{ id: 'mp', name: 'Schießausbildung MP' },
|
||||
{ id: 'sniper', name: 'Scharfschützenausbildung' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'vehicles',
|
||||
name: 'Fahrzeuge & Transport',
|
||||
skills: [
|
||||
{ id: 'car_b', name: 'Führerschein Klasse B' },
|
||||
{ id: 'car_c', name: 'Führerschein Klasse C' },
|
||||
{ id: 'car_ce', name: 'Führerschein Klasse CE' },
|
||||
{ id: 'motorcycle', name: 'Führerschein Klasse A' },
|
||||
{ id: 'boat', name: 'Bootsführerschein' },
|
||||
{ id: 'pilot', name: 'Flugschein PPL' }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
module.exports = { LANGUAGE_LEVELS, SKILL_HIERARCHY }
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren