Project

General

Profile

Actions

ClientProject #2811

open

ClientProject #2810: [Module] : Truck Stock

[API] : API develop & Integration for Truck Stock Module (Testing Only)

Added by Md.Sajib Ahmed 8 months ago. Updated 8 months ago.

Status:
Complete
Priority:
High
Target version:
Start date:
08/06/2025
Due date:
% Done:

100%

Estimated time:
8:00 h
Spent time:

Description

Tasks:

1. Set Minimum Page Height in Layout

2. Implement All Truck Stock APIs

  • Set up API routes and fetch logic for all required endpoints.

  • Implement both:

    • Next.js API Routes (under /app/api/v1/truck-stock...)
    • Fetch Functions (server-side use)
  • API List to Integrate:

    • /makers-and-bodytypes
    • /models/?makerId=''
    • /products
    • /sitemap
    • /products/:id

3. Testing Purposes Only – No UI Design

  • Do not implement or style any design components.

  • The purpose of this task is to ensure that:

    • API endpoints are reachable
    • Data is correctly fetched
    • Fetch functions return typed responses

4. Create Truck Stock API Service Functions

  • Set up reusable fetcher functions inside services/truck-stock.ts

  • Write type-safe wrappers for each API with proper TypeScript interfaces or types

  • Examples:

    • getTruckStockProducts()
    • getTruckStockProductDetail(id: string)
    • etc.

5. Redis integration

  • Maintian contastaint file using key value pair. (/lib.constants.ts)
  MODELS: {
    KEY: (id: string) => `getTruckModelCount-${id}`,
    EXPIRE_TIME_IN_SECONDS: 60 * 60, // 1 hour
  },
  PRODUCTS: {
    KEY: (searchParams: Record<string, string | number | string[]>) =>
      `getTruckStockList-${JSON.stringify(searchParams)}`,
    EXPIRE_TIME_IN_SECONDS: 60 * 60, // 1 hour
  },
  PRODUCT_DETAIL: {
    KEY: (id: string) => `getTruckProductDetails-${id}`,
    EXPIRE_TIME_IN_SECONDS: 60 * 60, // 1 hour
  },
  SITEMAP: {
    KEY: "getAllTruckStockListForSeo",
    EXPIRE_TIME_IN_SECONDS: 60 * 60 * 24, // 24 hours
  },

Notes:

  • Ensure all API calls are async and handle error states gracefully.
  • Keep console logs or JSON previews for now (for verification).
  • This issue is preparatory — future issues will focus on UI rendering and interactivity.
Actions #1

Updated by Md.Sajib Ahmed 8 months ago

  • % Done changed from 0 to 60
Actions #2

Updated by Md.Sajib Ahmed 8 months ago

  • Status changed from In Progress to Complete
  • % Done changed from 60 to 100
Actions #3

Updated by Md.Sajib Ahmed 8 months ago

  • Due date deleted (08/06/2025)
Actions #4

Updated by Md.Sajib Ahmed 8 months ago

  • Description updated (diff)
Actions

Also available in: Atom PDF