Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/rules/features/ticket-transfer-resale.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ paths:
- Buyer resale lives on the order page only: `useTicketResaleActions(orderLink, timezone)` verifies first, then opens `SellTicketModal` with the estimate. A listed ticket shows `TicketResaleListed` and none of the ticket link, print, transfer or edit actions. The ticket page never offers sell or withdraw, because the link may belong to a guest.
- `AttendeeTicket` replaces the QR code when `resale.status` is `LISTED` or `SOLD`, which covers the ticket page and both print views. Never render the QR code for a listed ticket anywhere else.
- E2E: `e2e/utils/resale.ts` (`markOrderPaidThroughStripe`) turns an offline-paid order into one paid through Stripe, which is all a listing needs; no real Stripe.
- Organizer oversight is `/manage/event/:id/resale` (`routes/event/Resale`); the failed-refund email links to that exact path. The status filter is server-side (`filter_fields[status]`); "Needs attention" is a client-side filter over the Sold page because the API cannot filter it. The Refund column shows only when the payload carries the money fields, "Close listing" needs `EDIT` and "Retry refund" needs `ISSUE_REFUNDS` as well. The organizer attendee payload's `resale` is `{status, sold_order_id, sold_order_public_id}`: a resold attendee shows "Resold" with the replacement order and no Activate action.
- Organizer oversight is `/manage/event/:id/resale` (`routes/event/Resale`); the failed-refund email links to that exact path. Its settings bar (`ResaleSettings`) saves `allow_ticket_resale` and `ticket_resale_cutoff_minutes` straight away through the same partial update as checkout settings: the switch always asks first (turning on shows `ticketResaleDescription()`, which carries the chargeback sentence), needs `ISSUE_REFUNDS`, and members without `EDIT` see no controls. The status filter is server-side (`filter_fields[status]`); "Needs attention" is a client-side filter over the Sold page because the API cannot filter it. The Refund column shows only when the payload carries the money fields, "Close listing" needs `EDIT` and "Retry refund" needs `ISSUE_REFUNDS` as well. The organizer attendee payload's `resale` is `{status, sold_order_id, sold_order_public_id}`: a resold attendee shows "Resold" with the replacement order and no Activate action.
- E2E for organizer pages: `e2e/utils/resale-listings.ts` (`seedResaleListing`) inserts listings in any stored state. A retried refund stays `PENDING` when the replacement order has no platform-fee row, so settle it (`settleResaleRefund`) when the test ends.

## Resale
Expand Down
17 changes: 17 additions & 0 deletions e2e/pages/resale.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ export class ResalePage {
return this.page.getByTestId('resale-attention-summary');
}

enabledSwitch(): Locator {
return this.page.getByTestId('resale-enabled-switch');
}

cutoffSelect(): Locator {
return this.page.getByTestId('resale-cutoff-select');
}

async toggleResale(): Promise<void> {
await this.enabledSwitch().click({ force: true });
}

async chooseCutoff(label: string): Promise<void> {
await this.cutoffSelect().click();
await this.page.getByRole('option', { name: label }).click();
}

async filterBy(status: 'All' | 'Open' | 'Sold' | 'Closed'): Promise<void> {
await this.page.getByRole('radiogroup', { name: 'Filter by status' }).getByText(status, { exact: true }).click();
}
Expand Down
25 changes: 25 additions & 0 deletions e2e/tests/management/resale-settings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test, expect } from '../../fixtures';
import { EventSettingsPage } from '../../pages/event-settings.page';
import { ProductEditPage } from '../../pages/product-edit.page';
import { ResalePage } from '../../pages/resale.page';
import { WebhookPage } from '../../pages/webhook.page';
import { createFreshOrganizer, createLiveEventWithFreeTicket } from '../../api/factory';

Expand All @@ -25,6 +26,30 @@ test.describe('organizer controls for ticket resale', () => {
expect((await api.getEventSettings(event.eventId)).ticket_resale_cutoff_minutes).toBe(1440);
});

test('an organizer turns resale on, moves the cutoff and turns it off again from the resale page', async ({ authedPage, api, account }) => {
const event = await createLiveEventWithFreeTicket(api, account.organizerId);

const resale = new ResalePage(authedPage);
await resale.goto(event.eventId);
await expect(resale.enabledSwitch()).not.toBeChecked();
await expect(resale.cutoffSelect()).toBeDisabled();

await resale.toggleResale();
const turnOn = authedPage.getByRole('dialog', { name: 'Turn on ticket resale?' });
await expect(turnOn.getByText('that chargeback is at your risk, as with any sale.')).toBeVisible();
await turnOn.getByRole('button', { name: 'Turn on resale' }).click();
await expect(resale.enabledSwitch()).toBeChecked();
await expect.poll(async () => (await api.getEventSettings(event.eventId)).allow_ticket_resale).toBe(true);

await resale.chooseCutoff('1 day before');
await expect.poll(async () => (await api.getEventSettings(event.eventId)).ticket_resale_cutoff_minutes).toBe(1440);

await resale.toggleResale();
await authedPage.getByRole('dialog', { name: 'Turn off ticket resale?' }).getByRole('button', { name: 'Turn off resale' }).click();
await expect(resale.enabledSwitch()).not.toBeChecked();
await expect.poll(async () => (await api.getEventSettings(event.eventId)).allow_ticket_resale).toBe(false);
});

test('the organizer default decides whether a new event allows resale', async ({ authedPage, api }) => {
const organizer = await createFreshOrganizer(api);

Expand Down
5 changes: 5 additions & 0 deletions frontend/public/blank-slate/audience-campaigns.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions frontend/public/blank-slate/audience-contacts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions frontend/public/blank-slate/audience-overview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading