export interface TenantBranding {
  brandName?: string;
  shortName?: string;
  logoUrl?: string;
  slogan?: string;
  theme?: Record<string, unknown>;
  publicAssets?: Record<string, unknown>;
}

export interface TenantContext {
  tenantId: string;
  tenantSlug?: string;
  host?: string;
  branding: TenantBranding;
  features: Record<string, unknown>;
  adminFeatures: Record<string, unknown>;
  publicConfig: Record<string, unknown>;
}

export interface ApiSession {
  token: string;
  expiresAt?: string;
}

export interface CurrentUser {
  id: string;
  name?: string;
  phone?: string;
  roles?: string[];
  permissions?: Record<string, boolean>;
}

export interface ApiEnvelope<T> {
  item?: T;
  items?: T[];
  tenant?: unknown;
  user?: CurrentUser;
  session?: ApiSession;
  code?: string;
  message?: string;
  [key: string]: unknown;
}

export interface ApiErrorPayload {
  status: number;
  code: string;
  message: string;
  details?: unknown;
}
