import { BasketEntry } from '../_models'; import { ComparableProduct } from './builded/comparable-product'; export declare class ItemsComparator { miamBasketEntries: ComparableProduct[]; retailerProduct: ComparableProduct; private previousMiamQuantity; constructor(); get retailerQuantity(): number; get miamQuantity(): number; get firstBasketEntryId(): string; /** * reset previousQuantity to the current miamQuantity (to be called at the end of a sync cycle) */ updatePreviousQuantity(): void; clearRetailerProduct(): void; /** * retailerProducts is a array for some retailer (like retailer) * so to have the moset standart code we turn it into an array * even if it's not needed */ addOrUpdateRetailerProduct(retailerProduct: ComparableProduct): void; /** * If the quantity in retailer's basket is inferior to that of Mealz's basket, it means the users removed one or more * of the product from their cart. So we need to remove products from Mealz's basket in this case. * * Multiples entries can be linked to the same product (ex: the same olive oil can be chosen for 'oil' & 'olive oil') * so we remove as much as possible from each entry's quantity, until all are at 0 or there isn't quantity to be removed. * @returns the entries to remove, with a quantity always positive, as you can't remove a negative number of products & * only removals of products can come from retailer's side */ removeMiamEntriesIfNecessary(): ComparableProduct[]; /** * Update miamBasketEntries with the entries coming from the latest miamBasket */ addOrUpdateBasketEntry(entry: BasketEntry): void; /** * Remove any entries that are not in the current basket or any remaining entry that does not have the same ext-id as the product compared * @param entriesInBasket Content of the last received Mealz basket */ cleanBasketEntries(entriesInBasket: BasketEntry[]): void; /** * Clear miamBasketEntries */ removeBasketEntries(): void; /** * If miamQuantity is different from what it was at the start of the sync cycle, we need to update the retailer's basket * with the difference (add products if the diff is positive, and remove them if it is negative). * @returns the product to add/remove with its quantity being the difference */ updateRetailerProductsFromEntry(): ComparableProduct[]; } //# sourceMappingURL=items-comparator.d.ts.map