feat(telegram): Unify Trezorerie button (Casa + Banca combined)

- Replace separate [Trezorerie Casa] and [Trezorerie Banca] buttons
  with single unified [Trezorerie] button in main menu
- Add format_treasury_combined_response() formatter showing:
  - Grand total (Sold Trezorerie)
  - Casa section with total + all accounts
  - Banca section with total + all accounts
- Compact menu layout: Row 2 [Sold Companie][Trezorerie],
  Row 3 [Sold Clienti][Sold Furnizori], Row 4 [Evolutie Incasari]
- Use Romanian number format (period as thousands separator)

Also includes:
- Oracle pool: Support both SERVICE_NAME and SID connections
  (ORACLE_SERVICE_NAME takes priority over ORACLE_SID)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-30 19:15:05 +02:00
parent ab160b628d
commit 4a886f0b64
9 changed files with 843 additions and 19 deletions

View File

@@ -40,18 +40,35 @@ class OraclePool:
getmode=oracledb.POOL_GETMODE_WAIT
)
else:
# Use individual parameters (host, port, sid)
self._pool = oracledb.create_pool(
user=config.get('user', os.getenv('ORACLE_USER')),
password=config.get('password', os.getenv('ORACLE_PASSWORD')),
host=config.get('host', os.getenv('ORACLE_HOST', 'localhost')),
port=config.get('port', int(os.getenv('ORACLE_PORT', '1526'))),
sid=config.get('sid', os.getenv('ORACLE_SID', 'ROA')),
min=config.get('min_connections', 2),
max=config.get('max_connections', 10),
increment=config.get('increment', 1),
getmode=oracledb.POOL_GETMODE_WAIT
)
# Use individual parameters (host, port, service_name or sid)
# Prefer SERVICE_NAME over SID (more modern Oracle approach)
service_name = config.get('service_name', os.getenv('ORACLE_SERVICE_NAME'))
sid = config.get('sid', os.getenv('ORACLE_SID'))
pool_params = {
'user': config.get('user', os.getenv('ORACLE_USER')),
'password': config.get('password', os.getenv('ORACLE_PASSWORD')),
'host': config.get('host', os.getenv('ORACLE_HOST', 'localhost')),
'port': config.get('port', int(os.getenv('ORACLE_PORT', '1526'))),
'min': config.get('min_connections', 2),
'max': config.get('max_connections', 10),
'increment': config.get('increment', 1),
'getmode': oracledb.POOL_GETMODE_WAIT
}
# Use service_name if available, otherwise fall back to sid
if service_name:
pool_params['service_name'] = service_name
logger.info(f"Using SERVICE_NAME: {service_name}")
elif sid:
pool_params['sid'] = sid
logger.info(f"Using SID: {sid}")
else:
# Default fallback
pool_params['service_name'] = 'ROA'
logger.info("Using default SERVICE_NAME: ROA")
self._pool = oracledb.create_pool(**pool_params)
logger.info(f"Oracle pool created with {self._pool.opened} connections")
@asynccontextmanager