import { SearchResponse } from '@algolia/client-search'; import { IIndexedCustomer } from '../../Interfaces/Algolia'; import ICustomer from '../../Interfaces/Customer'; import { IQueryProps } from '../../Interfaces/Product'; import { BaseServiceClass } from '../baseService'; import { ICustomerStoreCredit } from '../../Interfaces/Customer/IStoreCredit'; /** * Customer class */ export default class Customer extends BaseServiceClass { /** * Get the customer properties */ data: () => ICustomer; static fetch: ({ app, api, hpp, page, query, filters, indice, f, space, useProspr }: IQueryProps) => Promise>; save: (partial?: Partial | undefined, options?: any, saveToDatabase?: boolean, onlyPartial?: boolean) => Promise; /** * Read the current credit from the customer data * Do not use to validate, use the space function * @param creditSlug The credit slug to get * @returns the amount */ getStoreCredit: (creditSlug: string) => Promise; /** * Fetch store credit for customer by slug * @param customerStoreCredit * @param slug */ static getStoreCreditAmountBySlug: (customerStoreCredit: ICustomerStoreCredit[] | undefined, slug: string) => number; }