export interface IValuation { id: string; holdingId: string; // holdingType: HoldingType; date: Date; value: number; ownershipPercentage: number | null; currencyId: string; status: IValuationStatus; } export enum IValuationStatus { confirmed, expected, cancelled, } export interface IValuationCreateInput { id: string; holdingId: string; // holdingType: HoldingType; date: Date; value: number; ownershipPercentage: number | null; currencyId: string; status: IValuationStatus; } export interface IValuationDeleteInput { id: string; } export interface IValuationProperties { id: boolean; holdingId: boolean; // holdingType: boolean; date: boolean; value: boolean; ownershipPercentage: boolean; currencyId: boolean; status: boolean; } export interface IValuationPropertiesConfig { properties: Partial; relationProperties?: {}; } export function defaultGetValuationProperties(): Partial { return { id: true, holdingId: true, // holdingType: true, date: true, value: true, ownershipPercentage: true, currencyId: true, status: true, }; } export function defaultGetValuationPropertiesConfig(): IValuationPropertiesConfig { return { properties: defaultGetValuationProperties(), }; } export function parseValuation(valuation: IValuation): IValuation { valuation.date = new Date(valuation.date); valuation.value = +valuation.value; valuation.ownershipPercentage = +valuation.ownershipPercentage; valuation.status = +valuation.status; return valuation; }