Every company is divided into shares. Shares are issued to shareholders. Founders usually get them for free, whereas investors need to pay for each share. Aggregating all shares of a shareholder, we get the cap table: a list of all shareholders and the percentage they own in the company.
The goal of this challenge is to build a simple cap table management app.
First, we need to define a shareholder. For this, we use Flow to define a basic JavaScript object:
type Shareholder = {|
_id: string
name: string,
email: string,
address: {|
line1: string,
line2?: string,
street: string,
postcode: number,
city: string,
country: string, // ISO Alpha-2, e. g. CH, GB, US
|},
|}
Second, we need a define the issuance of new shares:
type SharesIssue = {|
shareholderId: string,
date: Date,
amount: number,
pricePerShare?: number, // USD
|}
Of course, there can be multiple share issues per shareholder.
So, here’s the task:
- Write a single-page app that handles a local state of shareholders and share issues.
- Provide pages and forms to manage shareholders and share issues.
- Visualize the resulting cap table, consisting of: name and address of each shareholder, number of shares, percentage, and invested amount.