import { AutoEncoder } from '@simonbackx/simple-encoding'; import { SimpleError, SimpleErrors } from '@simonbackx/simple-errors'; import { StamhoofdFilter } from '../../filters/StamhoofdFilter.js'; import { Group } from '../../Group.js'; import { GroupOption, GroupOptionMenu, GroupPrice } from '../../GroupSettings.js'; import { type Organization } from '../../Organization.js'; import { PriceBreakdown } from '../../PriceBreakdown.js'; import { StockReservation } from '../../StockReservation.js'; import { ObjectWithRecords, PatchAnswers } from '../ObjectWithRecords.js'; import { type PlatformMember } from '../PlatformMember.js'; import { RecordAnswer } from '../records/RecordAnswer.js'; import { RecordSettings } from '../records/RecordSettings.js'; import { type Registration } from '../Registration.js'; import { type RegisterCart } from './RegisterCart.js'; import { type RegisterContext } from './RegisterCheckout.js'; import { RegistrationWithPlatformMember } from './RegistrationWithPlatformMember.js'; import { GroupCategory } from '../../GroupCategory.js'; export declare class RegisterItemOption extends AutoEncoder { option: GroupOption; optionMenu: GroupOptionMenu; amount: number; } export declare class IDRegisterItem extends AutoEncoder { id: string; memberId: string; groupId: string; organizationId: string; groupPrice: GroupPrice; options: RegisterItemOption[]; recordAnswers: Map; replaceRegistrationIds: string[]; trial: boolean; customStartDate: Date | null; customEndDate: Date | null; hydrate(context: RegisterContext): RegisterItem; } export declare class RegisterItem implements ObjectWithRecords { id: string; member: PlatformMember; group: Group; organization: Organization; trial: boolean; groupPrice: GroupPrice; options: RegisterItemOption[]; recordAnswers: Map; customStartDate: Date | null; customEndDate: Date | null; /** * Price for the new registration */ calculatedPrice: number; /** * Price for the new registration that is due later */ calculatedPriceDueLater: number; /** * Refund for the replaced registrations */ calculatedRefund: number; /** * These registrations will be replaced as part of this new registration (moving or updating a registration is possible this way) */ replaceRegistrations: RegistrationWithPlatformMember[]; /** * Show an error in the cart for recovery */ cartError: SimpleError | SimpleErrors | null; /** * @deprecated */ get waitingList(): boolean; static defaultFor(member: PlatformMember, group: Group, organization: Organization): RegisterItem; constructor(data: { id?: string; member: PlatformMember; group: Group; organization: Organization; groupPrice?: GroupPrice; options?: RegisterItemOption[]; recordAnswers?: Map; replaceRegistrations?: RegistrationWithPlatformMember[]; cartError?: SimpleError | SimpleErrors | null; calculatedPrice?: number; calculatedRefund?: number; calculatedPriceDueLater?: number; trial?: boolean; customStartDate?: Date | null; customEndDate?: Date | null; }); static fromRegistration(registration: Registration, member: PlatformMember, organization: Organization): RegisterItem; clone(): RegisterItem; copyFrom(item: RegisterItem): void; static fromId(idRegisterItem: IDRegisterItem, context: RegisterContext): RegisterItem; convert(): IDRegisterItem; get isInCart(): boolean; get showItemView(): boolean; calculatePrice(): void; get totalPrice(): number; get priceBreakown(): PriceBreakdown; getPriceBreakown(cart: RegisterCart | null): PriceBreakdown; getFilteredPrices(): GroupPrice[]; getFilteredOptionMenus(): GroupOptionMenu[]; getFilteredOptions(menu: GroupOptionMenu): GroupOption[]; get memberId(): string; get groupId(): string; get family(): import("../PlatformMember.js").PlatformFamily; get checkout(): import("./RegisterCheckout.js").RegisterCheckout; /** * Update self to the newest available data, and throw error if something failed (only after refreshing other ones) */ refresh(group: Group, options?: { warnings?: boolean; forWaitingList?: boolean; final?: boolean; }): void; willReplace(registrationId: string): boolean; isAlreadyRegistered(): boolean; hasReachedCategoryMaximum(): { category: GroupCategory; groups: Group[]; } | null; isInvited(): boolean; getRequireGroupIdsError(): string | null; getRequireDefaultAgeGroupIdsError(): string | null; doesMeetPreventGroupIds(): boolean; doesMeetRequireOrganizationIds(): boolean; doesMeetRequireOrganizationTags(): boolean; doesMeetRequirePlatformMembershipOn(): boolean; doesMeetRequirePlatformMembershipOnRegistrationDate(): boolean; isExistingMemberOrFamily(): boolean; get description(): string; hasReachedGroupMaximum(): boolean; get validationErrorForWaitingList(): string | null; get validationError(): string | null; get validationWarning(): string | null; get isValid(): boolean; get defaultStartDate(): Date; get defaultEndDate(): Date; get calculatedStartDate(): Date; get calculatedEndDate(): Date; get calculatedTrialUntil(): Date | null; get canHaveTrial(): boolean; /** * Return wheter a given period id matches the period of this group for a requirement. * E.g. if you need to be registered for a default age group or organization, only count registrations that are in an active period. * * This evaluates to either the period of the group or the current period of the organization. The platform period is ignored and does not count as active. * This allows organizations to switch to a new period earlier and disable allowing registrations of the previous organization as being valid. */ isActivePeriodId(periodId: string): boolean; validatePeriod(group: Group, type: 'move' | 'register', admin?: boolean): void; validate(options?: { warnings?: boolean; forWaitingList?: boolean; final?: boolean; }): void; /** * Returns the stock that will be taken (or freed if negative) by all the register items before this item * and with the removed registrations freed up, so this can be negative */ getCartPendingStockReservations(): StockReservation[]; /** * Stock that will be taken or removed by this item */ getPendingStockReservations(): StockReservation[]; doesMatchFilter(filter: StamhoofdFilter): boolean; isRecordEnabled(_: RecordSettings): boolean; getRecordAnswers(): Map; patchRecordAnswers(patch: PatchAnswers): this; isSameRegistration(item: RegisterItem): boolean; } //# sourceMappingURL=RegisterItem.d.ts.map