2021-01-11 22:34:48 +00:00
|
|
|
// License: LGPL-3.0-or-later
|
2021-01-13 22:59:04 +00:00
|
|
|
import type { IdType, HoudiniObject, Amount, HoudiniEvent } from '../../common';
|
2021-01-11 22:34:48 +00:00
|
|
|
import type Nonprofit from '..';
|
|
|
|
import type Event from '.';
|
|
|
|
import type { TicketLevel } from './TicketLevel';
|
|
|
|
|
2021-01-13 22:59:04 +00:00
|
|
|
|
|
|
|
type DiscountType = { percent: number } | { amount: Amount };
|
2021-01-11 22:34:48 +00:00
|
|
|
/**
|
|
|
|
* Describes an EventDiscount (shell)
|
|
|
|
*/
|
|
|
|
export interface EventDiscount extends HoudiniObject {
|
2021-01-13 22:59:04 +00:00
|
|
|
code: string;
|
|
|
|
discount: DiscountType;
|
2021-01-11 22:34:48 +00:00
|
|
|
event: IdType | Event;
|
|
|
|
nonprofit: IdType | Nonprofit;
|
|
|
|
object: "event_discount";
|
|
|
|
ticket_levels: IdType[] | TicketLevel[];
|
2021-01-13 22:59:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type EventDiscountCreated = HoudiniEvent<'event_discount.created', EventDiscount>;
|
|
|
|
export type EventDiscountlUpdated = HoudiniEvent<'event_discount.updated', EventDiscount>;
|
|
|
|
export type EventDiscountDeleted = HoudiniEvent<'event_discount.deleted', EventDiscount>;
|