import { AutoEncoderPatchType, PartialWithoutMethods } from '@simonbackx/simple-encoding'; import { type Group } from '../Group.js'; import { GroupType } from '../GroupType.js'; import { Organization } from '../Organization.js'; import { PermissionLevel } from '../PermissionLevel.js'; import { Document as DocumentStruct } from '../Document.js'; import { Platform } from '../Platform.js'; import { UserWithMembers } from '../UserWithMembers.js'; import { Address } from '../addresses/Address.js'; import { StamhoofdFilter } from '../filters/StamhoofdFilter.js'; import { EmergencyContact } from './EmergencyContact.js'; import { MemberDetails, MemberProperty } from './MemberDetails.js'; import { MembersBlob, MemberWithRegistrationsBlob } from './MemberWithRegistrationsBlob.js'; import { type ContinuousMembershipStatus } from './MembershipStatus.js'; import { ObjectWithRecords, PatchAnswers } from './ObjectWithRecords.js'; import { OrganizationRecordsConfiguration } from './OrganizationRecordsConfiguration.js'; import { Parent } from './Parent.js'; import { Registration } from './Registration.js'; import { RegistrationsBlob } from './RegistrationsBlob.js'; import { RegisterCheckout } from './checkout/RegisterCheckout.js'; import { RegisterItem } from './checkout/RegisterItem.js'; import { RecordAnswer } from './records/RecordAnswer.js'; import { RecordCategory } from './records/RecordCategory.js'; import { RecordSettings } from './records/RecordSettings.js'; export declare class PlatformFamily { members: PlatformMember[]; documents: DocumentStruct[]; /** * Checkout is required for the member to know whether certain fields are required to get collected */ checkout: RegisterCheckout; /** * Items that have not been added to the cart/checkout, but will be - and for which data has to be collected */ pendingRegisterItems: RegisterItem[]; platform: Platform; organizations: Organization[]; /** * Helper data point, to know whether we already tried loading the full family for this member. * * By default it is false, which is okay most of the times. Set it to true when you know you didn't really load the full family and there is a chance * there are unknown members in the family. */ _isSingle: boolean; constructor(context: { contextOrganization?: Organization | null; platform: Platform; }); /** * returns the uuid of the oldest member */ get uuid(): string; insertOrganization(organization: Organization): void; getOrganization(id: string): Organization | undefined; static create(blob: MembersBlob, context: { contextOrganization?: Organization | null; platform: Platform; }): PlatformFamily; insertFromBlob(blob: MembersBlob, removeMissing?: boolean): void; /** * Update multiple members if you don't have a family reference (or multiple families) */ static updateFromBlob(members: PlatformMember[], blob: MembersBlob): void; /** * Same as insertFromBlob, but doesn't add new members, only updates existing members */ updateFromBlob(blob: MembersBlob): void; newMember(): PlatformMember; static createSingles(blob: MembersBlob, context: { contextOrganization?: Organization | null; platform: Platform; }): PlatformMember[]; /** * These clones are for patches so they only become visible after saving */ clone(): PlatformFamily; copyFromClone(clone: PlatformFamily): void; getAddressOccurrences(address: Address, skip?: { memberId?: string; parentId?: string; }): string[]; getAddressesWithoutPatches(skip: { memberId?: string; parentId?: string; }): Address[]; get addresses(): Address[]; get parents(): Parent[]; /** * Change all references to an address to a new address */ updateAddress(oldValue: Address, newValue: Address): void; patchParent(parent: AutoEncoderPatchType): void; getMembersForParent(parent: Parent): PlatformMember[]; patchEmergencyContact(emergencyContact: AutoEncoderPatchType): void; getRecommendedEventsFilter(): StamhoofdFilter; deleteMember(id: string): void; setDocuments(documents: DocumentStruct[]): void; belongsToFamily(member: MemberWithRegistrationsBlob): boolean; add(platformMember: PlatformMember): void; } export declare class PlatformRegistration extends Registration { member: PlatformMember; static createSingles(blob: RegistrationsBlob, context: { contextOrganization?: Organization | null; platform: Platform; }): PlatformRegistration[]; getMissingData(options?: { checkPermissions?: { user: UserWithMembers; level: PermissionLevel; }; }): string[]; isRecordEnabled(record: RecordSettings): boolean; } export declare class PlatformMember implements ObjectWithRecords { member: MemberWithRegistrationsBlob; patch: AutoEncoderPatchType; _savingPatch: AutoEncoderPatchType | null; _isCreating: boolean | null; family: PlatformFamily; isNew: boolean; /** * If you create a member yourself, you automatically get full access granted. * The frontend can't calculate this on its own because it is only temporary. */ hasFullAccess: boolean; /** * Cached data that is cleared when the member is patched */ cacheMap: { missingData?: string[]; }; get id(): string; constructor(data: { member: MemberWithRegistrationsBlob; family: PlatformFamily; isNew?: boolean; hasFullAccess?: boolean; patch?: AutoEncoderPatchType; }); clone(): PlatformMember; _cloneWithFamily(family: PlatformFamily): PlatformMember; get organizations(): Organization[]; get platform(): Platform; get allGroups(): Group[]; get isSaving(): boolean; get filteredMemberships(): import("./MemberPlatformMembership.js").MemberPlatformMembership[]; get membershipStatus(): import("./MembershipStatus.js").MembershipStatus; get hasFutureMembership(): boolean; get shouldApplyReducedPrice(): boolean; getContinuousMembershipStatus({ start, end }: { start: Date; end: Date; }): ContinuousMembershipStatus; addPatch(p: PartialWithoutMethods>): void; addEmergencyContact(emergencyContact: EmergencyContact): void; patchEmergencyContact(emergencyContact: AutoEncoderPatchType): void; addParent(parent: Parent): void; patchParent(parent: AutoEncoderPatchType): void; addDetailsPatch(p: PartialWithoutMethods>): void; isPropertyEnabledForPlatform(property: MemberProperty): any; isPropertyEnabled(property: MemberProperty, options?: { checkPermissions?: { user: UserWithMembers; level: PermissionLevel; }; scopeGroups?: Group[] | null; }): boolean; isPropertyRequiredForPlatform(property: MemberProperty): any; isPropertyRequired(property: MemberProperty, options?: { checkPermissions?: { user: UserWithMembers; level: PermissionLevel; }; scopeGroups?: Group[] | null; }): boolean; prepareSave(): void; markSaved(): void; markFailedSave(): void; /** * * @param filters * @param filters.groups - Only show registrations for these groups * @param filters.groupIds - Only show registrations for these group ids * @param filters.canRegister - Only show registrations for which the member can register * @param filters.periodId - Only show registrations for this period * @param filters.periodIds - Only show registrations for these periods * @param filters.currentPeriod - Only show registrations for the current period * @param filters.previousPeriod - Also who registrations for previous period, can be combined with currentPeriod * @param filters.includeFuture - Used in combination with currentPeriod. If true, also show registrations that start in the future. Defaults to true. * @param filters.types - Only show registrations for these group types * @param filters.organizationId - Only show registrations for this organization * @returns */ filterRegistrations(filters: { groups?: Group[] | null; groupIds?: string[] | null; defaultAgeGroupIds?: string[]; canRegister?: boolean; periodId?: string; periodIds?: string[]; includeFuture?: boolean; currentPeriod?: boolean; previousPeriod?: boolean; types?: GroupType[]; organizationId?: string; }): Registration[]; filterGroups(filters: { groups?: Group[] | null; canRegister?: boolean; periodId?: string; periodIds?: string[]; currentPeriod?: boolean; previousPeriod?: boolean; includeFuture?: boolean; includePending?: boolean; types?: GroupType[]; organizationId?: string; }): Group[]; filterRecordsConfigurations(filters: { groups?: Group[] | null; canRegister?: boolean; periodId?: string; currentPeriod?: boolean; previousPeriod?: boolean; types?: GroupType[]; organizationId?: string; }): OrganizationRecordsConfiguration[]; filterOrganizations(filters: { groups?: Group[] | null; canRegister?: boolean; periodId?: string; periodIds?: string[]; withResponsibilities?: boolean; currentPeriod?: boolean; types?: GroupType[]; }): Organization[]; get groups(): Group[]; get registrationDescription(): string; insertOrganization(organization: Organization): void; canRegister(group: Group, organization: Organization): boolean; canRegisterForWaitingList(group: Group, organization: Organization): boolean; get patchedMember(): MemberWithRegistrationsBlob; doesMatchFilter(filter: StamhoofdFilter): boolean; getAllRecordCategories(options?: { scopeOrganization?: Organization | null; }): RecordCategory[]; getEnabledRecordCategories(options: { checkPermissions?: { user: UserWithMembers; level: PermissionLevel; } | null; scopeOrganization?: Organization | null; scopeGroup?: Group | null; scopeGroups?: Group[] | null; }): { categories: RecordCategory[]; adminPermissionsMap: Map; }; isExistingMember(organization: Organization): boolean; isRecordEnabled(record: RecordSettings): boolean; getRecordAnswers(): Map; patchRecordAnswers(patch: PatchAnswers): this; getResponsibilities(filter?: { organization?: Organization | null | undefined; }): import("./MemberResponsibilityRecord.js").MemberResponsibilityRecord[]; static sorterByName(sortDirection?: string): (a: PlatformMember, b: PlatformMember) => 0 | 1 | -1; } //# sourceMappingURL=PlatformMember.d.ts.map