Product Management

Data Entities

31 entities across 5 subject areas. Click any entity to expand its attributes, relationships, and business rules.

31
Entities
5
Subject areas
23
Core entities
5
Junction entities
3
Lookup entities
How entities connect

Core trading flow

The main entities in a trade, flowing top to bottom. Supporting entities shown alongside. Not all 31 are here - see the full definitions below.

Company
Customer / Supplier
Contract
Sales / Purchase
Contract Line Item
Product + Qty + Price
Lot Allocation
Links lot to sales line
Inventory Lot
The trading unit
Product
Identity + Grade
Division
HSC / Punta / Merch
Commission Rule
Agent + Rate
Delivery Stage
BoL / Shipment
Bale
Gross / Tare / Nett
Blending
Input lots feed into blends via 4 processing paths ↓
Blend Cost Line
Processing costs
Blend
Scouring / Tops / Cutting / Superwash
Blend Input
Planned / Actual qty
produces (via Blend Output)
Blend Output
Role + Cost apportionment
Inventory Lot
Output (top + noil for Punta)
Lot Charge
Storage / Carriage
Contract + Lot data generate documents ↓
Document
Invoice / Packing list
Journal Line
Dr/Cr for GP export
Nominal Code Mapping
GL codes per company
FX Forward Contract
Currency hedge
FX Conversion
Actual rate + gain/loss
Trading
Blending
Stock / Allocation
Supporting
Not shown: Grade, Product Group Membership, Product Alias, Contact, Overprice Rule, Lot Farm, Bale, FX Contract Allocation, User, Audit Log Entry, Notification
Product Management 5 entities
Grade
Wool quality classification
Lookup 8 attributes

Reference classification for wool quality. A grade code inherently defines several product attributes (consistency, colour, type, origin) for approximately 70% of products. Currently mature for greasy wool - needs extending to cover other commodity types.

AttributeTypeRequiredDescription
grade_idIdentifierYesUnique ID
grade_codeShort TextYesNumeric/alphanumeric grade code (e.g. 226, 11057). Unique within commodity_code.
commodity_codeShort TextYesWhich commodity this grade applies to
nameShort TextYesDisplay name
descriptionTextNoWhat this grade represents
originShort TextNoCountry/region this grade implies
colourShort TextNoColour this grade implies
is_activeBooleanYesWhether available for new products. Default: true
Relationships
  • Product (1:M) - A grade classifies many products
Product
Uniquely catalogued product defined by fixed attributes
Core 12 attributes

A uniquely catalogued product defined by its fixed attributes. The commodity attribute indicates the product's typical role: greasy products are primarily materials (purchased, blended) but can also be sold directly; scoured/tops/etc. are sales items. Traders work at lot/batch level within a product.

AttributeTypeRequiredDescription
product_idIdentifierYesUnique ID
grade_idReferenceYesLinks to Grade
commodityEnumYesGreasy, Scoured, Noil, Tops, Open Tops, Carbonised. Determines role.
breedEnumYesFine, Medium, Crossbred, Hill, Mountain, Natural, Merino, Polwarth, Corriedale, Romney
wool_typeEnumYesFleece, Lambs, Shears, Pieces, Tannery
originShort TextYesCountry of origin
colourEnumYesWhite, Yellow, Average, Natural Coloured, Light Grey
length_rangeEnumNo1-3, 2-3, 2-4, 2-5, 3-4, 3-5, 4-5, 4-6, 5-6 (inches)
certifiedEnumNoNone, RWS, GOTS. Default: None
display_nameShort TextYesHuman-readable product name
statusEnumYesActive, Archived. Default: Active
created_atDateTimeYesRecord creation timestamp
Relationships
  • Grade (M:1) - Every product has a grade
  • Product Group (M:M) - Via Product Group Membership
  • Product Alias (1:M) - Customer-specific names
  • Contract Line Item (1:M) - Products appear on contract lines
  • Inventory Lot (1:M) - Lots belong to a product
  • Blend (1:M) - Blends target a product as output
Product Group
User-defined label for aggregating products
Core 5 attributes

A user-defined label for aggregating products for reporting and filtering. Products can sit in multiple groups. Groups drive position views but don't affect system logic.

