Problem
The CRM has three independent status dimensions that are updated separately:
- Pipeline status (
status): prospect → contacted → negotiating → closed-won / closed-lost
- Contract status (
contractStatus): none → verbal-agreement → registration-sent → contract-sent → contract-signed
- Invoice status (
invoiceStatus): separate dimension
When key contract events occur, only contractStatus is updated — the pipeline status is never automatically advanced. For example:
sendContract sets contractStatus: 'contract-sent' but doesn't move the pipeline to closed-won, even though sending a contract implies the deal is won.
sendPortalInvite sets contractStatus: 'registration-sent' but doesn't touch the pipeline status.
submitSignature (signing router) sets contractStatus: 'contract-signed' and signatureStatus: 'signed' but doesn't advance the pipeline either.
This means organizers must manually drag sponsors through the pipeline board even after contract actions have been taken, which is error-prone and leads to stale pipeline views.
Proposed solution
Implement automatic pipeline status promotion when certain contract events occur:
| Contract Event |
Contract Status |
Pipeline Auto-Promotion |
| Portal invite sent |
registration-sent |
No change (still negotiating) |
| Contract sent |
contract-sent |
→ closed-won (if not already closed-won) |
| Contract signed |
contract-signed |
→ closed-won (if not already closed-won) |
| Registration completed |
— |
No change (handled by contract flow) |
Implementation notes
- Auto-promotion should only advance forward, never regress (e.g. don't move
closed-won back to negotiating)
- Log the status change via
logStageChange() with the actor being the same user/system that triggered the contract event
- Apply in all code paths:
sendContract (sponsor.ts), generateAndSendContract (contract-send.ts), submitSignature (signing.ts), and the Adobe Sign webhook handler
- Consider making this configurable per conference if some organizers prefer manual pipeline management
Files to modify
src/server/routers/sponsor.ts — sendContract mutation
src/lib/sponsor-crm/contract-send.ts — generateAndSendContract (automated flow)
src/server/routers/signing.ts — submitSignature mutation
src/app/api/webhooks/adobe-sign/route.ts — webhook handler for AGREEMENT_WORKFLOW_COMPLETED
Problem
The CRM has three independent status dimensions that are updated separately:
status):prospect→contacted→negotiating→closed-won/closed-lostcontractStatus):none→verbal-agreement→registration-sent→contract-sent→contract-signedinvoiceStatus): separate dimensionWhen key contract events occur, only
contractStatusis updated — the pipelinestatusis never automatically advanced. For example:sendContractsetscontractStatus: 'contract-sent'but doesn't move the pipeline toclosed-won, even though sending a contract implies the deal is won.sendPortalInvitesetscontractStatus: 'registration-sent'but doesn't touch the pipeline status.submitSignature(signing router) setscontractStatus: 'contract-signed'andsignatureStatus: 'signed'but doesn't advance the pipeline either.This means organizers must manually drag sponsors through the pipeline board even after contract actions have been taken, which is error-prone and leads to stale pipeline views.
Proposed solution
Implement automatic pipeline status promotion when certain contract events occur:
registration-sentcontract-sentclosed-won(if not alreadyclosed-won)contract-signedclosed-won(if not alreadyclosed-won)Implementation notes
closed-wonback tonegotiating)logStageChange()with the actor being the same user/system that triggered the contract eventsendContract(sponsor.ts),generateAndSendContract(contract-send.ts),submitSignature(signing.ts), and the Adobe Sign webhook handlerFiles to modify
src/server/routers/sponsor.ts—sendContractmutationsrc/lib/sponsor-crm/contract-send.ts—generateAndSendContract(automated flow)src/server/routers/signing.ts—submitSignaturemutationsrc/app/api/webhooks/adobe-sign/route.ts— webhook handler forAGREEMENT_WORKFLOW_COMPLETED