The Savings Accounts module allows CashMan H.A. to provide clients with personal deposit accounts alongside their credit facilities. Customer Service staff (Role 4) manage account lifecycle events — opening, activating, blocking, and closing — while both staff and clients can initiate deposits, withdrawals, and inter-account transfers. Transfers are protected by a one-time numeric security code delivered via email, ensuring that no funds move without explicit confirmation from the account holder.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DanielRivera03/SistemaBancario/llms.txt
Use this file to discover all available pages before exploring further.
Account Lifecycle
Opening an Account
A new savings account is created by Customer Service viaRegistroNuevasCuentasAhorroClientesCashmanha(), which calls the stored procedure RegistroNuevasCuentasAhorroClientesCashmanha. The account is assigned a unique account number (numerocuenta) and an opening date (fechaapertura).
Account States
| State | Meaning |
|---|---|
activo | Account is open and fully operational |
bloqueado | Account is frozen; no transactions permitted |
cerrado | Account is permanently closed |
State Transitions
| Action | Model Method | Stored Procedure |
|---|---|---|
| Activate | ActivarCuentasAhorroClientes() | ActivarCuentasAhorroRegistradasClientes |
| Block | BloquearCuentasAhorroClientes() | BloquearCuentasAhorroRegistradasClientes |
| Close | CerrarCuentasAhorroClientes() | CerrarCuentasAhorroRegistradasClientes |
Deposits and Withdrawals
Customer Service staff process all cash transactions on behalf of clients. Each transaction records a reference number, the amount, the resulting balance, the processing employee, and a timestamp.| Transaction Type | Model Method | Stored Procedure |
|---|---|---|
| Deposit | RegistroDepositosCuentasAhorroClientesCashmanha() | RegistroDepositoCuentasAhorrosClientesCashManHa |
| Withdrawal | RegistroRetirosCuentasAhorroClientesCashmanha() | RegistroRetiroCuentasAhorrosClientesCashManHa |
| Void deposit | AnularDepositosProcesadosClientes() | AnularDepositosTransaccionesCuentasClientes |
| Void withdrawal | AnularRetirosProcesadosClientes() | AnularRetirosTransaccionesCuentasClientes |
saldo_actual on the cuentasahorro table.
Inter-Account Transfers
Transfers between savings accounts registered in the platform follow a two-step verification flow to prevent unauthorised movements of funds.Initiate Transfer & Validate Destination
The initiating user (client or staff) enters the destination account number. The system calls
ConsultaDatosClientes_TransferenciasCuentasAhorros() to verify that the destination account exists, is active, and belongs to a registered client.Generate & Email Security Code
Once the destination is validated, the system generates a numeric one-time security code. The code is:
- Emailed to the sender’s registered address via PHPMailer (SMTP)
- Stored in the
codigostransferenciastable viaRegistroCodigoSeguridad_TransferenciasCuentas(), which calls SPRegistroCodigoSeguridadTransferenciasCuentasClientes, with an initialestadoofValido
User Confirms with Security Code
The user submits the code they received by email. The stored procedure
Verifica_ValidacionCodigoSeguridadTransferencias checks the code against the codigostransferencias table, confirming it is Valido and belongs to the current user session.Execute Transfer
After successful code validation, the transfer is finalised by
RegistroTransferenciasCuentasClientes(), which calls SP RegistrarTransferenciasEnviadasClientes. This procedure:- Debits the sender’s account balance
- Credits the destination account balance
- Records the transaction in
transaccionescuentasclientesfor both accounts - Marks the security code as
Usadoincodigostransferencias
codigostransferencias Table Structure
| Column | Type | Description |
|---|---|---|
codigoseguridad | int | The numeric one-time transfer code |
fecha | timestamp | When the code was generated |
estado | varchar | Valido (unused) or Usado (already consumed) |
idusuarios | int | Foreign key to the user who requested the transfer |