Skip to content

[CT-12] Implement ticket cancellation with refund #776

@yusuftomilola

Description

@yusuftomilola

Overview

Allow ticket holders (or admin) to cancel a ticket and receive a full refund before the event starts. Work inside contracts/sandbox/event_ticketing/.

Acceptance Criteria

  • cancel_ticket(env, caller, ticket_id) is implemented
  • Only ticket owner or admin may cancel
  • Returns Error::TicketNotFound if ticket doesn't exist
  • Cannot cancel after event start time (returns appropriate error)
  • Refunds ticket_price from contract to ticket owner
  • Sets ticket status to Cancelled
  • Restores one unit of event capacity
  • Emits a cancellation event
  • Code compiles with cargo build

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions