Various QOL updates
This commit is contained in:
+15
-3
@@ -2123,16 +2123,28 @@ export interface DeviceNetworkMembership {
|
||||
device_id: string;
|
||||
portal_network_id: string;
|
||||
user_network_approval_id: string | null;
|
||||
state: MembershipState;
|
||||
active: boolean;
|
||||
status: ApprovalState;
|
||||
grant_type: ApprovalGrantType;
|
||||
granted_by_user_id: string | null;
|
||||
justification: string | null;
|
||||
join_seen: boolean;
|
||||
currently_authorized: boolean;
|
||||
approved_for_activation: boolean;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
deleted_at: string | null;
|
||||
active_session: ActivationSession | null;
|
||||
}
|
||||
|
||||
export function deriveMembershipState(status: ApprovalState, active: boolean): MembershipState {
|
||||
if (active) return "active_authorized";
|
||||
if (status === "approved") return "approved_inactive";
|
||||
if (status === "pending") return "pending_manager_approval";
|
||||
if (status === "rejected") return "rejected";
|
||||
if (status === "revoked") return "revoked";
|
||||
if (status === "suspended") return "suspended";
|
||||
return "pending_manager_approval";
|
||||
}
|
||||
|
||||
export interface EnrichedMembership {
|
||||
id: string;
|
||||
user_id: string;
|
||||
|
||||
Reference in New Issue
Block a user