BriefPrice (PredictionRequest)
BriefPrice contains pricing and prediction data for a brief. This entity is also known as “PredictionRequest” in the database. It stores the results of AI-powered pricing calculations including total price, cost breakdowns, production time estimates, and manufacturing process sequences. The entity provides comprehensive pricing analysis and supports quote versioning.
Main Purpose
Section titled “Main Purpose”- Store AI-generated pricing predictions
- Provide detailed cost breakdowns by category
- Track manufacturing process sequences
- Support price adjustments and deltas
- Enable quote versioning and optimization
- Link to machines and providers for manufacturing
Key Properties
Section titled “Key Properties”Core Properties
Section titled “Core Properties”| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
code | number | Sequential code (auto-generated) |
briefId | UUID | Parent brief reference |
userId | UUID | Creator user |
Price Breakdown
Section titled “Price Breakdown”| Property | Type | Description |
|---|---|---|
totalPrice | number | Total price (€) |
productCost | number | Product manufacturing cost (€) |
toolingCost | number | Tooling cost (€) |
toolingCostDelta | number | Manual tooling adjustment (€) |
deliveryCost | number | Delivery cost (€) |
deliveryCostDelta | number | Manual delivery adjustment (€) |
additionalCosts | Partial | Extra costs |
Production Data
Section titled “Production Data”| Property | Type | Description |
|---|---|---|
quantity | number | Production quantity |
productionTime | number | Estimated production time (hours) |
processCount | number | Number of manufacturing processes |
Versioning
Section titled “Versioning”| Property | Type | Description |
|---|---|---|
version | string | Quote version (format: “XX”) |
parentId | UUID | Parent quote (for iterations) |
rootId | UUID | Root quote (first version) |
locked | boolean | Quote locked for editing |
Main Relationships
Section titled “Main Relationships”| Relationship | Entity | Type | Description |
|---|---|---|---|
brief | Brief | One-to-One | Parent brief |
user | User | Many-to-One | Creator |
machines | Machine[] | Many-to-Many | Selected machines |
providers | Provider[] | Many-to-Many | External service providers |
priceSequence | BriefPriceSequence[] | One-to-Many | Metadata to manage the semi-supervised edition |
predictionRequestComputed | PredictionRequestComputed[] | One-to-Many | Manufacturing process |
Cost Breakdown Schema
Section titled “Cost Breakdown Schema”{ // Materials materialsCost: number; materialsDetails: { paper: number; cardboard: number; corrugated: number; other: number; };
// Production printingCost: number; dieCuttingCost: number; finishingCost: number; assemblyCost: number;
// Overhead toolingOverhead: number; productionOverhead: number; deliveryOverhead: number;
// Margin marginPercentage: number; marginAmount: number;
// Totals subtotal: number; taxes: number; grandTotal: number;}Price Calculation
Section titled “Price Calculation”Total Product Cost:
const totalCost = briefPrice.productCost + briefPrice.toolingCost + briefPrice.toolingCostDelta + briefPrice.deliveryCost + briefPrice.deliveryCostDelta;Use Cases
Section titled “Use Cases”- Quote Generation: Access
totalPricefor customer quotes - Cost Analysis: Use
costBreakdownfor detailed analysis - Manufacturing Planning: Reference
priceSequencefor process details - Price Adjustments: Apply deltas for manual corrections
- Quote Versioning: Track iterations via
parentIdandrootId - ERP Integration: Map costs to ERP pricing modules
Accessing Data
Section titled “Accessing Data”BriefPrice data is included when fetching brief details:
GET /briefs/:id/detailsReturns brief with nested predictionRequest object.
For value analysis with optimization:
GET /briefs/:id/value-analysisReturns BriefPrice with detailed cost breakdown and optimization opportunities.
Important Notes
Section titled “Important Notes”- The entity is stored as
prediction_requeststable but exposed asBriefPricein API - Always has a 1:1 relationship with Brief
aliciaResponsecontains the raw AI prediction data (not loaded by default)processCountdetermines number of manufacturing sequences- Deltas (
toolingCostDelta,deliveryCostDelta) allow manual price adjustments
Related Endpoints
Section titled “Related Endpoints”GET /briefs/:id/details- Get complete brief including BriefPriceGET /briefs/:id/value-analysis- Get detailed cost breakdown
See Also
Section titled “See Also”- Brief - Parent brief entity
- BriefPriceSequence - Manufacturing sequences
- Brief Integration Guide - Complete integration documentation