AttributeTypeRequiredDescription
product_group_idIdentifierYesUnique ID
nameShort TextYesGroup name (e.g. "BRE Crosses", "NZ Merino")
descriptionTextNoWhat this group represents
created_byReferenceNoLinks to User who created it
created_atDateTimeYesRecord creation timestamp
Relationships
  • Product (M:M) - Via Product Group Membership
Product Group Membership
Links products to groups
Junction 4 attributes

Junction entity linking products to groups. A product can belong to many groups. A group contains many products.

AttributeTypeRequiredDescription
product_group_membership_idIdentifierYesUnique ID
product_idReferenceYesLinks to Product
product_group_idReferenceYesLinks to Product Group
added_atDateTimeYesWhen added to the group
Relationships
  • Product (M:1) - The product being grouped
  • Product Group (M:1) - The group it belongs to
Product Alias
Customer-specific product name
Core 5 attributes

A customer-specific display name for a product. The product has one canonical identity but can display different names to different customers. Handles naming convention differences (e.g. type number "18WA" dictated by one customer).

AttributeTypeRequiredDescription
product_alias_idIdentifierYesUnique ID
product_idReferenceYesLinks to Product
company_idReferenceYesLinks to Company (customer)
alias_nameShort TextYesWhat this customer calls the product
created_atDateTimeYesRecord creation timestamp
Relationships
  • Product (M:1) - The canonical product
  • Company (M:1) - The customer using this name
Trading 8 entities
Company
Organisation that Standard Wool trades with
Core 16 attributes

Any organisation Standard Wool trades with - customer, supplier, or both. Also includes processors (Chadwicks) and hauliers (Bower Green). GP vendor/customer codes (V/C prefix) are maintained for export compatibility.

AttributeTypeRequiredDescription
company_idIdentifierYesUnique ID
company_codeShort TextYesShort reference code (e.g. SWUK, CHAD)
nameShort TextYesCompany name
company_typeEnumYesCustomer, Supplier, Both, Processor, Haulier
address_line_1Short TextNoAddress line 1
address_line_2Short TextNoAddress line 2
cityShort TextNoCity
postcodeShort TextNoPostcode
countryShort TextNoCountry
vat_numberShort TextNoVAT number
payment_termsShort TextNoDefault payment terms
sage_account_codeShort TextNoMapped code for Sage integration
gp_vendor_codeShort TextNoDynamics GP vendor code (V prefix, e.g. V15500)
gp_customer_codeShort TextNoDynamics GP customer code (C prefix, e.g. C45044)
is_activeBooleanYesDefault: true
created_atDateTimeYesRecord creation timestamp
Relationships
  • Contact (1:M) - People at this company
  • Contract (1:M) - As customer or supplier
  • Product Alias (1:M) - Customer-specific product names
  • Blend (1:M) - As processor (Chadwicks)
  • Blend Cost Line (1:M) - As processor on specific cost lines
Contact
Person at a company
Core 9 attributes

A person at a company.

AttributeTypeRequiredDescription
contact_idIdentifierYesUnique ID
company_idReferenceYesLinks to Company
first_nameShort TextYesFirst name
last_nameShort TextYesLast name
emailShort TextNoEmail address
phoneShort TextNoPhone number
roleShort TextNoJob title or function
is_primaryBooleanYesPrimary contact for this company. Default: false
created_atDateTimeYesRecord creation timestamp
Relationships
  • Company (M:1) - Belongs to a company
Division
Trading entity within Standard Wool UK
Lookup 8 attributes

A trading entity within Standard Wool UK. Each division is a trading desk with its own buying, selling, and position. Each division maps to a GP company which determines the nominal codes used for accounting exports.

AttributeTypeRequiredDescription
division_idIdentifierYesUnique ID
codeShort TextYesHSC, MERCH, TOPS, PUNTA
nameShort TextYesFull name (Home Scour, Merchanting, Tops, Punta)
descriptionTextNoWhat this trading desk does
gp_companyShort TextYesDynamics GP company code (SWB or JHP). Determines nominal codes.
gp_company_nameShort TextNoGP company display name (Standard Wool Bradford, Jacomb Hoare Punta)
gp_division_codeShort TextNoDivision code used in GP exports (e.g. SWH, JHP)
is_activeBooleanYesDefault: true
Relationships
  • Contract (1:M) - Contracts belong to a division
  • Inventory Lot (1:M) - Lots belong to a division
  • User (1:M) - Traders assigned to a division
Contract
Sales or purchase agreement
Core 21 attributes

