import { AptlyAllowanceReasonCode, AptlyChargeReasonCode, AptlyCurrency, AptlyQuantityUnitCode, AptlyTaxCategoryScheme, AptlyVatCategoryCode } from '../enums/index.js'; export declare enum AptlyAlgorithmPipelineOperation { Base = "base", Margin = "margin", Add = "add", Subtract = "subtract", Multiply = "multiply", Divide = "divide", Percent = "percent", Fee = "fee", Vat = "vat", Allowance = "allowance" } export declare enum AptlyAlgorithmPipelineApplyTo { Root = "root", Base = "base", PreviousStep = "previousStep" } export type AptlyAlgorithm = AptlyAlgorithmSchema; export interface AptlyAlgorithmSchema { _id: ID; name: string; currency?: AptlyCurrency; vatCategory?: AptlyVatCategoryCode; taxScheme?: AptlyTaxCategoryScheme; pipeline: AptlyAlgorithmPipelineSchema[]; reversed?: boolean; vat?: number; fee?: number; feePercent?: number; feeBasePercent?: number; organization?: ID; project?: ID; } export type AptlyAlgorithmPipeline = AptlyAlgorithmPipelineSchema; export interface AptlyAlgorithmPipelineSchema { _id: ID; label: string; operation: AptlyAlgorithmPipelineOperation; value: number; valuePercent?: number; applyTo: AptlyAlgorithmPipelineApplyTo; } export interface AptlyAlgorithmPipelineDataItemSchema extends AptlyAlgorithmPipelineData { _id: ID; } export interface AptlyAlgorithmPipelineData { label: string; operation: AptlyAlgorithmPipelineOperation; value?: number; baseAmount: number; amount: number; diff: number; } export interface AptlyVatCategory { id: AptlyVatCategoryCode; percent: number; taxScheme: AptlyTaxCategoryScheme; } export interface AptlyQuantity { quantity?: number; quantityUnitCode: AptlyQuantityUnitCode; } export interface AptlyExtensionQuantity extends AptlyQuantity { invoicedQuantity?: number; quantityUnitCode: AptlyQuantityUnitCode; } export interface AptlyExtensionAmount { extensionAmount: number; extensionVatAmount: number; currency: AptlyCurrency; } export interface AptlyPrice { amount: number; allowance?: AptlyPriceAllowance; baseQuantity: number; } export interface AptlyPriceAllowance { amount: number; baseAmount: number; } export interface AptlyExtensionPrice extends AptlyExtensionAmount { invoicedQuantity?: number; quantityUnitCode?: AptlyQuantityUnitCode; price?: AptlyPrice; currency: AptlyCurrency; } export interface AptlyLegalMonetaryTotal { lineExtensionAmount: number; taxExclusiveAmount: number; taxInclusiveAmount: number; allowanceTotalAmount: number; chargeTotalAmount: number; } export interface AptlyAllowance { amount?: number; multiplier?: number; incVAT?: boolean; } export type AptlyAllowanceCharge = AptlyAllowanceChargeSchema; export type AptlyAllowanceChargeItem = AptlyAllowanceChargeItemSchema; export type AptlyAllowanceChargeItemSchema = Omit, 'vatCategory'>; export interface AptlyAllowanceChargeSchema extends AptlyAllowance { _id: ID; chargeIndicator: CHARGE; code: CHARGE extends true ? AptlyChargeReasonCode : AptlyAllowanceReasonCode; reason: string; baseAmount?: number; vatCategory?: AptlyVatCategory; }