import { AptlyAlgorithmSchema } from './algorithm.js'; import { AptlyBaseSchema, AptlyHistorySchema } from './extends.js'; import { AptlyCategorySectionDisplayType, AptlyUnitTemplateCategorySectionProductMeasureUnitType, AptlyUnitTemplateCategorySectionProductParamKey } from '../enums/index.js'; import { AptlyPeriodSchema } from './period.js'; import { AptlyProductSchema } from './product.js'; import { AptlyProducerSchema } from './producer.js'; import { AptlyMediaSrcSchema } from './media.js'; import { AptlyUpsellTemplateSchema } from './upsell-template.js'; export type AptlyUnitTemplateBase = AptlyUnitTemplateBaseSchema; export interface AptlyUnitTemplateBaseSchema extends AptlyBaseSchema { _order_categories: ID[]; categories: AptlyUnitTemplateCategorySchema[]; } export type AptlyUnitTemplate = AptlyUnitTemplateSchema; export interface AptlyUnitTemplateSchema extends AptlyUnitTemplateBaseSchema, AptlyHistorySchema { name: string; description?: string; organization?: ID; project?: ID; unit?: ID; copiedFrom?: ID; blueprints: AptlyUnitTemplateBlueprintSchema[]; } export type AptlyUnitTemplateBlueprint = AptlyUnitTemplateBlueprintSchema; export interface AptlyUnitTemplateBlueprintSchema { _id: ID; image: string; featured: boolean; } export type AptlyUnitTemplateCategory = AptlyUnitTemplateCategorySchema; export interface AptlyUnitTemplateCategorySchema { _id: ID; _orderID: ID; name: string; text?: string; isRoom: boolean; category?: ID; size?: number; upsellTemplate?: AptlyUpsellTemplateSchema | ID | null; _order_sections: ID[]; sections: AptlyUnitTemplateCategorySectionSchema[]; sameAs?: ID; } export type AptlyUnitTemplateCategorySection = AptlyUnitTemplateCategorySectionSchema; export interface AptlyUnitTemplateCategorySectionSchema { _id: ID; _orderID: ID; name: string; text?: string; description?: string; standard?: boolean; multiSelect: boolean; displayType: AptlyCategorySectionDisplayType; packages: AptlyUnitTemplateCategorySectionPackageSchema[]; assortments?: AptlyUnitTemplateCategorySectionAssortmentSchema[]; _order_products: ID[]; products: AptlyUnitTemplateCategorySectionProductSchema[]; period: AptlyPeriodSchema | ID; } export type AptlyUnitTemplateCategorySectionPackage = AptlyUnitTemplateCategorySectionPackageSchema; export interface AptlyUnitTemplateCategorySectionPackageSchema { _id: ID; name: string; standard: boolean; image?: string | null; imageMedia?: AptlyMediaSrcSchema | null; description?: string; _product_order?: ID[]; products?: AptlyUnitTemplateCategorySectionProductSchema[]; assortments?: AptlyUnitTemplateCategorySectionAssortmentSchema[]; } export type AptlyUnitTemplateCategorySectionAssortment = AptlyUnitTemplateCategorySectionAssortmentSchema; export interface AptlyUnitTemplateCategorySectionAssortmentSchema extends Pick, '_id' | 'createdAt' | 'updatedAt'> { color: string; package?: ID | null; } export type AptlyUnitTemplateCategorySectionProduct = AptlyUnitTemplateCategorySectionProductSchema; export interface AptlyUnitTemplateCategorySectionProductSchema { _id: ID; _orderID: ID; product?: AptlyProductSchema; producer?: AptlyProducerSchema; availableProducts: ID[]; variantPrices: AptlyUnitTemplateCategorySectionProductVariantPriceSchema[]; text?: string; unitSizeRoom?: string; unitSizeParam?: string; unitCostRoom?: string; unitCostParam?: string; consequenceRoom?: string; consequenceParam?: string; amount: number; unitCost?: number; unitVat?: number; algorithm: ID | AptlyAlgorithmSchema | null; standard: boolean; standardVariant?: ID; partOfPackage?: ID; partOfAssortment?: ID; supplier?: ID | null; customTitle?: string; customDescription?: string; notifyWhenPicked?: boolean; onlyShowInSelection?: boolean; recommendation?: ID | null; labels?: ID[]; params: AptlyUnitTemplateCategorySectionProductParamSchema[]; measureUnitType: AptlyUnitTemplateCategorySectionProductMeasureUnitType; pick?: any; } export type AptlyUnitTemplateCategorySectionProductParam = AptlyUnitTemplateCategorySectionProductParamSchema; export interface AptlyUnitTemplateCategorySectionProductParamSchema { _id: ID; key: AptlyUnitTemplateCategorySectionProductParamKey; value: VALUE; categoryName?: string; sectionNames?: string[]; sectionName?: string; } export type AptlyUnitTemplateCategorySectionProductVariantPrice = AptlyUnitTemplateCategorySectionProductVariantPriceSchema; export interface AptlyUnitTemplateCategorySectionProductVariantPriceSchema { variant: ID; price: number; baseCost?: number; labels?: ID[]; }