A sales or purchase agreement with a company. In the sell-forward model, sales contracts are created first, then purchase contracts follow to fulfil them. Type attribute distinguishes sales from purchase.

AttributeTypeRequiredDescription
contract_idIdentifierYesUnique ID
contract_numberShort TextYesHuman-readable reference
contract_typeEnumYesSales, Purchase
company_idReferenceYesCustomer (sales) or supplier (purchase)
division_idReferenceYesWhich trading desk
trader_idReferenceYesWho created it
contract_dateDateYesDate created
currency_codeEnumYesGBP, USD, NZD, EUR
statusEnumYesOpen, Partially Fulfilled, Complete, Cancelled. Default: Open
customer_order_refShort TextNoCustomer's own reference
payment_terms_textShort TextNoPayment terms as displayed (e.g. "120 DAYS")
payment_terms_daysNumberNoNumeric credit period in days
delivery_termsShort TextNoIncoterms + location (e.g. "DAP CLIENTS MILL")
bank_accountShort TextNoBank account for this contract (sales)
payment_instructionsTextNoSWIFT/IBAN details printed on invoices (sales)
print_companyShort TextNoCompany name for document printing
borrowing_rateDecimalNoAnnual borrowing rate for payment term cost calc
remarksTextNoFree text notes
is_back_to_backBooleanYesBought and sold simultaneously. Default: false
spot_rateDecimalNoSpot FX rate at time of contract
created_atDateTimeYesRecord creation timestamp
Relationships
  • Company (M:1) - Customer or supplier
  • Division (M:1) - Which trading desk
  • User (M:1) - Trader who created it
  • Contract Line Item (1:M) - Lines on this contract
  • Commission Rule (1:M) - Commission agents/rates
  • Overprice Rule (1:M) - Additional charges
  • Document (1:M) - Invoices, packing lists generated
  • FX Conversion (1:M) - Currency conversions recorded
  • Currency Forward Contract (M:M) - FX hedges (via FX Contract Allocation)
Contract Line Item
Product + quantity + price on a contract
Core 21 attributes

A single line on a contract - product, quantity, price, currency. One contract can have multiple lines for different products or delivery tranches. For sales contracts, also carries cost-of-sale estimates and replacement price for margin management.

AttributeTypeRequiredDescription
line_item_idIdentifierYesUnique ID
contract_idReferenceYesParent contract
lot_numberShort TextYesSale or purchase lot number (SH/SM/H/M prefix)
product_idReferenceYesWhat's being bought or sold
descriptionTextNoFree text wool description (legacy/customer-facing)
quantity_weightDecimalYesContracted weight
weight_unitEnumYesKG, LB. Default: KG
num_balesNumberNoNumber of bales contracted
price_per_unitDecimalYesPrice in contract currency
price_basisEnumNoClean, Greasy, Conditioned
yield_estimateDecimalNoEstimated yield % (purchase contracts)
replacement_priceDecimalNoManual entry - current replacement value (sales, for weekly report)
estimated_shipping_per_kgDecimalNoEstimated shipping cost per kg at point of sale
insurance_rateDecimalNoCredit insurance rate (e.g. 0.0055 for 0.55%)
insurance_costDecimalNoDerived: invoice value x insurance rate
payment_term_costDecimalNoDerived: value x (borrowing_rate / 365 x payment days)
estimated_total_cost_of_saleDecimalNoSum of shipping + insurance + terms + commission
actual_shipping_costDecimalNoAllocated from actual shipping invoice post-dispatch
shipping_invoice_refShort TextNoReference to the actual shipping invoice
statusEnumYesOpen, Partially Fulfilled, Complete. Default: Open
created_atDateTimeYesRecord creation timestamp
Relationships
  • Contract (M:1) - Parent contract
  • Product (M:1) - What's being traded
  • Delivery Stage (1:M) - Partial fulfilment tracking
  • Lot Allocation (1:M) - Stock allocated to fulfil this line (sales)
  • Inventory Lot (1:M) - Lots received against this line (purchase)
Delivery Stage
Planned delivery tranche
Core 15 attributes

A planned delivery tranche against a contract line. Tracks partial fulfilment and customer call-offs against forward contracts. The bill of lading date is critical - it triggers invoice financing declaration to the bank.

AttributeTypeRequiredDescription
delivery_stage_idIdentifierYesUnique ID
line_item_idReferenceYesParent line item
shipment_numberNumberYesSequence within the line item
planned_dateDateYesExpected shipment/arrival date
actual_dateDateNoActual date
num_balesNumberNoBales in this shipment
weightDecimalNoWeight in this shipment
ship_fromShort TextNoOrigin location
ship_toShort TextNoDestination
vesselShort TextNoShip/vessel name (sea freight)
container_nosShort TextNoContainer number(s)
bill_of_lading_dateDateNoDate BoL produced - triggers finance declaration
bill_of_lading_refShort TextNoBoL document reference
statusEnumYesPlanned, In Transit, Received, Dispatched. Default: Planned
remarksTextNoNotes
Relationships
  • Contract Line Item (M:1) - Parent line item
Commission Rule
Commission agent/rate on a contract
Core 8 attributes

Commission agent and rate on a contract. Defined at contract level, applied when invoices are generated. Flows through to GP posting.

AttributeTypeRequiredDescription
commission_idIdentifierYesUnique ID
contract_idReferenceYesParent contract
agent_codeShort TextYesCommission agent/broker code
agent_nameShort TextNoAgent name
commission_percentDecimalNoPercentage rate
commission_amountDecimalNoFixed amount (if not percentage)
currency_codeEnumNoGBP, USD, NZD, EUR
remarksTextNoNotes
Relationships
  • Contract (M:1) - Belongs to a contract
Overprice Rule
Additional charge on a contract
Core 7 attributes

Additional charges above base price on a contract. Defined at contract level, applied at invoicing.

AttributeTypeRequiredDescription
overprice_idIdentifierYesUnique ID
contract_idReferenceYesParent contract
overprice_codeShort TextYesType code for the charge
descriptionShort TextNoWhat this charge is for
amountDecimalYesCharge amount
currency_codeEnumNoGBP, USD, NZD, EUR
remarksTextNoNotes
Relationships
  • Contract (M:1) - Belongs to a contract
Stock & Blending 9 entities
Inventory Lot
Specific batch of wool - the atomic trading unit
Core 29 attributes

A specific batch of wool with its own tested attributes, cost, and lifecycle. The atomic unit of all trading. All allocations, invoices, and margins happen at lot level. Lot type reflects origin and commodity state (H = greasy home scour, M = merchanting, SS = standard scoured, SH = shears, SM = slivermaker, JH = Jacomb Hoare/Punta, P = Punta, NL = noil by-product).

AttributeTypeRequiredDescription
lot_idIdentifierYesUnique ID
lot_numberShort TextYesLot reference (H19736, M19736, SS15513, etc.)
lot_typeEnumYesH, M, SS, SH, SM, JH, P, NL
product_idReferenceYesWhat product this lot is
division_idReferenceYesWhich trading desk
purchase_line_item_idReferenceNoPurchase contract line (for purchased lots). Null for blend outputs.
blend_idReferenceNoBlend that produced this lot (for scoured lots). Null for purchased lots.
num_balesNumberYesBale count
greasy_weightDecimalNoWeight before scouring (kg)
clean_weightDecimalNoWeight after scouring / clean equivalent (kg)
yield_percentDecimalNoYield % (clean / greasy)
conditioning_percentDecimalNoStandard conditioning allowance for this lot
regain_percentDecimalNoMoisture regain percentage
cost_per_kgDecimalYesCost in original currency
cost_currencyEnumYesGBP, USD, NZD, EUR
cost_gbpDecimalNoCost converted to GBP for comparison
processing_costDecimalNoScouring/processing cost (blend outputs)
micronDecimalNoTested fineness (batch-specific)
vm_percentDecimalNoVegetable matter % (batch-specific)
colour_reading_yzShort TextNoY-Z colour reading (batch-specific)
lengthShort TextNoTested length / Length HM for tops (batch-specific)
bw_sale_noShort TextNoBritish Wool auction sale number
bw_lot_noShort TextNoBritish Wool lot / supplier batch number
depotShort TextNoWhere graded (UK wool)
warehouseShort TextNoCurrent physical location (e.g. Bower Green, Thomas Chadwick)
received_dateDateNoDate goods received
dispatched_dateDateNoDate lot was dispatched (for stock turnover calculation)
statusEnumYesIn Stock, Allocated, Consumed, Dispatched. Default: In Stock
created_atDateTimeYesRecord creation timestamp
Relationships
  • Product (M:1) - What product this lot is
  • Division (M:1) - Which trading desk
  • Contract Line Item (M:1) - Purchase line this was received against
  • Blend (M:1) - Blend that produced this lot (convenience FK, Blend Output is authoritative)
  • Blend Output (1:1) - Blend output record for this lot (if produced by a blend)
  • Bale (1:M) - Individual bales in this lot
  • Lot Farm (1:M) - Farm traceability
  • Lot Allocation (1:M) - Sales allocations from this lot
  • Lot Charge (1:M) - Third-party charges against this lot (storage, carriage)
  • Blend Input (1:M) - Used as input in blends
