bill-reporting WIP
This commit is contained in:
parent
3befd4cd94
commit
8c50444e80
2 changed files with 24 additions and 1 deletions
|
|
@ -20,6 +20,25 @@ var PostgresqlInterface = function (conString) {
|
|||
PostgresqlInterface.factory = function factory(conString) { return new PostgresqlInterface(conString); };
|
||||
module.exports = PostgresqlInterface;
|
||||
|
||||
PostgresqlInterface.prototype.recordBill =
|
||||
function recordBill(deviceFingerprint, rec, cb) {
|
||||
|
||||
this.client.query('INSERT INTO bills (device_fingerprint, denomination, currency_code, ' +
|
||||
'transaction_id) ' +
|
||||
'VALUES ($1, $2, $3, $4)',
|
||||
[deviceFingerprint, rec.fiat, rec.currency, rec.txId],
|
||||
cb);
|
||||
};
|
||||
|
||||
PostgresqlInterface.prototype.recordBillValidatorEvent =
|
||||
function recordBillValidatorEvent(deviceFingerprint, event, cb) {
|
||||
|
||||
this.client.query('INSERT INTO bill_validator_events (device_fingerprint, event_type, note)' +
|
||||
'VALUES ($1, $2, $3)',
|
||||
[deviceFingerprint, event.eventType, event.note],
|
||||
cb);
|
||||
};
|
||||
|
||||
PostgresqlInterface.prototype.summonTransaction =
|
||||
function summonTransaction(deviceFingerprint, tx, cb) {
|
||||
// First do an INSERT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue