Redis KeyModel
initVariables
key/pattern
init
purpose
holds the variables that require initialization
functionality
check all variables in it if one variable is false it needs to be initialized by default values
onlineUsers
key/patterns
user:{email}:{ncid}:common (it must have a property called {updated} which is a boolean if it is true the database will be updated with this)
user:{email}:{ncid}:commissions
user:{email}:{ncid}:permissions:
user:{email}:{ncid}:balances
Notifications
key/patterns
user:{email}:{ncid}:notifications
admin:{role}:{username}:notifications
purpose
holds all notifications for users and admins
functionality
set the notification parameter in socket modules on application start
Transactions
key/patterns
purpose
holds all the informations about a user while the user is online (except notification)
functionality
any changes to user object on database must happen here first if the user is online, also it has a TTL of TokenValidation time (if TokenValidation time changes by admin the TTL must be updated accordingly)
transaction:exchange:{email('swap' if it is coinswap)}:{ncid(reqId if it is coinswap)}:{reqId}:{asserPair}:{time}
transaction:deposit:{email('swap' if it is coinswap)}:{ncid(reqId if it is coinswap)}:{reqId}:{asserPair}:{time}
transaction:withdraw:{email('swap' if it is coinswap)}:{ncid(reqId if it is coinswap)}:{reqId}:{asserPair}:{time}
transaction:system:withdraw:{network}:{assetPair/asset}:{type(can be auto or manual)}:{time}
transaction:system:deposit:{network}:{assetPair/asset}:{type(can be auto or manual)}:{time}
transaction:system:exchange:{network}:{assetPair/asset}:{type(can be auto or manual)}:{time}
:completed: (instead of deposit, exchange or withdraw this tag should be added)
functionalities
any function with :completed: pattern is ready for adding to data base
any function with :exchange: is ready for exchange
any function with :withdraw: is ready for withdraw
any function with :deposit: is ready for deposit
global permissions
withdraw
deposit
exchange
key/pattern
permit:withdraw:base_on:
key/pattern
permit:exchange:base_on:
key/pattern
permit:deposit:base_on:
system status(stats page)
key/pattern
system:stats: