/* data.jsx — sample RFQs, rate-card context, and fallback drafts.
   FORK POINT: swap RATE_CARD + RFQS + SAMPLE_DRAFTS per client. */

// ---- Rate card / price-list context (fed to the model, prompt-cached) ----
window.RATE_CARD = `RMAI ESTIMATING — RATE CARD (AUD, ex GST) · effective 2026-Q2
MATERIALS (per finished part, incl. drop/offcut allowance)
  6061-T6 aluminium billet ........ $18.40   (small bracket / plate class)
  7075-T6 aluminium ............... $31.10
  4140 pre-hard steel block ....... $26.80
  304 stainless bar/tube .......... $22.50
MACHINE TIME (per part, typical small-batch)
  Facing / first op ............... $8.50
  Profile / contour milling ....... $14.20  (simple 2.5D outline)
  Drilling, per hole .............. $1.20
  Tapping, per hole ............... $1.30
  Knurling ........................ $4.60
  Reaming, per hole ............... $1.80
  Deburr + dimensional inspect .... $2.50
  Bead blast / anodise (outsource)  $6.90
ONE-OFF
  Setup & first-article ........... $45.00  per job
DEFAULT ASSUMPTIONS when a spec is silent
  - Tolerance ±0.1mm general, unless drawing states tighter.
  - Surface finish Ra 3.2 as-machined.
  - Lead time = setup day + ~0.15 day/part, rounded up to working days.
  - Default commercial margin 30%.`;

// ---- Inbox ----
window.RFQS = [
  {
    id: 'northlink-0847',
    co: 'NorthLink Fabrication',
    who: 'Megan Ortiz · Procurement',
    email: 'm.ortiz@northlinkfab.com.au',
    initials: 'NL',
    subject: 'RFQ — bracket assembly DWG-2024-0847 Rev C, qty 50',
    received: '08:14',
    qty: 50,
    material: '6061-T6 Al',
    drawings: 3,
    status: 'new',
    drawing: 'bracket',
    body:
`Hi — please quote the following for our Q3 build.

Part: bracket assembly, drawing DWG-2024-0847 Rev C (attached).
Qty: 50 off.
Material: 6061-T6 aluminium.
Delivery: 3 weeks if possible.

Key features off the drawing: 88 x 60 plate, 4x Ø6.0 mounting holes
tapped M6, a knurled boss, profiled outline. 45mm centre dim is called
but tolerance is not noted. Surface finish not specified.

Need your number this week — we're comparing a couple of shops.
Thanks, Megan`
  },
  {
    id: 'apex-mani',
    co: 'Apex Hydraulics',
    who: 'Dev Sharma · Engineering',
    email: 'dsharma@apexhyd.com.au',
    initials: 'AH',
    subject: 'Quote request: manifold block, 4140, qty 12',
    received: 'Yesterday',
    qty: 12,
    material: '4140 steel',
    drawings: 2,
    status: 'new',
    drawing: 'generic',
    body:
`Morning. We need a price on a hydraulic manifold block.

Material: 4140 pre-hard steel block.
Qty: 12 off, prototype batch.
Features: 6x cross-drilled ports, 8x tapped mounting holes (M8),
faced top and bottom, profiled outer. Ports reamed to size.
Tolerance on port bores ±0.05mm. Bead blast finish.

Lead time flexible. Send through when you can.`
  },
  {
    id: 'coastal-rail',
    co: 'Coastal Marine Co.',
    who: 'Priya Naidu · Fitout',
    email: 'priya@coastalmarine.com.au',
    initials: 'CM',
    subject: 'Stainless rail stanchions, 304, qty 80',
    received: 'Mon',
    qty: 80,
    material: '304 stainless',
    drawings: 1,
    status: 'drafted',
    drawing: 'generic',
    body:
`Hi team, repeat job — stainless stanchions for a marina handrail run.

Material: 304 stainless bar/tube.
Qty: 80 off.
Features: faced ends, 2x drilled + tapped M6 per part, profiled,
deburr all edges (marine, hand-contact). Bead blast finish.
Standard ±0.1mm is fine.

Same as last run if that helps. Cheers, Priya`
  }
];

// ---- Fallback / instant drafts (used if the live call is unavailable) ----
window.SAMPLE_DRAFTS = {
  'northlink-0847': {
    part: 'Bracket assembly · DWG-2024-0847 Rev C',
    material: { spec: '6061-T6 aluminium billet', cost: 18.40, source_ref: 'RFQ · material line', confidence: 96 },
    line_items: [
      { op: 'Facing', qty: 1, unit_rate: 8.50, source_ref: 'DWG · face A datum', confidence: 94 },
      { op: 'Profile milling', qty: 1, unit_rate: 14.20, source_ref: 'DWG · 88×60 outline', confidence: 91 },
      { op: 'Drilling Ø6.0', qty: 4, unit_rate: 1.20, source_ref: 'DWG · 4× Ø6.0', confidence: 96 },
      { op: 'Tapping M6', qty: 4, unit_rate: 1.30, source_ref: 'DWG · M6 callout', confidence: 88 },
      { op: 'Knurling', qty: 1, unit_rate: 4.60, source_ref: 'RFQ · "knurled boss"', confidence: 72 },
      { op: 'Deburr + inspect', qty: 1, unit_rate: 2.50, source_ref: 'std · finish', confidence: 90 }
    ],
    setup: 45.00,
    lead_time_days: 8,
    base_qty: 50,
    overall_confidence: 94,
    assumptions: [
      'Tolerance on 45mm centre dim assumed ±0.1mm (drawing silent).',
      'Surface finish assumed Ra 3.2 as-machined (not specified).',
      'Knurl assumed medium diamond pattern.'
    ],
    clarifying_questions: [
      { q: 'Knurl pattern — diamond or straight?', assumption: 'Assumed medium diamond.' },
      { q: 'Tolerance on the 45mm centre dimension?', assumption: 'Assumed ±0.1mm general.' },
      { q: 'Surface finish requirement?', assumption: 'Assumed Ra 3.2 as-machined.' }
    ]
  }
};
