bill reporting WIP
This commit is contained in:
parent
8c50444e80
commit
3ed2a96263
3 changed files with 21 additions and 8 deletions
|
|
@ -24,18 +24,18 @@ 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],
|
||||
'satoshis, to_address, transaction_id, device_time) ' +
|
||||
'VALUES ($1, $2, $3, $4, $5, $6, $7)',
|
||||
[deviceFingerprint, rec.fiat, rec.currency, rec.satoshis, rec.toAddress, rec.txId, rec.deviceTime],
|
||||
cb);
|
||||
};
|
||||
|
||||
PostgresqlInterface.prototype.recordBillValidatorEvent =
|
||||
PostgresqlInterface.prototype.recordDeviceEvent =
|
||||
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],
|
||||
this.client.query('INSERT INTO device_events (device_fingerprint, event_type, note, device_time)' +
|
||||
'VALUES ($1, $2, $3, $4)',
|
||||
[deviceFingerprint, event.eventType, event.note, event.deviceTime],
|
||||
cb);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue