## Retrieve some code from c:\cloud\tikeasy

- Add Route 'api/status' and 'api/db_status' (similarly to tikeasy) but remove '/api' alone as shortcut to 'api/status'
- Check for valid JSON in API queries. When JSON is not valid, API call should retrun the error in JSON format.
  `{   "error": "invalid_json_exception",   "message": "invalid_json_exception",   "exception": "InvalidJsonException",   "statusCode": 480   }`
- Secure from brute force attach by desactivation of a user after N failed login, and create the command 'lnc:unlocck-user'.

## Ngnix local

- edit hosts file `C:\windows\system32\drivers\etc\hosts` to add `kview-investor.local`
- extend ngnix config on server `kview-investor.local` to support kview_investor application
- modif win script `C:\dev.local\myPath` acordingly

## Create GP and Investors

OK let's do step 1:

In this application, I am extecting all id to be 'uuid'

- Add 'gps' table (General Partners) (model Gp) and extend Web view accrodinglly.
- Add new Field 'gp' dans la table Funds (et un BelongsTo Gp) where gp ist a ling to a Gp
  id
  name
  legal_name

            registration_number
            jurisdiction_country
            entity_type
            country
            website

    GP has many Funds

- Add 'investor' table Model (Investor) and extend Web view accrodinglly
- Add new Field 'investor' dans la table Funds (et un BelongsTo Gp) where gp ist a ling to a Gp
  id
  type // individual, company, family_office, fund_of_funds, institution, other
  name
  legal_name

- Create WEB views accordinglly

## Dynamic Fields

Creer un seeder pour alimenter la table `dynamic_fields`.
pour les model Gp et Investor

## REviw data strucutre and add model 'Investment'

Create Model Investment
This is the join/follow-up model between an Investor and a Fund.
Main fields:
investor_id
fund_id
commitment
currency
commitment_date
status // draft, committed, active, partially_redeemed, fully_redeemed, cancelled
capital_called_amount
capital_called_percent
capital_distributed_amount
remaining_commitment
nav_amount
last_nav_date
ownership_percent
closing_date
subscription_document_status
kyc_validated_at
notes
created_at
updated_at

Change Model :
'Call & Distrib' and 'Capital Accounts' are atteched to an investor (supress display un fund and move under investor).

      'in fund, remove, commitment,

Modify Web Accordingly :
create invetment from an investor .
List all invement of a investor.

## Web improvment and search & filters.

On 'funds'list view create serach & filter (Gp, Fund Name of short name)
On 'investors' list view create search (Name of legal_name)
On 'Call & Distrib' and 'Capital Account' list view create filter (GP, Fund, investor, date )

On the Top Row add a general Search among (see TIKEASY):
GP, Funds, Investor

## Excel Login

In WEB view, Add a bouton Excel Login using lncom protocol, similar to TIKEASY

Add DropDown API used in TIKEASY to mannage Dropdown:
/dropdowns
/dropdown/{filename}
/dropdown/create

Handling DymanicFields
Add logic to manage table 'dynamic_fields', CRUD and logic
Route::group( [ 'prefix' => 'dynamic_fields', 'as' => 'dynamic_fields.' ], function () {
'dynamic_fields/fields'
'dynamic_fields/multiple'
} );
Route::apiResources( [
'dynamic_fields' => 'API\DynamicFieldController',
] );

## Add CRUD call for other model

Add CRUD API call for:

- Investor
- Gp
- Investment

# Investment Calcultation

Pour le Model Invesment, crrer les les fonctions suivante

## get_current_capital_account(date d)

get_current_capital_account(date d) = for the current investment get the 1st previous capital account before or equal to date 'd'

## calc_current_value(date d)

calc_current_value(date d)
retrun an associative array with :

- drawdown
- disribution
- dist_return_of_capital
- dist_income
- dist_capital_gain
- subcription_premium
- capital_contribution
- other_fees

Each value of these indocator is the value of get_current_capital_account(d)
plus the SUM all call_distribution for the period '[dref(d) - d['
of the coreesponding indicator

On the top to that the array containt the 'nav' (adjusted-nav)
wich is calc_current_value->nav - calc_current_value['drawdown'] + calc_current_value['distibution']
