Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/scoria02/marbes2021_backend/llms.txt

Use this file to discover all available pages before exploring further.

Marbes is built around a two-sided financial model: funds flow in from investors through contracts and collection records (TCOL), are held in controlled pools (Control de Fondos), and then flow out as loans (TPROD) disbursed to credit clients. Every entity in the system maps to a step in this cycle, and all monetary values carry an explicit currency and a BCV (Banco Central de Venezuela) exchange rate at the time of the transaction.

Core entities

Aportante (Investor)

A person or legal entity that provides funds to the company. Each aportante has a unique cedula_rif, contact details, a tipo (natural or corp), and an estatus. Aportantes are the origin of all capital in the system.

Cliente (Credit Client)

A person or legal entity that receives loans. A client record tracks their credit limit (credito), available credit (disponible), and the amount currently lent (prestado). Clients can be linked to one or more bank accounts.

Contrato (Investment Contract)

An agreement between an aportante and the company. A contract defines the invested amount (monto), currency, term (plazo_cantidad + plazo_opcion), start and end dates, and optional guarantee documents. One aportante can hold multiple contracts.

Compania (Company)

The operating entity that manages the fund cycle. A TCOL is always assigned to a specific company via id_compania. A company has a nombre, optional rif, and an estatus.

TCOL (Collection)

A record of funds received from a contract and assigned to a bank account. TCOL is the “money in” step: it links id_contratoid_companiaid_banco, stores the amount, currency, BCV rate, optional bank cost, and a referencia. Multiple TCOLs can belong to one contract.

TPROD (Loan Product)

A loan disbursed to a client from collected funds. TPROD is the “money out” step: it records the base amount (monto_prestado), commission, bank cost, total owed (monto_total), amount repaid (monto_pagado), term, guarantees, and the disbursing bank. A TPROD links back to a TCOL via id_tcol.

Control de Fondos (Fund Control)

An intermediate allocation pool created before loans are disbursed. A fund control record assigns monto_asignado to an operator and a set of executives within a company, tracks monto_usado, and can report monto_disponible. It acts as an authorization layer between collection and lending.

ContratoCerrado (Closed Contract)

A record that marks an investment contract as finalized. It stores the agreed tasa (rate) and comision for the closing, plus an optional nota. Once closed, the contract is moved to the finalized state.

Fund lifecycle

The following diagram shows how capital moves through the system from investor to client:
Aportante

    │ signs

Contrato (investment contract: amount, currency, term)

    │ funds received → recorded as

TCOL (collection: money IN → assigned to bank + company)

    │ funds pooled → optionally via

Control de Fondos (intermediate fund allocation)

    │ loan disbursed → recorded as

TPROD (loan product: money OUT → disbursed to client)

    │ repayments tracked via

Cliente (credit client: credito / disponible / prestado)
1

Investor registers and signs a contract

An Aportante is created and associated with a Contrato that specifies the amount, currency, and term. The contract has a start date (fecha_inicio) and a calculated end date (fecha_fin).
2

Funds are collected (TCOL)

When the investor transfers funds, a TCOL record is created linking the contract to a company and a bank account. The amount, currency, BCV rate, and optional bank cost percentage are recorded. The referencia field stores the transfer reference number.
3

Fund control is established (optional)

A ControlFondos record can be created to allocate a portion of collected funds to specific operators and executives before lending begins. This provides an authorization checkpoint and tracks usage against the assigned budget.
4

Loan is disbursed (TPROD)

A TPROD is created linking back to the TCOL, the target client, and a disbursing bank. It records the loan amount, commission percentage, term, guarantee documents, and start date. The client’s disponible balance decreases and prestado increases.
5

Contract is closed

When an investment contract completes, a ContratoCerrado record is created with the final rate and commission. The contract moves to finalized status.

Currencies

All monetary amounts in TCOL, TPROD, and Control de Fondos carry an explicit moneda field. Every transaction also stores tasa_bcv—the BCV exchange rate at the time of the operation—to allow cross-currency reconciliation.
CodeCurrency
VESVenezuelan bolívar
USDUS dollar
EUREuro

Status values

TCOL records follow a four-state lifecycle:
ValueMeaning
pendienteFunds received but not yet reviewed
aceptadoFunds accepted and available for lending
devueltoFunds returned to the investor
rechazadoCollection rejected (e.g., failed validation)
TPROD records have one additional state compared to TCOL:
ValueMeaning
pendienteLoan created but not yet disbursed
aceptadoLoan active and in repayment
devueltoLoan repaid in full
rechazadoDisbursement rejected
moraLoan in default (past due)
Fund control records track allocation lifecycle:
ValueMeaning
activoAllocation is active and available
suspendidoTemporarily paused
finalizadoAll funds used or explicitly closed
canceladoAllocation cancelled before use

Term (plazo) options

The plazo_opcion field appears on both contracts and loans and controls how plazo_cantidad is interpreted:
ValueUnitExample
diasDaysplazo_cantidad: 30, plazo_opcion: "dias" → 30-day term
mesMonthsplazo_cantidad: 6, plazo_opcion: "mes" → 6-month term
anoYearsplazo_cantidad: 1, plazo_opcion: "ano" → 1-year term

Entity field reference

FieldTypeDescription
idstringUUID
id_aportantestringReference to the investor
montonumberContract investment amount
monedastringCurrency code
plazo_cantidadnumberTerm quantity
plazo_opcionPlazoOpciondias, mes, or ano
fecha_iniciostringStart date (YYYY-MM-DD)
fecha_finstringEnd date (YYYY-MM-DD)
garantiastringJSON array of guarantee file paths
contrato_estatusstringCurrent contract status
responsable_idstringEmployee responsible for the contract
FieldTypeDescription
idstringUUID
id_contratostringParent contract reference
id_companiastring | nullCompany receiving the funds
montonumberAmount received
monedaVES | USD | EURCurrency
tasa_bcvnumberBCV exchange rate at time of receipt
costo_banconumberBank cost percentage
id_bancostringReceiving bank account
referenciastring | nullTransfer reference number
fecha_recibidostringDate funds were received
estatusaceptado | pendiente | devuelto | rechazadoCurrent status
FieldTypeDescription
idstringUUID
id_tcolstringSource collection record
id_clientestringBorrowing client
monto_prestadonumberBase loan amount
monto_comisionnumberCommission percentage applied
monto_totalnumberTotal owed (principal + commission)
monto_pagadonumberAmount repaid to date
costo_banconumberBank cost percentage
monedaVES | USD | EURCurrency
tasa_bcvnumberBCV rate at disbursement
plazo_cantidadnumberLoan term quantity
plazo_opciondias | mes | anoLoan term unit
id_bancostringDisbursing bank
referenciastring | nullDisbursement reference number
garantiastringJSON array of guarantee file paths
estatusaceptado | pendiente | devuelto | rechazado | moraCurrent status
fecha_iniciostringDisbursement start date
fecha_finstringRepayment due date

Build docs developers (and LLMs) love