Freight Mode

Entity representing a freight delivery mode. Tracks real delivery time from submission to delivery, estimated lead times, tax rate, and routing context. Future support for pack-size cost estimation via real-time freight APIs.


Setup

  • Go to settings and select Freight Modes.
  • Create a freight mode and provide a name, optional description, icon, and any known lead-time expectations.
  • Set tax rate (decimal) 0.2 is 20%.
  • Use this freight mode on purchase orders to capture real submission-to-delivery times. These feed your actuals for forecasting.

Attributes

freight-mode.schema.ts
1model FreightMode { 2 id String @id() @default(dbgenerated("gen_random_uuid()")) @db.Uuid() 3 modifiedAt DateTime? @updatedAt() 4 modifiedById String? @db.Uuid() 5 modifiedByEmail String? 6 modifiedByEndpoint String? 7 companyId String @db.Uuid() 8 company Company @relation("assetOfCompany", fields: [companyId], references: [id], onDelete: Cascade) 9 name String 10 description String? 11 defaultLeadTime Int? 12 estimatedLeadTime Int? 13 taxRate Decimal? 14 icon String @default("truck") 15 purchaseOrders PurchaseOrder[] 16 17 @@unique([companyId, id]) 18 @@index([companyId]) 19}

Capabilities

Lead Time Tracking

Capture default and estimated lead times; actuals are computed from purchase orders that use this mode.

Tax and Route Context

Store tax rate and route metadata like origin and destination countries for compliance and costing.

Future: Pack Size Costing

Will support estimating delivery cost by variant pack sizes via real-time freight API data.

Relationships

freight-mode.relations.ts
1type FreightMode = { 2 id: string // uuid 3 companyId: string // uuid 4 name: string 5 description?: string 6 defaultLeadTime?: number 7 estimatedLeadTime?: number 8 taxRate?: decimal 9 icon: string 10 // Relations 11 company: Company 12 purchaseOrders: PurchaseOrder[] 13}

FAQ

Copyright © 2025 Stockmate
All rights reserved