refactor(events): gate member benefits on hasMemberAccess
Extracts hasMemberAccess(member) in tickets.js and uses it across event registration, ticket purchase, and series purchase flows so guest, suspended, and cancelled records no longer count as members while pending_payment still does.
This commit is contained in:
parent
c5e901ed24
commit
15329e3e84
7 changed files with 188 additions and 30 deletions
|
|
@ -77,10 +77,10 @@ describe('tickets/purchase.post.js', () => {
|
|||
expect(source).toContain('upsert: true')
|
||||
})
|
||||
|
||||
it('treats guest Members as non-members for pricing and validation', () => {
|
||||
// Guests must not receive member pricing — plan §2
|
||||
expect(source).toContain('isRealMember')
|
||||
expect(source).toContain('!== "guest"')
|
||||
it('treats inactive Members (guest, suspended, cancelled) as non-members for pricing and validation', () => {
|
||||
// Only members with access (active or pending_payment) get member pricing.
|
||||
// hasMemberAccess is the shared gate in server/utils/tickets.js.
|
||||
expect(source).toContain('hasMemberAccess(member)')
|
||||
})
|
||||
|
||||
it('sets an auth cookie for new guests and returning guests', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue