QuoteItem
A QuoteItem represents a single line item in a quote. It can reference either a configured product from a Brief/BriefElement or a predefined Article. QuoteItems support hierarchical relationships for complex product structures.
Main Purpose
Section titled “Main Purpose”- Represent individual line items within a quote
- Link configured products (BriefElements) or predefined articles to quotes
- Track quantities, pricing, and dimensions per item
- Support hierarchical parent-child item relationships
- Enable mixed quotes with both custom configurations and catalog items
Key Properties
Section titled “Key Properties”| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
name | string | Item name |
quantity | number | Quantity (min: 0) |
price | number | Unit price (min: 0) |
totalPrice | number | Total price (min: 0) |
unit | string | Unit of measure (e.g., “pcs”, “boxes”) |
lengthDimension | number | Length dimension (min: 0) |
widthDimension | number | Width dimension (min: 0) |
heightDimension | number | Height dimension (min: 0) |
position | number | Display order within quote (default: 1) |
quoteDetailUrl | string | URL for detailed product information |
articleDescription | string | Article description text |
valid | boolean | Validation flag (default: false) |
createdAt | Date | Creation timestamp |
updatedAt | Date | Last update timestamp |
Main Relationships
Section titled “Main Relationships”| Relationship | Entity | Type | Description |
|---|---|---|---|
quote | Quote | Many-to-One | Parent quote (required) |
article | Article | Many-to-One | Associated article (for predefined products) |
brief | Brief | Many-to-One | Associated brief (for configured products) |
briefElement | BriefElement | Many-to-One | Specific configured product element |
parent | QuoteItem | Many-to-One | Parent quote item (for hierarchical items) |
children | QuoteItem | One-to-Many | Child quote items (for hierarchical items) |
comment | Comment | Many-to-One | Associated comment |
user | User | Many-to-One | Creator of the quote item |
Item Types
Section titled “Item Types”A QuoteItem can represent different types of products:
1. Configured Product (from Brief/BriefElement)
Section titled “1. Configured Product (from Brief/BriefElement)”- Links to a
briefandbriefElementfrom an actual Brief - Product was configured using the packaging configurator
- Includes custom dimensions, materials, decorations, etc.
- Pricing calculated from brief’s prediction system
2. Predefined Article (from Catalog)
Section titled “2. Predefined Article (from Catalog)”- Links to an
article - Product exists in the article catalog
- Can be stocked or custom-made
- Uses predefined pricing from article
- Article may or may not be linked to a BriefElement:
- Article linked to BriefElement from an actual Brief (has production specs)
- Article with standalone BriefElement (created with the article)
- Article without any BriefElement link
3. Mixed Items
Section titled “3. Mixed Items”- Quotes can contain both configured products and articles
- Each QuoteItem references either:
- A Brief/BriefElement (configured product), OR
- An Article (with or without BriefElement link)
Hierarchical Structure
Section titled “Hierarchical Structure”QuoteItems support parent-child relationships for organizing complex product structures.
General Hierarchy
Section titled “General Hierarchy”parent: Reference to parent QuoteItemchildren: Array of child QuoteItems- Useful for grouping related products or showing component breakdowns
Automatic Hierarchy (Quotes from Briefs)
Section titled “Automatic Hierarchy (Quotes from Briefs)”When a quote is generated from Briefs, the system automatically creates a hierarchical structure:
Structure:
- Parent QuoteItem → References the Brief (container)
- Children QuoteItems → Reference individual BriefElements from that Brief
Example:
Quote ├── QuoteItem (parent) → Brief "Folding Carton Set" │ ├── QuoteItem (child) → BriefElement 1 "Outer Box" │ ├── QuoteItem (child) → BriefElement 2 "Inner Box" │ └── QuoteItem (child) → BriefElement 3 "Insert Card" │ ├── QuoteItem (parent) → Brief "Display Packaging" │ ├── QuoteItem (child) → BriefElement 1 "Display Stand" │ └── QuoteItem (child) → BriefElement 2 "Header Card" │ ├── QuoteItem → Article "Standard Tape" (no BriefElement link) │ ├── QuoteItem → Article "Custom Label" (linked to standalone BriefElement) │ └── QuoteItem → Article "Box Insert" (linked to BriefElement from Brief "Folding Carton Set")This hierarchy allows:
- Clear organization of multi-product briefs with parent-child structure
- Easy identification of which BriefElements belong to which Brief
- Logical grouping for pricing and presentation
- Mix of configured products (from Briefs) and catalog articles
- Articles with various BriefElement linking scenarios (none, standalone, or from actual Brief)
Related Endpoints
Section titled “Related Endpoints”POST /quotes/:id/quote-items- Add items to quoteDELETE /quotes/:id/quote-items/:itemId- Remove item from quoteGET /quotes/:id- Get quote with all items
Usage Examples
Section titled “Usage Examples”Adding a Configured Product
Section titled “Adding a Configured Product”{ "briefId": "uuid-brief-1", "briefElementId": "uuid-element-1", "quantity": 1000, "comment": "Custom packaging configuration"}Adding a Predefined Article
Section titled “Adding a Predefined Article”{ "articleId": "uuid-article-1", "quantity": 50, "price": 25.0, "comment": "Standard box from catalog"}Key Features
Section titled “Key Features”- Flexible Product Types: Support for both configured and predefined products
- Hierarchical Items: Parent-child relationships for complex product structures
- Dimensional Data: Store length, width, height for logistics
- Validation: Track item validation status
- Comments: Attach notes to specific line items
- Positioning: Control display order within quote
See Also
Section titled “See Also”- Quote - Parent quote entity
- Article - Predefined products
- Brief - Configuration requests
- BriefElement - Individual configured products