/** 管理员 JWT 有效期（秒） */
export const JWT_EXPIRY_SECONDS = 86_400;

export const ADMIN_ROLE = "admin" as const;

export type Permission =
  | "pricing:markup:write"
  | "alert:read"
  | "rpa:operate";

/** 管理员角色默认权限（不含宿主侧加价写权限） */
export const ADMIN_PERMISSIONS: readonly Permission[] = [
  "alert:read",
  "rpa:operate",
] as const;

export type AdminJwtPayload = {
  sub: string;
  role: typeof ADMIN_ROLE;
};

export type ServiceTokenEntry = {
  customerId: string;
  permissions: Permission[];
};
