import {z} from 'zod' export type OnlyId = {id?: string | undefined}; export type CommissionSalesPartner = {id?: string | undefined, version?: string | undefined, commissionFix?: unknown | undefined, commissionPercentage?: unknown | undefined, commissionType: 'FIX' | 'FIX_AND_MARGIN' | 'FIX_AND_REVENUE' | 'MARGIN' | 'NO_COMMISSION' | 'REVENUE', createdDate?: number | undefined, lastModifiedDate?: number | undefined, salesPartnerSupplierId: string}; export type EntityReference = {entityId?: string | undefined, entityName?: string | undefined}; export type CustomAttribute = {attributeDefinitionId?: string | undefined, booleanValue?: boolean | undefined, dateValue?: number | undefined, entityId?: string | undefined, entityReferences?: Array | undefined, numberValue?: unknown | undefined, selectedValueId?: string | undefined, selectedValues?: Array | undefined, stringValue?: string | undefined}; export type RecordAddress = {city?: string | undefined, company?: string | undefined, company2?: string | undefined, countryCode?: ('AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CS' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DG' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EA' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'EU' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'IC' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'UNKNOWN' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'XI' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW') | undefined, firstName?: string | undefined, globalLocationNumber?: string | undefined, lastName?: string | undefined, middleName?: string | undefined, phoneNumber?: string | undefined, postOfficeBoxCity?: string | undefined, postOfficeBoxNumber?: string | undefined, postOfficeBoxZipCode?: string | undefined, salutation?: ('COMPANY' | 'FAMILY' | 'MR' | 'MRS' | 'NO_SALUTATION') | undefined, state?: string | undefined, street1?: string | undefined, street2?: string | undefined, titleId?: string | undefined, zipcode?: string | undefined}; export type EmailAddresses = {bccAddresses?: string | undefined, ccAddresses?: string | undefined, toAddresses?: string | undefined}; export type QuotationItemRelationship = {acceptedQuantity?: unknown | undefined, contractItemId?: string | undefined, projectMaterialItemId?: string | undefined, projectRequirementItemId?: string | undefined, salesInvoiceItemId?: string | undefined, salesOrderItemId?: string | undefined}; export type ReductionAdditionItem = {position?: number | undefined, source?: ('ARTICLE' | 'ARTICLE_AND_CUSTOMER' | 'ARTICLE_CATEGORY' | 'ARTICLE_CATEGORY_AND_CUSTOMER') | undefined, specialPriceReduction?: boolean | undefined, title?: string | undefined, type?: ('ADDITIONAL_ABS' | 'ADDITION_PERCENT' | 'REDUCTION_ABS' | 'REDUCTION_PERCENT') | undefined, value?: unknown | undefined}; export type PriceDataReductionAdditionItem = {position?: number | undefined, source?: ('ARTICLE' | 'ARTICLE_AND_CUSTOMER' | 'ARTICLE_CATEGORY' | 'ARTICLE_CATEGORY_AND_CUSTOMER') | undefined, specialPriceReduction?: boolean | undefined, title?: string | undefined, type?: ('ADDITIONAL_ABS' | 'ADDITION_PERCENT' | 'REDUCTION_ABS' | 'REDUCTION_PERCENT') | undefined, value?: unknown | undefined}; export type QuotationItemScaleValue = {discountPercentage?: unknown | undefined, fromSalesPrice?: boolean | undefined, price?: unknown | undefined, quantity?: unknown | undefined, reductionAdditionItems?: Array | undefined}; export type QuotationItem = {id?: string | undefined, version?: string | undefined, addPageBreakBefore?: boolean | undefined, alternative?: boolean | undefined, articleId?: string | undefined, commissionSalesPartners?: Array | undefined, createdDate?: number | undefined, customAttributes?: Array | undefined, description?: string | undefined, descriptionFixed?: boolean | undefined, discountPercentage?: unknown | undefined, grossAmount?: unknown | undefined, grossAmountInCompanyCurrency?: unknown | undefined, groupName?: string | undefined, invoicingType?: ('EFFORT' | 'FIXED_PRICE') | undefined, itScopeId?: string | undefined, itemType?: ('DEFAULT' | 'FREE_TEXT' | 'SAMPLE' | 'SERVICE' | 'SERVICE_QUOTA') | undefined, lastModifiedDate?: number | undefined, manualPlannedWorkingTimePerUnit?: boolean | undefined, manualQuantity?: boolean | undefined, manualUnitCost?: boolean | undefined, manualUnitPrice?: boolean | undefined, netAmount?: unknown | undefined, netAmountForStatistics?: unknown | undefined, netAmountForStatisticsInCompanyCurrency?: unknown | undefined, netAmountInCompanyCurrency?: unknown | undefined, note?: string | undefined, optional?: boolean | undefined, parentItemId?: string | undefined, plannedDeliveryDate?: number | undefined, plannedShippingDate?: number | undefined, plannedWorkingTimePerUnit?: number | undefined, positionNumber?: number | undefined, quantity?: unknown | undefined, quotationItemRelationships?: Array | undefined, recommendedRetailPrice?: unknown | undefined, reductionAdditionItems?: Array | undefined, scaleValues?: Array | undefined, servicePeriodFrom?: number | undefined, servicePeriodTo?: number | undefined, taxId?: string | undefined, title?: string | undefined, unitCost?: unknown | undefined, unitCostInCompanyCurrency?: unknown | undefined, unitId?: string | undefined, unitPrice?: unknown | undefined, unitPriceInCompanyCurrency?: unknown | undefined}; export type SalesStageHistory = {id?: string | undefined, version?: string | undefined, createdDate?: number | undefined, lastModifiedDate?: number | undefined, salesStageId?: string | undefined, userId?: string | undefined}; export type QuotationShippingCostItem = {id?: string | undefined, version?: string | undefined, articleId?: string | undefined, createdDate?: number | undefined, discountPercentage?: unknown | undefined, grossAmount?: unknown | undefined, grossAmountInCompanyCurrency?: unknown | undefined, lastModifiedDate?: number | undefined, manualUnitCost?: boolean | undefined, manualUnitPrice?: boolean | undefined, netAmount?: unknown | undefined, netAmountInCompanyCurrency?: unknown | undefined, reductionAdditionItems?: Array | undefined, taxId?: string | undefined, unitCost?: unknown | undefined, unitCostInCompanyCurrency?: unknown | undefined, unitPrice?: unknown | undefined, unitPriceInCompanyCurrency?: unknown | undefined}; export type QuotationStatusHistory = {status?: ('ACCEPTED' | 'CANCELLED' | 'ENTRY_COMPLETED' | 'INQUIRED' | 'OPEN' | 'REJECTED') | undefined, statusDate?: number | undefined, userId?: string | undefined}; export type Quotation = {id?: string | undefined, version?: string | undefined, activeVersion?: boolean | undefined, ccMailReminder?: string | undefined, ccUserReminder?: Array | undefined, commercialLanguage?: string | undefined, commission?: string | undefined, commissionSalesPartners?: Array | undefined, cost?: unknown | undefined, createdDate?: number | undefined, creatorId?: string | undefined, currencyConversionDate?: number | undefined, currencyConversionLocked?: boolean | undefined, currencyConversionRate?: unknown | undefined, customAttributes?: Array | undefined, customerId: string, dateReminder?: number | undefined, defaultShippingCarrierId?: string | undefined, deliveryAddress?: RecordAddress | undefined, deliveryEmailAddresses?: EmailAddresses | undefined, description?: string | undefined, disableRecordEmailingRule?: boolean | undefined, dispatchCountryCode?: ('AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CS' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DG' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EA' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'EU' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'IC' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'UNKNOWN' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'XI' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW') | undefined, expectedSignatureDate?: number | undefined, factoring?: boolean | undefined, followupAutomaticInquire?: boolean | undefined, followupCompleted?: boolean | undefined, followupType?: ('FIXED_DATE_REMINDER' | 'NO_REMINDER' | 'SCHEDULED_DATE_REMINDER') | undefined, grossAmount?: unknown | undefined, grossAmountInCompanyCurrency?: unknown | undefined, grossAmountWithoutShippingCosts?: unknown | undefined, grossAmountWithoutShippingCostsInCompanyCurrency?: unknown | undefined, headerDiscount?: unknown | undefined, headerSurcharge?: unknown | undefined, internalReminder?: boolean | undefined, invoiceAddress?: RecordAddress | undefined, invoiceRecipientId?: string | undefined, lastModifiedDate?: number | undefined, lastStatusChangeUserId?: string | undefined, mergedToQuotationId?: string | undefined, netAmount?: unknown | undefined, netAmountInCompanyCurrency?: unknown | undefined, netAmountWithoutShippingCosts?: unknown | undefined, netAmountWithoutShippingCostsInCompanyCurrency?: unknown | undefined, nonStandardTaxId?: string | undefined, opportunityId?: string | undefined, paymentMethodId?: string | undefined, plannedDeliveryDate?: number | undefined, plannedShippingDate?: number | undefined, pricingDate?: number | undefined, publicLink?: string | undefined, quotationDate?: number | undefined, quotationItems?: Array | undefined, quotationNumber?: string | undefined, quotationType?: ('BLANKET_SALES_ORDER' | 'CONTRACT' | 'NONE' | 'PROJECT' | 'SALES_INVOICE' | 'SALES_ORDER') | undefined, quotationVersion?: number | undefined, recordAddress?: RecordAddress | undefined, recordComment?: string | undefined, recordCommentInheritance?: boolean | undefined, recordCurrencyId: string, recordEmailAddresses?: EmailAddresses | undefined, recordFreeText?: string | undefined, recordFreeTextInheritance?: boolean | undefined, recordOpening?: string | undefined, recordOpeningInheritance?: boolean | undefined, rejectionReason?: string | undefined, reminderCalculationType?: ('AFTER_QUOTATION_START' | 'BEFORE_QUOTATION_END') | undefined, reminderDateCalculationQuantity?: number | undefined, reminderDateCalculationUnit?: ('DAY' | 'MONTH' | 'WEEK') | undefined, reminderSendType?: ('MAIL' | 'NOTIFICATION') | undefined, requestDate?: number | undefined, responsibleUserId?: string | undefined, salesChannel?: string | undefined, salesInvoiceEmailAddresses?: EmailAddresses | undefined, salesOrderEmailAddresses?: EmailAddresses | undefined, salesProbability?: number | undefined, salesStageHistory?: Array | undefined, salesStageId?: string | undefined, sentToRecipient?: boolean | undefined, servicePeriodFrom?: number | undefined, servicePeriodTo?: number | undefined, shipmentMethodId?: string | undefined, shippingCostItems?: Array | undefined, status: 'ACCEPTED' | 'CANCELLED' | 'ENTRY_COMPLETED' | 'INQUIRED' | 'OPEN' | 'REJECTED', statusHistory?: Array | undefined, tags?: Array | undefined, taskTemplateId?: string | undefined, template?: boolean | undefined, templateLabel?: string | undefined, termOfPaymentId?: string | undefined, validFrom?: number | undefined, validTo?: number | undefined, vatAmount?: unknown | undefined, vatAmountInCompanyCurrency?: unknown | undefined, warehouseId?: string | undefined}; export type UpdateApiQuotationIdIdArgs = {id: string, dryRun?: boolean | undefined, body: Quotation}; export type UpdateApiQuotationIdIdOptions = {baseUrl: string, APIToken?: string | undefined, fetch?: typeof fetch | undefined}; export const onlyId = z.object({id: z.string().optional()}); export const commissionSalesPartner = z.object({id: z.string().optional(), version: z.string().optional(), commissionFix: z.string().optional(), commissionPercentage: z.string().optional(), commissionType: z.enum(["FIX", "FIX_AND_MARGIN", "FIX_AND_REVENUE", "MARGIN", "NO_COMMISSION", "REVENUE"]), createdDate: z.number().int().optional(), lastModifiedDate: z.number().int().optional(), salesPartnerSupplierId: z.string()}); export const entityReference = z.object({entityId: z.string().optional(), entityName: z.string().optional()}); export const customAttribute = z.object({attributeDefinitionId: z.string().optional(), booleanValue: z.boolean().optional(), dateValue: z.number().int().optional(), entityId: z.string().optional(), entityReferences: z.array(entityReference).optional(), numberValue: z.string().optional(), selectedValueId: z.string().optional(), selectedValues: z.array(onlyId).optional(), stringValue: z.string().optional()}); export const recordAddress = z.object({city: z.string().optional(), company: z.string().optional(), company2: z.string().optional(), countryCode: z.enum(["AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CS", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DG", "DJ", "DK", "DM", "DO", "DZ", "EA", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "EU", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "IC", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "UNKNOWN", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XI", "XK", "YE", "YT", "ZA", "ZM", "ZW"]).optional(), firstName: z.string().optional(), globalLocationNumber: z.string().optional(), lastName: z.string().optional(), middleName: z.string().optional(), phoneNumber: z.string().optional(), postOfficeBoxCity: z.string().optional(), postOfficeBoxNumber: z.string().optional(), postOfficeBoxZipCode: z.string().optional(), salutation: z.enum(["COMPANY", "FAMILY", "MR", "MRS", "NO_SALUTATION"]).optional(), state: z.string().optional(), street1: z.string().optional(), street2: z.string().optional(), titleId: z.string().optional(), zipcode: z.string().optional()}); export const emailAddresses = z.object({bccAddresses: z.string().optional(), ccAddresses: z.string().optional(), toAddresses: z.string().optional()}); export const quotationItemRelationship = z.object({acceptedQuantity: z.string().optional(), contractItemId: z.string().optional(), projectMaterialItemId: z.string().optional(), projectRequirementItemId: z.string().optional(), salesInvoiceItemId: z.string().optional(), salesOrderItemId: z.string().optional()}); export const reductionAdditionItem = z.object({position: z.number().int().optional(), source: z.enum(["ARTICLE", "ARTICLE_AND_CUSTOMER", "ARTICLE_CATEGORY", "ARTICLE_CATEGORY_AND_CUSTOMER"]).optional(), specialPriceReduction: z.boolean().optional(), title: z.string().optional(), type: z.enum(["ADDITIONAL_ABS", "ADDITION_PERCENT", "REDUCTION_ABS", "REDUCTION_PERCENT"]).optional(), value: z.string().optional()}); export const priceDataReductionAdditionItem = z.object({position: z.number().int().optional(), source: z.enum(["ARTICLE", "ARTICLE_AND_CUSTOMER", "ARTICLE_CATEGORY", "ARTICLE_CATEGORY_AND_CUSTOMER"]).optional(), specialPriceReduction: z.boolean().optional(), title: z.string().optional(), type: z.enum(["ADDITIONAL_ABS", "ADDITION_PERCENT", "REDUCTION_ABS", "REDUCTION_PERCENT"]).optional(), value: z.string().optional()}); export const quotationItemScaleValue = z.object({discountPercentage: z.string().optional(), fromSalesPrice: z.boolean().optional(), price: z.string().optional(), quantity: z.string().optional(), reductionAdditionItems: z.array(priceDataReductionAdditionItem).optional()}); export const quotationItem = z.object({id: z.string().optional(), version: z.string().optional(), addPageBreakBefore: z.boolean().optional(), alternative: z.boolean().optional(), articleId: z.string().optional(), commissionSalesPartners: z.array(commissionSalesPartner).optional(), createdDate: z.number().int().optional(), customAttributes: z.array(customAttribute).optional(), description: z.string().optional(), descriptionFixed: z.boolean().optional(), discountPercentage: z.string().optional(), grossAmount: z.string().optional(), grossAmountInCompanyCurrency: z.string().optional(), groupName: z.string().optional(), invoicingType: z.enum(["EFFORT", "FIXED_PRICE"]).optional(), itScopeId: z.string().optional(), itemType: z.enum(["DEFAULT", "FREE_TEXT", "SAMPLE", "SERVICE", "SERVICE_QUOTA"]).optional(), lastModifiedDate: z.number().int().optional(), manualPlannedWorkingTimePerUnit: z.boolean().optional(), manualQuantity: z.boolean().optional(), manualUnitCost: z.boolean().optional(), manualUnitPrice: z.boolean().optional(), netAmount: z.string().optional(), netAmountForStatistics: z.string().optional(), netAmountForStatisticsInCompanyCurrency: z.string().optional(), netAmountInCompanyCurrency: z.string().optional(), note: z.string().optional(), optional: z.boolean().optional(), parentItemId: z.string().optional(), plannedDeliveryDate: z.number().int().optional(), plannedShippingDate: z.number().int().optional(), plannedWorkingTimePerUnit: z.number().int().optional(), positionNumber: z.number().int().optional(), quantity: z.string().optional(), quotationItemRelationships: z.array(quotationItemRelationship).optional(), recommendedRetailPrice: z.string().optional(), reductionAdditionItems: z.array(reductionAdditionItem).optional(), scaleValues: z.array(quotationItemScaleValue).optional(), servicePeriodFrom: z.number().int().optional(), servicePeriodTo: z.number().int().optional(), taxId: z.string().optional(), title: z.string().optional(), unitCost: z.string().optional(), unitCostInCompanyCurrency: z.string().optional(), unitId: z.string().optional(), unitPrice: z.string().optional(), unitPriceInCompanyCurrency: z.string().optional()}); export const salesStageHistory = z.object({id: z.string().optional(), version: z.string().optional(), createdDate: z.number().int().optional(), lastModifiedDate: z.number().int().optional(), salesStageId: z.string().optional(), userId: z.string().optional()}); export const quotationShippingCostItem = z.object({id: z.string().optional(), version: z.string().optional(), articleId: z.string().optional(), createdDate: z.number().int().optional(), discountPercentage: z.string().optional(), grossAmount: z.string().optional(), grossAmountInCompanyCurrency: z.string().optional(), lastModifiedDate: z.number().int().optional(), manualUnitCost: z.boolean().optional(), manualUnitPrice: z.boolean().optional(), netAmount: z.string().optional(), netAmountInCompanyCurrency: z.string().optional(), reductionAdditionItems: z.array(reductionAdditionItem).optional(), taxId: z.string().optional(), unitCost: z.string().optional(), unitCostInCompanyCurrency: z.string().optional(), unitPrice: z.string().optional(), unitPriceInCompanyCurrency: z.string().optional()}); export const quotationStatusHistory = z.object({status: z.enum(["ACCEPTED", "CANCELLED", "ENTRY_COMPLETED", "INQUIRED", "OPEN", "REJECTED"]).optional(), statusDate: z.number().int().optional(), userId: z.string().optional()}); export const quotation = z.object({id: z.string().optional(), version: z.string().optional(), activeVersion: z.boolean().optional(), ccMailReminder: z.string().optional(), ccUserReminder: z.array(onlyId).optional(), commercialLanguage: z.string().optional(), commission: z.string().optional(), commissionSalesPartners: z.array(commissionSalesPartner).optional(), cost: z.string().optional(), createdDate: z.number().int().optional(), creatorId: z.string().optional(), currencyConversionDate: z.number().int().optional(), currencyConversionLocked: z.boolean().optional(), currencyConversionRate: z.string().optional(), customAttributes: z.array(customAttribute).optional(), customerId: z.string(), dateReminder: z.number().int().optional(), defaultShippingCarrierId: z.string().optional(), deliveryAddress: recordAddress.optional(), deliveryEmailAddresses: emailAddresses.optional(), description: z.string().optional(), disableRecordEmailingRule: z.boolean().optional(), dispatchCountryCode: z.enum(["AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CS", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DG", "DJ", "DK", "DM", "DO", "DZ", "EA", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "EU", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "IC", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "UNKNOWN", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XI", "XK", "YE", "YT", "ZA", "ZM", "ZW"]).optional(), expectedSignatureDate: z.number().int().optional(), factoring: z.boolean().optional(), followupAutomaticInquire: z.boolean().optional(), followupCompleted: z.boolean().optional(), followupType: z.enum(["FIXED_DATE_REMINDER", "NO_REMINDER", "SCHEDULED_DATE_REMINDER"]).optional(), grossAmount: z.string().optional(), grossAmountInCompanyCurrency: z.string().optional(), grossAmountWithoutShippingCosts: z.string().optional(), grossAmountWithoutShippingCostsInCompanyCurrency: z.string().optional(), headerDiscount: z.string().optional(), headerSurcharge: z.string().optional(), internalReminder: z.boolean().optional(), invoiceAddress: recordAddress.optional(), invoiceRecipientId: z.string().optional(), lastModifiedDate: z.number().int().optional(), lastStatusChangeUserId: z.string().optional(), mergedToQuotationId: z.string().optional(), netAmount: z.string().optional(), netAmountInCompanyCurrency: z.string().optional(), netAmountWithoutShippingCosts: z.string().optional(), netAmountWithoutShippingCostsInCompanyCurrency: z.string().optional(), nonStandardTaxId: z.string().optional(), opportunityId: z.string().optional(), paymentMethodId: z.string().optional(), plannedDeliveryDate: z.number().int().optional(), plannedShippingDate: z.number().int().optional(), pricingDate: z.number().int().optional(), publicLink: z.string().optional(), quotationDate: z.number().int().optional(), quotationItems: z.array(quotationItem).optional(), quotationNumber: z.string().optional(), quotationType: z.enum(["BLANKET_SALES_ORDER", "CONTRACT", "NONE", "PROJECT", "SALES_INVOICE", "SALES_ORDER"]).optional(), quotationVersion: z.number().int().optional(), recordAddress: recordAddress.optional(), recordComment: z.string().optional(), recordCommentInheritance: z.boolean().optional(), recordCurrencyId: z.string(), recordEmailAddresses: emailAddresses.optional(), recordFreeText: z.string().optional(), recordFreeTextInheritance: z.boolean().optional(), recordOpening: z.string().optional(), recordOpeningInheritance: z.boolean().optional(), rejectionReason: z.string().optional(), reminderCalculationType: z.enum(["AFTER_QUOTATION_START", "BEFORE_QUOTATION_END"]).optional(), reminderDateCalculationQuantity: z.number().int().optional(), reminderDateCalculationUnit: z.enum(["DAY", "MONTH", "WEEK"]).optional(), reminderSendType: z.enum(["MAIL", "NOTIFICATION"]).optional(), requestDate: z.number().int().optional(), responsibleUserId: z.string().optional(), salesChannel: z.string().optional(), salesInvoiceEmailAddresses: emailAddresses.optional(), salesOrderEmailAddresses: emailAddresses.optional(), salesProbability: z.number().int().optional(), salesStageHistory: z.array(salesStageHistory).optional(), salesStageId: z.string().optional(), sentToRecipient: z.boolean().optional(), servicePeriodFrom: z.number().int().optional(), servicePeriodTo: z.number().int().optional(), shipmentMethodId: z.string().optional(), shippingCostItems: z.array(quotationShippingCostItem).optional(), status: z.enum(["ACCEPTED", "CANCELLED", "ENTRY_COMPLETED", "INQUIRED", "OPEN", "REJECTED"]), statusHistory: z.array(quotationStatusHistory).optional(), tags: z.array(z.string()).optional(), taskTemplateId: z.string().optional(), template: z.boolean().optional(), templateLabel: z.string().optional(), termOfPaymentId: z.string().optional(), validFrom: z.number().int().optional(), validTo: z.number().int().optional(), vatAmount: z.string().optional(), vatAmountInCompanyCurrency: z.string().optional(), warehouseId: z.string().optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * update quotation * * PUT /quotation/id/{id} */ export const updateApiQuotationIdId = async (args: UpdateApiQuotationIdIdArgs, options: UpdateApiQuotationIdIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, APIToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args.dryRun != null) query.append("dryRun", String(args.dryRun)) if (APIToken !== undefined) headers.set("AuthenticationToken", APIToken) const url = `${baseUrl.replace(/\/+$/, '')}/quotation/id/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(quotation, await res.json()) };