2021-01-11 22:34:48 +00:00
|
|
|
// License: LGPL-3.0-or-later
|
2021-02-10 22:04:05 +00:00
|
|
|
import { IDType, HoudiniObject, HoudiniEvent, Amount } from '../../common';
|
2021-01-11 22:34:48 +00:00
|
|
|
import Nonprofit from '..';
|
|
|
|
import Event from './';
|
|
|
|
import { EventDiscount } from './EventDiscount';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes a single ticket level for an event. Each Ticket is associated with a TicketLevel
|
|
|
|
*/
|
|
|
|
export interface TicketLevel extends HoudiniObject {
|
|
|
|
/** The cost of one ticket of the given amount */
|
|
|
|
amount: Amount;
|
|
|
|
/**
|
|
|
|
* Who can see and/or buy the ticket. 'everyone' is every visitor, 'admins' means event
|
|
|
|
* and nonprofit admins only
|
|
|
|
*/
|
|
|
|
available_to: 'everyone' | 'admins';
|
|
|
|
deleted: boolean;
|
|
|
|
description: string;
|
2021-02-10 22:04:05 +00:00
|
|
|
event: IDType | Event;
|
2021-01-11 22:34:48 +00:00
|
|
|
/**
|
|
|
|
* at some time, event discounts will be associated with a given ticket level.
|
|
|
|
* For now, this returns all of the discounts for the event though.
|
|
|
|
*/
|
2021-02-10 22:04:05 +00:00
|
|
|
event_discounts: IDType[] | EventDiscount[];
|
2021-01-11 22:34:48 +00:00
|
|
|
/**
|
|
|
|
* the max number of tickets to be sold on this TicketLevel, null means unlimited.
|
|
|
|
* If you edit this and decide to lower the limit below the number of tickets currently sold,
|
|
|
|
* we don't remove the tickets already there.
|
|
|
|
*/
|
|
|
|
limit?: number;
|
|
|
|
/**
|
|
|
|
* Nice readable name fo the ticket level
|
|
|
|
*/
|
|
|
|
name: string;
|
2021-02-10 22:04:05 +00:00
|
|
|
nonprofit: IDType | Nonprofit;
|
2021-01-11 22:34:48 +00:00
|
|
|
object: "ticket_level";
|
|
|
|
/** order to be displayed */
|
|
|
|
order: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TicketLevelCreated = HoudiniEvent<'ticket_level.created', TicketLevel>;
|
|
|
|
export type TicketLevelUpdated = HoudiniEvent<'ticket_level.updated', TicketLevel>;
|
|
|
|
export type TicketLevelDeleted = HoudiniEvent<'ticket_level.deleted', TicketLevel>;
|