emr-types
Version:
Comprehensive TypeScript Types Library for Electronic Medical Record (EMR) Applications - Domain-Driven Design with Zod Validation
90 lines • 2.25 kB
TypeScript
/**
* Money Value Object
*
* Represents monetary values with currency and precision
*
* @interface Money
* @description Money value object for financial calculations
*/
export interface Money {
/** The amount in smallest currency unit (e.g., cents for USD) */
amount: number;
/** The currency code (ISO 4217) */
currency: string;
/** The precision (number of decimal places) */
precision: number;
/** Whether the amount is valid */
isValid: boolean;
/** The formatted string representation */
formatted: string;
}
/**
* Currency Information
*/
export interface CurrencyInfo {
/** Currency code (ISO 4217) */
code: string;
/** Currency name */
name: string;
/** Currency symbol */
symbol: string;
/** Number of decimal places */
precision: number;
/** Whether the currency is active */
isActive: boolean;
}
/**
* Supported Currencies
*/
export declare const SUPPORTED_CURRENCIES: Record<string, CurrencyInfo>;
/**
* Money Factory Functions
*/
export declare const MoneyFactory: {
/**
* Create money from amount and currency
*/
create: (amount: number, currency: string) => Money;
/**
* Create money from string representation
*/
fromString: (amount: string, currency: string) => Money;
/**
* Create zero money for a currency
*/
zero: (currency: string) => Money;
};
/**
* Money Utility Functions
*/
export declare const MoneyUtils: {
/**
* Add two money amounts (must be same currency)
*/
add: (money1: Money, money2: Money) => Money;
/**
* Subtract two money amounts (must be same currency)
*/
subtract: (money1: Money, money2: Money) => Money;
/**
* Multiply money by a factor
*/
multiply: (money: Money, factor: number) => Money;
/**
* Divide money by a factor
*/
divide: (money: Money, factor: number) => Money;
/**
* Check if money is zero
*/
isZero: (money: Money) => boolean;
/**
* Check if money is positive
*/
isPositive: (money: Money) => boolean;
/**
* Check if money is negative
*/
isNegative: (money: Money) => boolean;
};
//# sourceMappingURL=Money.d.ts.map