fix(launch-flow): auto-link /join signups to existing PreRegistration
When a /join submitter's email matches a pending/selected/invited PreRegistration, mark the pre-reg as accepted and link memberId to the new Member. Prevents the same person from appearing as both an active member and an unaccepted pre-registrant. Silent — no email, no UI. Adds the PreRegistration mock to helcim-customer and free-signup-flow test suites, since both invoke the customer handler at runtime.
This commit is contained in:
parent
d4000c18cf
commit
da5e7efcb7
3 changed files with 33 additions and 0 deletions
|
|
@ -20,6 +20,9 @@ vi.mock('../../../server/models/member.js', () => ({
|
|||
findOneAndUpdate: vi.fn()
|
||||
}
|
||||
}))
|
||||
vi.mock('../../../server/models/preRegistration.js', () => ({
|
||||
default: { findOne: vi.fn().mockResolvedValue(null), findByIdAndUpdate: vi.fn() }
|
||||
}))
|
||||
vi.mock('../../../server/utils/mongoose.js', () => ({ connectDB: vi.fn() }))
|
||||
vi.mock('../../../server/utils/helcim.js', () => ({
|
||||
createHelcimCustomer: vi.fn(),
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ import { createMockEvent } from '../helpers/createMockEvent.js'
|
|||
vi.mock('../../../server/models/member.js', () => ({
|
||||
default: { findOne: vi.fn(), create: vi.fn(), findByIdAndUpdate: vi.fn() }
|
||||
}))
|
||||
vi.mock('../../../server/models/preRegistration.js', () => ({
|
||||
default: { findOne: vi.fn().mockResolvedValue(null), findByIdAndUpdate: vi.fn() }
|
||||
}))
|
||||
vi.mock('../../../server/utils/mongoose.js', () => ({ connectDB: vi.fn() }))
|
||||
vi.mock('../../../server/utils/helcim.js', () => ({
|
||||
createHelcimCustomer: vi.fn()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue