Quotes

Financial quotes for renovation work — unified lifecycle entity covering pre-win vendor cost quotes and post-win workflow-driven execution. Quotes track line items, funding allocations, and are synced bidirectionally with HubSpot Integration as deals.

Source Files

LayerPath
Schemabackend/src/db/schema.ts (line ~1678)
Routesbackend/src/routes/quotes.ts
Servicebackend/src/services/quote-service.ts, backend/src/services/quote-finance-service.ts
Pagesfrontend/src/pages/Quotes.tsx
Componentsfrontend/src/components/quotes/ (9 files)
Queriesfrontend/src/lib/queries/quoteQueries.ts

Database Tables

TablePurpose
quotesMain entity — project, contact, amounts, status, HubSpot sync, workflow columns
quote_line_itemsIndividual cost items with quantities, unit prices, component type
quote_phasesExecution phases for post-win workflow management
quote_phase_tasksTasks within each phase
quote_skill_assignmentsSkill/trade assignments for quote execution
quote_ab_snapshotsA/B comparison snapshots for quote versioning
quote_line_item_funding_measuresLinks line items to Funding Applications measures
quote_line_item_funding_loansLinks line items to funding loans
component_quote_linksLinks Building Components to quotes
funding_quote_allocationsDistributes funding across quotes

Key Fields

FieldTypeNotes
projectIduuid FKParent project (cascade delete)
buildingIduuid FKParent building
contactIduuid FKVendor/supplier contact
statusenumdraft, sent, accepted, awarded, in_progress, completed, superseded, etc.
totalAmount / netAmount / taxAmountdecimalFinancial totals (precision 12,2)
taxRatedecimalDefault 19% (German VAT)
discountPercentage, skontoPercentagedecimalDiscount and early-payment terms
hubspotIdvarcharBidirectional sync with HubSpot Integration
templateIduuid FKWorkflows template for post-win lifecycle
replacesQuoteIduuid FKSelf-referential for quote versioning

Relationships

Quote *──1 Project
Quote *──1 Building
Quote *──1 Contact (vendor)
Quote 1──* Quote Line Items
Quote 1──* Quote Phases ──* Quote Phase Tasks
Quote 1──* Quote Skill Assignments
Quote 1──* Quote A/B Snapshots
Quote *──* Building Components (via component_quote_links)
Quote *──* Funding Applications (via funding_quote_allocations)
Quote 1──* Invoices (derived from quote)

Frontend Components

ComponentPurpose
QuoteFormCreate/edit quote with financial details
QuoteLineItemsTableManage individual line items
QuotesListList view with filtering and sorting
BuildingQuotesListQuotes scoped to a building
InlineQuotesTable / InlineQuoteRowCompact inline display within other views
LinkFundingApplicationsDialogLink quotes to Funding Applications
CreateQuoteWithProjectDialogQuick-create quote with project selection

Features

  • Line items management with quantities, unit prices, and component type mapping
  • Funding allocation linking line items to Funding Applications measures and loans
  • Component linking connecting quotes to Building Components via junction table
  • A/B snapshots for comparing quote versions side-by-side
  • Skill assignments tracking which trades/skills are needed for execution
  • Workflow phases for post-award project management via Workflows
  • Skonto/discount terms with deadlines (German early-payment convention)
  • HubSpot sync as deals with pipeline/stage tracking

Projects | Buildings | Invoices | Funding Applications | Building Components | Products | Contacts | Workflows | Financial Calculations | HubSpot Integration | Database Architecture