import { AutoEncoder, AutoEncoderPatchType, Data, Decoder, PatchableDecoder } from '@simonbackx/simple-encoding'; import { Address } from '../addresses/Address.js'; import { City } from '../addresses/City.js'; import { Country } from '../addresses/CountryDecoder.js'; import { Province } from '../addresses/Province.js'; import { DNSRecord } from '../DNSRecord.js'; import { Replacement } from '../endpoints/EmailRequest.js'; import { Image } from '../files/Image.js'; import { RecordCategory } from '../members/records/RecordCategory.js'; import { PaymentConfiguration, PrivatePaymentConfiguration } from '../PaymentConfiguration.js'; import { PaymentMethod } from '../PaymentMethod.js'; import { PermissionsByRole } from '../PermissionsByRole.js'; import { Policy } from '../Policy.js'; import { RichText } from '../RichText.js'; import { SeatingPlan } from '../SeatingPlan.js'; import { SponsorConfig } from '../SponsorConfig.js'; import { Discount } from './Discount.js'; import { TransferSettings } from './TransferSettings.js'; import { WebshopField } from './WebshopField.js'; export declare enum WebshopLayout { Default = "Default", Split = "Split" } export declare enum DarkMode { Off = "Off", On = "On", Auto = "Auto" } export declare class WebshopTimeSlot extends AutoEncoder { id: string; /** * Day. The time is ignored, and timezone should be same timezone as the webshop/organization */ date: Date; /** * Saved in minutes since midnight */ startTime: number; /** * Saved in minutes since midnight (so can also keep going after midnight to indicate an event that keeps going until e.g. 03:00) */ endTime: number; maxOrders: number | null; usedOrders: number; maxPersons: number | null; usedPersons: number; get remainingOrders(): number | null; get remainingPersons(): number | null; /** * In case maxPersons and maxOrders are used at the same time, try to transform it onto 1 number of remainign 'stock' for this timeslot, * which will be visible for customers */ get listedRemainingStock(): number | null; static sort(a: WebshopTimeSlot, b: WebshopTimeSlot): 0 | 1 | -1; /** * Index for sorting on both start and end time */ get timeIndex(): string; toString(): string; dateString(): string; dateStringShort(): string; timeRangeString(): string; clearStock(): void; } /** * Configuration to keep track of available time slots. Can be a fixed number or an infinite amount of time slots */ export declare class WebshopTimeSlots extends AutoEncoder { timeSlots: WebshopTimeSlot[]; } export declare enum CheckoutMethodType { OnSite = "OnSite", Takeout = "Takeout", Delivery = "Delivery" } export declare class CheckoutMethodTypeHelper { static getName(type: CheckoutMethodType): string; } export declare class CheckoutMethod extends AutoEncoder { id: string; type: CheckoutMethodType; name: string; description: string; timeSlots: WebshopTimeSlots; get typeName(): string; clearStock(): void; } export declare class WebshopTakeoutMethod extends CheckoutMethod { type: CheckoutMethodType.Takeout; address: Address; } /** * Choose a location and time to eat / consume the order */ export declare class WebshopOnSiteMethod extends CheckoutMethod { type: CheckoutMethodType.OnSite; address: Address; } /** * If you want to have some sort of cost (e.g. delivery cost that is variable depending on the cart value) */ export declare class CheckoutMethodPrice extends AutoEncoder { price: number; /** * At what price of the cart the discount price should be used instead. * If it is null, the discount price will never get used */ minimumPrice: number | null; discountPrice: number; } export declare class WebshopDeliveryMethod extends CheckoutMethod { type: CheckoutMethodType.Delivery; price: CheckoutMethodPrice; cities: City[]; provinces: Province[]; countries: Country[]; } export type AnyCheckoutMethod = WebshopTakeoutMethod | WebshopDeliveryMethod | WebshopOnSiteMethod; export type AnyCheckoutMethodPatch = AutoEncoderPatchType | AutoEncoderPatchType | AutoEncoderPatchType; export declare class AnyCheckoutMethodPatchDecoder { static decode(data: Data): AnyCheckoutMethodPatch; static patchType(): PatchableDecoder; } export declare class AnyCheckoutMethodDecoder { static decode(data: Data): AnyCheckoutMethod; static patchType(): PatchableDecoder; static patchIdentifier(): Decoder; } export declare enum WebshopType { /** * Simple webshop */ Webshop = "Webshop", Donations = "Donations", TakeawayAndDelivery = "TakeawayAndDelivery", Performance = "Performance", Event = "Event", Registrations = "Registrations" } export declare enum WebshopTicketType { None = "None", /** * Create a single ticket for every order. Used to scan the order on takeout */ SingleTicket = "SingleTicket", /** * Create a single ticket for every product in an order * + this disables the use of checkout methods * + this enables the use of locations and times on products */ Tickets = "Tickets" } export declare enum WebshopStatus { Open = "Open", Closed = "Closed", Archived = "Archived" } export declare enum WebshopNumberingType { Continuous = "Continuous", Random = "Random" } export declare enum WebshopAuthType { Disabled = "Disabled", Required = "Required" } export declare class WebshopMetaData extends AutoEncoder { name: string; title: string; description: RichText; /** * Serves as a hint in the UI for better suggestions and UX. */ ticketType: WebshopTicketType; coverPhoto: Image | null; allowComments: boolean; phoneEnabled: boolean; allowDiscountCodeEntry: boolean; recordCategories: RecordCategory[]; /** * @deprecated */ customFields: WebshopField[]; checkoutMethods: CheckoutMethod[]; seatingPlans: SeatingPlan[]; reduceBranding: boolean; defaultDiscounts: Discount[]; /** * @deprecated * Use paymentConfiguration.paymentMethods instead */ oldPaymentMethods: PaymentMethod[]; /** * @deprecated * Use paymentConfiguration.transferSettings instead */ oldTransferSettings: TransferSettings; paymentConfiguration: PaymentConfiguration; /** * @deprecated * Use paymentConfiguration.paymentMethods instead */ get paymentMethods(): PaymentMethod[]; /** * @deprecated * Use paymentConfiguration.paymentMethods instead */ get transferSettings(): TransferSettings; policies: Policy[]; sponsors: SponsorConfig | null; availableUntil: Date | null; openAt: Date | null; /** * Manually close a webshop */ status: WebshopStatus; layout: WebshopLayout; darkMode: DarkMode; color: string | null; horizontalLogo: Image | null; squareLogo: Image | null; horizontalLogoDark: Image | null; squareLogoDark: Image | null; useLogo: boolean; expandLogo: boolean; cartEnabled: boolean; /** * Whether the domain name has been validated and is active. Only used to know if this domain should get used emails and in the dashboard. * This is to prevent invalid url's from being used in emails. * Lookups for a given domain still work if not active */ domainActive: boolean; authType: WebshopAuthType; customCode: string | null; get hasTickets(): boolean; get hasSingleTickets(): boolean; getEmailReplacements(): Replacement[]; } export declare class WebshopPrivateMetaData extends AutoEncoder { /** * Automatically has full access */ authorId: string; /** * @deprecated * Use role resources instead */ permissions: PermissionsByRole; /** * @deprecated * Use role resources instead */ scanPermissions: PermissionsByRole; startNumber: number; /** * DNS records that need to be set in order to activate mail domain and registration domain */ dnsRecords: DNSRecord[]; defaultEmailId: string | null; notificationEmails: string[]; numberingType: WebshopNumberingType; static buildDNSRecords(domain: string): DNSRecord[]; paymentConfiguration: PrivatePaymentConfiguration; } export declare class WebshopServerMetaData extends AutoEncoder { placeholder: string; } //# sourceMappingURL=WebshopMetaData.d.ts.map