import { AutoEncoder } from '@simonbackx/simple-encoding'; import { Address } from '../addresses/Address.js'; import { UitpasEventResponse } from '../endpoints/UitpasEventsResponse.js'; import { Image } from '../files/Image.js'; import { ReservedSeat } from '../SeatingPlan.js'; import { Webshop } from './Webshop.js'; import { WebshopField } from './WebshopField.js'; export declare class ProductPrice extends AutoEncoder { id: string; name: string; /** * Price is always in cents, to avoid floating point errors */ price: number; discountPrice: number | null; discountAmount: number; hidden: boolean; /** * Total stock, excluding already sold items into account */ stock: number | null; usedStock: number; /** * If this id is not null, this productPrice is the UiTPAS social tariff. * In that case it refers to the base price on which the UiTPAS social tariff is applied. * If it is null, this is not an UiTPAS social tariff. */ uitpasBaseProductPriceId: string | null; get isSoldOut(): boolean; get remainingStock(): number | null; clearStock(): void; } export declare class Option extends AutoEncoder { id: string; name: string; /** * Price added (can be negative) is always in cents, to avoid floating point errors */ price: number; /** * Total stock, excluding already sold items into account */ stock: number | null; usedStock: number; get isSoldOut(): boolean; get remainingStock(): number | null; clearStock(): void; } export declare class OptionMenu extends AutoEncoder { id: string; name: string; multipleChoice: boolean; /** * By default, we select the first option if multipleChoise is false. */ autoSelectFirst: boolean; options: Option[]; clearStock(): void; } export declare enum ProductType { Product = "Product", Person = "Person", Ticket = "Ticket", Voucher = "Voucher" } /** * This includes a location for a ticket (will be visible on the ticket) */ export declare class ProductLocation extends AutoEncoder { id: string; name: string; address: Address | null; } /** * This includes a time for a ticket (will be visible on the ticket) */ export declare class ProductDateRange extends AutoEncoder { id: string; startDate: Date; endDate: Date; toString(): string; } export declare class Product extends AutoEncoder { id: string; name: string; description: string; enabled: boolean; hidden: boolean; /** * Allow to order multiple pieces of the same product combination */ allowMultiple: boolean; /** * Only allow one piece per product combination */ unique: boolean; enableAfter: Date | null; disableAfter: Date | null; get isEnabled(): boolean; get enableInFuture(): boolean; get isTicket(): boolean; images: Image[]; customFields: WebshopField[]; type: ProductType; location: ProductLocation | null; dateRange: ProductDateRange | null; seatingPlanId: string | null; reservedSeats: ReservedSeat[]; /** * WIP: not yet supported * Set to true if you need to have a name for every ordered product. When this is true, you can't order this product mutliple times with the same name. * + will validate the name better */ askName: boolean; /** * Maximum amount per order */ maxPerOrder: number | null; /** * Only show available stock if going below this amount - or null to always show the stock. */ showStockBelow: number | null; /** * Total stock, excluding already sold items into account */ stock: number | null; usedStock: number; /** * All the prices of this product (e.g. small, medium, large), should contain at least one price. */ prices: ProductPrice[]; optionMenus: OptionMenu[]; /** * If this id is not null, we use the official UiTPAS flow. * If it is null, we use the non-official flow (if one of the productPrices is UiTPAS social tariff */ uitpasEvent: UitpasEventResponse | null; clearStock(): void; get isSoldOut(): boolean; /** * Only accounts for the stock of the product itself, not the stock of the options */ get remainingStock(): number | null; /** * Accounts for options and prices too */ get remainingStockWithOptions(): number | null; get hasAnyStock(): boolean; getRemainingSeats(webshop: Webshop, isAdmin: boolean): number | null; /** * Whether it is not possibel to add multiple different items of this product to the cart, or whether this product supports multiple items in the cart. * Controls whether cart is edited by default or updated when clicking it open in the webshop. */ get isUnique(): boolean; getRemainingStockText(stock: number): string; get stockText(): string | null; get isEnabledTextLong(): string | undefined; get closesSoonText(): string | null; filteredPrices(options: { admin: boolean; }): ProductPrice[]; } //# sourceMappingURL=Product.d.ts.map