Skip to content

PredictionRequestComputed

PredictionRequestComputed contains computed manufacturing process data and pricing details for individual brief elements. This entity stores the detailed production sequences, machine operations, cost calculations, and optimization data generated by the pricing engine for each product in a brief. It represents one manufacturing process variant for a specific element.

  • Store manufacturing process sequences and operations
  • Link element positions to manufacturing details
  • Provide detailed cost breakdowns by category
  • Track machine operations and provider services
  • Support production optimization recommendations
  • Calculate unit pricing and production time
PropertyTypeDescription
idUUIDUnique identifier
positionnumberElement position (0-indexed, matches BriefElement.position)
predictionRequestIdUUIDParent BriefPrice reference
PropertyTypeDescription
unitPricenumberUnit price per piece (€)
toolingCostnumberTooling cost (€)
deliveryCostnumberDelivery cost (€)
productCostnumberProduct manufacturing cost (€)
PropertyTypeDescription
productionTimenumberProduction time (hours)
partsCountnumberNumber of parts/components
partsRecord<string, string>Parts breakdown (JSONB)
productIdsstring[]Related product IDs
PropertyTypeDescription
sheetSizeWidthnumberSheet width (mm)
sheetSizeHeightnumberSheet height (mm)
layoutCountnumberNumber of layouts per sheet
simulationPliantLargeurPredisnumberSimulated flat width (mm)
simulationPliantHauteurPredisnumberSimulated flat height (mm)
simulationNbPosesPliantPredisnumberNumber of positions on sheet
nbFeuilleTotalPliantPredisnumberTotal sheet count
pliantObjFoldingWeightnumberFolding weight (kg)
PropertyTypeDescription
pliantPredisnumberFlat cost
cartonStructurePredisnumberCardboard structure cost
encrageRectoDeBasePredisnumberBase printing cost
plaqueOffsetPredisnumberOffset plate cost
vernisDeBasePredisnumberBase varnish cost
plaqueVernisPredisnumberVarnish plate cost
pelliculagePredisnumberLamination cost
varnishOrScreenprintingPredisnumberVarnish/screenprinting cost
ecranSerigraphiePredisnumberScreen printing cost
dorurePredisnumberHot stamping cost
colleContreCollagePredisnumberCounter-mounting glue cost
colleFenetrePrixPredisnumberWindow glue cost
petFenetrePrixPredisnumberWindow PET cost
digipackPredisnumberDigipack cost
sachetsPrixPredisnumberBags cost
cellophanePredisnumberCellophane cost
caissePredisnumberBox cost
palettePredisnumberPallet cost
predictedDeliveryPricenumberPredicted delivery price
predictedThousandPricenumberPrice per thousand units
prixFinalTotalPredisnumberFinal total price
decorticageCarcassePredisnumberCarcass stripping cost
decoupeCarcassePredisnumberCarcass cutting cost
sealingStripPredisnumberSealing strip cost
totalPrixMachinePredisnumberTotal machine price
PropertyTypeDescription
costBreakdownCostBreakdownDetailed cost breakdown (JSONB)
costSummaryCostSummaryCost summary (JSONB)
PropertyTypeDescription
commercialMarginInitialnumberInitial commercial margin (0-0.99)
commercialMarginnumberApplied commercial margin (0-0.99)
optimisationsRequestOptimisation[]Optimization recommendations
optimisationQuantitynumberOptimized quantity
optimiseProductQuantityPerDecorationDecorationCount[]Optimized quantities per decoration
PropertyTypeDescription
createdAtDateCreation timestamp
updatedAtDateLast update timestamp
RelationshipEntityTypeDescription
predictionRequestBriefPriceMany-to-OneParent pricing data
predictionMachineOperationRatesPredictionMachineOperationRate[]One-to-ManyMachine operation details with rates and pace
predictionProvidersOperationsRatesPredictionProvidersOperationsRate[]One-to-ManyExternal provider operation details
predictionOperationSequencePredictionOperation[]One-to-ManyOrdered sequence of manufacturing operations

