Open geekelo opened 1 month ago
This ActiveAdmin configuration sets up an interface for managing MasterWalletCryptoTransferFee
records, which appear to involve fees associated with cryptocurrency transfers. Here's a breakdown of the configuration:
actions :all, except: %i[destroy create new]
:
destroy
, create
, and new
. Admins can view, edit, and update existing records but cannot delete, create new records, or access the creation form.includes :user, :wallet, :crypto_transfer
:
user
, wallet
, and crypto_transfer
to optimize queries by reducing the number of database calls when displaying related data.config.sort_order = 'created_at_desc'
:
created_at
field in descending order, showing the most recent records first.menu parent: 'Transactions', label: 'Fees'
:
scope('Completed Today', default: true)
: Filters records completed today.scope('Completed in The Last Week')
: Filters records completed in the last week.scope('Has_Fees')
: Filters records where the amount is greater than zero.scope('Completed')
: Filters records with an external_status
of 'completed'.scope('Pending')
: Filters records with an external_status
of 'pending'.scope('Error')
: Filters records with an external_status
of 'error' or 'failed'.scope('All')
: Filters all records except those with an external_status
of 'error'.permit_params
:
permit_params :transfer_type, :master_wallet_id, :source, :destination, :amount, :currency, :external_id, :external_status, :status, :error_code, :description, :user_id, :crypto_transfer_id, :wallet_id, :discarded_at
filter :user_email_cont, as: :string, label: 'Email'
: Filters by user email.filter :id_eq, as: :string, label: 'ID'
: Filters by ID.filter :external_id_eq, as: :string, label: 'External ID'
: Filters by external ID.filter :wallet_transfer_type
: Filters by wallet transfer type.filter :destination_type
: Filters by destination type.filter :status
: Filters by status.filter :fee_type, as: :select, collection: ['user_fee', 'store_fee', 'trade_fee']
: Filters by fee type.filter :fees
: Filters by fees.filter :source
: Filters by source.filter :destination
: Filters by destination.filter :source_currency
: Filters by source currency.filter :destination_currency
: Filters by destination currency.index do
:
selectable_column
: Adds checkboxes for batch actions.id_column
: Displays the ID.column :fee_type
: Displays the fee type.column :transfer_type
: Displays the transfer type.column :amount
: Displays the amount with currency formatting.column 'Crypto Transfer'
: Links to the associated CryptoTransfer
record and displays its gross amount.column :external_status
: Displays the external status.column :status
: Displays the internal status.column :created_at
: Displays the creation date.column :updated_at
: Displays the last updated date.actions
: Adds edit and view actions.show do
:
Defines how to display detailed information for a single MasterWalletCryptoTransferFee
record.
Panels:
panel 'Fee Crypto Transfer'
: Displays a table of details related to the crypto transfer fee if associated crypto_transfer_for_fee
exists.
panel 'Customer Crypto Transfer'
: Displays a table of details related to the customer crypto transfer if associated crypto_transfer
exists.
This ActiveAdmin configuration provides a comprehensive interface for managing MasterWalletCryptoTransferFee
records. It includes options for filtering, sorting, and viewing detailed information about transfer fees and associated records. The configurations are set to optimize performance and usability for admins, with a focus on displaying relevant details and allowing easy access to related records.
FILE