Showing AI reviews for super-admin
Project AI Score ?
72%
Quality Avg ?
77%
Security Avg ?
64%
Reviews ?
91

Review Result ?

solutionbowl/super-admin · a59cbc01
The commit adds new routes related to net-exposure and implements a detailed React page for net-exposure bets with API integration and UI elements. Structure and typing are good, and the use of React Query for data fetching is appropriate. However, the commit message lacks detail, some code is hardcoded (such as paths and UI text), and minor naming inconsistencies exist (e.g., 'Herarchy' vs 'Hierarchy'). Error handling in the page component appears minimal and could be improved to enhance robustness and user experience.
Quality ?
80%
Security ?
70%
Business Value ?
75%
Maintainability ?
83%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Lacks Detail About Purpose And Changes
Where commit message
Issue / Evidence lacks detail about purpose and changes
Suggested Fix add a descriptive message summarizing the functional changes and intent
'Netexposureherarchyroute' Is Likely Missp...
Where src/routeTree.gen.ts:103
Issue / Evidence 'NetExposureHerarchyRoute' is likely misspelled
Suggested Fix rename to 'NetExposureHierarchyRoute' for clarity and consistency
Inline Navigation Path String
Where src/routes/net-exposure-bet.tsx:121
Issue / Evidence inline navigation path string
Suggested Fix extract route paths to a single source to avoid duplication
Minimal Loading Ui
Where src/routes/net-exposure-bet.tsx:134
Issue / Evidence minimal loading UI
Suggested Fix enhance loading and error states with more informative messages and retry options
Api Call
Where src/routes/net-exposure-bet.tsx:61
Issue / Evidence API call
Suggested Fix add error handling around the API request to handle failed fetches gracefully
Duplicate Logic
Where src/routeTree.gen.ts:25
Issue / Evidence import statements repeated
Suggested Fix ensure imports are organized and unused imports removed (if any)
Code Change Preview · src/routes/net-exposure-bet.tsx ?
Removed / Before Commit
- diff --git a/src/routes/net-exposure-bet.tsx b/src/routes/net-exposure-bet.tsx
- new file mode 100644
- index 0000000..da748b9
Added / After Commit
+ diff --git a/src/routes/net-exposure-bet.tsx b/src/routes/net-exposure-bet.tsx
+ new file mode 100644
+ index 0000000..da748b9
+ import { createFileRoute, useNavigate } from "@tanstack/react-router";
+ import { useQuery } from "@tanstack/react-query";
+ import { ArrowLeft, RefreshCw } from "lucide-react";
+ import { Button } from "@/components/ui/button";
+ import { cn } from "@/lib/utils";
+ import { tenantApiClient } from "@/services/api/apiClient";
+ import { format } from "date-fns";
+ 
+ export const Route = createFileRoute("/net-exposure-bet")({
+   component: NetExposureBetPage,
+   validateSearch: (s: Record<string, unknown>) => ({
+     raceId: String(s.raceId ?? ""),
+     marketId: String(s.marketId ?? ""),
+   }),
+   head: () => ({ meta: [{ title: "Net Exposure Bets - B2B-B2C Panel" }] }),
Removed / Before Commit
- diff --git a/src/routes/net-exposure-detail.tsx b/src/routes/net-exposure-detail.tsx
- new file mode 100644
- index 0000000..eda2bb2
Added / After Commit
+ diff --git a/src/routes/net-exposure-detail.tsx b/src/routes/net-exposure-detail.tsx
+ new file mode 100644
+ index 0000000..eda2bb2
+ import { createFileRoute, useNavigate } from "@tanstack/react-router";
+ import { useQuery } from "@tanstack/react-query";
+ import { useState } from "react";
+ import { ArrowLeft, RefreshCw, ChevronUp, ChevronDown } from "lucide-react";
+ import { Button } from "@/components/ui/button";
+ import { cn } from "@/lib/utils";
+ import { tenantApiClient } from "@/services/api/apiClient";
+ import { useAuth } from "@/hooks/useAuth";
+ 
+ // ─── Route ────────────────────────────────────────────────────────────────────
+ 
+ export const Route = createFileRoute("/net-exposure-detail")({
+   component: NetExposureDetailPage,
+   validateSearch: (s: Record<string, unknown>) => ({
+     raceId: String(s.raceId ?? ""),
Removed / Before Commit
- diff --git a/src/routes/net-exposure-herarchy.tsx b/src/routes/net-exposure-herarchy.tsx
- new file mode 100644
- index 0000000..c417f6b
- \ No newline at end of file
Added / After Commit
+ diff --git a/src/routes/net-exposure-herarchy.tsx b/src/routes/net-exposure-herarchy.tsx
+ new file mode 100644
+ index 0000000..c417f6b
+ import { createFileRoute } from "@tanstack/react-router";
+ import { useQuery } from "@tanstack/react-query";
+ import { useState } from "react";
+ import { ChevronDown, ChevronUp, RefreshCw } from "lucide-react";
+ 
+ import { tenantApiClient } from "@/services/api/apiClient";
+ import { Button } from "@/components/ui/button";
+ import { cn } from "@/lib/utils";
+ 
+ export const Route = createFileRoute("/net-exposure-herarchy")({
+   component: NetExposureHierarchyPage,
+   validateSearch: (search: Record<string, unknown>) => ({
+     raceId: String(search.raceId ?? ""),
+     marketId: String(search.marketId ?? ""),
+     userId: String(search.userId ?? ""),
Removed / Before Commit
- diff --git a/src/routes/net-exposure.tsx b/src/routes/net-exposure.tsx
- index f8bab6e..b1d511e 100644
- import { createFileRoute } from "@tanstack/react-router";
- import { useState } from "react";
- import { motion } from "motion/react";
- import { Card } from "@/components/ui/card";
- import { Button } from "@/components/ui/button";
- import { cn } from "@/lib/utils";
- 
- export const Route = createFileRoute("/net-exposure")({
- component: NetExposurePage,
-   head: () => ({ meta: [{ title: "Net Exposure - B2B-B2C Panel" }] }),
- });
- 
- type SportType = "My P/L" | "Total Block" | "Filter by Sport" | "All" | "Cricket" | "Football" | "Tennis" | "Horse Racing" | "Greyhound Racing";
- 
- function NetExposurePage() {
- const [selectedSport, setSelectedSport] = useState<SportType>("My P/L");
Added / After Commit
+ diff --git a/src/routes/net-exposure.tsx b/src/routes/net-exposure.tsx
+ index f8bab6e..b1d511e 100644
+ import { createFileRoute, useNavigate } from "@tanstack/react-router";
+ import { useState } from "react";
+ import { motion } from "motion/react";
+ import { Card } from "@/components/ui/card";
+ import { Button } from "@/components/ui/button";
+ import { cn } from "@/lib/utils";
+ import { useQuery } from "@tanstack/react-query";
+ import { Home, List, Users } from "lucide-react";
+ import { internalServices } from "@/services/api/internalServices";
+ 
+ export const Route = createFileRoute("/net-exposure")({
+ component: NetExposurePage,
+   head: () => ({ meta: [{ title: "Net Exposure  - B2B-B2C Panel" }] }),
+ });
+ 
+ type SportType =
Removed / Before Commit
- diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts
- index 3c32b04..c2262f4 100644
- import { Route as PositionTakingListingRouteImport } from './routes/position-taking-listing'
- import { Route as PlByMarketRouteImport } from './routes/pl-by-market'
- import { Route as PlByAgentRouteImport } from './routes/pl-by-agent'
- import { Route as NetExposureRouteImport } from './routes/net-exposure'
- import { Route as MarketingRouteImport } from './routes/marketing'
- import { Route as LoginRouteImport } from './routes/login'
- path: '/pl-by-agent',
- getParentRoute: () => rootRouteImport,
- } as any)
- const NetExposureRoute = NetExposureRouteImport.update({
- id: '/net-exposure',
- path: '/net-exposure',
- '/login': typeof LoginRoute
- '/marketing': typeof MarketingRoute
- '/net-exposure': typeof NetExposureRoute
- '/pl-by-agent': typeof PlByAgentRoute
Added / After Commit
+ diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts
+ index 3c32b04..c2262f4 100644
+ import { Route as PositionTakingListingRouteImport } from './routes/position-taking-listing'
+ import { Route as PlByMarketRouteImport } from './routes/pl-by-market'
+ import { Route as PlByAgentRouteImport } from './routes/pl-by-agent'
+ import { Route as NetExposureHerarchyRouteImport } from './routes/net-exposure-herarchy'
+ import { Route as NetExposureDetailRouteImport } from './routes/net-exposure-detail'
+ import { Route as NetExposureBetRouteImport } from './routes/net-exposure-bet'
+ import { Route as NetExposureRouteImport } from './routes/net-exposure'
+ import { Route as MarketingRouteImport } from './routes/marketing'
+ import { Route as LoginRouteImport } from './routes/login'
+ path: '/pl-by-agent',
+ getParentRoute: () => rootRouteImport,
+ } as any)
+ const NetExposureHerarchyRoute = NetExposureHerarchyRouteImport.update({
+   id: '/net-exposure-herarchy',
+   path: '/net-exposure-herarchy',
+   getParentRoute: () => rootRouteImport,
Removed / Before Commit
- diff --git a/src/services/api/internalServices.ts b/src/services/api/internalServices.ts
- index 84573e0..ae7f8ab 100644
- casinoLive: createResourceService<CasinoItem>("/casino/live", "games"),
- punching: createResourceService<PunchingMarket>("/punching", "markets"),
- horseRacingReports: {
- async globalProfitLoss(fromDate: string, toDate: string) {
- return unwrapData<ProfitLossReport>(
- await tenantApiClient.post<unknown>("/horse-racing/reports/global-profit-loss", {
Added / After Commit
+ diff --git a/src/services/api/internalServices.ts b/src/services/api/internalServices.ts
+ index 84573e0..ae7f8ab 100644
+ casinoLive: createResourceService<CasinoItem>("/casino/live", "games"),
+ punching: createResourceService<PunchingMarket>("/punching", "markets"),
+ horseRacingReports: {
+     async netExposure() {
+       const raw = await tenantApiClient.post<unknown>("/horse-racing/reports/net-exposure", {});
+       // Return raw so the caller can inspect the actual shape
+       if (Array.isArray(raw)) return raw;
+       const obj = raw as Record<string, unknown>;
+       if (Array.isArray(obj?.data)) return obj.data;
+       return raw;
+     },
+ async globalProfitLoss(fromDate: string, toDate: string) {
+ return unwrapData<ProfitLossReport>(
+ await tenantApiClient.post<unknown>("/horse-racing/reports/global-profit-loss", {