V2.0: Refonte système bancaire - DB SQLite, RIB FR, TVA auto, multi-banques

- Remplace JSON par SQLite (aiosqlite) pour atomicité et intégrité
- Nouveau format RIB français avec checksum modulo 97
- Chaque banque a son propre rôle Discord (isolation par serveur)
- TVA automatique Particulier -> Entreprise, redirection au Fisc
- Institutions gouvernementales avec droit d'audit optionnel
- Commandes: /gouv, /banque, /audit, /mes-ribs
- Supprime: 16 anciens fichiers (entreprises, FBM, URSAFF, etc.)
- Reset complet des données, repart de zéro
This commit is contained in:
utilisateurqu 2026-08-18 17:42:03 +02:00
parent 2e38d05152
commit c9ad155bf6
38 changed files with 3689 additions and 5106 deletions

44
commandes/mes_ribs.py Normal file
View file

@ -0,0 +1,44 @@
import discord
from discord import app_commands
from discord.ext import commands
from utils.bank_manager import BankManager
bank_manager = BankManager()
class MesRibs(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(name="mes-ribs", description="Afficher tous vos RIBs")
async def mes_ribs(self, interaction: discord.Interaction):
comptes = await bank_manager.get_comptes_user(interaction.guild.id, interaction.user.id)
if not comptes:
await interaction.response.send_message(
"❌ Vous n'avez aucun compte bancaire.", ephemeral=True
)
return
embed = discord.Embed(
title=f"💳 RIBs de {interaction.user.display_name}",
color=discord.Color.blue(),
)
for c in comptes:
tva_text = f" | TVA: {c['tva_rate']}%" if c["account_type"] == "entreprise" else ""
embed.add_field(
name=f"{c['bank_name']} ({c['account_type']})",
value=(
f"**RIB :** `{c['rib']}`\n"
f"**Solde :** `{c['solde']:.2f}€`{tva_text}"
),
inline=False,
)
await interaction.response.send_message(embed=embed, ephemeral=True)
async def setup(bot):
await bot.add_cog(MesRibs(bot))