import { VersionInfo } from '@start9labs/start-sdk'

// Adopt the Pipeline — the fundraising grid (canonical) now drives the deal board.
// An "Add to Pipeline" row action creates and durably links an opportunity via the new
// opportunities.fundraising_investor_id column (backend migration 0005, additive +
// reversible — applied at app startup by core_migrations, so this StartOS migration is a
// no-op). The link reuses the grid's already-synced contact (no POST /api/contacts
// side-door) and maps the grid `lead` → owner; it is idempotent (one live opp per
// investor; a re-link never reseeds the board-owned stage/probability). Two read-only
// grid columns — Pipeline + Pipeline Stage — are derived live from the linked opp.
// "Remove from Pipeline" soft-deletes the opp (the grid row is untouched); deleting an
// investor from the grid archives its orphaned opp. Also folds in the soft-delete fix for
// the pipeline report + dashboard aggregates (archived opps are no longer counted).
export const v_0_1_0_87 = VersionInfo.of({
  version: '0.1.0:87',
  releaseNotes: {
    en_US: [
      'Adopt the Pipeline: flag an investor in the fundraising grid as a deal and it',
      'creates a linked opportunity on the Pipeline board — no duplicate data entry, the',
      'board owns the stage/odds, and a read-only Pipeline Stage column mirrors it back',
      'into the grid. Removing from the pipeline archives the deal but leaves the grid intact.',
    ].join(' '),
  },
  migrations: { up: async () => {}, down: async () => {} },
})
