// ─────────────────────────────────────────────────────────────────────
// INDIVIDUAL CONTRIBUTOR — data layer.
//
// The contributor is a TRUSTED, INVITED individual who documents work
// performed for a specific collection. Not a vendor portal, not an
// employee portal — a streamlined, single-purpose view of the same
// Collector Archives platform. Their job: capture the evidence while it's
// in their hands and submit it for the collection manager to review.
//
//   Actions create records. Records create the archive.
//   For a contributor, actions become SUBMISSIONS — and submissions
//   become records only after the manager reviews and approves them.
// ─────────────────────────────────────────────────────────────────────

// Who we're logged in as. The engine builder behind the very invoice the
// receipt flow extracts — submitting their own work back to the collection.
const CONTRIBUTOR = {
  name: 'Marco Brandt',
  initials: 'MB',
  role: 'Engine Builder',
  org: 'Rennsport Technik',
  // The collection they've been invited to contribute to.
  collection: 'The Castell Collection',
  manager: 'Jeff Smith',
  invitedOn: '9 Apr 2026',
};

// The contributor's recent submissions — the running record of what they've
// handed off and where each one stands in the manager's review. This is the
// contributor's whole world: submit, then watch it move through review.
//
// status: 'pending'  → submitted, waiting for the manager to open it
//         'review'   → manager is reviewing / adjusting
//         'approved' → reviewed, approved, filed to the archive
const CONTRIB_SUBMISSIONS = [
  {
    id: 'sub-photos-300sl',
    kind: 'photos', icon: 'gallery',
    title: 'Cylinder head — machining progress',
    meta: '6 photos · 300 SL',
    when: 'Yesterday · 16:40',
    status: 'approved',
  },
  {
    id: 'sub-note-crank',
    kind: 'note', icon: 'FileText',
    title: 'Crankshaft found within spec — no regrind needed on #3',
    meta: 'Note · 2.7 MFI build',
    when: '2 days ago',
    status: 'review',
  },
  {
    id: 'sub-doc-warranty',
    kind: 'document', icon: 'Stamp',
    title: 'Mahle piston set — warranty & certificate',
    meta: 'Document · PDF',
    when: '3 days ago',
    status: 'approved',
  },
];

// Status presentation — label + tone. Gold for resolved (approved), bone
// outline for in-flight states. Never invents a "filed by you" state: the
// contributor never files anything; the manager does.
const SUB_STATUS = {
  pending:  { label: 'Submitted',  sub: 'Waiting for review',  tone: 'pending'  },
  review:   { label: 'In review',  sub: 'Manager reviewing',   tone: 'pending'  },
  approved: { label: 'Approved',   sub: 'Filed to the archive', tone: 'gold'    },
};

// The five things a contributor can document. Upload Receipt is the only
// fully-built workflow; the rest are present but stubbed.
const CONTRIB_ACTIONS = [
  { id: 'receipt',  icon: 'Receipt',  title: 'Upload Expense',
    desc: 'Photograph an invoice or receipt for work performed', primary: true, live: true },
  { id: 'note',     icon: 'FileText', title: 'Add Note',
    desc: 'Jot down progress, findings, or context' },
  { id: 'photos',   icon: 'gallery',  title: 'Upload Photos',
    desc: 'Document condition and progress' },
  { id: 'videos',   icon: 'Video',    title: 'Upload Videos',
    desc: 'Walkarounds, running engine, road test' },
  { id: 'documents',icon: 'Stamp',    title: 'Upload Documents',
    desc: 'Manuals, warranties, inspection reports' },
];

Object.assign(window, { CONTRIBUTOR, CONTRIB_SUBMISSIONS, SUB_STATUS, CONTRIB_ACTIONS });
