Add functionality to create transactions

- Transactions work against the account balance
- Needs helper functions for users
- Needs more testing
This commit is contained in:
Logan Cusano
2023-02-26 03:26:24 -05:00
parent fb99d6ab01
commit 14fac69ab7
8 changed files with 194 additions and 44 deletions

View File

@@ -69,4 +69,31 @@ exports.RSSPostRecord = class RSSPostRecord extends baseRSSRecord{
super(_id, _title, _link, _category);
this.guid = _guid;
}
}
}
/**
* Base transaction
*/
class BaseTransaction {
constructor(_provider_transaction_id, _account_id, _discord_tokens_used, _provider_tokens_used, _provider_id) {
this.transaction_id = _provider_transaction_id;
this.account_id = _account_id;
this.discord_tokens_used = _discord_tokens_used;
this.provider_tokens_used = _provider_tokens_used;
this.provider_id = _provider_id;
}
}
exports.BaseTransaction = BaseTransaction;
/**
* Base transaction
*/
class BaseUserAccount {
constructor(_discord_account_id, _account_id) {
this.discord_account_id = _discord_account_id;
this.account_id = _account_id;
}
}
exports.BaseUserAccount = BaseUserAccount;