Project

General

Profile

Actions

Improvement #31512

open

Improvement #31248: New Theme based Nextjs application dev analysis

Deals section in home page

Added by Sachin Suresh 4 months ago. Updated 4 months ago.

Status:
Fixed not Tested
Priority:
Normal
Assignee:
Target version:
-
Start date:
12/19/2025
Due date:
12/22/2025 (about 4 months late)
% Done:

100%

Estimated time:
8:00 h
Spent time:
remarks:
DB Changes:
Keys & Permissions:
Areas Affected:
Files Changed:
Actions #1

Updated by Sachin Suresh 4 months ago

  • Due date set to 12/19/2025
  • Status changed from Assigned to In Progress
Actions #2

Updated by Sachin Suresh 4 months ago

  • Status changed from In Progress to Fixed not Tested
  • % Done changed from 0 to 100
Actions #3

Updated by Sachin Suresh 4 months ago

  • Due date changed from 12/19/2025 to 12/22/2025
  • Status changed from Fixed not Tested to In Progress
  • Estimated time set to 8:00 h
Actions #4

Updated by Sachin Suresh 4 months ago

implemented banner deals - flight deals

Actions #5

Updated by Sachin Suresh 4 months ago

  • Status changed from In Progress to Fixed not Tested

The project uses a Server-Side Prefetching strategy with TanStack Query (React Query) to load deal data.

Page Level (page.tsx): Data is fetched on the server side using unique actions for each deal type.
State Management: The fetched data is passed to the client via QueryClient hydration or initial props.
UI Components: Client-side components (*Section.tsx) consume this data using useQuery and render responsive carousels.
1. Flights Implementation
Service: fetchFlightDeals in src/services/flight-service.ts
Endpoint: POST /api/FlightService/FlightDeal
Payload: { currency, isElastic: false, DealGroup: "1" }
Action: getFlightDealsAction calls the service.
Component: FlightDealsSection.tsx
Uses useQuery({ queryKey: ["flight-deals"] }).
Displays items using FlightDealItem.
2. Hotels Implementation
Service: fetchHotelDeals in src/services/hotel-service.ts
Endpoint: POST /api/HotelService/HotelDeal
Payload: { currency, isElastic: false, DealGroup: "2" }
Action: getHotelDealsAction calls the service.
Component: HotelDealsSection.tsx
Uses useQuery({ queryKey: ["hotel-deals"] }).
Displays items using HotelDealItem.
Note: It has a fallback image mechanism if deal images are missing.
3. Packages Implementation
Type: Static Package Categories
Service: fetchStaticPackageCategories in src/services/package-service.ts
Endpoint: POST /api/Package/StaticPackageCategory
Payload: Empty JSON {}.
Action: getStaticPackageCategoriesAction.
Component: TravelPackagesSection.tsx
Uses useQuery({ queryKey: ["travel-packages"] }).
Displays items using TravelPackageItem inside a carousel (configured for 4 items per slide).
Architecture Summary
page.tsx: Orchestrates the optional prefetching.
await Promise.all([
queryClient.prefetchQuery({ queryKey: ["flight-deals"], ... }),
queryClient.prefetchQuery({ queryKey: ["hotel-deals"], ... }),
queryClient.prefetchQuery({ queryKey: ["travel-packages"], ... })
]);
DealsCarouselMulti: A shared generic carousel component used by all three sections to maintain consistent behavior (autoplay, responsiveness).

Actions

Also available in: Atom PDF