# MySQL

# cofre_users

#### **Table name:** cofre\_users

**Description:** Table to store users registered in the Cofre Platform

<table id="bkmrk-field-type-descripti" style="width: 822px;"><tbody><tr><td style="width: 184px;">**Field**

</td><td style="width: 81px;">**Type**

</td><td style="width: 265px;">**Description**

</td><td style="width: 292px;">**API**

</td></tr><tr><td style="width: 184px;">**ID**

</td><td style="width: 81px;">Integer

</td><td style="width: 265px;">Sequential number of the registry in the table.

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**name**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">User’s name.

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**msisdn**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">User’s mobile phone.

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**email**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">User’s email address.

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**cpf**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">User’s CPF.

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**password**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">User’s password (encrypted).

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**identifier**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">An unique identification of the user supplied by Cofre before submit a customer creation to Salt Edge

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**saltedge\_customer\_id**

</td><td style="width: 81px;">Integer

</td><td style="width: 265px;">An identification of the customer supplied by Salt Edge when the customer was created

A Customer represents a single end-user of the Account Information API. The customer uses the API to create Connections, i.e. bank connections, that are further used to aggregate the customer's financial data.

</td><td style="width: 292px;">https://www.saltedge.com/api/v5/customers

</td></tr><tr><td style="width: 184px;">**saltedge\_secret**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">A secret generated by Salt Edge when the customer was created.

</td><td style="width: 292px;">https://www.saltedge.com/api/v5/customers

</td></tr><tr><td style="width: 184px;">**uuid**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">UUID generated by Google Firebase. Used for identify the user in sign-in process.

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**pin**

</td><td style="width: 81px;">String

</td><td style="width: 265px;">Personal Identification Number (6 digits) for mobile phone or email validation. It will be used for register process or password recovery.

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**status**

</td><td style="width: 81px;">Integer

</td><td style="width: 265px;">Status of the user for the Cofre platform.

User’s status could be:

0 – Inactive

1 – Active

2 – Suspended

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**datainsert**

</td><td style="width: 81px;">Timestamp

</td><td style="width: 265px;">Date and time when the registry was inserted in the table.

</td><td style="width: 292px;"></td></tr><tr><td style="width: 184px;">**dataupdate**

</td><td style="width: 81px;">Timestamp

</td><td style="width: 265px;">Date and time of the last update of the registry in the table.

</td><td style="width: 292px;"></td></tr></tbody></table>

# cofre_connections

**Table name:** cofre\_connections

**Description:** Table to store all Salte Edge users' connections.

<table id="bkmrk-field-type-descripti" width="1042"><tbody><tr><td style="width: 183px;">**Field**

</td><td style="width: 93px;">**Type**

</td><td style="width: 390px;">**Description**

</td><td style="width: 375px;">**API**

</td></tr><tr><td style="width: 183px;">**ID**

</td><td style="width: 93px;">Integer

</td><td style="width: 390px;">Sequential number of the registry in the table

</td><td style="width: 375px;"></td></tr><tr><td style="width: 183px;">**userID**

</td><td style="width: 93px;">Integer

</td><td style="width: 390px;">The id of the user in table cofre\_users

</td><td style="width: 375px;"></td></tr><tr><td style="width: 183px;">**saltedge\_connection\_id**

</td><td style="width: 93px;">String

</td><td style="width: 390px;">The id of the connection supplied by Salt Edge when the connection was created

</td><td style="width: 375px;">https://www.saltedge.com/api/v5/connections

</td></tr><tr><td style="width: 183px;">**status**

</td><td style="width: 93px;">Integer

</td><td style="width: 390px;">Status of the connection for the Cofre platform

A connection could be:

0 – Inactive

1 – Active

2 - Waiting **saltedge\_connection\_id**

</td><td style="width: 375px;"></td></tr><tr><td style="width: 183px;">**datainsert**

</td><td style="width: 93px;">Timestamp

</td><td style="width: 390px;">Date and time when the registry was inserted in the table

</td><td style="width: 375px;"></td></tr><tr><td style="width: 183px;">**dataupdate**

</td><td style="width: 93px;">Timestamp

</td><td style="width: 390px;">Date and time of the last update of the registry in the table

</td><td style="width: 375px;"></td></tr></tbody></table>

# cofre_providers

**Table name:** cofre\_providers

**Description:** Table to store all Salt Edge providers available for Cofre's users

<table id="bkmrk-field-type-descripti"><tbody><tr><td style="width: 198px;">**Field**

</td><td style="width: 86px;">**Type**

</td><td style="width: 221px;">**Description**

</td><td style="width: 304px;">**API**

</td></tr><tr><td style="width: 198px;">**ID**

