Introduction
Quotations in the Construction Backend API allow you to manage detailed cost estimates for construction projects. Each quotation includes factory information, cost breakdowns, and nested sections with itemized pricing.Data Structure
The quotation model uses a hierarchical structure with three levels:Schema Reference
Based on the Mongoose schema defined insrc/models/quotation.js:8:
Root Fields
| Field | Type | Required | Description |
|---|---|---|---|
factory | String | Yes | Factory or project identifier |
fix | String | Yes | Fix reference number |
description_quotation | String | Yes | Overall quotation description |
subtotal | Number | Yes | Subtotal before additional costs |
unexpected | Number | Yes | Unexpected costs or contingency |
iva | Number | Yes | VAT/IVA tax amount |
administratitive | Number | Yes | Administrative costs |
utility | Number | Yes | Utility or profit margin |
total_price | Number | Yes | Final total price |
sections | Array | Yes | Array of section objects |
Section Object
Each section in thesections array contains:
| Field | Type | Required | Description |
|---|---|---|---|
description_sections | String | Yes | Description of the section |
section_price | Number | Yes | Total price for this section |
items | Array | Yes | Array of item objects |
Item Object
Each item in theitems array contains:
| Field | Type | Required | Description |
|---|---|---|---|
item_name | String | Yes | Name of the item |
item_description | String | Yes | Detailed item description |
item_total | Number | Yes | Total cost for this item |
quantity | Number | Yes | Quantity of items |
unity | String | Yes | Unit of measurement (e.g., “m2”, “units”, “kg”) |
item_value | Number | Yes | Unit price per item |
Complete Schema Example
Cost Calculation
The
total_price should represent the sum of subtotal + unexpected + iva + administratitive + utility. Ensure your calculations are accurate before submitting.Validation Rules
As seen insrc/controllers/quotationController.js:18-24, the API validates:
- All root-level fields must be present
sectionsmust be an array- Numeric fields cannot be undefined (but can be 0)
- All nested section and item fields must meet schema requirements
Next Steps
Create Quotation
Learn how to create a new quotation
Retrieve Quotations
Learn how to fetch quotations