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<string>;
export interface AptlyAlgorithmSchema<ID> {
    _id: ID;
    name: string;
    currency?: AptlyCurrency;
    vatCategory?: AptlyVatCategoryCode;
    taxScheme?: AptlyTaxCategoryScheme;
    pipeline: AptlyAlgorithmPipelineSchema<ID>[];
    reversed?: boolean;
    vat?: number;
    fee?: number;
    feePercent?: number;
    feeBasePercent?: number;
    organization?: ID;
    project?: ID;
}
export type AptlyAlgorithmPipeline = AptlyAlgorithmPipelineSchema<string>;
export interface AptlyAlgorithmPipelineSchema<ID> {
    _id: ID;
    label: string;
    operation: AptlyAlgorithmPipelineOperation;
    value: number;
    valuePercent?: number;
    applyTo: AptlyAlgorithmPipelineApplyTo;
}
export interface AptlyAlgorithmPipelineDataItemSchema<ID> 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<CHARGE extends boolean> = AptlyAllowanceChargeSchema<string, CHARGE>;
export type AptlyAllowanceChargeItem<CHARGE extends boolean> = AptlyAllowanceChargeItemSchema<string, CHARGE>;
export type AptlyAllowanceChargeItemSchema<ID, CHARGE extends boolean> = Omit<AptlyAllowanceChargeSchema<ID, CHARGE>, 'vatCategory'>;
export interface AptlyAllowanceChargeSchema<ID, CHARGE extends boolean> extends AptlyAllowance {
    _id: ID;
    chargeIndicator: CHARGE;
    code: CHARGE extends true ? AptlyChargeReasonCode : AptlyAllowanceReasonCode;
    reason: string;
    baseAmount?: number;
    vatCategory?: AptlyVatCategory;
}
