Request for Quote (RFQ) System
Relevant source files
The following files were used as context for generating this wiki page:
- src/pages/admin/RFQEdit.tsx
- src/pages/vendor/ComprehensiveRFQDetail.tsx
- src/components/AdminRFQSystem.tsx
- src/components/VendorRFQSystem.tsx
- supabase/migrations/20251221064142_5f95f6d1-7f4a-457a-8d2b-daa02fdaa6d3.sql
- supabase/migrations/20251221092457_1f91df83-a92f-4d43-8b5d-a0074192e976.sql
- src/pages/admin/ComprehensiveRFQDetail.tsx
The Request for Quote (RFQ) System is a specialized procurement module designed to facilitate complex bidding processes for large-scale property management projects. It allows property managers (admins) to create highly structured RFQs containing detailed technical specifications, building configurations, and commercial frameworks, which are then distributed to verified vendors for competitive bidding.
The system supports a full lifecycle including RFQ creation, vendor invitation, bid submission, and contract award. It distinguishes between "Legacy Projects" (simpler task-based requests) and the "Comprehensive RFQ" system which utilizes a multi-sectioned data structure stored primarily in JSONB format to handle intricate requirements like HVAC or painting services.
Sources: src/components/AdminRFQSystem.tsx, src/pages/admin/RFQEdit.tsx, supabase/migrations/20251221064142_5f95f6d1-7f4a-457a-8d2b-daa02fdaa6d3.sql
System Architecture and Data Model
The RFQ system is built upon a flexible PostgreSQL schema that leverages standard relational tables for tracking high-level entities and JSONB columns for storing diverse, project-specific technical data.
Core Database Entities
| Table | Description | Key Fields |
|---|---|---|
rfqs | Primary entity containing the RFQ definition and structured technical data. | id, title, document_control, executive_summary, system_strategy, status |
rfq_lots | Specific items or service packages within an RFQ that vendors bid on. | id, rfq_id, lot_name, quantity, unit_of_measure |
rfq_invites | Manages the relationship between RFQs and specific vendors. | rfq_id, vendor_id, status (pending, submitted) |
rfq_documents | Metadata for technical files (blueprints, MEP designs) stored in Supabase Storage. | rfq_id, file_path, document_type, category_badge |
bid_lines | Individual pricing entries submitted by vendors per lot. | vendor_id, rfq_lot_id, unit_price |
Sources: supabase/migrations/20251221064142_5f95f6d1-7f4a-457a-8d2b-daa02fdaa6d3.sql:4-29, src/pages/admin/ComprehensiveRFQDetail.tsx:50-70
Structured Data Schema (JSONB)
The rfqs table uses several JSONB columns to store complex specifications without requiring frequent migrations:
- document_control: Contains reference numbers, project addresses, and issue purposes.
- unit_configuration: Stores arrays of unit types, quantities, and capacities (e.g., "1-Bedroom, 1.5 tons").
- commercial_framework: Defines payment milestones (percentage-based) and maintenance terms.
- budget_guidance: Outlines non-binding minimum and maximum estimated costs.
Sources: supabase/migrations/20251221064142_5f95f6d1-7f4a-457a-8d2b-daa02fdaa6d3.sql:4-16, src/pages/admin/RFQEdit.tsx:43-108
Workflow and Logic
The system operates through a structured workflow involving administrators and vendors, visualized in the diagrams below.
RFQ Lifecycle Flow
The following diagram illustrates the progression of an RFQ from draft to award.
RFQ Creation and Editing
Administrators use a multi-tab interface to populate the RFQ. The system includes an autosave mechanism (useAutosave) and supports importing/exporting templates via JSON or CSV to streamline project setup.
- Validation: Bidding can only be enabled if a title and deadline are present.
- Document Management: Files are categorized by type (e.g.,
blueprint,floor_plan,mep_design) and stored in a private Supabase bucket (rfq-documents).
Sources: src/pages/admin/RFQEdit.tsx:210-250, src/pages/admin/RFQEdit.tsx:406-440, supabase/migrations/20251221064142_5f95f6d1-7f4a-457a-8d2b-daa02fdaa6d3.sql:71-80
Vendor Interaction
Vendors interact with the system through a dedicated dashboard and detail view.
Bid Submission Process
Vendors invited to an RFQ see a "Comprehensive Detail" page. If the status is "open" and the deadline has not passed, they can submit bids for specific lots.
Access Control and Permissions
The system employs Row Level Security (RLS) and custom hooks (useRFQAccess) to manage visibility:
- Public View: Provides a limited summary and "Preview" of the project.
- Restricted Data: Technical documents and full BOQ (Bill of Quantities) are restricted until a vendor is specifically invited or granted access by an admin.
- Gatekeeper: Public users must "Request Access" to see the full specification.
Sources: src/pages/public/PublicRFQView.tsx:110-150, supabase/migrations/20251221064142_5f95f6d1-7f4a-457a-8d2b-daa02fdaa6d3.sql:32-60
Administrative Management
Administrators utilize a "Unified Management" interface to track multiple concurrent RFQs.
Bid Comparison and Awarding
The system aggregates bid_lines by vendor to calculate a "Bid Total." Administrators can view detailed line-item pricing per lot and compare vendor responses before using the ContractAward component to finalize the procurement.
Sources: src/pages/admin/ComprehensiveRFQDetail.tsx:50-95, src/pages/admin/ComprehensiveRFQDetail.tsx:570-610
Scoring and Evaluation
An optional "Scoring Engine" allows admins to define weights for different evaluation criteria (e.g., price, experience, certifications), which helps in quantifying vendor quality beyond just the lowest bid.
Sources: src/pages/admin/ComprehensiveRFQDetail.tsx:540-545
Technical Summary
The RFQ System provides a robust framework for handling property management procurement. By utilizing a hybrid storage strategy—relational for workflow state and JSONB for technical specifications—it ensures that complex data like building HVAC loads or painting square footages are preserved and accessible throughout the bidding lifecycle. This structure enables clear communication of "Non-Negotiable" system strategies and provides vendors with high-clarity data to eliminate risk prior to pricing submission.
Sources: supabase/migrations/20260127045528_b696dc9b-0f1a-4b6c-99f1-3ebf4bcae100.sql:1-35, supabase/migrations/20251221092457_1f91df83-a92f-4d43-8b5d-a0074192e976.sql:40-65