/** * Space interface. * * @link ecomm.gitngin.com/wiki/interfaces/space * @file Interface of a Space. A space reprensent an selling entity. * @author Alexandre Hébert-Vincent. * @since 01-01-2020 */ import Space from '../../lib/Space'; import IAddress from '../Address'; import { CustomPaymentTypeEnum, PaymentTypeEnum } from '../Cart'; import { CartGeneralTypeEnum } from '../../rules/GR/interfaces/cart'; import { ICashDrawer } from '../CashDrawers'; import { ISliderContent, ISliderOptions } from '../CMS'; import { InventoryPriorityTypeEnum } from '../Inventory'; import { IBankType } from '../PromiseToPurchase/BankType'; import { ISpaceSchedule } from '../Schedule'; import IStore from '../Store'; import ITranslation from '../Translation'; import { IExternalServices } from './IExternalService'; export default interface ISpace { readonly id?: string; readonly name: string; readonly use_supply_cycle?: boolean; readonly space_options?: ISpaceOptions; readonly default_currency: string; readonly enabled_currencies: string[]; readonly emailTemplate?: { readonly [key: string]: any; readonly company_logo_href: string; readonly company_logo_src: ITranslation[]; readonly company_logo_onwhite_src: ITranslation[]; readonly email_communications_clients: string; readonly phone_communications_clients: string; readonly copyrights: ITranslation[]; readonly address: string; readonly help_href: ITranslation[]; readonly preferences_href: ITranslation[]; readonly unsubscribe_href: string; readonly socialmedias_items?: []; }; readonly cms: { readonly website_in_maintenance: boolean; readonly sliders: { readonly name: string; readonly slug: string; readonly content: ISliderContent[]; }[]; readonly hide_pro_prices?: boolean; readonly hide_pro_prices_history?: { start: Date; end?: Date; }[]; readonly fixed_promo_banner?: IFixedPromoBanner; readonly available_menu_positions?: { name: string; slug: string; }[]; }; readonly models?: { readonly cms?: { readonly sliders: ISliderOptions; }; readonly invoice_footer?: { readonly left: ITranslation[]; readonly center: ITranslation[]; readonly right: ITranslation[]; }; }; readonly product_preferences: IProductPreferences; readonly external_services: IExternalServices[]; readonly default_tax_family?: string; readonly url?: string; readonly languages: ('fr' | 'en')[]; readonly default_language: string; readonly transport_preferences: { readonly pickup_base_cost?: number; readonly override_shipping_with_cost?: number; readonly add_percent_to_shipping_cost?: number; readonly add_amount_to_shipping_cost?: number; readonly default_departure_address?: IAddress & { readonly companyName: string; readonly email: string; readonly notify: boolean; readonly residential: boolean; readonly phone: string; }; readonly pickup_is_disabled?: boolean; readonly shipping_is_disabled?: boolean; readonly predefined_boxes?: IPredefinedBox[]; readonly predefined_products?: IPredefinedBox[]; readonly predefined_envelops?: IPredefinedBox[]; readonly dimension_units?: IDimensionUnit[]; readonly limit_shipping_range?: IShippingRangeRestrictions; readonly limit_free_shipping_range?: IShippingRangeRestrictions | boolean; readonly default_unit?: { readonly weight: 'kilograms' | 'pounds'; readonly measurments: 'centimeters' | 'inches'; }; readonly blocked_dates?: IBlockedDates[]; readonly shipping_as_product?: boolean; }; readonly payments_accepted: (PaymentTypeEnum | CustomPaymentTypeEnum)[]; readonly deposit_amount?: number; readonly stores_warehouses: IStore[]; readonly schedule?: ISpaceSchedule; readonly import_model?: IImportModelLine[]; readonly customer_types?: string[]; readonly customer_groups?: ICustomerGroup[]; readonly invoice_settings: IOrderInvoiceNumerotation & { readonly inherit_order_number: boolean; readonly seperate_invoices_from_order?: boolean; readonly fast_order?: boolean; readonly numbered_by_store: { [store_id: string]: IOrderInvoiceNumerotation; } | null; readonly numbered_by_web_type: { [expedition_type: string]: IOrderInvoiceNumerotation; } | null; readonly send_invoice_on_creation_to_emails: { is_active: boolean; emails: string[]; }; readonly send_delivery_invoice_on_creation_to_emails?: { is_active: boolean; emails: string[]; }; readonly notify_on_cancel_or_modify?: { is_active: boolean; emails_pickup: string[]; emails_delivery: string[]; emails_delivery_by_cart_type?: Partial>; auto_email_pickup: boolean; }; readonly notify_on_transfer_modified_by_cart?: { is_active: boolean; emails: string[]; }; }; readonly order_settings: IOrderInvoiceNumerotation & { readonly invoice_url?: { readonly [key: string]: string; }; readonly numbered_by_store: { [store_id: string]: IOrderInvoiceNumerotation; } | null; }; readonly admin_blog_url?: string; readonly is_saving_inventory: string | null; readonly g2_calls?: IG2Calls; readonly g2_price_fetch_active?: Date; readonly inventory_priority?: InventoryPriorityTypeEnum; readonly multipromo_aware?: boolean; readonly slack_channels_enabled?: { readonly channel_id: string; readonly team_id: string; readonly token: string; }[]; readonly email_settings?: { readonly receivers?: { readonly type: string; readonly emails: string[]; }[]; }; readonly bank_types?: IBankType[]; readonly promise_to_purchase_emails?: string[]; readonly promise_to_purchase_contingency?: number; readonly promise_to_purchase_seasons?: Record; readonly transfer_settings?: IOrderInvoiceNumerotation; readonly pos_settings?: { readonly auto_lock_delay?: number | null; readonly temp_prod?: { readonly use_specific_skus?: string | null; readonly can_add_multiple_of_same_sku?: boolean; }; }; readonly cash_drawers?: ICashDrawer[]; readonly other?: { readonly auto_fill_title_with_image_name?: { readonly is_active: boolean; readonly mode?: 'image' | 'product'; }; }; store_credits?: IStoreCreditEntry[]; } export interface IStoreCreditEntry { credit_slug: string; name: ITranslation[]; } export interface IBucketDocument { metadata: any; path: string; name: string; } export interface ISeason { readonly opened: ISeasonInfo | null; readonly ended: ISeasonInfo | null; readonly closed: ISeasonInfo | null; } export interface ISeasonInfo { readonly date: Date; readonly by_user: string; } export interface IOrderInvoiceNumerotation { readonly prefix?: string; readonly suffix?: string; readonly increment_by?: number; readonly start_at?: number; } export interface IProductPreferences { readonly auto_sku_regex?: string; readonly documents?: boolean; readonly panel_descriptions?: boolean; readonly decimals: number; readonly allow_negative_prices?: boolean; readonly product_upsells?: boolean; readonly can_be_unsearchable?: boolean; readonly can_be_service?: boolean; readonly barcode_next?: string; readonly generate_barcode?: boolean; readonly product_equivalents?: boolean; } export interface IShippingRangeRestrictions { readonly limit_countries: string[]; readonly limit_states: string[]; } export interface IImportModelLine { readonly label: string; readonly key: string; } export interface IPredefinedBox { readonly name: string; readonly slug: string; readonly height: number; readonly width: number; readonly length: number; readonly dimension_unit?: 'inches' | 'centimeters'; readonly weight?: number; readonly weight_unit?: 'kilograms' | 'pounds'; readonly price?: number; readonly category_id?: string; readonly attribute?: string; readonly is_shipping_option?: boolean; readonly shipping_option_data?: { readonly carrier?: string; readonly service_name?: string; readonly order_min_price?: number; readonly max_weight?: number; readonly max_item_in_box?: number; readonly quote_id?: string; readonly transitDays?: number; } | null; } export interface IDimensionUnit { readonly slug: string; readonly name: string; readonly use_for?: { readonly detailed_inventory_management?: boolean; readonly transfer_request_management?: boolean; }; readonly specifics: { readonly should_round_to_one_unit_in_calculations?: boolean; }; readonly name_translations?: ITranslation[]; readonly short_name_translations?: ITranslation[]; readonly plural_name_translations?: ITranslation[]; } export interface ICurrencies { readonly base: string; readonly date: Date; readonly rates: {}; } export interface ICustomerGroup { readonly name: ITranslation[]; readonly slug: string; readonly validate?: boolean; readonly document_type?: ITranslation[]; readonly regex?: string; readonly regex_exe?: string; readonly has_price?: boolean; readonly use_only_for_prices?: boolean; readonly show_first_in_prices?: boolean; readonly external_slug?: string; readonly external_price_list_slug?: string; readonly draft?: boolean; } export interface IG2Calls { readonly last_product_price_sync?: Date; readonly last_customer_sync?: Date; } export interface IBlockedDates { readonly cart_type: string; readonly dates?: { readonly start_date: Date | null; readonly end_date: Date | null; readonly unique_id: string; }[]; } export declare enum spaceCollectionNames { DISCOUNTS = "discountRules", PURCHASE_ORDERS = "purchaseOrders", ATTR_FAMILIES = "classes", SUPPLIERS = "suppliers", CARTS = "carts", ORDERS = "orders", INVOICES = "invoices", CUSTOMERS = "customers", INVENTORIES = "inventories", PRODUCTS = "products", TAGS = "tags", BOOKINGS = "bookings", PROMISES = "promises_to_purchase", BG_JOBS = "bg_jobs", SLIDERS = "sliders", EXTERNAL_SERVICES = "external_services", BRANDS = "brands", CATEGORIES = "categories", BLOG_ARTICLES = "blog_articles", BLOG_CATEGORIES = "blog_categories", BLOG_KEYWORDS = "blog_keywords", CATALOGUES = "catalogues", ATTRIBUTES = "attributes", TRANSFER_REQUESTS = "transfer_requests", NOTES = "notes", CART_RESERVED_QUANTITIES = "cart_reserved_quantities" } export declare enum POSTypeEnum { PUBLIC = "public", ADMIN_ONLY = "admin_only" } export interface ISpaceOptions { readonly products: { readonly last_saved: boolean; readonly use_keywords?: boolean; readonly save_cost_price?: boolean; readonly can_exclude_declis_from_cost_calulations?: boolean; readonly index_extra_info_in_decli?: boolean; readonly index_extra_product_images?: boolean; readonly product_can_have_presale?: boolean; }; readonly inventory?: { readonly minimum_inventory_per_sku: boolean; readonly bulk_inventory_edit?: boolean; readonly reserve_on_add_to_cart?: boolean; }; readonly tags: { readonly available: boolean; readonly auto_generated: boolean; }; readonly payment: { readonly promise_to_purchase: boolean; readonly save_multiple_paid_by: boolean; readonly online_payments_are_deposits: boolean; readonly has_payment_incentives: boolean; readonly space_has_store_credits?: boolean; }; readonly cms?: { readonly has_fixed_promo_banner?: boolean; readonly can_edit_sliders?: boolean; readonly can_set_detailed_store_schedule?: boolean; readonly custom_menu?: boolean; }; readonly security?: { readonly no_nip_from_pos?: boolean; }; readonly features?: { readonly allow_refunds?: boolean; readonly space_has_bookings?: boolean; readonly has_pos?: boolean; readonly allow_custom_prices_in_categories?: boolean; readonly can_manage_cash_drawers?: boolean; }; readonly pos?: { readonly has_custom_pos?: boolean; readonly is_public?: boolean; readonly can_put_carts_on_hold?: boolean; readonly must_assign_cash_drawer?: boolean; }; readonly booking?: { readonly set_store_for_booking_inventory_management?: boolean; }; readonly transfer_requests?: { readonly available?: boolean; readonly associate_origin_store_at_creation?: boolean; readonly dont_limit_qty?: boolean; readonly transfer_list_show_total_pal_qte?: boolean; readonly transfer_list_show_total_weight?: boolean; readonly allow_transfer_when_out_stock?: boolean; readonly ajust_inventory_on_to_be_prepared?: boolean; }; readonly invoices?: { readonly print_small_invoice?: boolean; }; } export declare const getDefaultSpaceOptions: () => ISpaceOptions; export declare const defaultSpace: () => ISpace; export declare const getDefaultDimensionUnit: (space: Space) => IDimensionUnit; export interface IFixedPromoBanner { readonly content: ITranslation[]; readonly is_active: boolean; readonly background_color?: string; readonly text_color?: string; readonly active_between_dates?: { start: Date; end: Date; }[]; } export interface IShippingServiceZone { description: string; polygon: string; base_fee: number; slug: string; name: string; }