Lot Allocation
Links lots to sales contract lines
Junction 7 attributes

Links an inventory lot to a sales contract line. Records which lots are allocated to fulfil which sales. A lot can be split across multiple sales, and a sales line can be fulfilled from multiple lots.

AttributeTypeRequiredDescription
allocation_idIdentifierYesUnique ID
lot_idReferenceYesWhich lot
sales_line_item_idReferenceYesWhich sales line
allocated_weightDecimalYesWeight allocated from this lot
allocated_balesNumberNoBales allocated
allocated_atDateTimeYesWhen allocation was made
statusEnumYesAllocated, Dispatched, Invoiced. Default: Allocated
Relationships
  • Inventory Lot (M:1) - The lot being allocated from
  • Contract Line Item (M:1) - The sales line being fulfilled
Lot Farm
Farm traceability per lot
Core 4 attributes

Farm traceability per lot. Especially important for Punta where full traceability is being requested. A lot can come from 10+ farms.

AttributeTypeRequiredDescription
lot_farm_idIdentifierYesUnique ID
lot_idReferenceYesWhich lot
farm_nameShort TextYesFarm name
notesTextNoNotes
Relationships
  • Inventory Lot (M:1) - Which lot this farm contributed to
Bale
Individual bale within a lot
Core 8 attributes

An individual bale within an inventory lot. Each bale has its own weights. Bale data enables automatic packing list generation, solving the current pain point of manual re-entry of bale weights.

AttributeTypeRequiredDescription
bale_idIdentifierYesUnique ID
lot_idReferenceYesWhich lot this bale belongs to
bale_numberShort TextYesBale identifier within the lot
gross_weightDecimalYesWeight including packaging
tare_weightDecimalNoWeight of packaging
nett_weightDecimalYesWool weight (gross minus tare)
marksShort TextNoBale marks/identification
warehouse_locationShort TextNoWhere the bale is stored
Relationships
  • Inventory Lot (M:1) - Which lot this bale belongs to
Blend
Manufacturing operation - transforms input lots into output lots via a processing path
Core 17 attributes

A manufacturing operation that transforms input lots into output lots via a processing path. The processing_type determines the transformation: Scouring (greasy → scoured), Tops Making (scoured → top + noil with cost apportionment), Cutting (top → cut top, cost accumulation), or Superwash (top → treated top, cost accumulation). Historical blends serve as the recipe knowledge base. Primary workflow is clone and modify.

AttributeTypeRequiredDescription
blend_idIdentifierYesUnique ID
blend_numberShort TextYesBlend reference (e.g. BL26047)
processing_typeEnumYesScouring, Tops Making, Cutting, Superwash. Determines valuation rules and valid output roles.
target_product_idReferenceYesThe sales product being produced
product_group_idReferenceNoProduct group context for generic blends
customer_idReferenceNoCustomer context (enables bespoke clone lookup)
division_idReferenceYesWhich trading desk
processor_idReferenceYesPrimary processor (Chadwicks)
cloned_from_blend_idReferenceNoWhich blend was cloned to create this one
target_weight_cleanDecimalNoTarget clean output weight in kg
planned_dateDateNoWhen blend is planned
completed_dateDateNoWhen blend was resulted
statusEnumYesPlanned, Instructed, Processing, Resulted, Cancelled. Default: Planned
instructionsTextNoSpecific blend instructions sent to processor
remarksTextNoInternal notes
run_numberShort TextNoProcessor's run reference (e.g. C35147)
created_atDateTimeYesRecord creation timestamp
Relationships
  • Product (M:1) - Target product being produced
  • Product Group (M:1) - Product group context (optional)
  • Company (M:1) - Customer context / processor
  • Division (M:1) - Which trading desk
  • Blend (M:1) - Self-referencing clone source
  • Blend Input (1:M) - Input lots used in this blend
  • Blend Output (1:M) - Output lots produced by this blend (with cost apportionment)
  • Blend Cost Line (1:M) - Individual processing/cost lines
  • Document (1:M) - Blend instructions and invoices
