diff --git a/src/index.test.ts b/src/index.test.ts index 6d1b64d..d8559ec 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -26,7 +26,18 @@ const fullChartRendererConfig: Required = { { ticketType: 'adult', price: 30, label: 'Adults' }, { ticketType: 'child', price: 20, label: 'Children' }, { ticketType: 'senior', price: 25, label: 'Senior', description: '65+ – Requires ID' } - ]} + ], channels: [ + { channel: 'channel1', price: 30}, + ]}, + { category: 'C', price: 10, channels: [ + { channel: 'channel1', price: 30}, + { channel: 'channel2', originalPrice: 40, price: 50}, + { channel: 'channel3', ticketTypes: [ + { ticketType: 'adult', price: 60 }, + { ticketType: 'child', price: 70, label: 'Children' } + ]} + ] + } ], priceFormatter: price => '$' + price, showSectionPricingOverlay: true, diff --git a/src/index.ts b/src/index.ts index 42e48e9..2a1dd5e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1096,6 +1096,7 @@ export type SimplePricing = { category: CategoryKey originalPrice?: number price: number + channels?: ChannelPricing[] } export type MultiLevelPricing = { @@ -1103,6 +1104,20 @@ export type MultiLevelPricing = { ticketTypes: TicketType[] } +export type ChannelPricing = (SimpleChannelPricing | MultiLevelChannelPricing) + +export type SimpleChannelPricing = { + channel: string + originalPrice?: number + price: number +} + +export type MultiLevelChannelPricing = { + channel: string + ticketTypes: TicketType[] +} + + export type TicketType = { ticketType: string originalPrice?: number