The position property is critical for linking manufacturing data to brief elements:

// Access manufacturing details for first element (position: 0)
GET /briefs/:briefId/process/0
// The position matches:
const element = brief.briefElements[0]; // position: 0
const computed = briefPrice.predictionRequestComputed.find(prc => prc.position === 0);
interface CostBreakdown {
// Materials
materialsCost: number;
materialsDetails: {
paper: number;
cardboard: number;
corrugated: number;
other: number;
};
// Operations
printingCost: number;
dieCuttingCost: number;
finishingCost: number;
assemblyCost: number;
// Breakdown by operation
operationsCost: {
operationId: string;
operationName: string;
cost: number;
}[];
// Total
totalCost: number;
}
interface CostSummary {
subtotal: number;
taxes: number;
total: number;
margin: number;
marginPercentage: number;
}

The optimisations field contains recommendations for cost reduction:

enum RequestOptimisation {
INCREASE_QUANTITY = 'INCREASE_QUANTITY',
CHANGE_MATERIAL = 'CHANGE_MATERIAL',
SIMPLIFY_FINISHING = 'SIMPLIFY_FINISHING',
ADJUST_DIMENSIONS = 'ADJUST_DIMENSIONS'
}
  1. Manufacturing Details: Access via GET /briefs/:id/process/:position to get full manufacturing process for element
  2. Cost Analysis: Use costBreakdown for detailed cost components
  3. Production Planning: Reference predictionOperationSequence for operation order
  4. Machine Selection: Check predictionMachineOperationRates for required machines
  5. Optimization: Review optimisations array for cost-saving recommendations
  6. Multi-Product Briefs: Use position to match elements with their manufacturing data

PredictionRequestComputed data is accessed through Brief endpoints:

Terminal window
# Get manufacturing details for specific element
GET /briefs/:id/process/:elementPosition
# Get complete pricing with all computed data
GET /briefs/:id/details

The /process/:elementPosition endpoint returns the PredictionRequestComputed for the specified element position (0-indexed).

  • Position is 0-indexed: First element is position 0, second is position 1, etc.
  • One per element per variant: Each BriefElement may have multiple PredictionRequestComputed entities representing different manufacturing approaches
  • Legacy fields: Many *Predis fields are legacy cost components from older prediction models
  • Cost structures: Prefer costBreakdown and costSummary over individual *Predis fields for modern integrations
  • Margin validation: Commercial margin fields are constrained between 0 and 0.99 (0% to 99%)
  • JSONB fields: costBreakdown, costSummary, parts, and optimiseProductQuantityPerDecoration are stored as JSONB for flexible structure

The predictionOperationSequence relationship contains the ordered sequence of manufacturing operations required to produce the element. Each operation represents one step in the manufacturing process with complete details about machines, materials, layouts, and costs.

Key Information:

  • Operations ordered by position (0-indexed)
  • Multi-part products grouped by partNumber
  • Each operation links to specific machine, materials, and provider
  • Contains detailed sheet layouts, logistics, and cost breakdowns

📖 Full PredictionOperation Entity Documentation

Quick Example:

// Access operations in sequence
const operations = predictionRequestComputed.predictionOperationSequence;
operations.sort((a, b) => a.position - b.position);
// First operation details
const op = operations[0];
console.log(`${op.operation.name} on ${op.machine.name}`);
console.log(`Time: ${op.setupTime}h setup + ${op.rollingTime}h rolling`);
console.log(`Sheets: ${op.sheetQuantity} @ ${op.sheetWidth}x${op.sheetHeight}mm`);

  • GET /briefs/:id/process/:position - Get manufacturing details for specific element (includes full PredictionRequestComputed with predictionOperationSequence)
  • GET /briefs/:id/details - Get complete brief with all PredictionRequestComputed data
  • GET /briefs/:id/value-analysis - Get cost analysis with optimization recommendations