Initial commit

This commit is contained in:
2025-06-22 00:01:22 +03:00
parent fd70166cf6
commit 033b80bfad
153 changed files with 26874 additions and 1 deletions

79
types/user.ts Normal file
View File

@@ -0,0 +1,79 @@
export type UserRole = "user" | "team_admin" | "department_admin" | "field_admin" | "global_admin"
export type ShelterStatus = "yes" | "no" | "no_alarm" | "safe_after_exit"
export type Department = "מאי" | "עדן" | "שניר" | "יקיר"
export type Team =
| "מאי"
| "שי"
| "תומר"
| "ינון"
| "עדי"
| "לינוי"
| "ניצן"
| "רונן"
| "אופיר"
| "הדר"
| "יקיר"
export type Field = "יקיר" | "אורלי" | "מיכאל" | "מאור" | "גלעד"
export interface User {
national_id: string
name: string
role: UserRole
is_admin: boolean
field?: Field
department?: Department
team?: Team
in_shelter?: ShelterStatus
last_updated?: string
must_change_password?: boolean
password_changed_at?: string
}
export interface AdminUser extends User {
is_admin: true
}
export const ROLE_NAMES: Record<UserRole, string> = {
user: "משתמש",
team_admin: "מנהל צוות",
department_admin: "מנהל מסגרת",
field_admin: "מנהל תחום",
global_admin: "מנהל על",
}
export const ROLE_HIERARCHY: Record<UserRole, number> = {
global_admin: 5,
field_admin: 4,
department_admin: 3,
team_admin: 2,
user: 1,
}
export const SHELTER_STATUS_NAMES: Record<ShelterStatus, string> = {
yes: "במקלט/חדר מוגן",
no: "לא במקלט",
no_alarm: "אין אזעקה",
safe_after_exit: "אני בטוח.ה (סוף אירוע)"
}
export const DEPARTMENTS: Department[] = ["מאי", "עדן", "שניר", "יקיר"]
export const TEAMS: Team[] = [
"מאי",
"שי",
"תומר",
"ינון",
"עדי",
"לינוי",
"ניצן",
"רונן",
"אופיר",
"הדר",
"יקיר",
]
export const FIELDS: Field[] = ["יקיר", "אורלי", "מיכאל", "מאור", "גלעד"]