Banking System Documentation

The Banking System is a comprehensive silver management solution for AlbionManager that handles both individual member balances and guild treasury accounts. This dual-layer system allows for complete financial tracking and management within your Albion Online guild.

🎯 Prerequisites: Before using the banking system, ensure your bot is properly configured. Please follow the First Steps guide to set up your bot.

📖 Table of Contents

🔍 System Overview

The Banking System provides a complete financial infrastructure for guild management:

💡 Key Feature: The system uses separate databases for player balances and guild accounts, ensuring complete financial transparency and accountability.

🏦 Dual-Layer Banking Architecture

The banking system operates on two distinct but interconnected layers:

Layer 1: Player Balance System (Individual Accounts)

📊 Player Balances: Individual silver accounts for each guild member, managed separately from guild treasury.

Layer 2: Guild Bank System (Treasury Accounts)

🏛️ Guild Banks: Multiple named accounts for guild treasury management, completely separate from player balances.

Critical Differences

⚠️ Important Distinction: Player balances and guild bank accounts are completely separate systems. Silver in player accounts does NOT come from guild banks, and vice versa.
Aspect Player Balances Guild Banks
Command Prefix /balance and /silver /bank
Account Structure One per Discord user Multiple named accounts
Access Level Members can view their own Management role required
Purpose Individual rewards/payments Guild treasury management
Transfer Between Not supported Between guild accounts only

👤 Player Balance System

Individual Member Accounts

Every Discord user automatically gets a silver balance account when they first interact with the banking system. These accounts are completely independent of guild bank accounts.

Account Features

Use Cases for Player Balances

Player Balance Commands

/balance

Purpose: Check silver balance for yourself or another user

Usage: /balance [user: @username]

Access: All members can use this command

Parameters:

Response: Shows current balance and lifetime balance

/silver add

Purpose: Add silver to one or more users' accounts (Admin only)

Usage: /silver add users: [users] amount: [amount] reason: [reason]

Access: Requires management role or Manage Guild permission

Parameters:

/silver remove

Purpose: Remove silver from one or more users' accounts (Admin only)

Usage: /silver remove users: [users] amount: [amount] reason: [reason]

Access: Requires management role or Manage Guild permission

/silver set

Purpose: Set exact balance for one or more users (Admin only)

Usage: /silver set users: [users] amount: [amount] reason: [reason]

Access: Requires management role or Manage Guild permission

/silver history

Purpose: View transaction history for a user (Admin only)

Usage: /silver history user: [@user] [page: number]

Access: Requires management role or Manage Guild permission

/silver leaderboard

Purpose: Display top members by current or lifetime balance

Usage: /silver leaderboard [type: current|lifetime]

Access: All members can use this command

🏛️ Guild Bank System

Multiple Treasury Accounts

The guild bank system allows you to create multiple named accounts for different purposes. Each guild can have unlimited bank accounts, each with its own balance and transaction history.

Account Features

Common Guild Bank Account Types

Guild Bank Commands

/bank overview

Purpose: Shows total silver balance across all guild bank accounts

Usage: /bank overview

Access: Requires management role

Response: Summary of all accounts with total balance

/bank create

Purpose: Create a new guild bank account

Usage: /bank create account_name: [name] description: [description]

Access: Requires management role

Parameters:

/bank balance

Purpose: Check balance of a specific guild bank account

Usage: /bank balance account_name: [name]

Access: Requires management role

/bank add

Purpose: Add silver to a guild bank account

Usage: /bank add account_name: [name] amount: [amount] reason: [reason]

Access: Requires management role

/bank remove

Purpose: Remove silver from a guild bank account

Usage: /bank remove account_name: [name] amount: [amount] reason: [reason]

Access: Requires management role

/bank transfer

Purpose: Transfer silver between guild bank accounts

Usage: /bank transfer from_account: [name] to_account: [name] amount: [amount] reason: [reason]

Access: Requires management role

/bank history

Purpose: View transaction history for a guild bank account

Usage: /bank history account_name: [name] [page: number]

Access: Requires management role

/bank delete

Purpose: Delete a guild bank account (must be empty)

Usage: /bank delete account_name: [name]

Access: Requires management role

Warning: Account must have zero balance to be deleted

🖥️ Dashboard Management

