Skip to content

Add In-Process Deal Flow and Status-Based Filtering#4

Open
thekavishshah wants to merge 1 commit intoRahulg321:mainfrom
thekavishshah:feature/in-process-filter
Open

Add In-Process Deal Flow and Status-Based Filtering#4
thekavishshah wants to merge 1 commit intoRahulg321:mainfrom
thekavishshah:feature/in-process-filter

Conversation

@thekavishshah
Copy link

  1. Database Schema & Actions

Prisma schema: Introduced a new DealStatus enum and added a status field to the Deal model (defaulting to RAW).

GetAllDeals action: Extended the deal-fetching helper to accept an optional status parameter so it only returns deals matching RAW, IN_PROCESS, etc.

  1. Raw Deals Page

Async params: Updated the component to await searchParams (Next.js 15 requirement).

Status filter: Always passes status = RAW into the deal-fetch call so that once a deal is moved out, it no longer appears here.

  1. In-Process Page

Async params: Likewise, awaits searchParams before reading page or limit.

Hardwired filter: Fetches only deals where status = IN_PROCESS, ensuring this list stays in sync.

  1. DealCard Component

New imports: Brought in two server-actions—one to flip RAW → IN_PROCESS, another to export an IN_PROCESS deal to Bitrix.

Form-action handlers: Wrapped each action in the proper (formData) => … signature that Next.js expects.

Conditional buttons:

RAW deals show a “Move to In Process” button.

IN_PROCESS deals show a “Publish to Bitrix” button.

Styling tweak: Ensured every action button spans the full width, matching the existing View and Screen buttons.

  1. Header Navigation

Renamed the nav item from “Infer” to “Screened” to reflect the new workflow terminology.

  1. Migration

Ran a Prisma migration (“add-deal-status”) to apply the new enum and field to the database.

@vercel
Copy link

vercel bot commented Apr 23, 2025

@thekavishshah is attempting to deploy a commit to the Destiny and Rahul Projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant