import Decimal from 'decimal.js';
export { default as Decimal } from 'decimal.js';

type MoneyInput = Decimal.Value;
declare const money: (v?: MoneyInput) => Decimal;
declare const ZERO: Decimal;
declare const sum: (values: readonly MoneyInput[]) => Decimal;
declare const isZero: (v: MoneyInput) => boolean;
declare const isNegative: (v: MoneyInput) => boolean;
/** Round to cents (2dp, half-up) — the canonical persisted form. */
declare const toCents: (v: MoneyInput) => Decimal;
declare const toFixed2: (v: MoneyInput) => string;
/** Format for display, e.g. formatMoney('1234.5', 'HK$') -> "HK$1,234.50" */
declare const formatMoney: (v: MoneyInput, symbol?: string) => string;
/** Display symbol for a currency code. The two frontends each carry this map
 *  already; this is the copy the server uses, so a notification and the screen
 *  it refers to cannot disagree. */
declare const CURRENCY_SYMBOLS: Record<string, string>;
/** formatMoney with the symbol looked up from the currency code. */
declare const formatCurrency: (v: MoneyInput, currency: string) => string;

/**
 * ENGINE PRIMITIVES — the finite, correctness-critical vocabulary the billing/
 * ledger engine is built on. These live in code (and are mirrored 1:1 as Prisma
 * enums) precisely because they are NOT business configuration.
 *
 * By contrast, BUSINESS TAXONOMY — charge types, tax/interest rates, settlement
 * methods, regions, property categories, approval steps, roles/permissions —
 * lives in the DATABASE as editable rows, so users configure it without a
 * redeploy. If you are tempted to add a value here that a user might one day
 * want to add themselves, it belongs in a table, not in this file.
 */
declare const LedgerDirection: Readonly<{
    DEBIT: string;
    CREDIT: string;
}>;
type LedgerDirection = (typeof LedgerDirection)[keyof typeof LedgerDirection];
/** Normal balance side is derived from this. Chart-of-accounts rows carry a type. */
declare const GlAccountType: Readonly<{
    ASSET: string;
    LIABILITY: string;
    INCOME: string;
    EXPENSE: string;
    EQUITY: string;
}>;
type GlAccountType = (typeof GlAccountType)[keyof typeof GlAccountType];
declare const JournalSourceType: Readonly<{
    INVOICE: string;
    RECEIPT: string;
    RECEIPT_ALLOCATION: string;
    DEPOSIT: string;
    DEPOSIT_ALLOCATION: string;
    ADJUSTMENT: string;
    OPENING_BALANCE: string;
    WRITE_OFF: string;
    REVERSAL: string;
}>;
type JournalSourceType = (typeof JournalSourceType)[keyof typeof JournalSourceType];
/** Category is a fixed engine concept; individual charge_types are DB rows. */
declare const ChargeCategory: Readonly<{
    RECURRING: string;
    ONE_OFF: string;
    DEPOSIT: string;
    UTILITY: string;
    ADJUSTMENT: string;
}>;
type ChargeCategory = (typeof ChargeCategory)[keyof typeof ChargeCategory];
/** How a recurring charge relates to the period it is billed in. */
declare const BillingTiming: Readonly<{
    ADVANCE: string;
    ARREARS: string;
}>;
type BillingTiming = (typeof BillingTiming)[keyof typeof BillingTiming];
declare const ProrationPolicy: Readonly<{
    DAILY: string;
    FULL_MONTH: string;
    NONE: string;
}>;
type ProrationPolicy = (typeof ProrationPolicy)[keyof typeof ProrationPolicy];
declare const InvoiceStatus: Readonly<{
    DRAFT: string;
    PENDING_APPROVAL: string;
    APPROVED: string;
    ISSUED: string;
    PARTIALLY_PAID: string;
    PAID: string;
    VOID: string;
}>;
type InvoiceStatus = (typeof InvoiceStatus)[keyof typeof InvoiceStatus];
declare const InvoiceLineKind: Readonly<{
    CHARGE: string;
    INTEREST: string;
    OVERDUE_CARRYFORWARD: string;
    DEPOSIT_APPLICATION: string;
    CREDIT_APPLICATION: string;
    WAIVER: string;
    ROUNDING: string;
}>;
type InvoiceLineKind = (typeof InvoiceLineKind)[keyof typeof InvoiceLineKind];
declare const ReceiptStatus: Readonly<{
    PENDING: string;
    APPROVED: string;
    REJECTED: string;
}>;
type ReceiptStatus = (typeof ReceiptStatus)[keyof typeof ReceiptStatus];
declare const AllocationStatus: Readonly<{
    DRAFT: string;
    CONFIRMED: string;
    VOID: string;
}>;
type AllocationStatus = (typeof AllocationStatus)[keyof typeof AllocationStatus];
declare const DepositStatus: Readonly<{
    HELD: string;
    PARTIALLY_APPLIED: string;
    APPLIED: string;
    REFUNDED: string;
    VOID: string;
}>;
type DepositStatus = (typeof DepositStatus)[keyof typeof DepositStatus];
declare const UnitStatus: Readonly<{
    AVAILABLE: string;
    OCCUPIED: string;
    RESERVED: string;
    SOLD: string;
    INACTIVE: string;
}>;
type UnitStatus = (typeof UnitStatus)[keyof typeof UnitStatus];
declare const LeaseStatus: Readonly<{
    DRAFT: string;
    ACTIVE: string;
    ENDED: string;
    TERMINATED: string;
    RENEWED: string;
}>;
type LeaseStatus = (typeof LeaseStatus)[keyof typeof LeaseStatus];
declare const ApprovalActorType: Readonly<{
    ROLE: string;
    USER: string;
}>;
type ApprovalActorType = (typeof ApprovalActorType)[keyof typeof ApprovalActorType];
declare const ApprovalActionType: Readonly<{
    APPROVE: string;
    REJECT: string;
    ACKNOWLEDGE: string;
}>;
type ApprovalActionType = (typeof ApprovalActionType)[keyof typeof ApprovalActionType];
declare const ReferenceDomain: Readonly<{
    REGION: string;
    AMENITY: string;
    MANAGEMENT_TYPE: string;
    LEASE_TYPE: string;
    PROPERTY_CATEGORY: string;
}>;
type ReferenceDomain = (typeof ReferenceDomain)[keyof typeof ReferenceDomain];

/**
 * Well-known keys for the `settings` table (key/value business config).
 * Anything a user should be able to change without a redeploy lives in the DB
 * under one of these keys — not as a literal in code. Add keys here to document
 * and type them; the values are always read from the database at runtime.
 */
declare const SettingKey: {
    readonly CURRENCY: "currency";
    readonly CURRENCY_SYMBOL: "currency.symbol";
    readonly TIMEZONE: "timezone";
    readonly LOCALE_DEFAULT: "locale.default";
    readonly INVOICE_ISSUE_DAY: "invoice.issue_day_of_month";
    readonly INVOICE_DUE_DAY: "invoice.due_day_of_month";
    readonly INVOICE_FIRST_DUE_OFFSET_DAYS: "invoice.first_due_offset_days";
    readonly INVOICE_AUTO_ISSUE: "invoice.auto_issue";
    readonly DEPOSIT_DEFAULT_MONTHS: "deposit.default_months";
    readonly INTEREST_DEFAULT_POLICY_CODE: "interest.default_policy_code";
    readonly BRAND_NAME: "brand.name";
    readonly BRAND_LOGO_MEDIA_ID: "brand.logo_media_id";
};
type SettingKey = (typeof SettingKey)[keyof typeof SettingKey];

export { AllocationStatus, ApprovalActionType, ApprovalActorType, BillingTiming, CURRENCY_SYMBOLS, ChargeCategory, DepositStatus, GlAccountType, InvoiceLineKind, InvoiceStatus, JournalSourceType, LeaseStatus, LedgerDirection, type MoneyInput, ProrationPolicy, ReceiptStatus, ReferenceDomain, SettingKey, UnitStatus, ZERO, formatCurrency, formatMoney, isNegative, isZero, money, sum, toCents, toFixed2 };
