@rajkrajpj/cultivate-ui-library
Version:
A modern, type-safe, accessible React component library for fintech investor forms. Build complete investor forms in minutes with zero configuration, supporting multiple regulations (RegA+, RegD, RegCF) and investor types.
101 lines (100 loc) • 2.93 kB
TypeScript
export type InvestorType = "individual" | "joint" | "company" | "trust" | "ira";
/**
* Maps frontend investor types to API-expected investor types
*/
export declare const investorTypeMap: Record<string, InvestorType>;
/**
* Interface for common form data across all investor types
*/
export interface FormData {
email: string;
firstName: string;
middleName?: string;
lastName: string;
phoneNumber: string;
investorType: string;
investmentAmount: string;
totalShares: string;
address1: string;
address2?: string;
city: string;
state: string;
zip: string;
ssn: string;
birthDate?: string;
metadata?: {
ipAddress?: string;
};
jointFirstName?: string;
jointMiddleName?: string;
jointLastName?: string;
jointEmail?: string;
jointPhoneNumber?: string;
jointAddress1?: string;
jointAddress2?: string;
jointCity?: string;
jointState?: string;
jointZip?: string;
jointSsn?: string;
jointIpAddress?: string;
jointType?: string;
entityName?: string;
entityEIN?: string;
entityAddress1?: string;
entityAddress2?: string;
entityCity?: string;
entityState?: string;
entityZip?: string;
entityPhone?: string;
trustName?: string;
taxId?: string;
trustAddress1?: string;
trustAddress2?: string;
trustCity?: string;
trustState?: string;
trustZip?: string;
trustPhone?: string;
beneficiaryName?: string;
beneficiaryAddress1?: string;
beneficiaryAddress2?: string;
beneficiaryCity?: string;
beneficiaryState?: string;
beneficiaryZip?: string;
beneficiarySSN?: string;
iraAddress1?: string;
iraAddress2?: string;
iraState?: string;
iraCity?: string;
iraZip?: string;
iraCountry?: string;
custodianName?: string;
retirementAccountName?: string;
authRepFullName?: string;
authRepTitle?: string;
authRepAddress1?: string;
authRepAddress2?: string;
authRepCity?: string;
authRepState?: string;
authRepZip?: string;
authRepEmail?: string;
authRepSSN?: string;
[key: string]: any;
}
/**
* Get the investor type in the format expected by the API
* @param formData The form data containing the investor type
* @returns The investor type string expected by the API
*/
export declare const getApiInvestorType: (formData: FormData) => InvestorType;
/**
* Main function to build PDF data based on form data and investor type
* @param formData The form data to build from
* @returns The formatted data for PDF generation
*/
export declare const buildPDFData: (formData: FormData) => Promise<any>;
declare const _default: {
buildPDFData: (formData: FormData) => Promise<any>;
getApiInvestorType: (formData: FormData) => InvestorType;
calculateSecuritiesCount: (investmentAmount: string, pricePerSecurity?: number) => string;
};
export default _default;