feat(pitch-deck): full pitch versioning with git-style history #4

Merged
sharang merged 1 commits from feature/pitch-versioning into main 2026-04-10 07:37:37 +00:00
Owner

Summary

Full pitch versioning system where all 12 data tables can be versioned, diffed, and assigned per-investor.

  • Version lifecycle: create draft → edit → commit (immutable) → fork → new draft. Parent chain = git-style history.
  • Per-investor assignment: admin assigns a committed version to an investor → investor sees that version's data. Unassigned investors see base tables (backward compatible).
  • Diff engine: compare any two versions per-table with added/removed/changed field highlighting.

Bug fixes included

  • FM editor [object Object] for JSONB array values → now JSON.stringify
  • Admin pages not scrollable → fixed flex/overflow on AdminShell

New routes

API (7): versions CRUD, commit, fork, per-table data GET/PUT, diff
Pages (4): versions list, new, editor (12 tabs), diff view

Modified

  • /api/data + /api/financial-model: version-aware loading
  • Investor PATCH: accepts assigned_version_id
  • Investors list: version column
  • Investor detail: version selector dropdown

Deploy steps

# Run migration on the server
docker exec -i $(docker ps -qf name=breakpilot-db) psql -U postgres -d breakpilot_db < pitch-deck/migrations/003_pitch_versions.sql

# Pull updated image (already pushed to registry)
orca deploy

Test plan

  • Run migration 003
  • Create first version from "New Version" (snapshots base tables)
  • Edit company tagline in the draft
  • Diff draft vs parent → shows the changed field
  • Commit the version
  • Assign to a test investor
  • Log in as investor → see the modified tagline
  • Unassigned investor → sees default base data
  • Fork a committed version → new draft with copied data
  • FM editor: JSONB arrays now display as JSON, not [object Object]
  • Admin pages scroll properly

Generated with Claude Code

## Summary Full pitch versioning system where all 12 data tables can be versioned, diffed, and assigned per-investor. - **Version lifecycle**: create draft → edit → commit (immutable) → fork → new draft. Parent chain = git-style history. - **Per-investor assignment**: admin assigns a committed version to an investor → investor sees that version's data. Unassigned investors see base tables (backward compatible). - **Diff engine**: compare any two versions per-table with added/removed/changed field highlighting. ## Bug fixes included - FM editor `[object Object]` for JSONB array values → now JSON.stringify - Admin pages not scrollable → fixed flex/overflow on AdminShell ## New routes **API (7):** versions CRUD, commit, fork, per-table data GET/PUT, diff **Pages (4):** versions list, new, editor (12 tabs), diff view ## Modified - `/api/data` + `/api/financial-model`: version-aware loading - Investor PATCH: accepts `assigned_version_id` - Investors list: version column - Investor detail: version selector dropdown ## Deploy steps ```bash # Run migration on the server docker exec -i $(docker ps -qf name=breakpilot-db) psql -U postgres -d breakpilot_db < pitch-deck/migrations/003_pitch_versions.sql # Pull updated image (already pushed to registry) orca deploy ``` ## Test plan - [ ] Run migration 003 - [ ] Create first version from "New Version" (snapshots base tables) - [ ] Edit company tagline in the draft - [ ] Diff draft vs parent → shows the changed field - [ ] Commit the version - [ ] Assign to a test investor - [ ] Log in as investor → see the modified tagline - [ ] Unassigned investor → sees default base data - [ ] Fork a committed version → new draft with copied data - [ ] FM editor: JSONB arrays now display as JSON, not [object Object] - [ ] Admin pages scroll properly Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-04-10 07:34:33 +00:00
feat(pitch-deck): full pitch versioning with git-style history + bug fixes
Some checks failed
CI / go-lint (pull_request) Failing after 13s
CI / python-lint (pull_request) Failing after 13s
CI / nodejs-lint (pull_request) Failing after 8s
CI / test-go-consent (pull_request) Failing after 3s
CI / test-python-voice (pull_request) Failing after 10s
CI / test-bqas (pull_request) Failing after 11s
CI / Deploy (pull_request) Has been skipped
1872079504
Adds a complete version management system where every piece of pitch
data (all 12 tables: company, team, financials, market, competitors,
features, milestones, metrics, funding, products, fm_scenarios,
fm_assumptions) can be versioned, diffed, and assigned per-investor.

Version lifecycle: create draft → edit freely → commit (immutable) →
fork to create new draft. Parent chain gives full git-style history.

Backend:
- Migration 003: pitch_versions, pitch_version_data tables + investor
  assigned_version_id column
- lib/version-helpers.ts: snapshot base tables, copy between versions
- lib/version-diff.ts: per-table row+field diffing engine
- 7 new API routes: versions CRUD, commit, fork, per-table data
  GET/PUT, diff endpoint
- /api/data + /api/financial-model: version-aware loading (check
  investor's assigned_version_id, serve version data or fall back
  to base tables)
- Investor PATCH: accepts assigned_version_id (validates committed)

Frontend:
- /pitch-admin/versions: list with status badges, fork/commit/delete
- /pitch-admin/versions/new: create from base tables or fork existing
- /pitch-admin/versions/[id]: 12-tab JSON editor (one per data table)
  with save-per-table, commit button, fork button
- /pitch-admin/versions/[id]/diff/[otherId]: side-by-side diff view
  with added/removed/changed highlighting per field
- Investors list: version column showing assigned version name
- Investor detail: version selector dropdown (committed versions only)
- AdminShell: Versions nav item added

Bug fixes:
- FM editor: [object Object] for JSONB array values → JSON.stringify
- Admin pages not scrollable → h-screen + overflow-hidden on shell,
  min-h-0 on flex column

Also includes migration 000 for fresh installs (pitch data tables).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sharang merged commit 1c3cec2c06 into main 2026-04-10 07:37:37 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Benjamin_Boenisch/breakpilot-core#4