# Lead Convert Phase 1 PRD Input Trace

Status: reviewed input trace
Reviewed date: 2026-04-24

The working PRD draft was supplied from the repository's gitignored
`personal-workspace/` area. This committed document records the Phase 1 inputs
accepted by `docs/design/lead-convert-phase1-metadata-driven-design.md` without
depending on a machine-local path.

## Scope

- Phase 1 only.
- Future Lead Convert phases are non-goals for this design.
- The standard-core path must pass in a fresh org without PingCAP tenant
  overlay data.

## Accepted Inputs

- Lead Convert is implemented as a generic standard action plus Flow runtime
  path.
- The standard action supports creating or reusing Account; the Phase 1 frontend
  rollout may expose only existing Account selection until the New Account UI
  branch is ready.
- Contact may be created or reused.
- Opportunity may be created, reused, or skipped according to metadata-defined
  action inputs and input guards.
- Reused Account and Contact records receive mapped Lead values only for blank
  target fields through generic metadata-driven merge behavior.
- Reused Opportunity preserves existing fields and campaign attribution unless
  Salesforce evidence or a separately declared NexusCRM extension changes that
  contract.
- Converted Lead anchors are stamped by the standard Flow path.
- Standard Lead field propagation is driven by `_System_ObjectFieldMapping`.
- Phase 1 standard Lead-to-Account field propagation includes OwnerId ownership
  parity and AccountSource parity with Salesforce; the standard AccountSource
  target field must exist before the mapping is seeded.
- Phase 1 standard Description propagation is a NexusCRM standard-core design
  choice applied consistently across Account, Contact, and Opportunity mappings,
  not a Salesforce-documented mapping row.
- Standard defaults are metadata-driven through action defaults, flow
  assignments, or schema defaults.
- CampaignMember records and open Tasks are reparented by Flow metadata.
- Primary OpportunityContactRole creation is tenant-neutral in standard core.
- OpportunityContactRole sync and CampaignMember/Task relink are standard
  conversion bookkeeping effects. They are not extra end-user CRUD requirements
  beyond the Lead/Account/Contact/Opportunity baseline; scoped bypass is
  declared through `_System_StandardActionInternalWriteScope` metadata and still
  routes through PersistenceService.
- Converted Lead write protection is enforced through `_System_ValidationRule`.

## Metadata-Driven Interpretations

- Platform code remains generic over SObjects, fields, permissions, and tenants.
- Standard core may include only Salesforce-compatible metadata safe for a
  greenfield org.
- PingCAP-specific custom mappings, OCR Role defaults, permission grants, and
  status timestamp behavior are tenant or admin metadata.
- `Department__c -> Department` is a PingCAP overlay mapping, not public
  standard-core seed.
- Any OCR `Role = "Decision_Maker"` requirement is a PingCAP overlay rule, not
  standard Flow metadata.
- Sales, SDR, Sales Ops, and other named org-role grants are tenant/admin
  operations, not public seed.
- Phase 1 does not require deterministic `triggerOrder`.
- Unknown action inputs are rejected with `INVALID_FIELD`.

## Tenant Acceptance Trace

- AC-T1: PingCAP custom Lead to Contact mappings propagate from customized
  metadata.
- AC-T2: `Department__c -> Department` exists as customized PingCAP metadata.
- AC-T3: PingCAP OCR Role default is owned by tenant or admin metadata.
- AC-T4: PingCAP status timestamp behavior remains in tenant metadata if that
  deployment requires it during convert.
- AC-T5: PingCAP-specific Lead to Opportunity extension mappings are verified
  as customized metadata and propagate by key.