</td><td style="width: 86px;">Integer

</td><td style="width: 221px;">Sequential number of the registry in the table

</td><td style="width: 304px;"></td></tr><tr><td style="width: 198px;">**saltedge\_provider\_code**

</td><td style="width: 86px;">String

</td><td style="width: 221px;">The code of the provider

</td><td style="width: 304px;">https://www.saltedge.com/api/v5/providers

</td></tr><tr><td style="width: 198px;">**provider\_name**

</td><td style="width: 86px;">String

</td><td style="width: 221px;">Given name (label) of the provider for front-end using

</td><td style="width: 304px;"></td></tr><tr><td style="width: 198px;">**saltedge\_logo\_url**

</td><td style="width: 86px;">String

</td><td style="width: 221px;">Image to identify the provider

</td><td style="width: 304px;">https://www.saltedge.com/api/v5/providers

</td></tr><tr><td style="width: 198px;">**status**

</td><td style="width: 86px;">Integer

</td><td style="width: 221px;">Providers should be:

0 – Inactive (is not showed by the app)

1 – Active

</td><td style="width: 304px;"></td></tr><tr><td style="width: 198px;">**datainsert**

</td><td style="width: 86px;">Timestamp

</td><td style="width: 221px;">Date and time when the registry was inserted in the table

</td><td style="width: 304px;"></td></tr><tr><td style="width: 198px;">**dataupdate**

</td><td style="width: 86px;">Timestamp

</td><td style="width: 221px;">Date and time of the last update of the registry in the table

</td><td style="width: 304px;"></td></tr></tbody></table>

# cofre_accounts

**Table name:** cofre\_accounts

**Description:** Table to store the users' accounts

<table id="bkmrk-field-type-descripti"><tbody><tr><td style="width: 149px;">**Field**

</td><td style="width: 86px;">**Type**

</td><td style="width: 168px;">**Description**

</td><td style="width: 406px;">**API**

</td></tr><tr><td style="width: 149px;">**ID**

</td><td style="width: 86px;">Integer

</td><td style="width: 168px;">Sequential number of the registry in the table

</td><td style="width: 406px;"></td></tr><tr><td style="width: 149px;">**connectionsID**

</td><td style="width: 86px;">Integer

</td><td style="width: 168px;">The id of the related connection in table cofre\_connections

</td><td style="width: 406px;"></td></tr><tr><td style="width: 149px;">**saltedge\_account\_id**

</td><td style="width: 86px;">String

</td><td style="width: 168px;">The id of the account

</td><td style="width: 406px;">https://www.saltedge.com/api/v5/accounts? connection\_id={connection.id}

</td></tr><tr><td style="width: 149px;">**status**

</td><td style="width: 86px;">Integer

</td><td style="width: 168px;">Status of the user for the Cofre platform

The accounts could be:

0 – Inactive

1 – Active

</td><td style="width: 406px;"></td></tr><tr><td style="width: 149px;">**datainsert**

</td><td style="width: 86px;">Timestamp

</td><td style="width: 168px;">Date and time when the registry was inserted in the table

</td><td style="width: 406px;"></td></tr><tr><td style="width: 149px;">**dataupdate**

</td><td style="width: 86px;">Timestamp

</td><td style="width: 168px;">Date and time of the last update of the registry in the table

</td><td style="width: 406px;"></td></tr></tbody></table>

# cofre_transactions

**Table name:** cofre\_transactions

**Description:** Table to store account transactions and savings

<table id="bkmrk-field-type-descripti"><tbody><tr><td style="width: 180px;">**Field**

</td><td style="width: 86px;">**Type**

</td><td style="width: 203px;">**Description**

</td><td style="width: 340px;">**API**

</td></tr><tr><td style="width: 180px;">**ID**

</td><td style="width: 86px;">Integer

</td><td style="width: 203px;">Sequential number of the registry in the table.

</td><td style="width: 340px;"></td></tr><tr><td style="width: 180px;">**connectionsID**

</td><td style="width: 86px;">Integer

</td><td style="width: 203px;">The id of the related connection in table cofre\_connections.

</td><td style="width: 340px;"></td></tr><tr><td style="width: 180px;">**accountsID**

</td><td style="width: 86px;">Integer

</td><td style="width: 203px;">The id of the related account in table cofre\_accounts.

</td><td style="width: 340px;"></td></tr><tr><td style="width: 180px;">**saltedge\_transaction\_id**

</td><td style="width: 86px;">String

</td><td style="width: 203px;">The id of the transaction.

Field `id` returned by the API.

</td><td style="width: 340px;">https://www.saltedge.com/api/v5/transactions?connection\_id={connection.id}&amp;account\_id={account.id}

