• This function returns the buy-history for given array of article-ids. The history is in the form of a map, where each customer that has bought at least one of the articles in question represents a key. In case articles were bought but no customer was referenced then they are accessible with the key 'unknown'.

    Parameters

    • ids: (undefined | number)[]

    Returns Promise<
        Map<
            | "unknown"
            | {
                birthday?: string;
                city?: string;
                company?: string;
                country?: string;
                email?: string;
                firstName?: string;
                houseNumber?: string;
                id: number;
                lastName?: string;
                notes?: string[];
                phone?: string;
                postCode?: string;
                salutation?: string;
                street?: string;
                timestamp?: string;
                uid_number?: string;
            },
            {
                customer?: {
                    birthday?: string;
                    city?: string;
                    company?: string;
                    country?: string;
                    email?: string;
                    firstName?: string;
                    houseNumber?: string;
                    id: number;
                    lastName?: string;
                    notes?: string[];
                    phone?: string;
                    postCode?: string;
                    salutation?: string;
                    street?: string;
                    timestamp?: string;
                    uid_number?: string;
                };
                id: number;
                isCanceled: boolean;
                items: {
                    discount: number;
                    id: number;
                    name: string;
                    price: number;
                    quantity: number;
                    taxRate: number;
                }[];
                paymentType: string;
                system_id?: unknown;
                timestamp: string;
                total: number;
            }[],
        >,
    >