Blend Input
Lot used as blend input with planned/actual qty and costs
Junction 10 attributes

A specific lot used as input to a blend, with planned and actual quantities and costs. For scouring blends the input is greasy wool; for tops making, cutting, and superwash the input is scoured wool or tops. Captures the fact that recipes are estimates - planned weight is set on creation, actual weight entered when the processor sends back results.

AttributeTypeRequiredDescription
blend_input_idIdentifierYesUnique ID
blend_idReferenceYesWhich blend
lot_idReferenceYesWhich input lot
planned_weightDecimalNoPlanned input weight to use (kg)
actual_weightDecimalNoActual input weight used (set on resulting)
planned_percentDecimalNoTarget % of blend
actual_percentDecimalNoActual % (derived from actual weights)
input_cost_per_kgDecimalNoInput cost per kg at time of blend (greasy cost for scouring, clean cost for other paths)
clean_cost_per_kgDecimalNoClean cost per kg (input cost / yield for scouring; same as input cost for other paths)
yield_percentDecimalNoYield for this lot at time of blend (applicable to scouring; null for cutting/superwash)
Relationships
  • Blend (M:1) - Which blend
  • Inventory Lot (M:1) - Which input lot
Blend Output
Lot produced by a blend with output role and cost apportionment
Junction 8 attributes

An output lot produced by a blend, with its role and cost apportionment method. For scouring, cutting, and superwash there is typically one output (Primary, Full Cost). For tops making (Punta), the blend produces two outputs: a top (Primary, absorbs balance of apportioned cost) and a noil (ByProduct, valued at a predetermined price per kg).

AttributeTypeRequiredDescription
blend_output_idIdentifierYesUnique ID
blend_idReferenceYesWhich blend produced this output
lot_idReferenceYesThe output lot created
output_roleEnumYesPrimary, ByProduct. Primary = main product; ByProduct = secondary output (e.g. noil).
valuation_methodEnumYesFull Cost, Apportioned Balance, Predetermined Price. Determines how cost is allocated to this output.
predetermined_price_per_kgDecimalNoFixed price per kg for by-products. Required when valuation_method = Predetermined Price.
actual_weightDecimalYesOutput weight in kg
allocated_costDecimalYesTotal cost allocated to this output (derived from valuation rules)
Relationships
  • Blend (M:1) - Which blend produced this output
  • Inventory Lot (1:1) - The output lot created (unique constraint on lot_id)
Blend Cost Line
Individual cost line on a blend (processing, opening, etc.)
Core 12 attributes

An individual cost line on a blend. Blends have multiple cost components - scouring (Chadwicks), opening (Andar Opener), metal removal, and other processing. Each line can be external (from a processor) or internal (derived from input lot costs). Multiple processors can work on the same blend.

AttributeTypeRequiredDescription
blend_cost_idIdentifierYesUnique ID
blend_idReferenceYesWhich blend
cost_descriptionShort TextYesWhat this cost is (e.g. "Processing Cost", "Andar Opener")
charge_sourceEnumYesExternal (processor invoice), Internal (input cost)
processor_idReferenceNoWhich processor (for external costs)
weight_kgDecimalYesWeight basis for cost calculation
cost_per_kgDecimalYesCost per kg in currency unit (pence for GBP)
currency_codeEnumYesGBP, USD, NZD, EUR
total_amountDecimalYesTotal cost (weight x cost_per_kg). Derived.
vat_rateDecimalNoVAT rate if applicable
vat_amountDecimalNoVAT amount. Derived.
invoice_refShort TextNoProcessor invoice reference
Relationships
  • Blend (M:1) - Which blend
  • Company (M:1) - Processor (for external costs)
Lot Charge
Third-party charge against a lot (storage, carriage, handling)
Core 10 attributes

A third-party charge against a specific inventory lot — storage fees, carriage costs, handling charges, or other ancillary costs that are not part of blend processing. Enables cross-referencing supplier invoices (e.g. Bower Green storage, haulier carriage) against actual stock movements for variance analysis.