</td></tr><tr><td style="width: 180px;">**saltedge\_amount**

</td><td style="width: 86px;">Decimal

</td><td style="width: 203px;">The amount of the transaction.

Field `amount` returned by the API.

</td><td style="width: 340px;">https://www.saltedge.com/api/v5/transactions?connection\_id={connection.id}&amp;account\_id={account.id}

</td></tr><tr><td style="width: 180px;">**amount\_saved**

</td><td style="width: 86px;">Decimal

</td><td style="width: 203px;">The amount saved (AS):  
AS = saltedge\_amount \* percentage.

The percentage is defined by the Cofre’s user.

</td><td style="width: 340px;"></td></tr><tr><td style="width: 180px;">**status**

</td><td style="width: 86px;">Integer

</td><td style="width: 203px;">Status of the transaction selected by the user to calculate a saving for the Cofre platform.

Transactions could be:

0 – Selected, but not processed

1 – Saved

2 – Processing

3 – Technical error. Must be analysed  
4 – Sent to payment gateway, but waiting response

5 – Not approved by payment gateway

6 – Retrieve asked by the user

7 – Retrieve processed

</td><td style="width: 340px;"></td></tr><tr><td style="width: 180px;">**saltedge\_made\_on**

</td><td style="width: 86px;">Datetime

</td><td style="width: 203px;">The date when the transaction was made.

Field `made_on` returned by the API.

</td><td style="width: 340px;">https://www.saltedge.com/api/v5/transactions?connection\_id={connection.id}&amp;account\_id={account.id}

</td></tr><tr><td style="width: 180px;">**dt\_saving**

</td><td style="width: 86px;">Datetime</td><td style="width: 203px;">Date and time when the saving was responded by the payment gateway.

</td><td style="width: 340px;"></td></tr><tr><td style="width: 180px;">**dt\_retrieve**

</td><td style="width: 86px;">Datetime</td><td style="width: 203px;">Date and time when the user asked a retrieving.

</td><td style="width: 340px;"></td></tr><tr><td style="width: 180px;">**datainsert**

</td><td style="width: 86px;">Timestamp

</td><td style="width: 203px;">Date and time when the registry was inserted in the table.

</td><td style="width: 340px;"></td></tr><tr><td style="width: 180px;">**dataupdate**

</td><td style="width: 86px;">Timestamp

</td><td style="width: 203px;">Date and time of the last update of the registry in the table.

</td><td style="width: 340px;"></td></tr></tbody></table>

# cofre_users_parms

**Table name:** cofre\_users\_parms

**Description:** Table to store parameters for each user, like preferences, UI settings, percentage to saving etc.

<table id="bkmrk-field-type-descripti"><tbody><tr><td style="width: 117px;">**Field**

</td><td style="width: 86px;">**Type**

</td><td style="width: 301px;">**Description**

</td><td style="width: 305px;">**API**

</td></tr><tr><td style="width: 117px;">**ID**

</td><td style="width: 86px;">Integer

</td><td style="width: 301px;">Sequential number of the registry in the table

</td><td style="width: 305px;"></td></tr><tr><td style="width: 117px;">**userID**

</td><td style="width: 86px;">Integer

</td><td style="width: 301px;">The id of the user in table cofre\_users

</td><td style="width: 305px;"></td></tr><tr><td style="width: 117px;">**category**

</td><td style="width: 86px;">String

</td><td style="width: 301px;">Where the parameter will be used. A category is keyword used to identify a set of data.  
  
**Examples:** SAVING, REGISTER, UI\_SETTINGS

</td><td style="width: 305px;"></td></tr><tr><td style="width: 117px;">**value**

</td><td style="width: 86px;">JSON

</td><td style="width: 301px;">JSON with all parameters referred to the category.  
  
**Example:**  
  
{  
 “percentage”: 5.0,  
 “amount\_max”: 1000.0

}

All these key/values pair should be defined in another document.

</td><td style="width: 305px;"></td></tr><tr><td style="width: 117px;">**status**

</td><td style="width: 86px;">Integer

</td><td style="width: 301px;">A parameter could be:  
0 – Inactive

1 – Active

</td><td style="width: 305px;"></td></tr><tr><td style="width: 117px;">**datainsert**

</td><td style="width: 86px;">Timestamp

</td><td style="width: 301px;">Date and time when the registry was inserted in the table

</td><td style="width: 305px;"></td></tr><tr><td style="width: 117px;">**dataupdate**

</td><td style="width: 86px;">Timestamp

</td><td style="width: 301px;">Date and time of the last update of the registry in the table

</td><td style="width: 305px;"></td></tr></tbody></table>