- Find a way to import FS by default
- Coverage tests
- [] Re-write FS and FS.Clients Test
-
Create_client(name, main_currency \ "BRL")
- Presently named
cc
- Presently named
-
Delete_client(client_id)
-
Create a wallet by default with an
amount_deposited
- Update nested Map in Struct
- Init Currency with the
main_currency
-
Create_wallet(client_id, currency, deposit \ 0)
-
Delete wallet, only if empty -> value == 0
-
Transfert()
- transfert(client_id, to_client_id, value, currency, direct_conversion \ :true)
- transfert(account_id, to_account_id , value)
- account_id == client_id + currency_code
- transfert(client_id, wallet, to_wallet, value)
- wallet/to_wallet :: currency_code :: integer in list_currency ISO_4217
-
Multi_transfert
- multi_transfert(client, [to_clients], value, currency, direct_conversion \ :true)
- multi_transfert(account_id, [to_account_id], value)
- account_id == client_id + currency_code
- multi_transfert([client_id], wallet, to_wallet, value)
- wallet/to_wallet :: currency_code :: integer in list_currency ISO_4217
-
Create the whole architecture
- Create a supervisor
- Create a registry
- Create a DynamicSupervisor for Clients
- Create first rules for Clients
- Find a way to fetch conversion values
-
Architecture: ~~
- Supervisor
- Client Registry
- DynamicSupervisor
- Client
- Transfer Registry
- DynamicSupervisor
- Transfers
- Currencies API
- Supervisor
- Prototype:
- Parameters: ("name", ID, "Currency_CODE", %{Wallets map})
- .
- When you create a `new client`, you have to create a `unique HASH` from
the `global map{}` of client.
- Basic
- A number from 1000 to N
- Improved
- This `HASH` will be as the ID in the Client structure.
Like that you will be able to certified the unicity of the client and
to provide a simple way to identify the client.
-
-
- %{ID: %Client{}}
- Each ID have to be
unique
- Each ID have to be
- %{ID: %Client{}}
Definition of the structure of one
Client
- Struct %Name{}- Require: - Client Name - String - Client ID - Unique Hash ::integer - from 1000 to N - The "000" part is for identified the wallet currency code - Main_currency - String reference from ISO_4217 - Ex: {"BRL", 986} - The code has to be feel by the program - Wallets - Map %{} - At least one key:value init (value can be positive or negative) - Ex: {"BRL": 1000} or {986: 1000} - Optionals: - Date of the Wallet Creation - Date of the last activity - Financial exchanges historics - from/to - require - %{Client ID} - require - Currency of the payment - require - Currency of reception (Was it a direct conversion ?) - optional - Value - require - Rate - optional - Client ID - Unique Crypted/Hashed ID seed by: - the Client Name - the Date of the wallet creation This could provide a security in front of account manipulation because we could be able to retrieve creation informations from this `ID` or to proof the incoherence of the datas
-
##################################################
##################################################
check_clients = check_clients()
- transfer/5
- check client and [to_client]
- multi/5
- check client and [to_clients]
- transfer/3
- check client and [to_client]
- multi/3
- check client and [to_clients]
- transfer/4
- check_client RETURN :ok | {:error, reason}
2 check functions (1 sub_function, 1 direct check)
check_currencies = check_currencies()
- transfer/5
- check currency and [to_main_currency] -> create list main_currencies // Direct Conversion == true
- check currency and [currency] -> create list of N elem with only [currency]
- multi/5
- check currency and [to_main_currencies] -> create list main_currencies // Direct Conversion == true
- check currency and [currency] -> create list of N elem with only [currency]
- transfer/3
- check currency and [to_currency]
- multi/3
- check currency and [to_currencies]
- transfer/4
- check currency and [to_currency] RETURN [to_currencies] | {:error, reason} [to_currencies] = [code_number, ...]
2 functions
- transfer/5 multi/5 return a created list and Direct conversion param
- other get list of currencies, and return it if OK
check_values = check_values([to_currencies]) // check_currencies return
- transfer/5
(split_value = value / 1)
- check conversion(split_value, [to_currency]) > 0 // Direct Conversion == true
- check split_value > 0
- multi/5
(split_value = value / nb([to_currencies]))
- check conversion(split_value, [to_currencies]) > 0 // Direct Conversion == true
- check split_value > 0
- transfer/3
- check conversion(split_value, [to_currency]) > 0
- multi/3
- check conversion(split_value, [to_currencies]) > 0
- transfer/4
- check conversion(split_value, [to_currencies]) > 0 RETURN [{split_value, transfer_value}] | {:error, reason}
1 function
- Direct conversion or not conversion function take care about return the
value if the
from_currency
and theto_currency
are the same
-
Init the project
-
Clients
- Create process for each new client
- Save him in the Registry state
- Feel informations in the client state
- name
- id
- main_currency
- default_wallet
- ID usage identification
- Can fetch informations of client from his ID
- Can fetch informations of clients from names
- Find a way to return multiple value from List in get_id_name(name, id_name)
-
Add spec to all functions -- Have to continue until the end
-
- Get decimal
-
Fetch currency conversion value
- First and simple way:
- Hard encoded conversion value
- use Poison for JSON
- {:poison, "~> 4.0.1"}, [x] Use a rescue system if API is not available.
- Get information from backup json file
- Update the backup file when new API are available
- check timestamp
- use Poison for JSON
- Hard encoded conversion value
- or:
- Extern API usage
- https://fixer.io/ (free -- EUR)
- API_key use
- Save the api_key in a
secret
folder - Make request on API
- Get information a save it in the Transfert GenServer State
- Save update informations in a backup file, cf
First way
- https://fixer.io/ (free -- EUR)
- Good ressources :
-
Simple request:
-
Subscribe/Sockets
- No need, the Fixer.API do not provide a pure realtime update system.
- https://www.poeticoding.com/realtime-market-data-updates-with-elixir/
- {:poison, "~> 4.0.1"},
-
- Extern API usage
- First and simple way:
-
Manage Decimal type correctly
-
Conversion(value, from_currency, to_currency)
- Base to Currency
- Currency to Base
- Currency to Currency
- Base to Base
- Round by Minor Unit
- Manage Decimal type correctly
-
Review Clients functions -- Bad wallet management
- Check available_currencies
- Check minor_unit compliance
- wallet creations
- wallet updates
[x] Correct timestamp check refresh condition ! [x] BUG conversion -- Bad return [x] Bug Currency integer_to_sting
- "Hello World" Elixir
- "Hello World" Elixir Script
- Advanced Test programming in progress
- Get ISO_4217 tab in csv and json format.
- Clean json
- Fetch and save Test subject
-
Init CircleCi
-
Read Documentation -> 25%
-
Add rule in CircleCi to check format
-
Reactivate CircleCi on the master branch
-
Dialyxir integration
-
Remove useless warning for protocol GIN in registry.ex
- Create a dev git branch
- Install Elixir
- Config Atom for Elixir
- Add Elixir linter in Atom
- Format command executed for each save on '.ex' and '.exs' files
- Make docs for clients.ex
- Make docs for registry.ex
- Tests FS
- Create Client
- Tests Registry
- Create_client
- Fetch
- Test Transfer part
- need details ...
- Test Currency_API part
- need details ...
-
Read documentation about Stoneco best practice
-
Read documentation about Elixir Style Guide
-
Read documentation from Elixir School
- Basic Part
- Advanced Part In Progress
-
Read documentation from Elixir-lang
- Getting Started DONE
- MIX and OTP DONE
-
Get Cheat sheet
-
Export Documentations on Mobile Device
- Stoneco best practice
- Elixir Style Guide
- Cheat sheet
- Elixir School
- Elixir-lang