import { ICartReservedQuantities } from '../../Interfaces/CartReservedQuantities'; import { BaseServiceClass } from '../baseService'; export default class CartReservedQuantities extends BaseServiceClass { private _space; data: () => ICartReservedQuantities; save(partial?: Partial, _options?: any, saveToDatabase?: boolean, _update?: boolean, merge?: boolean, _beforeData?: any, onlyPartial?: boolean, noEvent?: boolean): Promise; private _getInventory; /** * Add a quantity to a SKU in the reservation list * If the SKU is new, a new entry is added with the quantity * else the quantity is added to the existing one * @param sku The sku to add * @param qty The quantity to add * @param storeId The store id to use for reservation, undefined if web only * @returns True if successfull, False if failled */ addProduct: (sku: string, qty: number, storeId: string | undefined) => Promise; /** * Remove a quantity from a SKU in the reservation list * Remove the provided quantity from the list, if the amount reatch 0 the * SKU is removed from the list * @param sku The sku to remove * @param qty The quantity to remove * @param storeId The store id to use for reservation, undefined if web only * @returns True if successfull, False if failled */ removeProduct: (sku: string, qty: number, storeId: string | undefined) => Promise; /** * Set a sku quantity in the reservation list * The SKU will be added to the list if it's not in the list yet * The value will be set to the provided quantity and the inventory * will be adjusted accordingly * @param sku The sku to set * @param qty The quantity to set * @param storeId The store id to use for reservation, undefined if web only * @returns True if successfull */ setProduct: (sku: string, qty: number, storeId: string | undefined) => Promise; /** * Delete this document and release all reserved quantities * @returns List of sku in error */ deleteAndFreeInventory: (storeId: string | undefined) => Promise; /** * Set last_update property with provided value * @param newValue */ setLastUpdate: (newValue: Date) => Promise; }