import { AptlyAddress } from './address.js';
import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal } from './algorithm.js';
import { AptlyAppSchema } from './app.js';
import { AptlyCustomer, AptlyCustomerSchema } from './customer.js';
import { AptlyDocumentSchema } from './document.js';
import { AptlyBaseSchema } from './extends.js';
import { AptlyOrder, AptlyOrderSchema } from './order.js';
import { AptlyOrganizationContent, AptlyOrganizationSchema } from './organization.js';
import { AptlyPickConfirmedSchema } from './pick.js';
import { AptlyProjectContent, AptlyProjectSchema } from './project.js';
import { AptlyUnitContent, AptlyUnitSchema } from './unit.js';
import { AptlyUserSchema } from './user.js';
import { AptlyOfferSchema } from './offer';
import { Populated } from '../core';
export type AptlyPayment = AptlyPaymentSchema<string, string>;
export interface AptlyPaymentSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
    organization: ID | AptlyOrganizationSchema<ID, DATE>;
    project: ID | AptlyProjectSchema<ID, DATE>;
    unit: ID | AptlyUnitSchema<ID, DATE>;
    order: ID | AptlyOrderSchema<ID, DATE>;
    offer: ID | AptlyOfferSchema<ID, DATE> | null;
    app: ID | AptlyAppSchema<ID, DATE>;
    document?: ID | AptlyDocumentSchema<ID, DATE>;
    reportDocument?: ID | AptlyDocumentSchema<ID, DATE>;
    status: AptlyPaymentStatus;
    number: number;
    amount: number;
    vatAmount: number;
    totalCost: number;
    totalVat: number;
    total?: AptlyLegalMonetaryTotal | null;
    allowanceCharges?: AptlyAllowanceChargeSchema<ID, boolean>[];
    items: AptlyPaymentItemSchema<ID>[];
    picks: (ID | AptlyPickConfirmedSchema<ID, DATE>)[];
    transaction: {
        ref: string;
        at: DATE;
    };
    company: AptlyPaymentCompany;
    customer: AptlyCustomerSchema<ID, DATE>;
    shipping: AptlyAddress;
    shippingDate?: DATE;
    shippingDescription?: string;
    billing?: AptlyAddress;
    card?: {
        brand: string;
        last4: string;
    };
    splits: AptlyPaymentSplitSchema<ID>[];
    captures: AptlyPaymentCaptureSchema<ID, DATE>[];
    captured: {
        amount: number;
        at: DATE;
    };
    createdBy: Populated<AptlyUserSchema<ID, DATE>> | null;
}
export declare enum AptlyPaymentStatus {
    Authorized = "AUTHORIZED",
    PendingDelivery = "PENDING_DELIVERY",
    PendingCapture = "PENDING_CAPTURE",
    Captured = "CAPTURED",
    Annulled = "ANNULLED"
}
export type AptlyPaymentSplit = AptlyPaymentSplitSchema<string>;
export interface AptlyPaymentSplitSchema<ID> {
    _id: ID;
    destination: 'platform' | string;
    amount: number;
}
export type AptlyPaymentCapture = AptlyPaymentCaptureSchema<string, string>;
export interface AptlyPaymentCaptureSchema<ID, DATE> {
    _id: ID;
    amount: number;
    description: string;
    ref: string;
    user?: ID | AptlyUserSchema<ID, DATE>;
    at: DATE;
}
export interface AptlyPaymentCompany {
    vat: string;
    name: string;
    email: string;
    address: AptlyAddress;
    phone?: string;
}
export interface AptlyPaymentItemSchema<ID> {
    _id: ID;
    name: string;
    sku: string;
    quantity: number;
    vat: number;
    baseCost: number;
    unitCost: number;
    unitVat: number;
    totalCost: number;
    totalVat: number;
}
export interface AptlyPaymentInitPaymentBody {
    organization: AptlyOrganizationContent;
    project: AptlyProjectContent;
    unit: AptlyUnitContent;
    order: AptlyOrder;
    customer: AptlyCustomer;
    shipping: AptlyAddress;
    billing: AptlyAddress;
    redirectUri: string;
}
export interface AptlyPaymentTransactionBody {
    app: string;
    id: string;
    at: string;
    customer: {
        user?: string;
        firstName: string;
        lastName: string;
        email: string;
        phone?: string;
    };
    card: AptlyPayment['card'];
    shipping: AptlyAddress;
    billing?: AptlyAddress;
    splits: Omit<AptlyPaymentSplit, '_id'>[];
}
export interface AptlyPaymentCaptureBody {
    terms: boolean;
    description?: string;
}
