// ─────────────────────────────────────────────────────────────────────
// COLLECTION MANAGER — Team & Review data.
//
// The receiving end of the contributor experience. Contributors submit;
// the manager reviews, adjusts, approves, and files to the archive.
// Submissions become records only after this review.
// ─────────────────────────────────────────────────────────────────────

// The signed-in collection manager. Identity lives in Administration —
// the account surface, kept separate from the operational hub.
const COLLECTION_MANAGER = {
  name: 'Jeff Smith', initials: 'JS', role: 'Collection Manager',
  collection: 'The Voss Collection', email: 'j.smith@vosscollection.com',
};

// Active contributors invited into the collection.
const CONTRIBUTORS_ACTIVE = [
  { id: 'c-marco', name: 'Marco Brandt', initials: 'MB', role: 'Engine Builder',
    org: 'Rennsport Technik', via: 'Email', since: 'Apr 2026', submissions: 14, access: 'active' },
  { id: 'c-elena', name: 'Elena Foss', initials: 'EF', role: 'Photographer',
    org: 'Foss Studio', via: 'Email', since: 'Feb 2026', submissions: 38, access: 'active' },
  { id: 'c-tomas', name: 'Tomás Reier', initials: 'TR', role: 'Transport',
    org: 'Reier Logistics', via: 'SMS', since: 'Jan 2026', submissions: 9, access: 'active' },
  { id: 'c-dana', name: 'Dana Whitlock', initials: 'DW', role: 'Detailer',
    org: 'Concours Detail Co.', via: 'Email', since: 'Mar 2026', submissions: 6, access: 'disabled' },
];

// Outstanding invitations not yet accepted.
const CONTRIBUTORS_PENDING = [
  { id: 'i-1', to: 'j.albright@upholstery-works.com', role: 'Trim & Upholstery', via: 'Email', sent: '2 days ago' },
  { id: 'i-2', to: '+1 (415) 555-0188', role: 'Inspector', via: 'SMS', sent: '5 days ago' },
];

// The review queue — what contributors have submitted, awaiting the
// manager. `kind: 'receipt'` opens the full Upload Receipt review/allocate
// workflow (largely unchanged). Other kinds open a lightweight review.
//   state: 'new' (unopened, drives the badge) | 'opened'
const REVIEW_QUEUE = [
  {
    // The scheduled monthly reporting task. Created automatically on the
    // manager's chosen cadence (default: near the end of each month) —
    // opening it lands directly in the Monthly Expense Report flow.
    id: 'rq-task-report', kind: 'report', icon: 'FileSpreadsheet', state: 'new',
    title: 'Send Expense Report — May 1 – May 29',
    contributor: 'Scheduled task', initials: 'CA', org: 'Reporting period ready',
    meta: 'Reports', when: 'Ready to send',
    note: '', vehicles: [],
  },
  {
    id: 'rq-receipt-rt', kind: 'receipt', icon: 'Receipt', state: 'new',
    title: 'Rennsport Technik — engine & head work',
    contributor: 'Marco Brandt', initials: 'MB', org: 'Rennsport Technik',
    meta: '6 line items · €30,602.10', when: 'Today · 09:12',
    note: 'Crank was within spec — no regrind needed on #3. Head still out for machining.',
    vehicles: ['2.7 MFI build', '300 SL'],
  },
  {
    id: 'rq-photos-300sl', kind: 'photos', icon: 'gallery', state: 'new',
    title: 'Cylinder head — machining progress',
    contributor: 'Marco Brandt', initials: 'MB', org: 'Rennsport Technik',
    meta: '6 photos', when: 'Yesterday · 16:40',
    note: 'Seats cut, guides pressed. Ready for the 3-angle valve job.',
    vehicles: ['300 SL'],
  },
  {
    id: 'rq-photos-transport', kind: 'photos', icon: 'Truck', state: 'new',
    title: 'Collection delivery — condition on arrival',
    contributor: 'Tomás Reier', initials: 'TR', org: 'Reier Logistics',
    meta: '11 photos · transport', when: 'Yesterday · 11:05',
    note: 'No new marks. Front splitter protected as requested.',
    vehicles: ['275 GTB'],
  },
  {
    id: 'rq-doc-warranty', kind: 'document', icon: 'Stamp', state: 'opened',
    title: 'Mahle piston set — warranty & certificate',
    contributor: 'Marco Brandt', initials: 'MB', org: 'Rennsport Technik',
    meta: 'Document · PDF', when: '3 days ago',
    note: '', vehicles: ['2.7 MFI build'],
  },
];

const REVIEW_NEW_COUNT = REVIEW_QUEUE.filter(i => i.state === 'new').length;

Object.assign(window, {
  COLLECTION_MANAGER,
  CONTRIBUTORS_ACTIVE, CONTRIBUTORS_PENDING, REVIEW_QUEUE, REVIEW_NEW_COUNT,
});
