51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
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 = string
|
|
|
|
export type Team = string
|
|
|
|
export type Field = string
|
|
|
|
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: "אני בטוח.ה (סוף אירוע)"
|
|
}
|