The web dashboard provides a comprehensive interface for managing both player balances and guild bank accounts with advanced filtering, sorting, and bulk operations.

Accessing the Banking Dashboard

  1. Visit your bot's web interface
  2. Login with Discord OAuth
  3. Select a guild from the sidebar dropdown
  4. Click "Bank Management" from the guild overview

Dashboard Features

Banking Overview

The main banking page displays comprehensive statistics for both systems:

Guild Bank Statistics
Player Balance Statistics

Guild Bank Account Management

Player Balance Management

Advanced Dashboard Features

📊 Dashboard Advantage: The web dashboard provides visual charts, bulk operations, and advanced filtering that aren't available through Discord commands. It's the recommended way to manage large-scale banking operations.

💬 Discord Commands Summary

Player Balance Commands

Command Access Purpose
/balance All Members Check user balance
/silver add Admin Add silver to user accounts
/silver remove Admin Remove silver from user accounts
/silver set Admin Set exact user balance
/silver history Admin View user transaction history
/silver leaderboard All Members View balance leaderboard

Guild Bank Commands

Command Access Purpose
/bank overview Management View all guild accounts summary
/bank create Management Create new guild bank account
/bank balance Management Check guild account balance
/bank add Management Add silver to guild account
/bank remove Management Remove silver from guild account
/bank transfer Management Transfer between guild accounts
/bank history Management View guild account history
/bank delete Management Delete empty guild account

📋 Transaction Management

Transaction Types

The system tracks different types of transactions:

Player Balance Transactions

Guild Bank Transactions

Transaction Data

Each transaction records:

Audit Trail

The system maintains a complete audit trail:

📊 Data Structure

Player Balance Model (BankAccount)

{
  "userId": "discord_user_id",
  "guildId": "discord_guild_id",
  "balance": "current_silver_amount",
  "totalAdded": "lifetime_silver_added",
  "discordUsername": "cached_username",
  "discordDiscriminator": "cached_discriminator",
  "discordAvatarHash": "cached_avatar_hash",
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-15T12:30:00.000Z"
}

Guild Bank Model (GuildBankAccount)

{
  "id": "auto_increment_id",
  "accountName": "account_display_name",
  "guildId": "discord_guild_id",
  "balance": "current_silver_amount",
  "totalAdded": "lifetime_silver_added",
  "totalWithdrawn": "lifetime_silver_withdrawn",
  "description": "account_purpose_description",
  "isActive": true,
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-15T12:30:00.000Z"
}

Transaction Models

Player Transaction (Transaction)

{
  "id": "auto_increment_id",
  "userId": "discord_user_id",
  "guildId": "discord_guild_id",
  "amount": "transaction_amount",
  "type": "add|remove|set",
  "reason": "admin_provided_reason",
  "adminUserId": "admin_discord_id",
  "balanceBefore": "balance_before_transaction",
  "balanceAfter": "balance_after_transaction",
  "createdAt": "2024-01-01T00:00:00.000Z"
}

Guild Bank Transaction (GuildBankTransaction)

{
  "id": "auto_increment_id",
  "accountId": "guild_bank_account_id",
  "amount": "transaction_amount",
  "type": "deposit|withdrawal|transfer_in|transfer_out",
  "reason": "admin_provided_reason",
  "adminUserId": "admin_discord_id",
  "balanceBefore": "balance_before_transaction",
  "balanceAfter": "balance_after_transaction",
  "relatedAccountId": "for_transfers_only",
  "createdAt": "2024-01-01T00:00:00.000Z"
}

Database Relationships

🔧 Troubleshooting

Common Issues

Insufficient Permissions

Symptoms: "You don't have permission" error when using banking commands

Solutions:

Balance Not Updating

Symptoms: Commands succeed but balance doesn't change

Solutions:

Guild Bank Account Not Found

Symptoms: "Account not found" error

Solutions:

Negative Balance Issues

Symptoms: Cannot remove silver or getting validation errors

Solutions:

Dashboard Access Issues

Symptoms: Cannot access banking dashboard

Solutions:

Large Number Display Issues

Symptoms: Very large silver amounts display incorrectly

Solutions:

Data Recovery

If banking data is lost or corrupted:

  1. Check automatic database backups
  2. Review transaction logs for reconstruction
  3. Use audit trail to verify data integrity
  4. Contact support with specific error messages