import type { InboxEntry } from '../../api/inbox'
import { DEMO_WORKSPACE_ID } from './workspaces'

export const DEMO_REPORT_PATH = 'research-AAPL-q1.md'

const FIVE_MIN_AGO = Date.now() - 5 * 60 * 1000

export const demoInboxEntry: InboxEntry = {
  id: 'demo-inbox-aapl-q1',
  ts: FIVE_MIN_AGO,
  workspaceId: DEMO_WORKSPACE_ID,
  workspaceLabel: 'demo',
  docs: [{ path: DEMO_REPORT_PATH }],
  comments: [
    'I dug into Apple\'s Q1 earnings — see the report above.',
    '',
    '**Key finding:** services revenue growth has decelerated three quarters in a row, now at **+9.1%** YoY (was +14.2% last quarter). The headline EPS beat is masking the deceleration in what\'s historically been the margin defender.',
    '',
    'Want me to set up a watchlist alert on next quarter\'s services number?',
  ].join('\n'),
}

// File contents served back to readWorkspaceFile() for demo workspace docs.
// Keyed by relative path.
export const demoWorkspaceFiles: Record<string, string> = {
  [DEMO_REPORT_PATH]: `# AAPL Q1 — Hidden Deceleration Signal

**Workspace:** aapl-q1 · **Generated:** just now

## TL;DR

Headline Q1 EPS beat ($1.65 vs $1.50e), but the breakdown shows
**services revenue growth decelerating to +9.1% YoY** from +14.2% last
quarter. Third consecutive deceleration. **Recommendation:** trim long
exposure into the post-earnings pop; revisit after iPhone 17 launch
comps.

## What I looked at

- Q1 FY2026 10-Q (filed yesterday)
- Rolling services-segment breakdown across last four quarters
- iPhone unit run-rate vs analyst whisper numbers

## The number that doesn't line up

Headline EPS beat, but services growth — historically the margin
defender — has decelerated three quarters in a row:

| Quarter | Services Rev YoY | Operating Margin |
|---------|------------------|------------------|
| Q2 FY25 | +16.3% | 29.1% |
| Q3 FY25 | +14.2% | 29.7% |
| Q4 FY25 | +12.0% | 29.4% |
| **Q1 FY26** | **+9.1%** | **28.8%** |

If services growth keeps marching toward single digits, the multiple
re-rate that buy-side is pricing in (services as a SaaS-like recurring
moat) will need to recompute. Trim or hedge here.

## What I did NOT verify

- Forward iPhone 17 demand (need supply-chain data)
- App Store regulatory trajectory in EU / US
- China-channel inventory levels

## Next steps if you want them

1. Set a watch alert: services revenue YoY < **+8%** next quarter →
   reduce position by 50%.
2. Pair trade: long GOOGL / short AAPL on services-margin spread.
3. Wait for May 30 supply-chain reports before adding back.

---

*Generated by the agent in workspace \`demo\`. Reply in the workspace
to drill in or kick off the watchlist alert.*
`,
}
