All files / lib api-types.ts

0% Statements 0/2
100% Branches 0/0
100% Functions 0/0
0% Lines 0/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71                                                                                                                                             
export type UserRole = "ADMIN" | "OPERATOR" | "VIEWER" | "DRIVER" | "MANAGER";
export const userRoles = [
  "DRIVER",
  "MANAGER",
  "VIEWER",
  "OPERATOR",
  "ADMIN",
] as const satisfies readonly UserRole[];
export type CommandState = "QUEUED" | "SENT" | "SUCCEEDED" | "FAILED" | "TIMED_OUT" | "CANCELLED";
export type AuthorizationStatus = "Accepted" | "Blocked" | "Invalid" | "Expired";
 
export type User = {
  id: string;
  tenantId: string;
  email: string;
  name: string;
  role: UserRole;
  platformAdmin?: boolean;
  eulaAccepted?: boolean;
};
export type Row = Record<string, unknown>;
export type PageData = { items: Row[]; total: number };
export type Page<T> = { items: T[]; total: number };
export type ProblemDetail = {
  type?: string;
  title?: string;
  status?: number;
  detail?: string;
  instance?: string;
};
 
export const componentKeys = [
  "organization",
  "pricing",
  "billing",
  "roaming",
  "smart_charging",
  "statistics",
  "assets",
  "cars",
  "public_charging",
] as const;
export type ComponentKey = (typeof componentKeys)[number];
export type Components = Record<ComponentKey, boolean>;
 
export type Workspace = {
  id: string;
  slug: string;
  name: string;
  active: boolean;
  components?: Partial<Components>;
  logo_url?: string | null;
};
 
export type RecordItem<T extends Row = Row> = {
  id: string;
  name: string;
  data: T;
  revision: number;
  updated_at: string;
};
 
export type ImportResult = {
  created: number;
  updated: number;
  skipped: number;
  errors: { line: number; message: string }[];
};
 
export type CommandReceipt = { id: string; state: CommandState };