AttributeTypeRequiredDescription
lot_charge_idIdentifierYesUnique ID
lot_idReferenceYesWhich lot this charge applies to
company_idReferenceYesWho charged (Bower Green, haulier, etc.)
charge_typeEnumYesStorage, Carriage, Handling, Other
charge_dateDateYesDate of the charge
weight_kgDecimalNoWeight basis if applicable
cost_per_kgDecimalNoRate per kg if applicable
total_amountDecimalYesTotal charge amount
invoice_refShort TextNoSupplier invoice reference
notesTextNoFree-text context
Relationships
  • Inventory Lot (M:1) - Which lot this charge applies to
  • Company (M:1) - Who charged
Documents & Finance 6 entities
Document
Generated trading document
Core 18 attributes

A generated trading document - sales invoice, purchase invoice, blend invoice, packing list, blend instruction, credit note, or stock adjustment. Auto-generated from data already in the system. Each document generates a set of balanced Journal Lines for GP export.

AttributeTypeRequiredDescription
document_idIdentifierYesUnique ID
document_numberShort TextYesDocument reference (e.g. S41947)
document_typeEnumYesSales Invoice, Purchase Invoice, Blend Invoice, Packing List, Blend Instruction, Credit Note, Stock Adjustment
contract_idReferenceNoRelated contract
blend_idReferenceNoRelated blend (for blend instructions)
company_idReferenceNoRecipient company
issue_dateDateYesDate issued
due_dateDateNoPayment due date (invoices)
total_amountDecimalNoDocument total
currency_codeEnumNoGBP, USD, NZD, EUR
total_gbpDecimalNoGBP equivalent
vat_amountDecimalNoVAT amount
gp_nominal_codeShort TextNoMapped GP GL code
gp_postedBooleanYesWhether pushed to GP. Default: false
gp_posted_atDateTimeNoWhen posted to GP
file_referenceShort TextNoPath/reference to generated PDF
statusEnumYesDraft, Issued, Posted, Failed. Default: Draft
created_atDateTimeYesRecord creation timestamp
Relationships
  • Contract (M:1) - Related trading contract
  • Blend (M:1) - Related blend
  • Company (M:1) - Recipient
  • Journal Line (1:M) - Double-entry journal lines for GP export
FX Conversion
Currency conversion record
Core 11 attributes

A record of when a trader converted currency and at what rate. Captures the difference between the contract rate and the actual conversion rate for FX gain/loss calculation.

AttributeTypeRequiredDescription
fx_conversion_idIdentifierYesUnique ID
contract_idReferenceYesWhich contract
from_currencyEnumYesUSD, NZD, EUR
to_currencyEnumYesGBP (usually)
amount_convertedDecimalYesAmount in original currency
contract_rateDecimalYesRate at time of contract
actual_rateDecimalYesRate actually received
gain_loss_gbpDecimalYesFX gain or loss in GBP (derived)
conversion_dateDateYesWhen the conversion happened
gp_journal_postedBooleanYesWhether FX journal posted to GP. Default: false
created_atDateTimeYesRecord creation timestamp
Relationships
  • Contract (M:1) - Which trading contract
Currency Forward Contract
FX hedge with bank/provider
Core 9 attributes

An FX hedging contract with a bank or FX provider. Tracks the hedging position for margin and exposure calculations. The PRD recommends an external FX provider (Wise Business, Airwallex) for the actual money movement.

AttributeTypeRequiredDescription
fx_contract_idIdentifierYesUnique ID
bank_referenceShort TextYesBank or FX provider reference
currency_codeEnumYesForeign currency being hedged
contracted_rateDecimalYesRate locked in
amountDecimalYesAmount of foreign currency hedged
maturity_dateDateYesWhen the contract expires
providerShort TextNoBank, Wise, Airwallex, etc.
statusEnumYesActive, Exercised, Expired. Default: Active
created_atDateTimeYesRecord creation timestamp
Relationships
  • Contract (M:M) - Via FX Contract Allocation
FX Contract Allocation
Links FX hedge to trading contracts
Junction 4 attributes

Links an FX hedge to specific trading contracts. A single hedge can cover multiple contracts, and a contract might draw from multiple hedges.

AttributeTypeRequiredDescription
fx_allocation_idIdentifierYesUnique ID
fx_contract_idReferenceYesWhich FX hedge
contract_idReferenceYesWhich trading contract
allocated_amountDecimalYesAmount of hedge allocated to this contract
Relationships
  • Currency Forward Contract (M:1) - The hedge
  • Contract (M:1) - The trading contract being hedged
