import { IConcreteOrder, IGrassProduct, IVracType } from '../interfaces/products'; import ICart, { ICartItem } from '../../../Interfaces/Cart'; import { IBlockedDates } from '../../../Interfaces/Space'; import { ICustomPriceItem } from '../../../Interfaces/G2'; import IIndexedProduct from '../../../Interfaces/Indexed/Product'; import IAddress from '../../../Interfaces/Address'; import IStore from '../../../Interfaces/Store'; import { CartGeneralTypeEnum, TExpeditionMethod, TFeesAppliedResponse } from '../interfaces/cart'; import IInventoryItem from '../../../Interfaces/Product/IInventoryItem'; import { ISpaceSchedule } from '../../../Interfaces/Schedule'; export declare const getDefaultTimeValues: () => { label: string; value: string; }[]; export declare const getAvailableHours: (minDeliveryDate: Date | undefined, selectedDate: Date | undefined, grassProduct: IGrassProduct | undefined, concreteOrder: IConcreteOrder | undefined, expeditionMethod: TExpeditionMethod, selectedDeliveryTime: string | undefined, isPro: boolean, isSample: boolean, isAccessoriesOnly: boolean, testDate: Date | undefined, keepHours?: boolean) => { deliveryTimes: { label: string; value: string; }[]; newSelectedDeliveryTime?: undefined; } | { deliveryTimes: { label: string; value: string; }[]; newSelectedDeliveryTime: { label: string; value: string; } | undefined; }; interface IMinDates { min_delivery?: Date; min_pickup?: Date; } /** * Function getMinDatePicker * @description Sets the minimum shipping day for delivery */ export declare const getMinDatePicker: (cartData: ICart, grassProduct: IGrassProduct | undefined, concreteOrder: IConcreteOrder | undefined, expeditionMethod: string, isPro: boolean, testDate?: Date, blockedShippingDates?: IBlockedDates[], vracType?: IVracType | boolean, isPOS?: boolean, spaceSchedule?: ISpaceSchedule) => IMinDates; export declare const getSamplesMinDateOffset: () => number; export declare const getMinDateOffset: (now: Date, cartContainsInstallation: boolean, cartContainsVrac: boolean, cartData: ICart, grassProduct: IGrassProduct | undefined, concreteOrder: IConcreteOrder | undefined, isAccessoriesOnly: boolean, expeditionMethod: string, vracType?: IVracType | boolean) => number; /** * Function shouldDisableDate * @description compares date with blockedDates from DB and blocked days (currently hardcoded in function) * @param date - Date to check * @param blockedDates - Blocked dates from DB * @param expeditionMethod - pickup or shipping * @param cartData */ export declare const shouldDisableDate: (date: Date, blockedDates: IBlockedDates[], expeditionMethod: TExpeditionMethod, cartData: ICart | undefined, schedule?: ISpaceSchedule | undefined, selectedStore?: string | undefined) => boolean; export declare const dateIsClosedInSchedule: (storeId: string, dateToCheck: Date, spaceSchedule: ISpaceSchedule) => boolean; /** * Function checkIfCartTypeHasBlockedDates * @description checks if type of cart corresponds to a blockedDates array and if array has dates defined * @param cartData * @param blockedDates */ export declare const checkIfCartTypeHasBlockedDates: (cartData: ICart | undefined, blockedDates: IBlockedDates[] | undefined) => boolean; export declare const slugsToCheckFromExpeditionFees: { pickup: string[]; shipping: string[]; }; export declare const getPalletQty: (items: ICartItem[], orderType?: 'grass' | 'concrete', minQteGrassOrder?: number) => number; export declare const getGrassRoundedPickupPalletFees: (realPalletNumber: number) => number; export declare const getPalletQtyPalletFee: (items: ICartItem[], expeditionMethod: TExpeditionMethod, isGrass?: boolean, isMixed?: boolean) => number; export declare const calculatePalFeeForOtherThanGrass: (items: ICartItem[]) => number; export declare const getMinGrassQte: (_grassProduct: IGrassProduct, expeditionMethod: string, _isPro: boolean) => number; export declare const getMinQteInstall: (_isPro: boolean) => number; export declare const checkIfShouldApplySameDayGrassFee: (firstDayForExpedition: { min_pickup?: Date; min_delivery?: Date; }, expeditionMethod: TExpeditionMethod, selectedExpeditionDate: Date, testDate?: Date) => boolean; export declare const checkForSameGrassDayFee: (isPOS: boolean, isPro: boolean, totalPallet: number, grassProduct: IGrassProduct | undefined, selectedExepeditionDate: Date | undefined, isReserved?: boolean) => boolean; export declare const expeditionFeePalletTier = 24; export declare const installationFeePalletTier = 48; /** * Calculates fees that should be applied to provided cart, and fetches them from database or fee array if provided. * Returns the items to add, update and delete, as well as other cart info to set after fees. * ** Optimized version possible, where address zones and distance are calculated before and properties are sent directly to function * ** Optimized version reverted, logic found in commit here : [#2087b32]{@link https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6} * @async * @param fetchProduct * @param getIfAddressIsInsideZones * @param getDistanceFromAddress * @param cart * @param expeditionMethod * @param grassProduct * @param concreteOrder * @param cartContainsInstallation * @param cartContainsVrac * @param availableVracStoreIDs * @param isPro * @param addOnePalletToPickup * @param cartContainsSample * @param saveToShippingPayload * @param deliveryAddress * @param locale * @param expeditionDate * @param equipmentPickupOnSite * @param cartContainsOnlyAccessories * @param pickupStore * @param allStores * @param customPriceList * @param useFeeArray */ export declare const applyFeesToCart: (fetchProduct: (slug: string, locale: string | undefined, useFeeArray?: boolean, noDrafts?: boolean) => Promise, getIfAddressIsInsideZones: (address: IAddress | string) => Promise, getDistanceFromAddress: (start: IAddress | string, finish: IAddress | string) => Promise, cart: ICart, expeditionMethod: TExpeditionMethod, grassProduct: IGrassProduct | undefined, concreteOrder: IConcreteOrder | undefined, cartContainsInstallation: boolean, cartContainsVrac: boolean, availableVracStoreIDs: string[] | undefined, isPro: boolean, addOnePalletToPickup: boolean, cartContainsSample: boolean, saveToShippingPayload: boolean, deliveryAddress: IAddress | undefined, locale: string | undefined, expeditionDate: Date | undefined, equipmentPickupOnSite: boolean, cartContainsOnlyAccessories: boolean, pickupStore: IStore | undefined, allStores: IStore[], customPriceList?: ICustomPriceItem[], useFeeArray?: boolean) => Promise; /** * Checks if sample shipping fee should be removed from cart depending on cart items found in cart. * ** Optimized version possible using brand name instead of brand id, removing async check. * ** Optimized version reverted, logic found in commit here : [#2087b32]{@link https://github.com/ciaoqc/gng-tb-admin-sdk/commit/2087b3207df9e5916a979b8bb255abc2a4c1dac6} * @param fetchProduct * @param cart * @param locale * @param useFeeArray */ export declare const checkIfShouldRemoveSampleShippingFee: (fetchProduct: (slug: string, locale: string | undefined, useFeeArray?: boolean, noDrafts?: boolean) => Promise, cart: ICart, locale: string | undefined, useFeeArray?: boolean) => Promise; export declare const calculateShippingForVrac: (distance: number | undefined, cartItems: ICartItem[], deliveryTruckProduct: IIndexedProduct, currentItemsToAdd: ICartItem[], deliveryDate: Date | undefined) => ICartItem[]; export declare const getStoresForVracProdShipping: (inventoryItem: IInventoryItem) => { [key: string]: boolean; }; /** * Function checkIfCartExpired * @description checks if cart expired using the updated_at date stored in the shipping_payload * @param cartData * @param grassProduct * @param concreteOrder * @param isPro * @param options.blocked_shipping_dates * @param options.vracType * @param options.chosenPaymentType * @param options.forceCheckForCartTypes */ export declare const checkIfCartExpired: (cartData: ICart, grassProduct: IGrassProduct | undefined, concreteOrder: IConcreteOrder | undefined, isPro: boolean, options?: { blocked_shipping_dates?: IBlockedDates[]; vracType?: IVracType | boolean | undefined; chosenPaymentType?: string; forceCheckForCartTypes?: CartGeneralTypeEnum[]; }) => boolean; export declare const checkIfNoDeliveryDateIsNormal: (cartData: ICart, concreteOrder: IConcreteOrder | undefined, checkForInputShown?: boolean) => boolean; export {};