import { Item, ItemOptions, ItemType } from "./item"; import { Price, PriceOptions } from "./price"; export declare class Measurement { readonly unit: string; readonly quantity: number; constructor(unit: string, quantity: number); } export type ProductOptions = ItemOptions & { prices: Price[]; quantity: number; retailPrice: number; measurement: Measurement; sku: string; sponsored: boolean; referenceId: number; ledgerAccount: string; description: string; lowStock: boolean; brandName: string; minQuantity: number; maxQuantity?: number; referencePromotionId?: number; }; export type ProductRaw = Omit & { prices: PriceOptions[]; type: ItemType; }; export declare class Product extends Item { readonly prices: Price[]; readonly measurement: Measurement; readonly sku: string; readonly sponsored: boolean; readonly referenceId: number; readonly ledgerAccount: string; readonly description: string; readonly lowStock: boolean; readonly brandName: string; readonly minQuantity: number; readonly retailPrice: number; readonly _maxQuantity?: number; readonly referencePromotionId?: number; constructor({ stock, quantity, multipleQuantity, name, image, id, warehouseId, packagingType, prices, measurement, sku, sponsored, referenceId, ledgerAccount, description, lowStock, brandName, minQuantity, maxQuantity, retailPrice, referencePromotionId, }: ProductOptions); get maxQuantity(): number | undefined; get total(): number; get subtotal(): number; /** * Set the quantity and updates the prices quantities * * @param quantity the quantity * @returns the remaining quantity */ set quantity(quantity: number); get quantity(): number; static from({ id, name, stock, warehouseId, medium, packagingType, multipleQuantity, prices, quantity, measurement, sku, sponsored, referenceId, ledgerAccount, description, lowStock, brandName, minQuantity, maximumQuantity, }: any): Product; static fromShopCart({ multipleQuantity, prices, discountedTotal, managerPrice, discountedSubtotal, stock, quantity, medium, id, warehouseId, packagingType, sku, sponsored, referenceId, ledgerAccount, description, lowStock, customerTotal, brandName, minQuantity, customerMeasurement, customerMeasurementUnit, name, }: any): Product; static fromCatalog({ stock, quantity, multipleQuantity, name, medium, id, warehouseId, packagingType, prices, primaryPackaging, sku, sponsored, referenceId, ledgerAccount, description, customerPrice, lowStock, brandName, minQuantity, maxQuantity, maximumQuantity, discountedMaximumQuantity, scheduleEndDate, }: any): Product; static fromPromoDetail({ id, multipleQuantity, sku, displayName, measurementUnit, salesUnit, packagingType, prices, warehouseId, stock, image, }: any): Product; get discountExpirationDate(): Date | undefined | null; get regularPrice(): number; get discountedPrice(): number | undefined; increase(): void; decrease(): void; clone(): Product; toJSON(): { brandName: string; description: string; prices: { customerTotal: number; ico: number; iva: number; base: number; subtotal: number; managerSubtotal: number; total: number; measurementTotal: number; externalId: number | undefined; maxQuantity: number | undefined; discountedExternalId: number | null; expireDate: Date | null | undefined; quantity: number; discount: number | null; }[]; retailPrice: number; ledgerAccount: string; lowStock: boolean; maxQuantity: number | undefined; measurement: Measurement; referenceId: number; sku: string; sponsored: boolean; id: string | number; warehouseId: number; type: ItemType; name: string; stock: number; quantity: number; image: string; medium: string; packagingType: string; minQuantity: number; multipleQuantity: number; total: number; subtotal: number; maximumQuantity: number | undefined; regularPrice: number; discountedPrice: number | undefined; }; }