Nominal Code Mapping
Maps transaction types to GL nominal codes per GP company
Lookup 5 attributes

Reference table mapping transaction types to GL nominal codes per GP company. Different divisions post to different GP companies (SWB vs JHP) with different nominal codes. Drives automated journal line generation.

AttributeTypeRequiredDescription
mapping_idIdentifierYesUnique ID
gp_companyShort TextYesGP company code (SWB, JHP)
transaction_typeEnumYesPurchase, Sale, Processing, PurchaseCharge, Commission, ClosingStock, StockMovement, VAT
nominal_codeShort TextYesGL account code (e.g. 0500, 0235, 4500)
descriptionShort TextYesHuman-readable purpose
Relationships
  • Journal Line (1:M) - Journal lines reference this mapping
Journal Line
Individual debit/credit line for GP export
Core 20 attributes

An individual debit or credit line in a double-entry journal for GP export. Every document generates a balanced set of journal lines. The system must ensure total debits equal total credits per document. Lines are exported in a fixed-width text format for GP import.

AttributeTypeRequiredDescription
journal_line_idIdentifierYesUnique ID
document_idReferenceYesParent document
nominal_codeShort TextYesGL account code (from Nominal Code Mapping or V/C code)
debit_creditEnumYesD, C
amountDecimalYesAmount in transaction currency
currency_codeEnumYesGBP, USD, NZD, EUR
fx_rateDecimalNoExchange rate to GBP
base_amountDecimalNoGBP equivalent (for foreign currency lines)
lot_numberShort TextNoLot reference
product_codeShort TextNoProduct code reference
vendor_customer_codeShort TextNoGP V/C prefix code
batch_refShort TextNoGP batch number
tax_codeEnumNoS (standard), Z (zero-rated), A
vat_amountDecimalNoVAT amount if applicable
user_codeShort TextNoOperator who created the transaction (e.g. AKJ, PSH)
descriptionTextNoFree-text narrative
transaction_dateDateNoTransaction date for the journal line
weight_qtyDecimalNoWeight or quantity associated with this line (kg)
export_statusEnumYesPending, Exported. Default: Pending
exported_atDateTimeNoWhen line was exported to GP
Relationships
  • Document (M:1) - Parent document
Platform 3 entities
User
System user - trader, finance, or admin
Core 8 attributes

A system user - trader, finance, or admin.

AttributeTypeRequiredDescription
user_idIdentifierYesUnique ID
usernameShort TextYesLogin username
emailShort TextYesEmail address
first_nameShort TextYesFirst name
last_nameShort TextYesLast name
roleEnumYesTrader, Finance, Admin, Management
division_idReferenceNoPrimary trading desk
is_activeBooleanYesDefault: true
Relationships
  • Division (M:1) - Primary trading desk
  • Contract (1:M) - Contracts created by this user
  • Notification (1:M) - Alerts assigned to this user
  • Audit Log Entry (1:M) - Actions logged by this user
Audit Log Entry
Action log with full context
Core 10 attributes

Every action logged with user, timestamp, entity, and full context. Designed to be ML-ready from day one - captures enough context to reconstruct the state at the time of any decision.

AttributeTypeRequiredDescription
audit_log_idIdentifierYesUnique ID
user_idReferenceYesWho performed the action
entity_typeShort TextYesWhich entity was affected (e.g. "Contract")
entity_idShort TextYesID of the affected entity
actionEnumYesCreated, Updated, Deleted, Status Changed
field_nameShort TextNoWhich field changed (for updates)
old_valueTextNoPrevious value
new_valueTextNoNew value
contextTextNoFull context snapshot
created_atDateTimeYesWhen the action happened
Relationships
  • User (M:1) - Who performed the action
Notification
Alert or task for a user
Core 9 attributes

An alert or pending task for a user. Covers threshold warnings (stock aging, margin breach), delivery date reminders, and pending action items.

AttributeTypeRequiredDescription
notification_idIdentifierYesUnique ID
user_idReferenceYesRecipient
notification_typeEnumYesAlert, Task, Threshold Warning
titleShort TextYesNotification title
messageTextYesNotification message
entity_typeShort TextNoRelated entity type
entity_idShort TextNoRelated entity ID
is_readBooleanYesDefault: false
created_atDateTimeYesWhen created
Relationships
  • User (M:1) - Assigned to this user